/
workplan_set ()

workplan_set ()



Function prototype

workplan_set (session, workplan, workplan_data)

API Version

2.7.22 and higher

 

Modifies the properties of a WORKPLAN OBJECT

Input

  • session: is the session token obtained in the session_init() call

  • workplan: Reference of the workplan to be modified

  • workplan_data: A XML string with the following structure

    • frequency: to define if the workplan is a RECURSIVE TASK. Posible values:

      • NULL (not recursive)

      • 'EVERYHOUR'

      • '4ADAY'

      • '3ADAY'

      • '2ADAY'

      • 'DAY'

      • 'WEEK', 'WEEK{week_days}: The TASK will be repeated on a weekly basis. Since API Version 2.7.21 it is possible to append a modifier indicating only certain days of the week. For example, WEEK{MF} means that the TASK will be repeated weekly on Mondays and Fridays

      • 'BEWEEK'

      • 'MONTH'

      • 'YEAR';

    • recursive_mode: To define how RECURSIVE TASKS are generated. This property is only used when frequency is not NULL. Valid values are:

      • 0: The new iteration of a RECURSIVE TASK is generated when the TASK si closed

      • 1: The new iteration of a RECURSIVE TASK is generated automatically by the system even when the previous TASK is not closed. The TASK is generated when the date/time of the theoretic next TASK arrives. For example, i a TASK has a frequency of type 'DAY' and is programmed for '2018-11-01 09:00:00', the next programmed TASK should occur on '2018-11-02 09:00:00', so if that time arrives and the previous TASK is not closed yet, then the new iteration is calculated automatically 

    • visibility_mode:

      • 0 - wont appear in list of optional tasks of mobile device, only in list of patient optional tasks in web application. (professional)

      • 1 - in case of optional task this task will appear in list of optional tasks in mobile device (patient)

      • 2 - will appear in list of optional tasks of both professional and patient.

    • allow_add_activity: (true/false) Indicates whether TASKS based on this TASK TEMPLATE should allow to add activities dynamically. If false, then once the TASK instance has been created, the system will not allow to add more ACTIVITIES

    • admission_required: (true/false) This property is only used for EVENT TEMPLATES (i.e. the STAGE of the WORKPLAN is "EVENT"). If true, when creating an EVENT based on this TEMPLATE, it is mandatory that it is associate to an ADMISSION. Otherwise functions like event_insert ( session, date, case, event_type {, event_code} {, team} {, admission} ) or event_set () will return an error.

    • direction:(0: undefined, 1: incoming, 2: outgoing) This property is only used for EVENT TEMPLATES (i.e. the STAGE of the WORKPLAN is "EVENT").

    • default_time: Default time at which TASKS created from this WORKPLAN should be scheduled. If empty, new TASKS will be scheduled at the amen local time when the TASK is created.

    • unscheduled: (true/false) Indicates whether the Workplan has not been defined for a specific time of the day (TASKS created from this WORKPLAN can be done at any time of the day). When this property is true, the default_time will be ignored. Introduced in API Version 2.7.25

    • expiration: Indicates the expiration period of the TASKs created using this WORKPLAN OBJECT. Possible values are described in WORKPLAN OBJECT.

      • unit: MINUTES/HOURS/DAYS/WEEKS/MONTHS/YEARS

      • number

    • closed: task will be inserted already closed (state 13 = Done)

    • trial_group: (I/C) Only for TRIAL PROGRAMS. "I" = Intervention, "C" = Control

    • stage/ref: Stage assigned to the Workplan (See the Admission live cycle in ADMISSION OBJECT). Possible values are:

      • "ADMSETUP": Admission setup stage

      • "INCOMPLETE": "Incomplete admission data" stage

      • "ENROLL": Enrolled stage

      • "ADMIS": Admission stage

      • "REJECT": Admission rejected stage

      • "OPTIONAL": Optional stage is used to allow to insert manually TASKS when the Admission is in the "Admission" stage

      • "DISC": Discharge stage

Output

  • result: empty

  • ErrorMsg: If any error occurs, then this value contains a description of the error translated to the current language

  • ErrorCode: If any error occurs, then this value contains any of the standard ERROR CODES

Request Sample

workplan_template_set (“LC53060c6f729de8.42629546”,

<?xml version="1.0" encoding="UTF-8"?> <workplan> <frequency>DAILY</frequency> <recursive_mode>0</recursive_mode> <day>90</day> <end_day>1234</end_day> <roles>24|20|26</roles> <visibility_mode>0</visibility_mode> <closed>true</closed> <allow_add_activity>false</allow_add_activity> <admission_required>false</admission_required> <direction>0</direction> <locked>false</locked> <end_day>134</end_day> <default_time>00:11</default_time> <unscheduled>false</unscheduled> <expiration> <unit>days</unit> <number>2</number> </expiration> <trial_group>I</trial_group> <stage> <ref>ENROLL</ref> </stage> </workplan>

)

ResponseSample

<?xml version="1.0" encoding="UTF-8"?> <result/> </ErrorMsg/> <ErrorCode/>



Related content