task_insert_by_task_code ()
Function prototype | task_insert_by_task_code ( session, admission, task_code, [date]) |
---|---|
API Version | ALL |
Inserts a task with TASK CODE in an admission in a given date. If the admission belongs to a TRIAL PROGRAM, then the same TASK CODE may exist either for the 'Control' or 'Intervention' groups. In that case, the function takes into account to which group belongs the ADMISSION to insert the appropriate TASK. If the TASK CODE has not been defined for an specific trial group, then the function will try to find the TASK TEMPLATE that has no trial group assigned | |
Version: | |
Input parameters: |
|
Output parameters: |
See below output parameters in API versions prior to 2.7.15 |
Request sample: | task_insert_by_task_code( “LC00000000”,“1234”, “SPIRO“, “2012-01-01 00:00:00”) |
Response sample: | <?xml version="1.0" encoding="utf-8" standalone="yes"?> <result>1222</result> <ErrorMsg></ErrorMsg> <ErrorCode></ErrorCode> |
Notes: |
Return Error codes
ERROR CODE | |
---|---|
INVALID_TOKEN | The session token provided is not valid |
INSUFFICIENT_PRIVILEGES | The session user does not have the necessary privileges to create an ADMISSION in the SUBSCRIPTION or the TEAM reference provided is not a member of the SUBSCRIPTION |
ADMISSION.NOT_FOUND | The ADMISSION reference provided in parameter admission does not correspond to an existing ADMISSION |
TASK.CODE_AMBIGUOUS | The TASK CODE provided in parameter task_code exists in more than one WORKPLAN |
TEMPLATE.NOT_PRESENT | The TASK CODE provided in parameter task_code was not found |
TASK.NOT_INSERTED | An unexpected error happened while inserting the TASK |
API Versions prior to 2.7.15
In prior versions, the API response for this function only returned the TASK ID with no other format
Response in previous versions | 1222 |