Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Version published after converting to the new editor


Function prototype

task_get (session, task, context)

API VersionAll


API VersionChanges respect to previous version
2.7.25

Calculation of previous and next TASKs have been removed. See Changes in version 2.7.25 for more details

IMPORTANT: Remember to call session_init() indicating the appropriate API Version

...

Excerpt

Returns all information about a TASK OBJECT.


Input

parameters:

  • session:is the session token obtained in the session_init() call
  • task: a reference to a task object
  • context: ADMI/USER/CASE, by default “”. This parameter is needed to calculate the next/prev tasks (in the order of the task_list)

Output

parameters:

  • result: an XML representation of the object:
    • ref: task reference
    • refs
      • activity: is the activity_id of the original task template
      • task_code: is the code of the original task
    • description: is the description in the session language of the task
    • name: is the name of the task
    • event: This information is added when the TASK is embedded in an EVENT
      • ref: Reference to the EVENT in which this TASK is embedded
      • name: Name of the EVENT (included in API version 2.7.9.1)
    • modified
      • date: is the date in YYYY-MM-DD format of the last update of the task
      • hour: is the time in HH:MM:SS format of the last update of the task
      • user:
        • id: user_id of the professional
        • nickname: user nickname
        • name_complete: user name complete
    • assignments/assignment: is the list of roles of the task with the users that can be modify the task
      • team:
        • ref: id of assigned team
        • name: name of assigned team
      • role:
        • ref: the role
        • name: the role description in the session language
      • user:
        • ref: user_id of the professional
        • nickname: user nickname
        • name: user name complete
    • forms/form: List of FORMS included in the TASK
      • ref: Reference of the FORM
      • code: FORM CODE. Introduced in API version 2.7.20
      • description: Description of the FORM
    • type: type of the task, It should be: CASE,CALL,VIDEO,TELE,CARE,MSG,SUSPEND,RESUME,ENROLL,DISCHARGE,JOIN, EDU
    • educational: (true/false) The value is true if this TASK is considered an EDUCATIONAL TASK. Introduced in API Version 2.7.25
    • class: It can be: PRO_TASK or SYS_TASK
    • category: Is the category of the task
      • id: the identification of the task category
      • description: the description in the session language
    • date: is the date in YYYY-MM-DD format of the task
    • hour: is the time in HH:MM:SS format of the task ( if the task is PENDING, is the planning date-hour. If the task is DONE, is the  last modify date-hour)
    • unscheduled: (true/false) Indicates whether the TASK has not been defined for a specific time of the day (can be done at any time of the day). When this property is true, the hour will be ignored. Introduced in API Version 2.7.25

    • duration: is the prevision of the duration to doing the task
    • follow_report: Y/N is the check that marks if the task is included in the followup report
    • status: DONE/PENDING
    • recursive: insert same task after closing it in {DAY/WEEK/BEWEEK/MONTH/YEAR} after close task
    • admission: information about the ADMISSION to which the TASK belongs
      • ref: the reference of the admission
    • program: basic information about the PROGRAM to which the ADMISSION of the TASK belongs. This information was added in API 2.7.6
      • ref: reference to the PROGRAM
      • name: Name of the program
      • description: Description of the program (translated to the current session language)
      • image_info: Picture associated to the PROGRAM expressed as a LIBRARY RESOURCE INFO (JSON)
    • case: information about the CASE of the ADMISSION
      • ref: the reference to the case of the admission
    • task_code_tasks: list of the tasks which have the same task_code in admission (in same program if task_code starts with $):
  1. As described the pending or finished tasks will be displayed, NO selected and NO derived from the selected task will be displayed.
    1. Simple tasks (which are not within a compound or composite device task) with the same TASK_CODE
    2. The composite jobs "COM" or "DIS" containing some task with the selected TASK_CODE
    • permissions
      • edit: flag that indicates if task can be edited by the active user (it must have one of the following roles in the SUBSCRIPTION: "CASE MANAGER", "PROGRAM ADMINISTRATOR", "SERVICE")
      • deleteflag that indicates if task can be deleted by the active user (it must have one of the following roles in the SUBSCRIPTION: "CASE MANAGER", "PROGRAM ADMINISTRATOR", "SERVICE")
      • allow_add_activiy: (true/false) Indicates whether the TASK admits the possibility of inserting ACTIVITIES. This property only makes sense if the TASK was generated from a WORKPLAN OBJECT). This property was introduced in API version 2.7.6
    • record:
      • ref: a reference to a record object if not null
    • locked: Indicates whether the TASK is 'locked' or not. A locked TASK cannot be answered by the user to whom it is assigned. Usually a TASK is locked when you don't want it to be completed until another condition happens (for example until a previous TASK has been completed). The 'locked' status of a TASK can be changed using a FORMULA LOCK_TASK(), or API function /wiki/spaces/DES/pages/16974090.
  • 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:

task_get (“LCAAAAAAAAA”, task_id{@source})

Response

sample:


Code Block
languagexml
<?xml version="1.0" encoding="UTF-8"?>
<result>
  <task>
    <ref>10627</ref>
    <refs>
      <task_code>TASK_CMP</task_code>
      <activity>14</activity>
      <next>
        <ref>40882</ref>
        <status>DONE</status>
      </next>
      <prev>
        <ref>40884</ref>
        <status>DONE</status>
      </prev>
    </refs>
    <description>HSOM l'utilitza actualment en l'inclusió de programa</description>
    <name>HSOM l'utilitza actualment en l'inclusió de programa</name>
    <modified>
      <date>2014-03-25</date>
      <hour>14:22:22</hour>
      <user>
        <id>6117</id>
        <nickname>Call C.</nickname>
        <name_complete>Call Center</name_complete>
      </user>
    </modified>
    <assignments>
      <assignment>
        <team>
          <id>1</id>
          <description>Linkcare</description>
        </team>
        <role>
          <id>23</id>
          <description>Enfermero</description>
        </role>
        <user>
          <id>1056</id>
          <nickname>Call C.</nickname>
          <name_complete>Call Center</name_complete>
        </user>
      </assignment>
      <assignment>
        <team>
          <id>1</id>
          <description>Linkcare</description>
        </team>
        <role>
          <id>22</id>
          <description>Gestor de Casos</description>
        </role>
        <user>
          <id>1056</id>
          <nickname>Call C.</nickname>
          <name_complete>Call Center</name_complete>
        </user>
      </assignment>
    </assignments>
    <forms>
      <form>
        <ref>87738</ref>
        <description>Medication plan</description>
      </form>
    </forms>
    <type>CARE</type>
    <class>PRO_TASK</class>
    <category>
      <id>11</id>
      <description>PATIENT</description>
    </category>
    <date>2011-03-25</date>
    <hour>11:19:11</hour>
    <duration>20</duration>
    <follow_report>N</follow_report>
    <status>DONE</status>
    <recursive>DAY</recursive>
    <admission>
      <ref>10</ref>
    </admission>
    <program>
      <ref>367</ref>
      <name>OSAKIDETZA ESPIRO</name>
      <description>Remote spirometry program for OSAKIDETZA</description>
      <image_info></image_info>
    </program>
    <case>
      <ref>1234</ref>
    </case>
    <group_task_cases>
      <case>
        <ref>324242</ref>
        <nickname>Raul P.M.</nickname>
        <admission>
          <ref>12312</ref>
        </admission>
      </case>
    </group_task_cases>
    <task_code_tasks>
      <task>
        <ref>54529</ref>
        <name>Specialist Visit</name>
        <state>NOT_DONE</state>
        <date>2014-09-29 09:52:17</date>
      </task>
    </task_code_tasks>
    <permissions>
      <edit>false</edit>
      <delete>true</delete>
      <allow_add_activity>true</allow_add_activity>
    </permissions>
    <record>
      <ref>ref</ref>
    </record>
    <locked>false</locked>
    <image_info>{"resource_ref":14324,"description":"","mimeType":"jpg","code":"","scope":"PROGRAM"}</image_info>
  </task>
</result>
<ErrorMsg></ErrorMsg>
<ErrorCode></ErrorCode>


...