Page Status: draft updated 2025-08-06

HVOOrganizationTransactionBundle

Create/Update HVOOrganization and/or HVOOrganizationalUnit

Constraints

The HVOOrganizationTransactionBundle must consist of at least one entry with a HVOOrganization or at least one entry with a HVOOrganizationalUnit.

For all resources that are being created, the entry.fullUrl element must use a unique temporary UUID, which should also be used to reference to each other when needed. In the example below, Organization1 is referenced to in OrganizationalUnit1.partOf by the entry's fullUrl "urn:uuid:123-456-789". The UUID can have any sequence of characters or digits, as long as it is unique in the Bundle. The request.method element of all entries must be set to POST.

For all resources that are being updated, the entry.resource.id element must contain the existing resource's UUID. The request.method element of all entries must be set to PUT or PATCH. The only elements that can be updated using PATCH are name, period.start and period.end. All values must be entered if they exist.

Note that certain data of an organization is retrieved from official registries and can not be altered through the API. See handbok for where to turn to update this kind of information.

Some of these elements are profiled as mandatory, ie have a cardinality of 1..1, which should be interpreted as a certainty that they will be included in a read. These elements WILL NOT be updated in the backend if provided in a PUT/POST request. The elements to which this applies are listed down below:

  • name
  • alias
  • contact.address
  • legalForm
  • period
  • organizationActive

Operations

The URL of an operation of a Bundle does not contain the resource type, since the Bundle in this context is used as a transaction containing multiple resources. The invocation then consists only of the base address: POST [base]/

Note that the HTTP verb for the operation is POST even if only updates are being performed. Specifying the POST or PUT action is done per resource, on each entry.request.method.

Headers

Header Comment Example
If-None-Exist []

Examples

Example 1. Create a HVOOrganization and a HVOOrganizationalUnit

Bundle
{
"resourceType": "Bundle",
"id": "OrganizationTransactionBundle1",
"meta": {
"profile": [
"http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganizationTransactionBundle"
]
},
"entry": [
{
"request": {
"method": "POST",
"url": "Organization"
},
"fullUrl": "urn:uuid:123-456-789",
"resourceType": "Organization",
"id": "Organization1",
"meta": {
"profile": [
"http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganization"
]
},
{
"system": "urn:oid:2.5.4.97",
"value": "2321000040"
}
],
{
"url": "http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganizationActiveStatusExtension",
"valueBoolean": true
},
{
"start": "1970-01-01T00:00:00+01:00"
},
"url": "http://hl7.org/fhir/StructureDefinition/organization-period"
},
{
"url": "http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganizationLegalFormExtension",
"code": "84",
"system": "http://electronichealth.se/CodeSystem/skatteverket-jurform"
}
},
{
"url": "http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganizationOwnershipExtension",
"code": "30",
"system": "http://electronichealth.se/CodeSystem/organization-ownership-scb"
}
}
],
"alias": [
""
],
"type": [
{
"coding": [
{
"code": "143591000052106",
"system": "http://snomed.info/sct",
"version": "http://snomed.info/sct/45991000052106"
}
]
}
],
"name": "Region Östergötland"
}
},
{
"request": {
"method": "POST",
"url": "Organization"
},
"fullUrl": "urn:uuid:987-654-321",
"resourceType": "Organization",
"id": "OrganizationalUnit1",
"meta": {
"profile": [
"http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganizationalUnit"
]
},
{
"system": "urn:oid:1.2.752.29.4.19",
"value": "SE2321000040-xxxxxx"
}
],
{
"url": "http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganizationActiveStatusExtension",
"valueBoolean": true
},
{
"start": "1970-01-01T00:00:00+01:00"
},
"url": "http://hl7.org/fhir/StructureDefinition/organization-period"
}
],
"type": [
{
"coding": [
{
"code": "43741000",
"system": "http://snomed.info/sct",
"version": "http://snomed.info/sct/45991000052106"
}
]
}
],
"partOf": {
"reference": "urn:uuid:123-456-789"
},
"name": "Kardiologiska kliniken US, Linköping"
}
}
],
"type": "transaction",
"total": 2
}

Example 2. HVOOperationOutcome returned with errors

The example below shows how a HVOOperationOutcome might look like if any entries in the Bundle contains errors. Note that the issue.expression field is used to indicate which entry the issue belongs to, where Bundle.entry[0] references the first entry in the Bundle.

OperationOutcome
{
"resourceType": "OperationOutcome",
"id": "FailedHVOOrganizationTransactionBundle",
"issue": [
{
"details": {
"coding": [
{
"code": "2-34-303",
"system": "http://electronichealth.se/CodeSystem/error-codes",
"display": "12345-6789 är ett ogiltigt format för organisationsnummer"
}
]
},
"Bundle.entry[0]"
],
"severity": "error",
"code": "invalid"
},
{
"details": {
"coding": [
{
"code": "2-34-301",
"system": "http://electronichealth.se/CodeSystem/error-codes",
"display": "Organisationsnumret 1234567890 är inte registrerat hos Bolagsverket"
}
]
},
"Bundle.entry[2]"
],
"severity": "error",
"code": "business-rule"
}
]
}