ePMA Implementation Guidance for FHIR STU3

This guidance is under active development by NHS Digital and content may be added or updated on a regular basis.
Please note: This guidance has been superseded by the Implementation guide for digitial medicines, which contains up-to-date information.

Duplicate errors

When responding to consumer API requests, provider systems MUST return one of the following OperationOutcome details when a resource could not be created or updated because it would cause a duplicate in the provider system:

HTTP code Issue type Error code Error message
409 duplicate DUPLICATE_REJECTED Create would lead to creation of a duplicate resource

For example, if the ePMA system attempted to send a MedicationRequest that is already an active record on the pharmacy system the error details would be returned:

{
    "resourceType": "OperationOutcome",
    "meta": {
        "profile": [
            "https://fhir.nhs.uk/STU3/StructureDefinition/Spine-OperationOutcome-1"
        ]
    },
    "issue": [
        {
            "severity": "error",
            "code": "duplicate",
            "details": {
                "coding": [
                {
                    "system": "https://fhir.nhs.uk/STU3/ValueSet/Spine-ErrorOrWarningCode-1",
                    "code": "DUPLICATE_REJECTED",
                    "display": "Create would lead to creation of duplicate resource"
                }
            ]
        },
        "diagnostics": "MedicationRequest record already exists with that logical identifier"
    }
  ]
}

back to top