interoperability_key_create ()

interoperability_key_create ()

Function prototype

interoperability_key_create (session, key_data)

API Version

2.7.29 and higher

Supported interfaces

SOAP, REST

Description

Creates a new interoperability key

Considerations about the properties of the new key:

  • The CODE assigned to the key must be unique. Once created this value cannot be changed

  • The APP_ID and PRIVATE_KEY properties of the new key cannot be defined manually. They are generated automatically by the API.

Required permissions: The active user must be a super-administrator

Input parameters:

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

  • key_data: A JSON string with the information for new interoperability key. The properties supported are:

    • name: String with the name assigned to the key

    • code: internal code that will be assigned to the key. This code cannot be changed after the creation. It must be composed of a leading letter and a sequence of other numbers, letters and underscores (until a maximum length of 32 characters). The code will always be converted to uppercase

    • comments: free text up to 512 characters

    • language: a 2 letter ISO code of the language to be used as the default language when an external system interacts with the Linkcare platform. if not provided, the active session language will be used

Output parameters:

  • result: Information of the created interoperability key

    • name: String with the name assigned to the key.

    • code: internal code that will be assigned to the key. This code cannot be changed after the creation. It must be composed of a leading letter and a sequence of other numbers, letters and underscores (until a maximum length of 32 characters). The code will always be converted to uppercase

    • app_id: Id of the interoperability key. This value is generated automatically by the API and cannot be changed

    • private_key: private key of the interoperability key. This value is generated automatically by the API and cannot be modified to a manually chosen value, but can be reseted to a new value using the API function interoperability_key_set().

    • comments: free text up to 512 characters.

    • language: a 2 letter ISO code of the language to be used as the default language when an external system interacts with the Linkcare platform

    • creation_date: date of creation (in the session local timezone) of the key.

    • modification_date: date of the last modification (in the session local timezone) of the key.

  • 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

interoperability_key_create ( “LCAAAAAAAAAAAA”, " { "name": "Hospital Clinic", "code": "CLINIC", "comments": "Interoperability key used by the HIS of the Hospital Clinic of Barcelona", "language": "EN" }")

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 session user does not have the necessary privileges to execute this function

INTEROPERABILITY.KEY.CODE_EMPTY

The code for the new interoperability key has not been provided

INTEROPERABILITY.KEY.CODE_EXISTS

The code provided for the new interoperability key already exists



Related content