task_cancel()

task_cancel()

Function prototype

task_cancel (session, task)

API Version

2.7.29 and higher

Supported interfaces

SOAP, REST

Description

Changes the status of a TASK to “CANCELLED”

Required permissions: The operation is only allowed if the active user:

  • Has active Role "Service" and also has role "Service" in the Subscription (independently of the status of the Admission)

  • Has active Role "Case manager", and is also "Case Manager" in the Subscription and the Admission is active (not dicharged nor paused)

Otherwise an INSUFFICIENT_PRIVILEGES error will be returned.

Input parameters:

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

  • task: The reference that should be cancelled

Output parameters:

  • 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 example

task_cancel ( “LCAAAAAAAAAAAA”, "54618")

Response

The response format is XML when the function has been invoked via the SOAP API, and JSON when it has been invoked via the REST API

Return Error codes

ERROR CODE

 

ERROR CODE

 

INVALID_TOKEN

The session token provided is not valid

INSUFFICIENT_PRIVILEGES

The session user does not have the necessary privileges to change the status of the TASK

TASK.NOT_FOUND

The TASK with the reference indicated in the parameter task was not found

ADMISSION.NOT_FOUND

The TASK with the reference indicated in the parameter task does not belong to an ADMISSION

ADMISSION.NOT_OPEN

Cannot change the status of the TASK because the ADMISSION is discharged or paused

PROGRAM.LOCKED

Cannot change the status of the TASK because the PROGRAM is locked