goal_get ( )

goal_get ( )

Function prototype

goal_get (session, [data_code], [level], [ref], [type], [date])

API Version

2.6.15 and higher

Supported interfaces

SOAP, REST (Since API Version 2.8.1)

Description

Returns the list of GOAL OBJECT that match the filter defined by the input parametersDetailed explanation of the function.

Restrictions: though all the parameters are optional, there are some combinations that have a special behavior or are prohibited

  • If level = ADMISSION, it is mandatory to provide a valid ref (to avoid retrieving GOALS for all ADMISSIONS in the system)

  • If level <> ADMISSION, then the GOALS at ADMISSION level are not included (to avoid retrieving GOALS for all ADMISSIONS in the system)

Required permissions: The active user must have role XXXX. Otherwise an INSUFFICIENT_PRIVILEGES error will be returned.

Input parameters:

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

  • data_code: the DATA CODE object to which the new GOAL will be assigned

  • level: The clinical level where this GOAL applies. Valid values: (GLOBAL, PROGRAM, SUBSCRIPTION, ADMISSION)

  • ref: A reference to the clinical object to which this GOAL applies. The level parameter defines the type of object. For example, if level=”ADMISSION”, then the reference must be an ADMISSION reference

  • type: indicates how to consider the value assigned to the GOAL. Valid values: (MAX, MIN).
    For example, if type=”MAX” it means that the value related to the DATACODE should not exceed the value assigned to the goal. If type=”MIN”, then the value related to the DATACODE should not fall below the value assigned to the goal.

  • date: Allows to indicate a limit date. If a date is provided, then the function will return the goals assigned at that date or before.
    This parameter is mandatory if level=ADMISSION

Output parameters:

  • result: List of assigned goals

    • data_code: Name of the DATACODE to which the goal is assigned

    • level: The clinical level where this GOAL applies.

    • level_ref: Reference to the clinical object to which this GOAL applies.

    • type: indicates how to apply the value of the GOAL. Valid values: (MAX, MIN)  

  • 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

goal_get ( “LCAAAAAAAAAAAA”, "WEIGHT", "ADMISSION", 12342, "MAX", "2018-01-03");

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

Invalid session token

OBJECT_NOT_FOUND

The object referenced by ref in the specified level (ADMISSION, PROGRAM...) does not exist

INSUFFICIENT_PRIVILEGES

The session user does not have enough privileges to create a  GOAL OBJECT

WRONG_PARAMS

Any of the parameters passed to the function does not have a valid value

INVALID_DATE

The date provided does not have a valid value

EMPTY_PARAMS

A mandatory parameter is empty