case_get_task_calendar ()

case_get_task_calendar ()

Function prototype

case_get_task_calendar ( session , case , [filter = null])

API Version2.6.4 and higher

Returns a calendar 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)

Note: if the session's 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

Input

parameters:

  • session: a token obtained by calling session_init ()
  • case: a case reference
  • filter: a JSON expression with any of the following criteria (see TASK FILTER (JSON) for details).

Output

parameters:

  • result/dates: a list of dates with TASKS with a summary of the number of TASKs per day. For each EVENT or TASK, the information provided is:
    • closed: Number of elements in 'closed' status
    • open: Number of elements in 'open' status
    • not_read: (only EVENTS) Number of EVENTS not read by the active USER
    • flagged: (only EVENTS) Number of EVENTS that have a priority set. Introduced in API Version 2.7.15
  • 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:

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

Response

sample:

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

<result>

<dates>
  <total>
    <events>
      <closed>5</closed>
      <open>4</open>
      <not_read>0</open>
      <flagged>0</flagged>
    </events>
    <tasks>
      <closed>5</closed>
      <open>4</open>
    </tasks>
  </total>
  <date>
    <value>2017-04-01</date>
    <events>
      <closed>5</closed>
      <open>4</open>
      <not_read>0</open>
      <flagged>0</flagged>
    </events>
    <tasks>
      <closed>5</closed>
      <open>4</open>
    </tasks>
  </date>
  <date>..</date>
</dates>

</result>

<ErrorMsg></ErrorMsg>

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