Page Status: draft updated 2025-02-28

HVOOrganizationTransactionBundle

Create/Update HVOOrganization and/or HVOOrganizationalUnit

Page index

Constraints

The HVOOrganizationTransactionBundle must consist of at least one entry with a HVOOrganization or at least one entry with a HVOOrganizationalUnit. All organizations that follow the organization at the top of the hierarchy must be referenced to in Organization.partOf, otherwise they will be ignored.

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.

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 []

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",
            "resource": {
                "resourceType": "Organization",
                "id": "Organization1",
                "meta": {
                    "profile":  [
                        "http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganization"
                    ]
                },
                "identifier":  [
                    {
                        "system": "urn:oid:2.5.4.97",
                        "value": "2321000040"
                    }
                ],
                "extension":  [
                    {
                        "url": "http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganizationActiveStatusExtension",
                        "valueBoolean": true
                    },
                    {
                        "valuePeriod": {
                            "start": "12/31/1969 23:00:00"
                        },
                        "url": "http://hl7.org/fhir/StructureDefinition/organization-period"
                    },
                    {
                        "url": "http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganizationLegalFormExtension",
                        "valueCoding": {
                            "code": "84",
                            "system": "http://electronichealth.se/CodeSystem/skatteverket-jurform"
                        }
                    },
                    {
                        "url": "http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganizationOwnershipExtension",
                        "valueCoding": {
                            "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",
            "resource": {
                "resourceType": "Organization",
                "id": "OrganizationalUnit1",
                "meta": {
                    "profile":  [
                        "http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganizationalUnit"
                    ]
                },
                "identifier":  [
                    {
                        "system": "urn:oid:1.2.752.29.4.19",
                        "value": "SE2321000040-xxxxxx"
                    }
                ],
                "extension":  [
                    {
                        "url": "http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganizationActiveStatusExtension",
                        "valueBoolean": true
                    },
                    {
                        "valuePeriod": {
                            "start": "12/31/1969 23:00: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"
                    }
                ]
            },
            "expression":  [
                "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"
                    }
                ]
            },
            "expression":  [
                "Bundle.entry[2]"
            ],
            "severity": "error",
            "code": "business-rule"
        }
    ]
}