References
NHS Digital Profile: NRL-DocumentReference-1 |
HL7 FHIR STU3 Resource(s): DocumentReference |
User Stories: - |
Delete
Provider interaction to support the deletion of NRL pointers. The delete interaction is a FHIR RESTful delete interaction.
Prerequisites
In addition to the requirements on this page, the general guidance and requirements detailed on the Development Overview page MUST be followed when using this interaction.
Delete Request Headers
Provider API delete requests support the following HTTP request headers:
Header | Value | Conformance |
---|---|---|
Accept |
The Accept header indicates the format of the response the client is able to understand, if set, this must be either application/fhir+json or application/fhir+xml . |
OPTIONAL |
Authorization |
The Authorization header will carry the base64url encoded JSON web token required for audit on the spine - see the JSON Web Token Guidance page for details. |
REQUIRED |
fromASID |
Client System ASID. | REQUIRED |
toASID |
The Spine ASID. | REQUIRED |
Delete Operation
Provider systems MUST only delete pointers for records where they are the pointer owner (custodian).
For all delete requests the custodian
ODS code in the DocumentReference
to be deleted MUST be affiliated with the Client System ASID
value in the fromASID
HTTP request header sent to the NRL.
Delete by id
The API supports the delete by ID interaction, which allows a provider to delete an existing pointer based on the pointer’s logical ID.
The logical ID can be obtained from the Location
header contained in the create response - see the Create API Interaction for details.
To accomplish this, the provider issues an HTTP DELETE as shown:
DELETE [baseUrl]/STU3/DocumentReference/[id]
DELETE [baseUrl]/DocumentReference/da2b6e8a-3c8f-11e8-baae-6c3be5a609f5-584d385036514c383142
Delete the DocumentReference resource for a pointer with a logical id of 'da2b6e8a-3c8f-11e8-baae-6c3be5a609f5-584d385036514c383142'.
Conditional Delete by id
The API supports the conditional delete by id
interaction which allows a provider to delete an existing pointer based on the search parameter _id
which refers to the pointer’s logical ID.
The logical ID can be obtained from the Location
header contained in the create response - see the Create API Interaction for details.
To accomplish this, the provider issues an HTTP DELETE as shown:
DELETE [baseUrl]/DocumentReference?_id=[id]
DELETE [baseUrl]/DocumentReference?_id=da2b6e8a-3c8f-11e8-baae-6c3be5a609f5-584d385036514c383142
Delete the DocumentReference resource for a pointer conditionally with a logical ID of 'da2b6e8a-3c8f-11e8-baae-6c3be5a609f5-584d385036514c383142'.
Conditional Delete by masterIdentifier
The API supports the conditional delete by masterIdentifier
interaction which allows a provider to delete an existing pointer using the master identifier
negating the requirement to persist or query the NRL to obtain the generated logical ID for the pointer.
To accomplish this, the provider issues an HTTP DELETE as shown:
DELETE [baseUrl]/DocumentReference?subject=[https://demographics.spineservices.nhs.uk/STU3/Patient/[nhsNumber]&identifier=[system]%7C[value]
- [nhsNumber] - The NHS Number of the patient related to the
DocumentReference
. - [system] - The namespace of the
masterIdentifier
value associated with theDocumentReference
. - [value] - The value of the
masterIdentifier
associated with theDocumentReference
.
DELETE [baseUrl]/DocumentReference?subject=https%3A%2F%2Fdemographics.spineservices.nhs.uk%2FSTU3%2FPatient%2F9876543210%26identifier%3Durn%3Aietf%3Arfc%3A3986%257Curn%3Aoid%3A1.3.6.1.4.1.21367.2005.3.71
Delete the DocumentReference resource for a pointer with a subject and identifier.
|
) character must be percent encoded (%7C
).Response
The delete
interaction removes an existing DocumentReference
resource.
Success
A successful execution of the delete
interaction will return:
- a
200
OK HTTP status code confirming pointer deletion. - a response body containing an
OperationOutcome
resource (see below for full details).
OperationOutcome
The OperationOutcome
in the response body will conform to the Spine-OperationOutcome-1 FHIR resource:
Element | Content |
---|---|
id |
A UUID for this OperationOutcome . |
meta.profile |
Fixed value: https://fhir.nhs.uk/STU3/StructureDefinition/Spine-OperationOutcome-1 |
issue.severity |
Fixed value: information |
issue.code |
Fixed value: informational |
issue.details.coding.system |
Fixed value: https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1 |
issue.details.coding.code |
Fixed value: RESOURCE_DELETED |
issue.details.coding.display |
Fixed value: Resource removed |
issue.details.text |
A Spine internal message UUID which can be used to identify the client’s create transaction within Spine. A client system SHOULD reference this UUID in any related incidents raised with the National Service Desk. The UUID will be used to retrieve log entries that relate to a specific client transaction. |
issue.diagnostics |
Dynamic value: Successfully removed resource DocumentReference: [URL] |
Example success response body (XML)
Example success response body (JSON)
Failure
The following errors can be triggered when performing this operation:
Explore the NRL
You can explore and test the delete interaction using Swagger in the NRL API Reference Implementation.