case_get_task_list ()

case_get_task_list ()

Function prototype

case_get_task_list ( session , case {, max_res{, offset}} {, filter} {, ascending})

API Version2.6.4 and higher
API VersionChanges respect to previous versions
2.7.15

XML structure containing EVENT information has changed (see Change details for version 2.7.15)

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


Is a function to  retrieve the list of TASKS and/or EVENTS of all ADMISSIONS of a specific CASE


This operation is restricted by privileges granted to the session's user. It is only allowed if:

  • If the CASE corresponds to the same session's user then: 
    • If the SESSION's user is not simultaneously a PROFESSIONAL: only existing TASKS assigned to the CASE (role = PATIENT) will be returned
    • If the SESSION's user is also a PROFESSIONAL: All existing TASKS will be returned
  • Otherwise, if the session's user is a PROFESSIONAL (doctor): all existing TASKS from SUBSCRIPTIONS where the PROFESSIONAL has access will be returned
  • Otherwise, if the session's user is an ASSOCIATE of the CASE and the permission #PERMISSIONS.TASK_DELEGATE is granted for browsing or editing: all existing TASKS assigned to the CASE (role = PATIENT) will be returned
  • Otherwise: an error will be returned (no permissions)

Special cases:

  • if session's ACTIVE USER is not a PROFESSIONAL, any role specified as a filter (if any) different that PATIENT will return an error, because in this situation only TASKS with role PATIENT can be returned
  • If session's ACTIVE ROLE is PROVIDER, then only TASKs assigned to that ROLE will be returned

Input

parameters:

  • session: a token obtained by calling session_init ()
  • case: a case reference
  • max_res: (number) to limit the maximum number of results desired
  • offset: (number) to paginate the results. Is the ordinal position of the first result desired
  • filter: a JSON expression with any of the following criteria (see TASK FILTER (JSON) for details).
  • ascending: (boolean) Default value: 'false'. Determines whether the list of results is sorted ascending or descending by date

Output

parameters:

  • tasks: a list of TASKS and/or EVENTS with complementary information 
    • next / prev: when filtering by date (from_date / to_date) it will also be returned the previous or posterior date where the CASE has any TASK
    • task: summarised information about a TASK
      • ref: task reference
      • code: TASK CODE
      • description: is the name of the TASK in the session language of the task
      • type: type of the task, It should be: CASE,CALL,VIDEO,TELE,CARE,MSG,SUSPEND,RESUME,ENROLL,DISCHARGE,JOIN, EDU
      • date: is the datetime in YYYY-MM-DD HH:MM:SS format of the task
      • 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 of the date will be ignored. Introduced in API Version 2.7.25

      • status: "ASSIGNED/NOT DONE", "DONE"
      • 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
        • description: Name of the program
      • progress: percentage of completeness of the TASK
      • forms: Summary of FORMs included in the TASK. For each FORM the following information is provided:
        • ref: Reference to the FORM
        • code: FORM CODE. Introduced in API version 2.7.15
        • description: Name of the FORM
    • event: Summarized information about an EVENT. The structure of the information returned is equal to the returned by event_get () but with summarized information
  • ErrorMsg: any fault in the call, either in the validation of input parameters, errors in the connection to the database or any other error, this parameter returns the error message produced
  • ErrorCode: If any error occurs, then this value contains any of the standard ERROR CODES

Request

sample:

case_get_task_list ( “LCAAAAAAAAAAAA”, 32131, , , '{"from_date" : "2017-04-01", "role" : "39"}')

Response

sample:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<result>

<tasks>
  <next>
    <date>2015-06-04</date>
  </next>
  <prev>
    <date>2015-04-14</date>
  </prev>
  <task>
    <ref>55380</ref>
    <code>BRCA_ELEGIBILITY</code>
    <description>Elegibility</description>
    <type>FORM</type>
    <locked>false</locked>
    <external>false</external>
    <date>2015-01-28 00:00:00</date>
    <unscheduled>false</unscheduled>
    <last_modification>2015-01-28 00:00:00</last_modification>
    <status>ASSIGNED/NOT_DONE</status>
    <image_info>{"resource_ref":14324,"description":"","mimeType":"jpg","code":"","scope":"PROGRAM"}<image_info>
    <admission>
      <ref>21844</ref>
    </admission>
    <subscription>
      <ref>9876</ref>
    </subscription>
    <program>
      <ref></ref>
      <description></description>
    </program>
    <progress>55</progress>
    <forms>
      <form>
        <ref>12312</ref>
        <code>FRM_1</code>
        <description>Form 1</description>
      </form>
      <form>
        <ref>12313</ref>
        <code>FRM_2</code>
        <description>Form 2</description>
      </form>
    </forms>
  </task>
  <event>
    <ref>10735</ref>
    <event_code>#EVENT:CARE</event_code>
    <type>
      <id>#EVENT:CARE</id>
      <desc>Care Issue</desc>
    </type>
    <status>OPEN</status>
    <date>2020-09-30 10:53:35</date>
    <read_mark>true</read_mark>
    <close_date/>
    <priority>NULL</priority>
    <admission>
      <ref>27491</ref>
      <version>1</version>
      <data>
        <subscription>
          <ref>1283</ref>
          <team>
            <ref>1</ref>
            <name>Linkcare</name>
            <insignia>380000</insignia>
          </team>
          <program>
            <id>373</id>
            <version>1</version>
            <name>BRCA screening</name>
            <code>BRCA</code>
          </program>
        </subscription>
      </data>
    </admission>
    <case>
      <ref>10511</ref>
      <pictures>
        <insignia>
          <ref>1770000</ref>
        </insignia>
      </pictures>
      <data>
        <nickname>JIM R</nickname>
        <bdate>1959-04-09</bdate>
        <age>61</age>
        <gender>M</gender>
      </data>
    </case>
    <assigned_to>
      <role>
        <ref>24</ref>
        <name>Case Manager</name>
      </role>
      <team>
        <ref>1</ref>
        <name>Linkcare</name>
      </team>
      <user>
        <ref>15941</ref>
        <nickname>JOSEP B</nickname>
        <name>JOSEP BENAVENT</name>
      </user>
    </assigned_to>
    <issued_by>
      <ref>16761</ref>
      <nickname>PEDRO S</nickname>
      <name>PEDRO SANCHEZ</name>
      <gender>M</gender>
      <date>2020-09-30 10:53:35</date>
      <type>POSTER</type>
      <pictures>
        <insignia>
          <ref>1860000</ref>
        </insignia>
      </pictures>
    </issued_by>
    <permissions>
      <edit>true</edit>
      <delete>true</delete>
    </permissions>
  </event>
</tasks>

</result>
<ErrorMsg></ErrorMsg>
<ErrorCode></ErrorCode>

Notes:

  • A TASK is considered to be 'locked' if it belongs to a SUBSCRIPTION of which the session's user is not member
  • A TASK is considered to be 'external' if it belongs to a SUBSCRIPTION of which the session's user is member, but has no privileges to execute it

XML changes in API version 2.7.15 respect previous versions

In order to use a consistent structure across all API functions, in version 2.7.15, the structure of the XML used to provide EVENT information has been changed so that it matches the structure returned by event_get (). The old structure was quite similar, but there are some changes.

2.7.15

Previous versions

Comments

<event>
  <ref>10735</ref>
  <event_code>#EVENT:CARE</event_code>
<type>
    <id>#EVENT:CARE</id>
    <desc>Care Issue</desc>
  </type>
  <status>OPEN</status>
  <date>2020-09-30 10:53:35</date>
  <read_mark>true</read_mark>
  <close_date/>
  <priority>NULL</priority>
  <admission>
    <ref>27491</ref>
    <version>1</version>
    <data>
      <subscription>
        <ref>1283</ref>
        <team>
          <ref>1</ref>
          <name>Linkcare</name>
          <insignia>380000</insignia>
        </team>
        <program>
          <id>373</id>
          <version>1</version>
          <name>BRCA screening</name>
          <code>BRCA</code>
        </program>
      </subscription>
    </data>
  </admission>
  <case>
    <ref>10511</ref>
    <pictures>
      <insignia>
        <ref>1770000</ref>
      </insignia>
    </pictures>
    <data>
      <nickname>JIM R</nickname>
      <bdate>1959-04-09</bdate>
      <age>61</age>
      <gender>M</gender>
    </data>
  </case>
  <assigned_to>
    <role>
      <ref>24</ref>
      <name>Case Manager</name>
    </role>
    <team>
      <ref>1</ref>
      <name>Linkcare</name>
    </team>
    <user>
      <ref>15941</ref>
      <nickname>JOSEP B</nickname>
      <name>JOSEP BENAVENT</name>
    </user>
  </assigned_to>















<issued_by>
    <ref>16761</ref>
    <nickname>PEDRO S L</nickname>
    <name>PEDRO SANCHEZ LULING</name>
    <gender>M</gender>
    <date>2020-09-30 10:53:35</date>
    <type>POSTER</type>
    <pictures>
      <insignia>
        <ref>1860000</ref>
      </insignia>
    </pictures>
  </issued_by>


<permissions>
    <edit>true</edit>
    <delete>true</delete>
  </permissions>










</event>

<event>
  <ref>55380</ref>
  <code>#EVENT:CARE</code>
  <subject>First comment...</subject>
  <type>FORM</type>
  <description>Elegibility</description

<status>OPEN</status>
  <date>2020-09-30 10:53:35</date>
  <read_mark>true</read_mark

<priority>NULL</priority>
  <admission>
    <ref>21844</ref>
  </admission>
  <subscription>
    <ref>1283</ref>
  </subscription>
  <program>
    <ref>373</ref>
    <description>BRCA Screening</description>
  </program>










<case>
    <ref></ref>
    <data>
      <nickname>JOHN S</nikcname>
      <bdate></bdate>
      <age>29</age>
      <gender></gender>
    <data>
  </case>





<assigned_to>
    <role>
      <ref>24</ref>
      <name>Case Manager</name>
    </role>
    <team>
      <ref>1</ref>
      <name>Linkcare</name>
    </team>
    <user>
      <ref>15941</ref>
      <nickname>JOSEP B</nickname>
      <name>JOSEP BENAVENT</name>
    </user>
  </assigned_to>
  <posted_by>
    <role>
      <ref>24</ref>
      <name>Case Manager</name>
    </role>
    <team>
      <ref>1</ref>
      <name>Linkcare</name>
    </team>
    <user>
      <ref>16761</ref>
      <nickname>PEDRO S L</nickname>
      <name>PEDRO SANCHEZ LULING</name>
    </user>
  </posted_by>
  <issuer>
    <name>POSTER</name>
    <description>POSTER</description>
  </issuer>









<duration>5</duration>
  <group_by>JOHN S(29)</group_by>
  <permissions>
    <edit>false</edit>
    <delete>false</delete>
  </permissions>
  <forms>
    <form>
      <ref>12312</ref>
      <description>Form 1</description>
    </form>
    <form>
      <ref>12313</ref>
      <description>Form 2</description>
    </form>
  </forms>
</event>

Removed nodes:

  • <subject>: removed in new structure. In previous versions this node contained the first comment of the EVENT.

  • <type>: Moved into <type/id>

  • <description>: Moved into <type/desc>

  • <subscription>: The information about the SUBSCRIPTION now is into the ADMISSION information

  • <program>: The information about the PROGRAM now is into the ADMISSION information

  • <posted_by>: removed in new version

  • <forms>: removed in new version

Modified nodes

  • <type>: was previously a string. Now is a node with extended information

  • <admission> now contains extended information about the ADMISSION

  • <issuer> has been replaced by <issued_by>  and contains extended information

Added nodes:

  • <close_date>: date of closure of the EVENT

  • <case/pictures>: image information of the CASE