case_insert_associate()
Function prototype | case_insert_associate(session, case, associate ) |
---|---|
API Version | All The format of the response changed in version 2.7.12. See Response format prior to version 2.7.12 for additional information |
Adds a new ASSOCIATE to a CASE.This operation is restricted by privileges granted to the session's user. The operation is only allowed when:
After the successful execution of case_insert_associate(), a communication is sent (via eMail, phone or any other communication channel indicated in the associate parameter) to the ASSOCIATE. The communication includes a URL that contains a SHARED KEY OBJECT that will be used after the ASSOCIATE signs up or logs in the system to accept the invitation. | |
Input parameters: |
When an ASSOCIATE is inserted then it must also be accepted by the new associate. This will trigger a communication to the ASSOCIATE so that he can accept or reject the request. The communication includes a URL that contains a SHARED KEY OBJECT that will be used after the ASSOCIATE signs up or logs in the system to accept the invitation. |
Output parameters: |
|
Request sample: | case_insert_associate ( “LCAAAAAAAAA”, 2132, " <associate> <ref/> <!-- optional value. Only if the ASSOCIATE 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>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>Martinez</family_name> <family_name2 /> </name> <channels> <phones> <phone> <type>mobile</type> <value>634546365</value> </phone> </phones> <emails> <email> <type>work</type> <value>mrmartinez@linkcare.es</value> </email> </emails> </channels> <permissions> <permission> <code>MEDICAL_PROFILE</code> <access_type>none</access_type> </permission> <permission> <code>ASSOCIATE</code> <access_type>edit</access_type> </permission> </permissions> </associate> ") |
Response sample: | <?xml version="1.0" encoding="utf-8" standalone="yes"?> <result> <case_insert_associate> <ref>1234</ref> <validation></validation> </case_insert> </result> <ErrorMsg></ErrorMsg> <ErrorCode></ErrorCode> |
Return Error codes
ERROR CODE | |
---|---|
INVALID_TOKEN | The session token provided is not valid |
XML_ERROR | The information provided for creating the CASE does not have a valid XML format |
INSUFFICIENT_PRIVILEGES | The session user does not have the necessary privileges to create an ADMISSION in the SUBSCRIPTION or the TEAM reference provided is not a member of the SUBSCRIPTION |
CONTACT_DATA.VALIDATION | The information provided to validate the CASE is not valid |
Response format in version prior to version 2.7.12
The XML response generated in previous versions was the following
- result: reference to the new CASE created or empty if any error occurred
- type: ("NEW" / "EXIST") If the operation was successful, indicates whether a new CASE was created or a existing one that matched the information was used
- 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
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <result>case_id</result> <type>NEW</type> <ErrorMsg></ErrorMsg>