Operation Definition: Batch create index records

Introduction

Creates index records in batch. One index record represents the relationship between as care provider and a patient, including date and in what system the data was created.

See Batch unregister index records operation for documentation on how to unregister an index records in batch.

See Create Index Record and Unregister Index Record operations for documentation on how to create and unregister single index records.

This operation changes content.

Usage

Invocations

POST [base]/$batch-create-index-records

Parameters (In)

Name Cardinality Type Documentation
healthcareProvider 1..1 Identifier (system and value) Healthcare provider identifier
indexRecord 1..* Index records
indexRecord.patient 1..1 Identifier (system and value) Patient identifier
indexRecord.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
indexRecord.system 0..1 url The system in which the patient data was registered

Valid patient identifier systems

Valid healthcare provider identifier systems

Return Values (Out)

Name Cardinality Type Documentation
return 1..1 OperationOutcome OperationOutcome with result of operation

Validation messages

Validation messages are error, information or success messages that are returned as a result of an operation. These messages are returned in a OperationOutcome.

Message Severity Parameter Comment
X: - Error -

Examples

The following section includes examples of request bodies and corresponding response bodies when successfully or unsuccessfully invoking BatchCreateIndexRecord.

Successful request and response

Request body

Below is an example of a request to batch create index records for 4 patients. The first three patients are identified with personal identity number and the fourth with coordination number.

The healthcare provider is provided as a parameter outside the indexRecord parameter group. This means that the index records created for the 4 patients all belong to the same care provider (5563813962).

The first two index records shares the same system (system1) and the last two share another system (system2).

{
"resourceType": "Parameters",
"id": "BatchCreateIndexRecords-RequestBody",
{
"name": "healthcareProvider",
"system": "urn:oid:2.5.4.97",
"value": "5563813962"
}
},
{
"name": "indexRecord",
"part": [
{
"name": "patient",
"system": "http://electronichealth.se/identifier/personnummer",
"value": "193409269085"
}
},
{
"name": "availabilityTime",
"valueInstant": "2025-02-01T18:31:20+01:00"
},
{
"name": "system",
"valueUrl": "https://rs.system1.example"
}
]
},
{
"name": "indexRecord",
"part": [
{
"name": "patient",
"system": "http://electronichealth.se/identifier/personnummer",
"value": "198001092397"
}
},
{
"name": "availabilityTime",
"valueInstant": "2025-03-01T18:31:20+01:00"
},
{
"name": "system",
"valueUrl": "https://rs.system1.example"
}
]
},
{
"name": "indexRecord",
"part": [
{
"name": "patient",
"system": "http://electronichealth.se/identifier/personnummer",
"value": "199001152397"
}
},
{
"name": "availabilityTime",
"valueInstant": "2025-03-16T18:31:20+01:00"
},
{
"name": "system",
"valueUrl": "https://rs.system2.example"
}
]
},
{
"name": "indexRecord",
"part": [
{
"name": "patient",
"system": "http://electronichealth.se/identifier/samordningsnummer",
"value": "197701862398"
}
},
{
"name": "availabilityTime",
"valueInstant": "2025-04-18T18:31:20+01:00"
},
{
"name": "system",
"valueUrl": "https://rs.system2.example"
}
]
}
]
}
<Parameters xmlns="http://hl7.org/fhir">
<id value="BatchCreateIndexRecords-RequestBody" />
<name value="healthcareProvider" />
<system value="urn:oid:2.5.4.97" />
<value value="5563813962" />
</valueIdentifier>
</parameter>
<name value="indexRecord" />
<name value="patient" />
<system value="http://electronichealth.se/identifier/personnummer" />
<value value="193409269085" />
</valueIdentifier>
</part>
<name value="availabilityTime" />
<valueInstant value="2025-02-01T18:31:20+01:00" />
</part>
<name value="system" />
<valueUrl value="https://rs.system1.example" />
</part>
</parameter>
<name value="indexRecord" />
<name value="patient" />
<system value="http://electronichealth.se/identifier/personnummer" />
<value value="198001092397" />
</valueIdentifier>
</part>
<name value="availabilityTime" />
<valueInstant value="2025-03-01T18:31:20+01:00" />
</part>
<name value="system" />
<valueUrl value="https://rs.system1.example" />
</part>
</parameter>
<name value="indexRecord" />
<name value="patient" />
<system value="http://electronichealth.se/identifier/personnummer" />
<value value="199001152397" />
</valueIdentifier>
</part>
<name value="availabilityTime" />
<valueInstant value="2025-03-16T18:31:20+01:00" />
</part>
<name value="system" />
<valueUrl value="https://rs.system2.example" />
</part>
</parameter>
<name value="indexRecord" />
<name value="patient" />
<system value="http://electronichealth.se/identifier/samordningsnummer" />
<value value="197701862398" />
</valueIdentifier>
</part>
<name value="availabilityTime" />
<valueInstant value="2025-04-18T18:31:20+01:00" />
</part>
<name value="system" />
<valueUrl value="https://rs.system2.example" />
</part>
</parameter>
</Parameters>

Response body

Example of response body with an OperationOutcome of successful BatchCreateIndexRecords operation.

{
"resourceType": "OperationOutcome",
"id": "4186624e-8996-4f65-8148-e198825295d6",
"issue": [
{
"severity": "success",
"code": "success",
"details": {
"coding": [
{
"system": "http://electronichealth.se/CodeSystem/error-codes",
"code": "4-44-XXX",
"display": "Index records registered successfully."
}
]
}
}
]
}
<OperationOutcome xmlns="http://hl7.org/fhir">
<id value="4186624e-8996-4f65-8148-e198825295d6" />
<severity value="success" />
<code value="success" />
<system value="http://electronichealth.se/CodeSystem/error-codes" />
<code value="4-44-XXX" />
<display value="Index records registered successfully." />
</coding>
</details>
</issue>
</OperationOutcome>