NHS Digital FHIR Medicines

OperationDefinition

prepare

Name Url
prepare-message https://fhir.nhs.uk/OperationDefinition/MessageHeader-prepare-message

Invocations

URL: [base]/$prepare

This operation changes content

Parameters (In)

NameCardinalityTypeDocumentation
content1..1Bundle

The prescription order message to process (without Provence resource)

Return Values (Out)

NameCardinalityTypeDocumentation
digest1..1string

Message Digest response containing the signed signature in XML format

algorithm1..1string

Algorithm used

timestamp1..1string

dateTime when the digest was created

This operation does not use the parameters resource for input parameters, it does for the response. \n\n A server may return one of several status codes: \n\n * 200 OK: Indicates that the message has been fully processed.

{
    "resourceType": "OperationDefinition",
    "id": "MessageHeader-prepare-message",
    "url": "https://fhir.nhs.uk/OperationDefinition/MessageHeader-prepare-message",
    "version": "4.0.1",
    "name": "MessageheaderPrepareMessage",
    "status": "draft",
    "kind": "operation",
    "date": "2020-08-03T00:00:00+00:00",
    "publisher": "NHS Digital",
    "contact":  [
        {
            "telecom":  [
                {
                    "system": "email",
                    "value": "interoperabilityteam@nhs.net"
                }
            ]
        }
    ],
    "description": "Convert a prescription in FHIR format into the canonicalised HL7 V3 signature fragments which should be signed by the prescriber.",
    "code": "prepare",
    "comment": "This operation does not use the parameters resource for input parameters, it does for the response.  \\n\\n A server may return one of several status codes: \\n\\n * **200 OK**: Indicates that the message has been fully processed.",
    "system": true,
    "type": false,
    "affectsState": true,
    "instance": false,
    "parameter":  [
        {
            "name": "content",
            "use": "in",
            "min": 1,
            "max": "1",
            "documentation": "The prescription order message to process (without Provence resource)",
            "type": "Bundle"
        },
        {
            "name": "digest",
            "use": "out",
            "min": 1,
            "max": "1",
            "documentation": "Message Digest response containing the signed signature in XML format",
            "type": "string"
        },
        {
            "name": "algorithm",
            "use": "out",
            "min": 1,
            "max": "1",
            "documentation": "Algorithm used",
            "type": "string"
        },
        {
            "name": "timestamp",
            "use": "out",
            "min": 1,
            "max": "1",
            "documentation": "dateTime when the digest was created",
            "type": "string"
        }
    ]
}
<OperationDefinition xmlns="http://hl7.org/fhir">
    <id value="MessageHeader-prepare-message" />
    <url value="https://fhir.nhs.uk/OperationDefinition/MessageHeader-prepare-message" />
    <version value="4.0.1" />
    <name value="MessageheaderPrepareMessage" />
    <status value="draft" />
    <kind value="operation" />
    <date value="2020-08-03T00:00:00+00:00" />
    <publisher value="NHS Digital" />
    <contact>
        <telecom>
            <system value="email" />
            <value value="interoperabilityteam@nhs.net" />
        </telecom>
    </contact>
    <description value="Convert a prescription in FHIR format into the canonicalised HL7 V3 signature fragments which should be signed by the prescriber." />
    <affectsState value="true" />
    <code value="prepare" />
    <comment value="This operation does not use the parameters resource for input parameters, it does for the response.  \n\n A server may return one of several status codes: \n\n * **200 OK**: Indicates that the message has been fully processed." />
    <system value="true" />
    <type value="false" />
    <instance value="false" />
    <parameter>
        <name value="content" />
        <use value="in" />
        <min value="1" />
        <max value="1" />
        <documentation value="The prescription order message to process (without Provence resource)" />
        <type value="Bundle" />
    </parameter>
    <parameter>
        <name value="digest" />
        <use value="out" />
        <min value="1" />
        <max value="1" />
        <documentation value="Message Digest response containing the signed signature in XML format" />
        <type value="string" />
    </parameter>
    <parameter>
        <name value="algorithm" />
        <use value="out" />
        <min value="1" />
        <max value="1" />
        <documentation value="Algorithm used" />
        <type value="string" />
    </parameter>
    <parameter>
        <name value="timestamp" />
        <use value="out" />
        <min value="1" />
        <max value="1" />
        <documentation value="dateTime when the digest was created" />
        <type value="string" />
    </parameter>
</OperationDefinition>

process-message

See NHS Digital IG process-message

release

Name Url
Task-release https://fhir.nhs.uk/OperationDefinition/Task-release-message

Invocations

URL: [base]/Task/$release

This operation changes content

Parameters (In)

NameCardinalityTypeDocumentation
group-identifier0..1Identifier

The short-form-prescription-id (token) of the prescription. Used for releasing Patient prescriptions

owner1..1Organization

The organization (pharmacy) downloading the prescriptions. Used for releasing Nominated Pharmacy prescriptions

status1..1code

Status from ValueSet http://hl7.org/fhir/valueset-task-status.html Use: accepted

agent1..1PractitionerRole

The professional submitting the release request

Return Values (Out)

NameCardinalityTypeDocumentation
return1..1Bundle

A FHIR Bundle (type=searchset) which contains prescription-order FHIR Messages which match the search parameters. An empty search will still return a FHIR Bundle but with no entries.

Only one of the parameters group-identifier and owner MUST be provided. This operation performs both a query on the message queue and updates the status of returned prescriptions.

{
    "resourceType": "OperationDefinition",
    "id": "Task-release-message",
    "meta": {
        "lastUpdated": "2019-11-01T09:29:23.356+11:00"
    },
    "url": "https://fhir.nhs.uk/OperationDefinition/Task-release-message",
    "version": "4.0.1",
    "name": "ReleaseTask",
    "status": "draft",
    "kind": "operation",
    "date": "2020-11-13T09:29:23+11:00",
    "publisher": "NHS Digital",
    "contact":  [
        {
            "telecom":  [
                {
                    "system": "email",
                    "value": "interoperabilityteam@nhs.net"
                }
            ]
        }
    ],
    "description": "Use this endpoint to download prescriptions from Spine before it is dispensed. You can download a single prescription using the prescription's ID, or download up to 25 prescriptions (per request) nominated to a dispenser using the dispenser's ODS code.",
    "code": "release",
    "comment": "Only one of the parameters group-identifier and owner MUST be provided. This operation performs both a query on the message queue and updates the status of returned prescriptions.",
    "resource":  [
        "Task"
    ],
    "affectsState": true,
    "system": false,
    "type": true,
    "instance": false,
    "outputProfile": "https://fhir.nhs.uk/StructureDefinition/NHSDigital-Bundle-SearchSet",
    "parameter":  [
        {
            "name": "group-identifier",
            "use": "in",
            "min": 0,
            "max": "1",
            "documentation": "The short-form-prescription-id (token) of the prescription. Used for releasing Patient prescriptions",
            "type": "Identifier"
        },
        {
            "name": "owner",
            "use": "in",
            "min": 1,
            "max": "1",
            "documentation": "The organization (pharmacy) downloading the prescriptions. Used for releasing Nominated Pharmacy prescriptions",
            "type": "Organization"
        },
        {
            "name": "status",
            "use": "in",
            "min": 1,
            "max": "1",
            "documentation": "Status from ValueSet http://hl7.org/fhir/valueset-task-status.html Use: accepted",
            "type": "code"
        },
        {
            "name": "agent",
            "use": "in",
            "min": 1,
            "max": "1",
            "documentation": "The professional submitting the release request",
            "type": "PractitionerRole"
        },
        {
            "name": "return",
            "use": "out",
            "min": 1,
            "max": "1",
            "documentation": "A FHIR Bundle (type=searchset) which contains prescription-order FHIR Messages which match the search parameters. An empty search will still return a FHIR Bundle but with no entries.",
            "type": "Bundle"
        }
    ]
}
<OperationDefinition xmlns="http://hl7.org/fhir">
    <id value="Task-release-message" />
    <meta>
        <lastUpdated value="2019-11-01T09:29:23.356+11:00" />
    </meta>
    <url value="https://fhir.nhs.uk/OperationDefinition/Task-release-message" />
    <version value="4.0.1" />
    <name value="ReleaseTask" />
    <status value="draft" />
    <kind value="operation" />
    <date value="2020-11-13T09:29:23+11:00" />
    <publisher value="NHS Digital" />
    <contact>
        <telecom>
            <system value="email" />
            <value value="interoperabilityteam@nhs.net" />
        </telecom>
    </contact>
    <description value="Use this endpoint to download prescriptions from Spine before it is dispensed. You can download a single prescription using the prescription&#39;s ID, or download up to 25 prescriptions (per request) nominated to a dispenser using the dispenser&#39;s ODS code." />
    <affectsState value="true" />
    <code value="release" />
    <comment value="Only one of the parameters group-identifier and owner MUST be provided. This operation performs both a query on the message queue and updates the status of returned prescriptions." />
    <resource value="Task" />
    <system value="false" />
    <type value="true" />
    <instance value="false" />
    <outputProfile value="https://fhir.nhs.uk/StructureDefinition/NHSDigital-Bundle-SearchSet" />
    <parameter>
        <name value="group-identifier" />
        <use value="in" />
        <min value="0" />
        <max value="1" />
        <documentation value="The short-form-prescription-id (token) of the prescription. Used for releasing Patient prescriptions" />
        <type value="Identifier" />
    </parameter>
    <parameter>
        <name value="owner" />
        <use value="in" />
        <min value="1" />
        <max value="1" />
        <documentation value="The organization (pharmacy) downloading the prescriptions. Used for releasing Nominated Pharmacy prescriptions" />
        <type value="Organization" />
    </parameter>
    <parameter>
        <name value="status" />
        <use value="in" />
        <min value="1" />
        <max value="1" />
        <documentation value="Status from ValueSet http://hl7.org/fhir/valueset-task-status.html Use: accepted" />
        <type value="code" />
    </parameter>
    <parameter>
        <name value="agent" />
        <use value="in" />
        <min value="1" />
        <max value="1" />
        <documentation value="The professional submitting the release request" />
        <type value="PractitionerRole" />
    </parameter>
    <parameter>
        <name value="return" />
        <use value="out" />
        <min value="1" />
        <max value="1" />
        <documentation value="A FHIR Bundle (type=searchset) which contains prescription-order FHIR Messages which match the search parameters. An empty search will still return a FHIR Bundle but with no entries." />
        <type value="Bundle" />
    </parameter>
</OperationDefinition>

group-identifier

group-identifier is used to download a single prescription. This is called a Patient Release Request. This group identifier (also known as prescription token or the prescription short form id) is either retrieved via the Task API Prescription Tracker API or is presented to the pharmacy to the pharmacy by the patient (on paper or patient App).

Patient Release Request

        {
            "name": "group-identifier",
            "valueIdentifier": {
                "system": "https://fhir.nhs.uk/Id/prescription-order-number",
                "value": "82D996-C81010-11DB12"
            }
        },

owner

An Organization resource representing the pharmacy downloading the prescription.

       {
            "name": "owner",
            "resource": {
                "resourceType": "Organization",
                "id": "organization",
                "identifier":  [
                    {
                        "system": "https://fhir.nhs.uk/Id/ods-organization-code",
                        "value": "VNE51"
                    }
                ],
                "address":  [
                    {
                        "city": "West Yorkshire",
                        "use": "work",
                        "line":  [
                            "17 Austhorpe Road",
                            "Crossgates",
                            "Leeds"
                        ],
                        "postalCode": "LS15 8BA"
                    }
                ],
                "active": true,
                "type":  [
                    {
                        "coding":  [
                            {
                                "system": "https://fhir.nhs.uk/CodeSystem/organisation-role",
                                "code": "182",
                                "display": "PHARMACY"
                            }
                        ]
                    }
                ],
                "name": "The Simple Pharmacy",
                "telecom":  [
                    {
                        "system": "phone",
                        "use": "work",
                        "value": "0113 3180277"
                    }
                ]
            }
        }

accept

The only value to be used is accepted. This is for consistency with NHSDigital-Task and for future use.

        {
            "name": "status",
            "valueCode": "accepted"
        },

agent

This is a NHSDigital-PractitionerRole resource.

GMC Reference Number MUST NOT be used as a Practitioner identifier


An example of a unattended $release payload.

{
    "resourceType": "Parameters",
    "id": "ee778f88-e1aa-49b0-8cbc-77d54c65ef9e",
    "parameter":  [
        {
            "name": "status",
            "valueCode": "accepted"
        },
        {
            "name": "agent",
            "resource": {
                "resourceType": "PractitionerRole",
                "id": "16708936-6397-4e03-b84f-4aaa790633e0",
                "identifier":  [
                    {
                        "system": "https://fhir.nhs.uk/Id/sds-role-profile-id",
                        "value": "555086415105"
                    }
                ],
                "practitioner": {
                    "identifier": {
                        "system": "https://fhir.nhs.uk/Id/sds-user-id",
                        "value": "3415870201"
                    },
                    "display": "Jackie Clark"
                },
                "code":  [
                    {
                        "coding":  [
                            {
                                "system": "https://fhir.nhs.uk/CodeSystem/NHSDigital-SDS-JobRoleCode",
                                "code": "S0030:G0100:R0620"
                            }
                        ]
                    }
                ],
                "telecom":  [
                    {
                        "system": "phone",
                        "value": "02380798431",
                        "use": "work"
                    }
                ]
            }
        },
        {
            "name": "owner",
            "resource": {
                "resourceType": "Organization",
                "id": "organization",
                "identifier":  [
                    {
                        "system": "https://fhir.nhs.uk/Id/ods-organization-code",
                        "value": "VNE51"
                    }
                ],
                "address":  [
                    {
                        "city": "West Yorkshire",
                        "use": "work",
                        "line":  [
                            "17 Austhorpe Road",
                            "Crossgates",
                            "Leeds"
                        ],
                        "postalCode": "LS15 8BA"
                    }
                ],
                "active": true,
                "type":  [
                    {
                        "coding":  [
                            {
                                "system": "https://fhir.nhs.uk/CodeSystem/organisation-role",
                                "code": "182",
                                "display": "PHARMACY"
                            }
                        ]
                    }
                ],
                "name": "The Simple Pharmacy",
                "telecom":  [
                    {
                        "system": "phone",
                        "use": "work",
                        "value": "0113 3180277"
                    }
                ]
            }
        }
    ]
}

An example of a attended $release payload.

{
    "resourceType": "Parameters",
    "id": "66bc43c6-b803-4593-96c9-44c62f4613f4",
    "parameter":  [
        {
            "name": "status",
            "valueCode": "accepted"
        },
        {
            "name": "agent",
            "resource": {
                "resourceType": "PractitionerRole",
                "id": "16708936-6397-4e03-b84f-4aaa790633e0",
                "practitioner": {
                    "identifier": {
                        "system": "https://fhir.nhs.uk/Id/sds-user-id",
                        "value": "1231234"
                    },
                    "display": "Jackie Clark"
                },
                "code":  [
                    {
                        "coding":  [
                            {
                                "system": "https://fhir.nhs.uk/CodeSystem/NHSDigital-SDS-JobRoleCode",
                                "code": "S0030:G0100:R0620"
                            }
                        ]
                    }
                ],
                "telecom":  [
                    {
                        "system": "phone",
                        "value": "02380798431",
                        "use": "work"
                    }
                ]
            }
        },
        {
            "name": "owner",
            "resource": {
                "resourceType": "Organization",
                "id": "organization",
                "identifier":  [
                    {
                        "system": "https://fhir.nhs.uk/Id/ods-organization-code",
                        "value": "VNE51"
                    }
                ],
                "address":  [
                    {
                        "city": "West Yorkshire",
                        "use": "work",
                        "line":  [
                            "17 Austhorpe Road",
                            "Crossgates",
                            "Leeds"
                        ],
                        "postalCode": "LS15 8BA"
                    }
                ],
                "active": true,
                "type":  [
                    {
                        "coding":  [
                            {
                                "system": "https://fhir.nhs.uk/CodeSystem/organisation-role",
                                "code": "182",
                                "display": "PHARMACY"
                            }
                        ]
                    }
                ],
                "name": "The Simple Pharmacy",
                "telecom":  [
                    {
                        "system": "phone",
                        "use": "work",
                        "value": "0113 3180277"
                    }
                ]
            }
        }
    ]
}

verify-signature

Name Url
verify-signature https://fhir.nhs.uk/OperationDefinition/verify-signature

Invocations

URL: [base]/$verify-signature

This operation changes content

Parameters (In)

NameCardinalityTypeDocumentation
content1..1Bundle

The search Bundle retrieved from the $release operation

Return Values (Out)

NameCardinalityTypeDocumentation
entryNumber1..1integer

Index to the Bundle.entry in the supplied FHIR Bundle

{
    "resourceType": "OperationDefinition",
    "id": "ee360b98-f807-4c5b-a16f-d72933aff9d1",
    "url": "https://fhir.nhs.uk/OperationDefinition/verify-signature",
    "version": "4.0.1",
    "name": "VerifySignature",
    "status": "draft",
    "kind": "operation",
    "date": "2022-02-17T09:29:23+11:00",
    "publisher": "NHS Digital",
    "contact":  [
        {
            "telecom":  [
                {
                    "system": "email",
                    "value": "interoperabilityteam@nhs.net"
                }
            ]
        }
    ],
    "description": "Use this endpoint to verify a prescription's signature to ensure that the signature is valid, and that it matches the prescription it is attached to. This endpoint is expected to be used immediately after downloading prescriptions. Send the response message from the release endpoint to this endpoint. The signatures on these prescriptions will be verified. \n The endpoint will return a set of (up to 25) verify responses associated with the bundle of prescriptions sent to the endpoint for verification.",
    "code": "verify-signature",
    "resource":  [
        "Task"
    ],
    "affectsState": true,
    "system": true,
    "type": false,
    "instance": false,
    "parameter":  [
        {
            "name": "content",
            "use": "in",
            "min": 1,
            "max": "1",
            "documentation": "The search Bundle retrieved from the $release operation",
            "type": "Bundle"
        },
        {
            "name": "entryNumber",
            "use": "out",
            "min": 1,
            "max": "1",
            "documentation": "Index to the Bundle.entry in the supplied FHIR Bundle",
            "type": "integer",
            "part":  [
                {
                    "name": "messageIdentifier",
                    "use": "out",
                    "min": 1,
                    "max": "1",
                    "documentation": "A reference to the Bundled prescription-order FHIR Bundle",
                    "type": "Reference"
                },
                {
                    "name": "result",
                    "use": "out",
                    "min": 1,
                    "max": "1",
                    "documentation": "The result of the individual prescription-order signature verification",
                    "type": "OperationOutcome"
                }
            ]
        }
    ]
}
<OperationDefinition xmlns="http://hl7.org/fhir">
    <id value="ee360b98-f807-4c5b-a16f-d72933aff9d1" />
    <url value="https://fhir.nhs.uk/OperationDefinition/verify-signature" />
    <version value="4.0.1" />
    <name value="VerifySignature" />
    <status value="draft" />
    <kind value="operation" />
    <date value="2022-02-17T09:29:23+11:00" />
    <publisher value="NHS Digital" />
    <contact>
        <telecom>
            <system value="email" />
            <value value="interoperabilityteam@nhs.net" />
        </telecom>
    </contact>
    <description value="Use this endpoint to verify a prescription&#39;s signature to ensure that the signature is valid, and that it matches the prescription it is attached to. This endpoint is expected to be used immediately after downloading prescriptions. Send the response message from the release endpoint to this endpoint. The signatures on these prescriptions will be verified. \n The endpoint will return a set of (up to 25) verify responses associated with the bundle of prescriptions sent to the endpoint for verification." />
    <affectsState value="true" />
    <code value="verify-signature" />
    <resource value="Task" />
    <system value="true" />
    <type value="false" />
    <instance value="false" />
    <parameter>
        <name value="content" />
        <use value="in" />
        <min value="1" />
        <max value="1" />
        <documentation value="The search Bundle retrieved from the $release operation" />
        <type value="Bundle" />
    </parameter>
    <parameter>
        <name value="entryNumber" />
        <use value="out" />
        <min value="1" />
        <max value="1" />
        <documentation value="Index to the Bundle.entry in the supplied FHIR Bundle" />
        <type value="integer" />
        <part>
            <name value="messageIdentifier" />
            <use value="out" />
            <min value="1" />
            <max value="1" />
            <documentation value="A reference to the Bundled prescription-order FHIR Bundle" />
            <type value="Reference" />
        </part>
        <part>
            <name value="result" />
            <use value="out" />
            <min value="1" />
            <max value="1" />
            <documentation value="The result of the individual prescription-order signature verification" />
            <type value="OperationOutcome" />
        </part>
    </parameter>
</OperationDefinition>
back to top