/
record_insert ()

record_insert ()

Function prototype

record_insert (session, task, record)

API Version

All

Supported interfaces

SOAP, REST (From API Version 2.7.26)

NOTE: In API versions before 2.7.26, the information passed in the parameter record as a XML had a different format. See Before 2.7.26

Description

Modifies information about a Medical Record

Function parameters

Input parameters:

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

  • task: a reference of a TASK to which the Medical Record will be bound

  • record: A XML with the record info that should be updated.

    • date: Date of the Medical Record

    • visibility: Indicates who can view the Medical Record. Possible options are:

      • “all”: (default) Everybody can see the Medical Record (either Professionals or Patients)

      • “professional”: Only Professionals can see the Medical Record

    • tags: List of tags added to the Medical Record. Each tag consist in a pair of STANDARD_CODE / CODE values, and for each tag the contents is:

Output parameters:

  • result: empty

  • 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 example

The record parameter can be provided either as a XML or a JSON string (JSON is only supported since API Version 2.7.26)

Example request using XML

<record> <ref></ref> <date>2014-09-22</date> <visibility>all</visibility> <tags> <tag> <category>DIAGNOSIS.MDC</category> <code>4</code> </tag> <tag> <category>#RECORD.TYPE</category> <code>LAB_TEST</code> </tag> </tags> </record>

Example request using JSON

{ "date": "2014-09-22", "visibility": "all", "tags": { "tag": { "category": "DIAGNOSIS.MDC", "code": 4 } "tag": { "category": "#RECORD.TYPE", "code": "LAB_TEST" } } }

Return Error codes

ERROR CODE

 

ERROR CODE

 

INVALID_TOKEN

The session token provided is not valid

TASK.NOT_FOUND

The reference of the TASK was not found

Versions before 2.7.26

In previous versions, the record parameter only accepted XML string, and with a different format.

List of changes:

Before 2.7.26

From 2.7.26

Description

Before 2.7.26

From 2.7.26

Description

<tag> <tagId>RECORD.TYPE</tagId> <valueId>LATEST</valueId> </tag>

 

<tag> <category>DIAGNOSIS.MDC</category> <code>4</code> <name>Anatomic system</name> <value>Respiratory</value> </tag>

The subnodes tagId and valueId of the <tag> node have been replaced by <category> and <code> respectively

 

 

<visibility>

 

New node added only accepted from API Version 2.7.26

Parameter example of versions before 2.7.26:

<record> <ref>12828317</ref> <date>2014-09-22</date> <tags> <tag> <tagId>DIAGNOSIS.MDC</tagId> <valueId>RESP</valueId> </tag> <tag> <tagId>RECORD.TYPE</tagId> <valueId>LATEST</valueId> </tag> </tags> </record>

Related content