/
action_list_case ()

action_list_case ()

Function prototype

action_list_case (session, id , action{, path = NULL} {, action_context = NULL})

API Version2.7.8 and higher

This function returns a list of possible actions that a PROFESSIONAL can execute for a CASE.The difference between this function and action_list_patient () is that this function is called from the PROFESSIONAL point of view, while action_list_patient () is called from the PATIENT point of view (a professional can execute actions on a patient that are not allowed to the patient itself).

The input parameter “action” describes the type of action

Input

parameters:

  • session: is the session token obtained in the session_init() call
  • id: is a CASE reference id (mandatory)
  • action:
    • EVENT: the function will return all the available EVENT actions for the CASE
    • MNG: the function will return all the possible actions for a CASE or an ADMISSION of a CASE.
      • The function will return actions for an ADMISSION (specified in the action_context) only if the active user has ROLE "CASE MANAGER" or "SERVICE" in the SUBSCRIPTION of the ADMISSION.
  • pathThe goal of this parameter is to organize the actions hierarchically (as in a file tree where path represents the subdirectory). When calling action_list_user(), some of the actions returned may be of type PATH, in which case the value of the path returned can be used to make a subsequent call to action_list_user() to get the actions nested in that path.
  • action_context: JSON structure that the function will use as context information to generate the list of actions. See ACTION CONTEXT (JSON) for more information

Output

parameters:

  • result: XML with the list of possible actions. Each action in the XML contains:
    • ref: action reference. If the action is of class PATH, then this it can be used to call again the function passing the value in the path parameter to obtain a new list of actions
    • name: short name in the active session’s language
    • description: description in the active session’s language
    • class: PATH | ACTION
    • type: action type
  • 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:

action_list_case ( “LCAAAAAAAAAAAA”, "232", "MNG", "", "{program: 23}" );

Response

sample:


<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<result>
	<actions>
		<description>Select an action</description>
   		<action>
			<ref>action_token</ref>
			<name>short_name</name>
			<description>desc</description>
			<class>ACTION</class>
		</action>
		<action>...</action>
	</actions>
</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

INVALID_JSON

The JSON string provided in parameter action_context has an invalid format

CASE.NOT_FOUND

The CASE reference provided in parameter id or in  action_context does not correspond to an existing CASE

TEAM.NOT_FOUND

The TEAM reference provided in parameter action_context does not correspond to a valid TEAM

PROGRAM.NOT_FOUNDThe PROGRAM reference provided in parameter action_context does not correspond to a valid PROGRAM
INVALID_DATEThe date value provided in parameter action_context does not have a valid format

Related content