/
associate_insert_case(session, associate, case )

associate_insert_case(session, associate, case )

Is a function to add a new CASE to an ASSOCIATE.

Input

parameters:

  • session: is the token obtained in the session_init call
  • associate: The ASSOCIATE to which the CASE will be added
  • case: a XML with new CASE data (see below). At least one IDENTIFIER or CHANNEL for the associate is always expected, and if not provided, an error will occur. The IDENTIFIERS and CHANNELS provided will be used to look for already existing CASES with that data.
    • If there exist a CASE (and only one) with the indicated IDENTIFIERS or CHANNELS, then all provided data will be ignored and the existing CASE will be added into the associate's CASE list.
    • If there exist more than one CASE with the indicated IDENTIFIERS or CHANNELS, then the list of existing CASES will be returned so that it is possible to choose from one of the list
    • If no CASE exists, then a new one will be created with the provided data (this will require a confirmation by the new CASE)

When an CASE is inserted then it must also be accepted by the new CASE. This will trigger a notification to the CASE so that he can accept or reject the request.

Output

parameters:

  • result: reference to the CASE added
  • 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

Request

sample:

associate_insert_case ( “LCAAAAAAAAA”, 332423, "

<case>
   <ref/>    <!-- optional value. Only if the CASE is known. if provided, the rest of fields are ignored -->
   <relationship>
      <type>
         <code>FAMILY</code>
      </type>
      <relative>
         <code>PARENT(M)</code>
      </relative>
   </relationship>
   <identifiers>
      <identifier>
         <label>NICK</label>
         <value>dsfd</value>
      </identifier>
      <identifier>
         <label>NAT_ES</label>
         <value>46114346J</value>
      </identifier>
   </identifiers>
   <data>
      <bdate />
      <age />
      <gender />
   </data>
   <name>
      <given_name>Maria Rosa</given_name>
      <middle_name />
      <maiden_name />
      <family_name>Perez</family_name>
      <family_name2 />
   </name>
   <channels>
      <phones>
         <phone>
            <type>mobile</type>
            <value>634546365</value>
            <comment />
         </phone>
      </phones>
      <emails>
         <email>
            <type>work</type>
            <value>adsasda@LINKCARE.ES</value>
            <comment />
         </email>
      </emails>
   </channels>
</case>

")

Response

sample:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<result>322</result> <!-- Case Ref -->
<ErrorMsg></ErrorMsg>

Notes:


Related content