/
case_get_associate_list ()

case_get_associate_list ()

Function prototype

case_get_associate_list (session, case)

API VersionAll

Returns a list of associates of a CASE. This operation is restricted by privileges granted to the session's user.

Access to the associate list is only allowed if:

  • The CASE corresponds to the same session's user
  • The session's user is an ASSOCIATE of 'case' and has the permission #PERMISSION.ASSOCIATE_MANAGE
  • The session's user is a professional (doctor)

Input

parameters:

  • session: is the session token obtained in the session_init() call
  • case: a case reference. The list of associates for the CASE specified will be returned

Output

parameters:

  • result/associates: and XML with the list of ASSOCIATES:
    • associate: One entry per ASSOCIATE
      • ref: Reference to the ASSOCIATE
      • name: name of the ASSOCIATE
      • image_id: Reference to the image of the associate
      • relationship: information about the relationship between the CASE and the ASSOCIATE
        • type: relationship type
          • code: See RELATIONSHIP CODES. E.g. : FAMILY
          • description: name of the relationship translated to the session language. E.g: "Family member"
        • relative
          • code: See RELATIVE CODES. Eg: PARENT(F)
          • description: name of the relative type translated to the session language. E.g: "Mother"
      • status: Describes the status of the association between the ASSOCIATE and CASE. Can be one of the following
        • CHILD_REQUEST: The CASE has sent a request to be cared by the ASSOCIATE, but the invitation has not been accepted yet
        • ACCEPTED: The invitation has been accepted
        • REJECTED: The invitation has been rejected
      • invitation_date: This node is only present if an invitation has been sent from the case to the associate or vice-versa but the invitation has not been accepted yet. Introduced in API Version 2.7.23
      • active: indicates whether the ASSOCIATE is active or not. Inactive ASSOCIATES are treated as if they weren't ASSOCIATES any more, but they can be activated at any moment.
  • 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_associate_list ( “LCAAAAAAAAAAAA”, 32131)

Response

sample:


<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<result>
  <associates>
    <associate>
      <ref>5283</ref>
      <name>John Smith</name>
      <image_id>323</image_id>
      <relationship>
        <type>
          <code>FAMILY</code>
          <description>Family member</description>
        </type>
        <relative>
          <code>PARENT(M)</code>
          <description>Father</description>
        </relative>
      </relationship>
      <status>PARENT_REQUEST</status>
      <invitation_date>2021-01-28 12:23:21</invitation_date>
      <active>true</active>
    </associate>
    <associate>
      <ref>5319</ref>
      <name>Mary Anderson</name>
      <image_id>354</image_id>
      <relationship>
        <type>
          <code>FAMILY</code>
          <description>Familiar</description>
        </type>
        <relative>
          <code>SIBLING(F)</code>
          <description>Sister</description>
        </relative>
      </relationship>
      <status>ACCEPTED</status>
      <active>true</active>
    </associate>
  </associates>
</result>
<ErrorMsg></ErrorMsg>
<ErrorCode></ErrorCode>

Return Error codes

ERROR CODE

INVALID_TOKEN

The session token provided is not valid

INSUFFICIENT_PRIVILEGES

The session user does not have the necessary privileges to request the list of ASSOCIATES of the CASE

CASE.NOT_FOUND

The CASE reference provided in parameter case does not correspond to an existing CASE

Related content