Cancel Referral

Whilst the trigger for some cancellations (and the reason for cancellation) can be determined automatically by a source system, many may need to be triggered with manual intervention – for example where the Patient's condition has deteriorated, they are making their own arrangements, the referral was sent in error, etc.

A structured notification in these circumstances, enables social care providers to automatically update their case management systems, so that hey do not waste resources assessing and setting up care for patient who no longer require it.

Where the referral has an associated Assessment Notice, cancelling the referral will also withdraw that notice (Note: it is not possible to withdraw an assessment notice without cancelling the referral)


HTTPS Request

Method:

PUT

Request URL:

The request URL will consist of 'https://'+'{Host}'+'{BaseURL}'+'?'+'{QueryString}'

Host Environments:

The Host URLs will determined by the service provider, for example the host URLs for the Nottinghamshire County Council Social Care Data Service are:

Environment Host
Test health-interoperability-test.nottscc.gov.uk
Live health-interoperability.nottscc.gov.uk

Base URL:

/ReferralService/v3/Encounter

Query String /Parameters:

Name Value
identifier The identifier as per Encounter the asscoiated ReferralRequest, in the format {identifier.system |identifier.value}

Example Request Url:

https://health-interoperability-test.nottscc.gov.uk/ReferralService/v3/Encounter?identifier=http://fhir.nottinghamshire.gov.uk/encounter/identifier|6521ea68-e87e-4c80-9ea4-510892d7025f



Request Body:

The Request body should be in either json or xml format

The primary base FHIR resource is a CareConnect-SHD-Encounter-1 with references to other resources as per the Entity Relationship Model below: UpdateEncounterUseCaseDiagram

See Examples for an illustration of the Request body of a typical Referral to Social Care for a Supported Hospital Discharge.


Response

Success

SHALL return a HTTP status code 200 OK on successful execution of the request

Error

An Error SHALL return one of the following HTTP Status Codes and an OperationOutcome with details of the issue:

HTTP Code Display Description
400 Bad Request Poor Syntax or breaks a core FHIR constraint
401 Unauthorized User is not authorised to perform the request.
403 Forbidden The request is forbidden, authorization will not help.
409 Conflict User has requested to create a resource that already exists.
422 Unprocessable Entity The syntax is valid, but cannot be processed, e.g. breaks a business rule.
500 Internal Error The server encountered an unexpected condition which prevented it from fulfilling the request.

JSON example of an OperationOutcome for a Unprocessable Entity

{
    "resourceType": "OperationOutcome",
    "issue":  [
        {
            "severity": "error",
            "code": "processing",
            "diagnostics": "Encounter statusHistory 'status change reason' value text must be supplied if coding equals 'Other'",
            "location":  [
                "Encounter.statusHistory.extension.where(url = 'https://fhir.nottinghamshire.gov.uk/extensions/SHD-EncounterStatusChangeReason').value"
            ]
        }
    ]
}


XML example of an OperationOutcome for a 422 Unprocessable Entity

<OperationOutcome xmlns="http://hl7.org/fhir">
    <issue>
        <severity value="error" />
        <code value="processing" />
        <diagnostics value="Encounter statusHistory &#39;status change reason&#39; value text must be supplied if coding equals &#39;Other&#39;" />
        <location value="Encounter.statusHistory.extension.where(url = &#39;https://fhir.nottinghamshire.gov.uk/extensions/SHD-EncounterStatusChangeReason&#39;).value" />
    </issue>
</OperationOutcome>



Examples

Request Body

JSON example of a CareConnect-SHD-Encounter-1

{
    "resourceType": "Encounter",
    "meta": {
        "profile":  [
            "https://fhir.nottinghamshire.gov.uk/STU3/StructureDefinition/CareConnect-SHD-Encounter-1"
        ]
    },
    "contained":  [
        {
            "resourceType": "Practitioner",
            "id": "shd-lead-clinician",
            "meta": {
                "profile":  [
                    "https://fhir.nottinghamshire.gov.uk/STU3/StructureDefinition/CareConnect-SHD-Practitioner-1"
                ]
            },
            "name":  [
                {
                    "use": "official",
                    "text": "Ms Laura Clarke"
                }
            ]
        },
        {
            "resourceType": "Location",
            "id": "shd-location",
            "meta": {
                "profile":  [
                    "https://fhir.nottinghamshire.gov.uk/STU3/StructureDefinition/CareConnect-SHD-Location-1"
                ]
            },
            "name": "Ward 22",
            "managingOrganization": {
                "reference": "#shd-hospital"
            }
        },
        {
            "resourceType": "Organization",
            "id": "shd-hospital",
            "meta": {
                "profile":  [
                    "https://fhir.nottinghamshire.gov.uk/STU3/StructureDefinition/CareConnect-SHD-Organization-1"
                ]
            },
            "identifier":  [
                {
                    "system": "https://fhir.nhs.uk/Id/ods-site-code",
                    "value": "RK5BC"
                }
            ],
            "name": "King's Mill Hospital"
        }
    ],
    "text": {
        "status": "additional",
        --- We have skipped the narrative for better readability of the resource ---
    },
    "extension":  [
        {
            "url": "https://fhir.nottinghamshire.gov.uk/STU3/StructureDefinition/Extension-SHD-MedicallyFitDetails",
            "extension":  [
                {
                    "url": "medicallyFitStatus",
                    "valueCoding": {
                        "system": "https://fhir.nottinghamshire.gov.uk/STU3/codesystem/SHD-MedicallyFitStatus",
                        "code": "01",
                        "display": "Medically Fit"
                    }
                },
                {
                    "url": "dateDeemedMedicallyFit",
                    "valueDateTime": "2019-01-30T10:56:00+00:00"
                }
            ]
        }
    ],
    "identifier":  [
        {
            "system": "http://fhir.sfht.nhs.uk/encounter/identifier",
            "value": "11a2d937-39d5-439e-bc6a-d5e586eSteve"
        }
    ],
    "status": "cancelled",
    "statusHistory":  [
        {
            "extension":  [
                {
                    "url": "https://fhir.nottinghamshire.gov.uk/STU3/StructureDefinition/Extension-SHD-EncounterStatusChangeReason",
                    "valueCodeableConcept": {
                        "coding":  [
                            {
                                "system": "https://fhir.nottinghamshire.gov.uk/STU3/codesystem/SHD-CancellationReason",
                                "code": "13",
                                "display": "Other"
                            }
                        ],
                        "text": "Social Care Assessment no longer required, the patient's condition has changed and may need to be re-referred / assessed at a later date"
                    }
                }
            ],
            "status": "in-progress",
            "period": {
                "start": "2019-01-25T00:00:00+00:00",
                "end": "2019-02-01T00:00:00+00:00"
            }
        }
    ],
    "type":  [
        {
            "coding":  [
                {
                    "system": "https://fhir.nottinghamshire.gov.uk/encounter/type",
                    "code": "supported-discharge"
                }
            ]
        }
    ],
    "participant":  [
        {
            "individual": {
                "reference": "#shd-lead-clinician"
            }
        }
    ],
    "period": {
        "start": "2019-01-25T00:00:00+00:00",
        "end": "2019-02-03T00:00:00+00:00"
    },
    "reason":  [
        {
            "text": "Description of the reason why the patient was admitted to hospital"
        }
    ],
    "location":  [
        {
            "location": {
                "reference": "#shd-location"
            }
        }
    ]
}


XML example of a CareConnect-SHD-Encounter-1

<Encounter xmlns="http://hl7.org/fhir">
    <meta>
        <profile value="https://fhir.nottinghamshire.gov.uk/STU3/StructureDefinition/CareConnect-SHD-Encounter-1" />
    </meta>
    <text>
        <status value="additional" />
        --- We have skipped the narrative for better readability of the resource ---
    </text>
    <contained>
        <Practitioner>
            <id value="shd-lead-clinician" />
            <meta>
                <profile value="https://fhir.nottinghamshire.gov.uk/STU3/StructureDefinition/CareConnect-SHD-Practitioner-1" />
            </meta>
            <name>
                <use value="official" />
                <text value="Ms Laura Clarke" />
            </name>
        </Practitioner>
    </contained>
    <contained>
        <Location>
            <id value="shd-location" />
            <meta>
                <profile value="https://fhir.nottinghamshire.gov.uk/STU3/StructureDefinition/CareConnect-SHD-Location-1" />
            </meta>
            <name value="Ward 22" />
            <managingOrganization>
                <reference value="#shd-hospital" />
            </managingOrganization>
        </Location>
    </contained>
    <contained>
        <Organization>
            <id value="shd-hospital" />
            <meta>
                <profile value="https://fhir.nottinghamshire.gov.uk/STU3/StructureDefinition/CareConnect-SHD-Organization-1" />
            </meta>
            <identifier>
                <system value="https://fhir.nhs.uk/Id/ods-site-code" />
                <value value="RK5BC" />
            </identifier>
            <name value="King&#39;s Mill Hospital" />
        </Organization>
    </contained>
    <extension url="https://fhir.nottinghamshire.gov.uk/STU3/StructureDefinition/Extension-SHD-MedicallyFitDetails">
        <extension url="medicallyFitStatus">
            <valueCoding>
                <system value="https://fhir.nottinghamshire.gov.uk/STU3/codesystem/SHD-MedicallyFitStatus" />
                <code value="01" />
                <display value="Medically Fit" />
            </valueCoding>
        </extension>
        <extension url="dateDeemedMedicallyFit">
            <valueDateTime value="2019-01-30T10:56:00+00:00" />
        </extension>
    </extension>
    <identifier>
        <system value="http://fhir.sfht.nhs.uk/encounter/identifier" />
        <value value="11a2d937-39d5-439e-bc6a-d5e586eSteve" />
    </identifier>
    <status value="cancelled" />
    <statusHistory>
        <extension url="https://fhir.nottinghamshire.gov.uk/STU3/StructureDefinition/Extension-SHD-EncounterStatusChangeReason">
            <valueCodeableConcept>
                <coding>
                    <system value="https://fhir.nottinghamshire.gov.uk/STU3/codesystem/SHD-CancellationReason" />
                    <code value="13" />
                    <display value="Other" />
                </coding>
                <text value="Social Care Assessment no longer required, the patient&#39;s condition has changed and may need to be re-referred / assessed at a later date" />
            </valueCodeableConcept>
        </extension>
        <status value="in-progress" />
        <period>
            <start value="2019-01-25T00:00:00+00:00" />
            <end value="2019-02-01T00:00:00+00:00" />
        </period>
    </statusHistory>
    <type>
        <coding>
            <system value="https://fhir.nottinghamshire.gov.uk/encounter/type" />
            <code value="supported-discharge" />
        </coding>
    </type>
    <participant>
        <individual>
            <reference value="#shd-lead-clinician" />
        </individual>
    </participant>
    <period>
        <start value="2019-01-25T00:00:00+00:00" />
        <end value="2019-02-03T00:00:00+00:00" />
    </period>
    <reason>
        <text value="Description of the reason why the patient was admitted to hospital" />
    </reason>
    <location>
        <location>
            <reference value="#shd-location" />
        </location>
    </location>
</Encounter>