Script API types
info
This content is intended for advanced Studio users.
This page defines all types used as parameters and return values in the Script API.
FormMetadata
| Key | Type | Description |
|---|---|---|
name | string | Form name. |
version | string | Form version. |
templateId | string | Template ID. |
resources | Resources | Form resources. |
Resources
| Key | Type | Default | Description |
|---|---|---|---|
description | object | null | EHR form description. |
layout | object | — | Form layout definition. |
Credentials
| Key | Type | Required | Description |
|---|---|---|---|
username | string | Yes | Username. |
password | string | Yes | Password. |
authType | string | No | Authentication type. |
MrdTimePlaceholderFormat
| Key | Type | Accepted | Required | Description |
|---|---|---|---|---|
hour | string | Hour formats | No | Hour format. |
minute | string | Minute formats | No | Minute format. |
ValidationModel
| Key | Type | Description |
|---|---|---|
valid | boolean | Whether the form is valid. |
errorMessages | object | Validity state for required fields. |
InputItem
| Key | Type | Required | Description |
|---|---|---|---|
label | string | Yes | Display label. |
code | string | Yes | Code value. |
FormElement
| Key | Type | Description |
|---|---|---|
name | string | Element name. |
type | string | Element type. |
value | object | Element value. |
aqlPath | string | AQL path of the element. |
isHidden | boolean | Whether the element is hidden. |
isReadOnly | boolean | Whether the element is in read-only mode. |
isContainer | boolean | Whether the element is a container. |
min | number | Minimum multiplicity. |
max | number | Maximum multiplicity. |
ScriptApiListenerOptions
| Key | Type | Default | Required | Description |
|---|---|---|---|---|
onInitialValueSet | boolean | true | No | Whether the listener fires on initial form render. |
searchWithinContainer | string | — | No | Tag or ID of the parent container to search from. |
debounce | number | — | No | Debounce delay in milliseconds before the listener processes a new event. |
ScriptApiClearOptions
| Key | Type | Required | Description |
|---|---|---|---|
prop | string | No | Property name of the form element to clear. |
searchWithinContainerTag | string | No | Tag of the parent container to search from. |
Variable
| Key | Type | Description |
|---|---|---|
id | string | Variable ID. |
name | string | Variable name. |
mandatory | string | Whether a value must be provided. |
type | string | Variable type. See Variable types. |
value | string, number, boolean, object, or array | Current value. |
source | string | Variable source. See Variable sources. |
created | string | Creation type. See Variable creation types. |
dependentFields | array<string> | Form element IDs that depend on this variable. |
testValue | string, number, boolean, object, or array | Value used during form building. |
ModelDuplicate
| Key | Type | Description |
|---|---|---|
duplicatedModel | object | The duplicated model. |
modelIndex | number | Index of the model within its parent's children. |
FormInfo
| Key | Type | Description |
|---|---|---|
name | string | Form name. |
version | string | Form version. |
templateId | string | Template ID. |
tags | object | Form tags. |
ImageArea
| Key | Type | Accepted | Required | Description |
|---|---|---|---|---|
shape | string | 'rect', 'circle', 'poly' | Yes | Shape of the area. |
coords | string | — | Yes | SVG coordinates. Example for rect: '206,153,257,192'. |
value | string | — | No | Code value mapping to a field input value. |
title | string | — | No | Helper text shown on hover. |
color | ImageAreaColor | — | No | Fill and outline colour. |
ImageAreaColor
| Key | Type | Description |
|---|---|---|
fill | string | Fill colour in HEX format, e.g. #fefefe. |
outline | string | Border colour in HEX format, e.g. #fefefe. |
PreSaveHookOptions
| Key | Type | Description |
|---|---|---|
catchError | boolean | Whether errors thrown by the hook should be caught. |
Frequently asked questions (FAQs)
Where are these types used?
These types appear as parameter types and return types in the Script API methods. Refer to this page when the method reference mentions a type by name.