Skip to main content

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​

KeyTypeDescription
namestringForm name.
versionstringForm version.
templateIdstringTemplate ID.
resourcesResourcesForm resources.

Resources​

KeyTypeDefaultDescription
descriptionobjectnullEHR form description.
layoutobject—Form layout definition.

Credentials​

KeyTypeRequiredDescription
usernamestringYesUsername.
passwordstringYesPassword.
authTypestringNoAuthentication type.

MrdTimePlaceholderFormat​

KeyTypeAcceptedRequiredDescription
hourstringHour formatsNoHour format.
minutestringMinute formatsNoMinute format.

ValidationModel​

KeyTypeDescription
validbooleanWhether the form is valid.
errorMessagesobjectValidity state for required fields.

InputItem​

KeyTypeRequiredDescription
labelstringYesDisplay label.
codestringYesCode value.

FormElement​

KeyTypeDescription
namestringElement name.
typestringElement type.
valueobjectElement value.
aqlPathstringAQL path of the element.
isHiddenbooleanWhether the element is hidden.
isReadOnlybooleanWhether the element is in read-only mode.
isContainerbooleanWhether the element is a container.
minnumberMinimum multiplicity.
maxnumberMaximum multiplicity.

ScriptApiListenerOptions​

KeyTypeDefaultRequiredDescription
onInitialValueSetbooleantrueNoWhether the listener fires on initial form render.
searchWithinContainerstring—NoTag or ID of the parent container to search from.
debouncenumber—NoDebounce delay in milliseconds before the listener processes a new event.

ScriptApiClearOptions​

KeyTypeRequiredDescription
propstringNoProperty name of the form element to clear.
searchWithinContainerTagstringNoTag of the parent container to search from.

Variable​

KeyTypeDescription
idstringVariable ID.
namestringVariable name.
mandatorystringWhether a value must be provided.
typestringVariable type. See Variable types.
valuestring, number, boolean, object, or arrayCurrent value.
sourcestringVariable source. See Variable sources.
createdstringCreation type. See Variable creation types.
dependentFieldsarray<string>Form element IDs that depend on this variable.
testValuestring, number, boolean, object, or arrayValue used during form building.

ModelDuplicate​

KeyTypeDescription
duplicatedModelobjectThe duplicated model.
modelIndexnumberIndex of the model within its parent's children.

FormInfo​

KeyTypeDescription
namestringForm name.
versionstringForm version.
templateIdstringTemplate ID.
tagsobjectForm tags.

ImageArea​

KeyTypeAcceptedRequiredDescription
shapestring'rect', 'circle', 'poly'YesShape of the area.
coordsstring—YesSVG coordinates. Example for rect: '206,153,257,192'.
valuestring—NoCode value mapping to a field input value.
titlestring—NoHelper text shown on hover.
colorImageAreaColor—NoFill and outline colour.

ImageAreaColor​

KeyTypeDescription
fillstringFill colour in HEX format, e.g. #fefefe.
outlinestringBorder colour in HEX format, e.g. #fefefe.

PreSaveHookOptions​

KeyTypeDescription
catchErrorbooleanWhether 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.