Operation Definition: Create Index Record (MeRI)
Introduction
Creates an index record of a healthcare provider and patient.
See operation Unregister Index Record for documentation on how to unregister an index record of a healthcare provider and a patient. If an index record that has been unregistered is to be registered again, it has to be created as a new one using this operation.
This operation changes content.
Usage
Invocations
POST [base]/$create-index-record
Parameters (In)
| Name | Cardinality | Type | Documentation |
|---|---|---|---|
| patient | 1..1 | Identifier (system and value) | Patient identifier |
| healthcareProvider | 1..1 | Identifier (system and value) | Healthcare provider identifier |
| availabilityTime | 1..1 | instant | When patient data was first made available by the healthcare provider. An instant must be specified at least to the second and include time zone offset, for example 2015-02-07T13:28:17.239+02:00 |
Valid patient identifier systems
- Swedish personal identity number (sv: personnummer)
- system:
http://electronichealth.se/identifier/personnummer - value format: 12 digits with or without hyphen, eg 198001032385
- system:
- Swedish coordination number (sv: samordningsnummer)
- system:
http://electronichealth.se/identifier/samordningsnummer - value format: 12 digits with or without hyphen, eg 201903682399
- system:
Valid healthcare provider identifier systems
- Swedish personal identity number (sv: personnummer)
- system:
http://electronichealth.se/identifier/personnummer - value format: 12 digits with or without hyphen, eg 198001032385
- system:
- Swedish organization identifier (sv: organisationsnummer)
- system:
urn:oid:2.5.4.97 - value format: 10 digits with or without hyphen, eg 5560269986
- system:
Return Values (Out)
| Name | Cardinality | Type | Documentation |
|---|---|---|---|
| return | 1..1 | OperationOutcome | OperationOutcome with result of operation |
Validation messages
These validation messages are error, information or success messages that SHOULD be returned in the OperationOutcome response.
| Message | Severity | Parameter | Comment |
|---|---|---|---|
| 2-44-1: Required parameter missing. | Error | Parameters with cardinality 1..N must be supplied | |
| 2-44-2: Invalid format of personal identity number. Submit the personal identity number using 12 digits with or without hyphen, e.g. 198001032385. | Error | patient.valueIdentifier.value, healthcareProvider.valueIdentifier.value | |
| 2-44-3: Invalid format of coordination number. Submit the coordination number using 12 digits with or without hyphen, e.g. 198000602394. | Error | patient.valueIdentifier.value | |
| 2-44-4: Invalid system. Valid systems are %s. | Error | patient.valueIdentifier.system, healthcareProvider.valueIdentifier.system | The Identifier.system values of parameters patient and healthcareProvider must be be from list of valid systems (see section Parameters (In) above) |
| 2-44-5: Invalid timestamp. Submit the timestamp in the format YYYY-MM-DDThh:mm:ss.sss+zz:zz, e.g. 2015-02-07T13:28:17.239+02:00. | Error | availabilityTime.valueInstant | Instant must be a correctly formatted instant, ie specified at least to the second and including time zone offset, for example 2015-02-07T13:28:17.239+02:00 |
| 2-44-7: Invalid format of organization identifier. Submit the organization identifier using 10 digits without hyphen, e.g. 5560269986. | Error | healthcareProvider.valueIdentifier.value | |
| 2-44-9: Invalid parameter. Valid parameters are patient, healthcareProvider, availabilityTime. | Error | ||
| 2-44-100: Required attribute missing in JWT token. | Error | Attribute client_id required. | |
| 4-44-300: Index record registered successfully. | Success | ||
| 4-44-303: Index record for supplied patient and healthcare provider already exists. | Information |
Examples
The following section includes examples of request bodies and corresponding response bodies when successfully or unsuccessfully invoking CreateIndexRecord.
Successful request and response
Request body
This example shows how to create an index record for a patient with a personal identity number at a healthcare provider with an organization identifier.
This example shows how to create an index record for a patient with a coordination number at a healthcare provider with an organization identifier.
Response body
Example of response body with an OperationOutcome of successful CreateIndexRecord operation.
Response when index post already exists
Example of OperationOutcome response when an index post with the supplied healthcare provider and patient already exists. Since the desired state had already been achieved the severity will be "information" with a code of "duplicate" to inform that an additional index post has not been created.
Invalid request format and corresponding response
Request body
Example of invalid request body for CreateIndexRecord operation because of wrongly formatted personal identity number of sole trader Organization - valueIdentifier.value of first parameter has 10 digit version of personal identity number instead of 12, and invalid value of identifier system of second parameter - http://electronichealth.se/personnummer instead of http://electronichealth.se/identifier/personnummer.
Response body
Example of response body with an OperationOutcome of failed CreateIndexRecord operation because of invalid format.
The first issue is about a wrongly formatted personal identity number. To specify which parameter the issue pertains to, the diagnostics element shows the path leading to the element in the request body that contains the wrongly formatted value - in this case the valueIdentifier.value element of the healthcareProvider parameter.
The second issue is about an invalid system ID. To specify which parameter the issue pertains to, the diagnostics element shows the path leading to the element in the request body that contains the invalid system value - in this case the valueIdentifier.system element of the patient parameter.