event_get ()

event_get ()

Function prototype

event_get ( session, event_id )

API Version

All

Supported interfaces

SOAP, REST (Since API Version 2.7.31)

Function prototype

 

API Version

ALL

Description

Returns all information about an event.

Input

parameters:

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

  • event_id: an event reference

Output

parameters:

result: an XML representation of the object:

  • version: Version of the XML representation. Indicates the API Version in which this format was introduced

  • ref: Reference to the EVENT in Linkcare platform

  • type: is the type of event. See more in event_type() function

    • id: Identifier of the EVENT type

    • desc: description of the EVENT type

  • status: is the status of the EVENT. Possible values OPEN/CLOSED

  • date: date assigned to the EVENT: This date depends on the status of the EVENT (is the open_date when the EVENT is open and the close_date when the EVENT is closed

  • open_date: date when the EVENT was opened

  • close_date: date when the EVENT was closed

  • read_mark: (true/false) Indicates whether this EVENT has been 'read' by the session user. This value can be modified by setting the read mark using event_set_read_mark () API function. Introduced in API version 2.6.18

  • multi_message: (true/false) If true, this EVENT is similar to a chat and can contain multiple comments. Otherwise it is considered an EVENT that is sent from one user to another, and when the second USER responds, the EVENT is considered closed. Multi message events must be closed manually. This property was introduced in API version 2.7.4

  • priority: priority order (HIGH / MEDIUM / NULL)

  • event_code

  • assigned_to: information about the assigned ROLE/TEAM/USER (who should take care of this EVENT)

    • user: (may be empty) Information about the assigned USER (if any) 

      • ref: internal reference to the USER

      • nickname: nickname of the user

      • name: complete name of the USER

    • team: (may be empty) Information about the assigned TEAM (if any)

      • ref:

      • name: name of the TEAM

    • role: (may be empty) Information about the assigned ROLE (if any)

      • ref: internal reference of the ROLE

      • name: name of the ROLE (translated to the current SESSION language)

    • default_address: if the EVENT is an outgoing communication (issuer is "POSTER" and there is a communication channel selected), then this field indicates the default communication address of the assigned_to TEAM or USER. This is the address that will be used to send a communication when the first comment is added to the EVENT

  • comments: list of comments associated to this EVENT

    • comment: contains all the information of a single comment

      • order: ordinal position of the comment

      • editable: (true/false) indicates whether the comment is editable by the Session user (the one that invokes event_get() )

      • date: datetime when the comment was created

      • channel: communication channel by which the comment was sent

        • type:

      • user: Information about the user that created the comment

        • ref: internal reference to the USER

        • nickname: nickname of the user

        • name: complete name of the USER

  • members: List of participants in the EVENT. Introduced in version 2.7.8

    • member: information about each participant

      • name: name of the participant

      • type: ("POSTER", "ASSIGNED", "OTHER")

      • actor: Indicates how the member is participating (as a PROFESSIONAL, CASE or ASSOCIATE). Introduced in version 2.7.16

      • role: Role with which the member is participating. Introduced in version 2.7.16

        • ref: internal reference of the ROLE

        • name: name of the ROLE (translated to the current SESSION language)

  • closed_by: Information about the USER that marked this EVENT as "closed"

    • ref: internal reference to the USER

    • nickname: nickname of the user

    • name: complete name of the USER

  • follow_report: (true/false) if the event must be show in the follow report

  • call_type: IN/OUT/VOID. Is the direction of the communication between phone and phone_poster

  • modified: Information about the last person that modified the event

    • date: modification datetime

    • user: Information about the last USER that modified the EVENT

      • ref: internal reference to the USER

      • nickname: nickname of the user

      • name: complete name of the USER

  • issued_by: is the origin person that reports the event

    • ref: Reference of the issuer USER. It may be empty when the issuer is a person not registered in the system, In that case only the name will be available

    • nickname: Nickname of the USER (only when the issuer is a person registered in the system)

    • name: name of the issuer

    • date: datetime of creation of the EVENT

    • type: Can be POSTER /CASE / OTHER

    • description:

    • phone: The phone number, email or other channel of the interlocutor

    • channel: ((void) / EMAIL / PHONE / IM) indicates by which channel type has been sent or received the EVENT (introduced in version 2.7.8)

  • admission: is the admission XML object that is related by the event. See more in admission_get() function

  • case: is the case XML object that is related by the event. See more in case_get() function

  • tasks: is a list of tasks related with the event. See more in event_task_list() function

    • task: information block for each TASK 

      • ref: reference of the TASK

      • name: name of the TASK translated to the active session language

      • type: type of TASK (CUE / COM / REP / DIS)

      • status: status of the TASK

      • date: scheduled date time

      • activities: is a list of activities (FORMS or REPORTS) related with the event (introduced in version 2.7.8)

        • activity: information block for each activity 

          • type: (FORM/REPORT)

          • ref: reference of the activity

          • name: name of the activity translated to the active session language

          • date: date of creation of the activity

          • status: OPEN / CLOSE

  • permissions: edit and delete event permissions

    • edit: flag that indicates if event can be edited by active USER (true/false)

    • delete: flag that indicates if event can be deleted by active USER (true/false)

    • allow_add_activiy: (true/false) Indicates whether the EVENT admits the possibility of inserting ACTIVITIES. This property only makes sense if the EVENT is assigned to an ADMISSION and there exist an specific definition of this EVENT TYPE in the PROGRAM (see WORKPLAN). When the EVENT is not assigned to an ADMISSION, the value is always 'true'. This property was introduced in API version 2.7.6

    • add_comments: true/false. Indicates if the session user can add new comments

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

Notes:



Request example

event_get( “LCAAAAAAAAAAAAAA”, “54234“);

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

The session token provided is not valid

INSUFFICIENT_PRIVILEGES

The active session does not have permission to create or modify the DATACODE

Version compatibility notes

API Version

Changes respect to previous version

API Version

Changes respect to previous version

2.7.8

FORM cannot be directly included in an EVENT. Instead, all FORMS appended to an EVENT are included into a TASK, and only the TASK is linked to the EVENT.

In this version, the information about the TASK also includes the FORMS information (see change details for version 2.7.8)

2.7.3

Added support for multiple comments

XML structure changed (see change details for version 2.7.3)

0.0.0

Initial version

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

XML changes in API version 2.7.8 respect version 2.7.3

2.7.8

2.7.3

Comments

2.7.8

2.7.3

Comments

<event>
...

  <issued_by>
    <ref>17474</ref>
    <nickname>PEDRO SL</nickname>
    <name>PEDRO SÁNCHEZ</name>
    <date>2018-05-28 00:00:00</date>
    <type>POSTER</type>
    <description>Creator</description>
    <phone/>
    <channel>EMAIL</channel>
  </issued_by>

<event>
...
  <phone_poster></phone_poster>
  <issued_by>
    <ref>17474</ref>
    <nickname>PEDRO SL</nickname>
    <name>PEDRO SÁNCHEZ</name>
    <date>2018-05-28 00:00:00</date>
    <type>POSTER</type>
    <description>Creator</description>
    <phone/>
  </issued_by>

Removed nodes:

  • <phone_poster>: Moved into <issued_by>

Added nodes into <issued_by>:

  • <channel>

<event>
...

  <assigned_to>
    <user>
      <ref>123123</ref>
      <nickname>juanm</nickname>
      <name>Juan Martínez</name>
    </user>
    <team>
      <ref>1</ref>
      <name>Linkcare</name>
    </team>
    <role>
      <ref>24</ref>
      <name>Case manager</name>
    </role>
  </assigned_to>

<event>
...
  <comments>
    <comment>
      <assigned_to>
        <user>
          <ref>123123</ref>
          <nickname>juanm</nickname>
          <name>Juan Martínez</name>
        </user>
        <team>
          <ref>1</ref>
          <name>Linkcare</name>
        </team>
        <role>
          <ref>24</ref>
          <name>Case manager</name>
        </role>
      </assigned_to>
    </comment>
  </comments>

  • Added node <assigned_to> from each comment

  • Added node <assigned_to> to the root node

In version 2.7.8 the whole event is assigned io a target instead of assigninig each comment separately

<event>
...
  <tasks>
    <task>
      <ref>77358</ref>
      <name>Spirometry report</name>
      <type>REP</type>
      <status>DONE</status>
      <date>2017-07-05 12:23:33</date>
      <activities>
        <activity>
          <type>FORM</type>
          <ref>106150</ref>
          <name>Multiple Sclerosis - Case evolution</name>
          <date>2019-09-16 13:14:40</date>
          <status>OPEN</status>
        </activity>
      </activities>
    </task>
  </tasks>

<event>
...
  <forms>
    <form>
      <ref>106150</ref>
      <short_name>Multiple Sclerosis - Case evolution</short_name>
      <description>LinkCare Form Library</description>
      <date>2019-09-16 13:14:40</date>
      <editable>true</editable>
      <status>OPEN</status>
    </form>
  </forms>
...

In version 2.7.8 <forms> node has been moved from the root node to the corresponding <task> node and renamed to <activities>

<event>
...
 <members>
    <member>
      <name>Juan Martínez</name
      <type>POSTER</type>
    </member>
    ...
  </members>

...

<event>



New node <members> in version 2.7.8

Contains the list of members of the EVENT (all persons that participate in the conversation)

<event>
...
  <tasks>
    <task>
      <ref>77358</ref>
      <name>Spirometry report</name>
      <type>COM</type>
      <status>ASSIGNED/NOT DONE</status>
      <date>2019-09-16 13:14:40</date>
      <activities>
        <activity>
                      <type>FORM</type>
          <ref>106150</ref>
          <name>Multiple Sclerosis - Case evolution</name>
          <date>2019-09-16 13:14:40</date>
          <status>OPEN</status>
        </form>
      </forms>
    </task>
  </tasks>
..

<event>
...
  <tasks>
    <task>
      <id>77358</id>
      <description>Spirometry report</description>
      <type>REP</type>
      <status>DONE</status>
      <date>2017-07-05</date>
      <hour>12:46:13</hour>
      <class>TASK</class>
    </task>
  </tasks>
...

  • Node task/id has been renamed to task/ref

  • Node task/description has been renamed to task/name

  • node date now contains a full date time value

  • node task/hour has been removed

  • node task/class has been removed

  • node task/activities is new and contains the list of activities of the TASK