/
ENROLL()

ENROLL()

ENROLL(condition, program_code,[date_time], [team])

API Version

All

Creates a new ADMISSION for the active patient in a PROGRAM

This FORMULA searches a SUBSCRIPTION to the PROGRAM identified by the parameter program_code and creates a new ADMISSION for the active patient (the one in the context where the FORMULA is being executed).

The SUBSCRIPTION must be owned by the TEAM specified in the parameter team (or the active session TEAM if no specific team is provided). If no SUBSCRIPTION is found, the FORMULA will generate an error and the return value will be empty.

If there already exists an active ADMISSION (not paused nor discharged) in the selected PROGRAM, then the function will do nothing and will return the reference of the existing ADMISSION

Input Parameters

Parameter

Type

Default

Required

Description

Parameter

Type

Default

Required

Description

condition

Boolean

true

No

If false, the formula will not be executed.

program_code

String/Number

 

Yes

PROGRAM_CODE of the PROGRAM where the active patient will be enrolled

date_time

String/Number

Current date time

No

Date of enroll that will be assigned to the new ADMISSION. By default the current date time is used

team

String/Number

Active Session’s TEAM

No

TEAM reference or TEAM CODE of the SUBSCRIPTION owner

Return value

The value returned by the function is the reference of the ADMISSION created.

If there already exists an active ADMISSION (not paused nor discharged) in the selected PROGRAM, then the function will do nothing and will return the reference of the existing ADMISSION

Execution

When the FORM containing the FORMULA is closed

Examples

Formula

Description

Formula

Description

ENROLL(true, 'ACTIVITY_FOLLOWUP')

Creates a new ADMISSION for the active patient in the PROGRAM “ACTIVITY_FOLLOWUP”



Related content