ACTION WEB SERVICES
The ACTIONs mechanism
ACTIONs are a way of asking the system a list of suggested actions that could be done for a specific object.
For example, if we are editing a PROGRAM, we could ask the system what can we do on that PROGRAM. Then the system would return a list of actions like “Create a Workplan”, “Publish the Program”, etc.
Action Web Services are a group of API functions that can be used to obtain list of actions and execute them. There exists a different function depending on the target object:
- action_list_user (): available actions for the active professional. Invoking this action assumes that the user who started the active SESSION is a professional.
- action_list_case (): available actions that the active professional can execute on a particular CASE. Invoking this action assumes that the user who started the active SESSION is a professional.
- action_list_patient (): available actions that a patient can execute. Invoking this action assumes that the user who started the active SESSION is a patient (a CASE).
- library_program_action_list ( session, id, action {, path, parameter})): available actions for a PROGRAM.
The ACTION Context
Sometimes it is desirable to provide additional information to obtain a more specific list of actions. For example, instead of invoking action_list_case () and get all the available actions for a CASE, we would prefer to obtain only the specific list of actions for a particular ADMISSION of that CASE.
To solve this problem, action_list functions admit a parameter for specifying a context (see ACTION CONTEXT (JSON) structure)
Navigation through ACTION trees
The list of actions for an object may be large, or it may include different groups of actions. For this reason, the system organizes ACTIONs as nodes of an ACTION tree. Therefore, an ACTION can be considered as a node of an ACTION tree, and we can find three classes of nodes (see
the action_list() API functions offer a way of navigating through a categorized tree until the desired ACTION is found (think of it as navigating through folders in a file system until the desired file is found).
When a list of ACTIONs is requested using any of the action_list() functions, the API can return three different classes of nodes (see ACTION OBJECT):
- ACTION: this is a final object. It is an action that can be executed by invoking action_exec ()
- PATH: This is an intermediate object. Represents a branch in the ACTION tree (like a folder in a file system). To view the contents of this PATH we must call again the corresponding action_list function passing the path value as parameter
- INPUT: The API needs some information from the user to generate the list of ACTIONs. This is similar to a PATH, but it is not possible to navigate farther unless we provide the requested information. To continue navigating we must call again the corresponding action_list function passing the value requested
Action functions
- action_exec ()
Function prototype action_exec (session, action_token)
API Version All - action_list_case ()
This function returns a list of possible actions that a PROFESSIONAL can execute for a CASE.
- action_list_patient ()
This function returns a list of possible actions that can be executed by a PATIENT or a PATIENT'S ASSOCIATE.
- action_list_user ()
Returns the possible actions available for the active user In the TASKS and EVENTS page.
- goal_set (session, data_code, level, ref, type {, date} {, value})
goal_set (account, code, lang )
Creates or deletes a GOAL OBJECT
- If value=null then the GOAL OBJECT will be deleted
- library_program_action_list ( session, id, action {, path, parameter}))
library_program_action_list ( session, id, action {, path})
This function returns a list of possible choices related with actions with the versions of a library_program
- contact_list ( )
This function returns a list of contacts related with the ACTIVE USER and an optional CASE or ADMISSION
- goal_get ( )
Returns the list of GOAL OBJECT that match the filter defined by the input parametersDetailed explanation of the function.