FORM_INSERT ()
FORM_CLONE(form_code, [task_ref], [condition], [position], [hidden], [insert_closed], [parameters], [new_form_code]) |
API Version | All |
---|
Short description
FORMULA Description
Input Parameters
Parameter | Type | Default | Required | Description |
---|---|---|---|---|
|
| Yes | A FORM CODE referring to the FORM TEMPLATE that will be used the to create the new FORM instance | |
|
| No | If not provided, the FORM cloned will be inserted in the current TASK. Otherwise it can be one of the following:
| |
| true | No | Must be true to clone the FORM, possible true options: ('true', 's', '1'), others are considered as false value. It can be a FORMULA | |
| “LAST” | No | The position in the TASK where the FORM is inserted.
| |
| 0 | No | indicate whether the inserted FORM must be hidden. Possible values are:
| |
| false | No | If true, the inserted FORM will be inserted closed.This parameter will not have effect if HIDDEN = “ALWAYS” | |
|
|
| No | The parameter called parameters allows to provide a list of values that will be assigned to the ITEMS of the FORM inserted It must be a JSON string representing an array of objects with initial values that will be applied to the ITEMS of the ACTIVITIES. Each array item must be an object with 2 properties:
The values can be either simple values or arrays. The values assigned to each parameter will be stored in the newly created ACTIVITY into the ITEMS whose ITEM_CODE matches the property "code" See the following examples: Example of passing 2 parameters with simple values: [
{"code":"PARAMETER.RELATIVE", "value":"RELATIVE.PARENT(M)"},
{"code":"PARAMETER.DIAGNOSE.ICD10", "value":"H60.20"}
]
Note that if the TEMPLATE of the new ACTIVITY does not contain an ITEM with a ITEM_CODE named as any of the parameters provided, then a new ITEM will be created (hidden) Example of passing 2 parameters with array values: [
{"code":"HEART_RATE", "value":[87, 97]},
{"code":"HEART_RATE_TIME", "value":["12:00:00","16:00:00"]}
]
If the TEMPLATE of the new FORM already contains an array of ITEM with ITEM_CODE that match the parameter names, then the necessary rows will be added to fit as many values as provided. Otherwise, a new array of ITEMs will be created (hidden) for each parameter with multiple values |
|
| No | FORM_CODE that will be assigned to the inserted FORM. If no value is specified, the FORM_CODE of the template will not be changed. |
Return value
Reference to the cloned FORM.
Execution
On closing the FORM. The ITEM containing this FORMULA must be defined as type 'ACTION' (which are always executed when a FORM is closed)
Examples
Formula | Description |
---|---|
| Inserts a new FORM based on the FORM TEMPLATE with code “CLINICAL_ASSESMENT” into the current TASK (where the formula is executed) |
| Inserts a new FORM based on the FORM TEMPLATE with code “CLINICAL_ASSESMENT” into a TASK of the same ADMISSION with TASK_CODE = “SPIRO_TASK“ |
| Inserts a an activity (the one with TASK_CODE="F3" in the PROGRAM TEMPLATE) into the task with task code SPIRO_TASK. The inserted ACTIVITY will be placed the first into the TASK. |
| Inserts a new FORM based on the FORM TEMPLATE with code “CLINICAL_ASSESMENT” into the curent TASK. The inserted FORM will be placed the first into the TASK and will be closed, and will be hidden when the TASK is closed. |
| Inserts a new FORM based on the FORM TEMPLATE with code “CLINICAL_ASSESMENT” into the current TASK. The ITEMS of the insert FORM with ITEM CODES “TECHASSCOMM1” and “TECHASSQP1” will be initialized respectively with the values “abc” and “xyz” respectively |