Page Status: draft updated 2025-02-27

HVOContractTransactionBundle

Create/Update HVOContract, HVOOrganizationAffiliation and/or HVOService

Page Index

Constraints

The HVOContractTransactionBundle must consist of one entry with a HVOContract and at least one entry with a HVOOrganizationAffiliation. All HVOOrganizationAffiliations must be referenced to in HVOContract.subject, otherwise they will be ignored.

The Bundle can also contain any number of entries with a HVOService. All HVOServices must be referenced to in the relevant HVOOrganizationAffiliation.healthcareService, 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, OrganizationAffiliation1 is referenced to in Contract1.subject by the entry's fullUrl "urn:uuid:987-654-321". 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.

Example 1. Create a HVOContract and a HVOOrganizationAffiliation

Bundle
{
    "resourceType": "Bundle",
    "id": "ContractTransactionBundle1",
    "meta": {
        "profile":  [
            "http://electronichealth.se/fhir/hvo/StructureDefinition/HVOContractTransactionBundle"
        ]
    },
    "entry":  [
        {
            "request": {
                "url": "Contract",
                "method": "POST"
            },
            "resource": {
                "identifier":  [
                    {
                        "value": "123",
                        "system": "extern-id"
                    }
                ],
                "applies": {
                    "start": "08/04/2024 22:00:00",
                    "end": "08/15/2030 22:00:00"
                },
                "subject":  [
                    {
                        "reference": "urn:uuid:987-654-321"
                    }
                ],
                "meta": {
                    "profile":  [
                        "http://electronichealth.se/fhir/hvo/StructureDefinition/HVOContract"
                    ]
                },
                "resourceType": "Contract"
            },
            "fullUrl": "urn:uuid:123-456-789"
        },
        {
            "request": {
                "url": "OrganizationAffiliation",
                "method": "POST"
            },
            "resource": {
                "period": {
                    "start": "08/04/2024 22:00:00",
                    "end": "08/15/2030 22:00:00"
                },
                "meta": {
                    "profile":  [
                        "http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganizationAffiliation"
                    ]
                },
                "resourceType": "OrganizationAffiliation",
                "organization": {
                    "reference": "Organization/RegionOrganization1"
                },
                "participatingOrganization": {
                    "reference": "Organization/RegionOrganization1"
                }
            },
            "fullUrl": "urn:uuid:987-654-321"
        }
    ],
    "type": "transaction"
}