Page Status: draft updated 2025-11-07

Create/Update healthcare organization hierarchy (HVOOrganizationTransactionBundle)

See HVOOrganizationTransactionBundle for generic information about how to use the Bundle. This page explains how to use it to create or update a hierarchy of a healthcare organization.

How to use

See HVOOrganizationHealthcareTransactionTemplate for template to fill in. The following section describes rules that apply when filling in the template for a healthcare organization hierarchy.

  • The healthcare provider SHALL NOT be supplied.

  • The entire organizational structure apart from the healthcare provider MUST be provided. This ensures that the structure can be validated properly to make sure that there are no structural errors that would make the hierarchy invalid. If a previously entered organizational unit is not provided when updating the hierarchy, it will be considered inactivated.

  • The organizational unit directly below the healthcare provider SHALL reference the healthcare provider in the organizational unit's partOf element using the healthcare provider's organization identifier or personal identity number.

    • partOf reference using organization identifier (sv: organisationsnummer)
      {
          [...]
          "entry": [
              {
                  "resource": {
                      "resourceType": "Organization",
                      "partOf": {
                          "identifier": {
                              "system": "urn:oid:2.5.4.97",
                              "value": "<identifier>"
                          }
                      }   
                      [...] 
      }
      
      
    • partOf reference using personal identity number (sv: personnummer)
      {
          [...]
           "entry": [
              {
                  "resource": {
                      "resourceType": "Organization",
                      "partOf": {
                          "identifier": {
                              "system": "http://electronichealth.se/identifier/personnummer",
                              "value": "<identifier>"
                          }
                      }
                      [...]
      }
      
      
  • All organizational units SHALL have a supplied UUID in the id element. All connecting systems are expected to create own UUIDs for new entries in the hierarchy or use the existing UUIDs for entries that are being updated.

    {
        [...]
        "entry": [
            {
                "resource": {
                    "resourceType": "Organization",
                    "id": "401e157b-153f-4324-9ab8-d239f3f9056b"
                    [...]
    }
    
    
  • All organizational units SHALL be chained together using the partOf element, referencing the UUID of the organizational unit that is above a given member in the hierarchy. Any entry that is not related to another entry in this way will be ignored.

    {
        [...]
        "entry": [
            {
                "resource": {
                    "resourceType": "Organization",
                    "partOf": {
                        "reference": "Organization/401e157b-153f-4324-9ab8-d239f3f9056b"
                    }
                    [...]
    }
    
    
  • For a given hierarchy of organizational units, only one can have the type set to healthcare unit. To mark an organizational unit as a healthcare unit, the code 43741000 from Snomed CT should be used in the type coding element:

    {
       [...]
        "entry": [
            {
                "resource": {
                    "resourceType": "Organization",
                    "type": [
                        {
                            "coding": [ 
                                {
                                    "system": "http://snomed.info/sct",
                                    "code": "43741000"
                                }
                            ]
                        }
                    ]
                    [...]
    }
    
    
  • The only elements that can be updated using PATCH are name, period.start and period.end. All of these values must be entered if they exist - an empty value will be interpreted as intentionally empty.

Operations

The URL of an operation that contains a Bundle does not contain the resource type, since the Bundle in this context is used as a transaction containing multiple resources. The invocation 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, PATCH or PUT action is done per resource, on each entry.request.method in the following way:

{
    [...]
    "entry": [
        {
            "request": {
                "url": "Organization",
                "method": "PATCH"
            },
            "resource": {
                "resourceType": "Organization",
                [...]
        }
    ],

Headers

Header Comment Example
If-None-Exist []

Examples

Create a hierarchy with a healthcare unit

Bundle
{
"resourceType": "Bundle",
"id": "OrganizationTransactionBundle1",
"meta": {
"profile": [
"http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganizationTransactionBundle"
]
},
"entry": [
{
"request": {
"url": "Organization",
"method": "POST"
},
"resourceType": "Organization",
"id": "2b215323-5606-4dc0-bdfb-961654e394f7",
"meta": {
"profile": [
"http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganizationalUnit"
]
},
"alias": [
"Medicin och akutsjukvård Linköping"
],
{
"system": "urn:oid:1.2.752.29.4.19",
"value": "SE2321000040-E234515111154"
}
],
{
"url": "http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganizationActiveStatusExtension",
"valueBoolean": true
},
{
"start": "1970-01-01"
},
"url": "http://hl7.org/fhir/StructureDefinition/organization-period"
}
],
"type": [
{
"coding": [
{
"code": "43741000",
"system": "http://snomed.info/sct",
"version": "http://snomed.info/sct/45991000052106"
}
]
}
],
"partOf": {
"system": "urn:oid:2.5.4.97",
"value": "2948377738"
},
"reference": "123-456-789"
},
"contact": [
{
"purpose": {
"coding": [
{
"code": "CATADMIN",
"system": "http://electronichealth.se/CodeSystem/fhir/hvo-extended-contact-entity-type"
}
]
},
"telecom": [
{
"system": "email",
"value": "admin.lcs@linkoping.com"
}
]
},
{
"purpose": {
"coding": [
{
"code": "ADMIN",
"system": "http://terminology.hl7.org/CodeSystem/contactentity-type"
}
]
},
"address": {
"line": [
"Linköpings centralsjukhus",
"Verksamhet medicin och akutsjukvård",
"589 57",
"Linköping"
]
}
},
{
"purpose": {
"coding": [
{
"code": "PROF",
"system": "http://electronichealth.se/CodeSystem/fhir/hvo-extended-contact-entity-type"
}
]
},
"telecom": [
{
"system": "phone",
"value": "+46426165677"
}
]
}
],
"name": "Medicin och akutsjukvård, Linköping"
}
}
],
"type": "transaction"
}

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"
}
]
}