NHSDigital / gp-connect-prescriptions-management-fhir

Other
1 stars 1 forks source link

POST /Task Example #22

Closed KevinMayfield closed 1 year ago

KevinMayfield commented 1 year ago

Describe the bug

The example in the POST /Task has a number of FHIR Schema errors. This is mostly around an object being used instead of an array.

In the corrected example below to get this working against NHSDigital-Task, I've also had to use identifier references in addition to raw Patient/{nhsNumber} <- I presume this is the intent, it's not clear if this is meant to be a NHS Number.

Have also added Task.code, this is to indicate what the Task is about and is recommended (presume the use case in this API is to reauthorise/reorder/renew a prescription)

The use of a contained MedicationRequest is not recommended https://nhsd-confluence.digital.nhs.uk/display/APM/Designing+your+FHIR+API#DesigningyourFHIRAPI-using_containedUsingcontainedresources (I presume the supplier already has this resource, so I don't understand why it is being sent back to them. I wouldn't expect a patient to ask for a prescription to be created this way and not sure this makes sense from a clinical safety point of view)

{
    "resourceType": "Task",
    "id": "7c747c6e-15c8-4b2f-8aa0-441f2ef703d6",
    "identifier": [
        {
            "system": "https://tools.ietf.org/html/rfc4122",
            "value": "30d65c8e-98e8-4806-b6a6-fpwjfkhs729"
        }
    ],
    "contained": [
        {
            "resourceType": "MedicationRequest",
            "id": "b269d1d7-1acf-47bb-8b3c-e38b583d9a07",
            "status": "active",
            "intent": "order",
            "category": [
                {
                    "coding": [
                        {
                            "system": "http://terminology.hl7.or/CodeSystem/medicationrequest-category",
                            "code": "community",
                            "display": "Community"
                        }
                    ]
                }
            ],
            "medicationCodeableConcept": [
                {
                    "coding": [
                        {
                            "system": "https://dmd.nhs.uk",
                            "code": 39695211000001102,
                            "display": "Aspirin 300mg dispersible tablets"
                        }
                    ]
                }
            ],
            "subject": {
                "reference": "Patient/9000000009",
                "display": "Jane Smith"
            },
            "requester": {
                "reference": "Patient/9000000009",
                "display": "Jane Smith"
            },
            "courseOfTherapyType": [
                {
                    "coding": [
                        {
                            "system": "https://fhir.hl7.org.uk/CodeSystem/UKCore-MedicationRequestCourseOfTherapy",
                            "code": "continuous-repeating-dispensing",
                            "display": "Continuous long term (repeat dispensing)"
                        }
                    ]
                }
            ],
            "authoredOn": "2022-10-13T09:20:27.000Z",
            "substitution": {
                "allowedBoolean": false
            },
            "dispenseRequest": {
                "performer": {
                    "reference": "Organization/Y12345",
                    "type": "Organization"
                }
            }
        }
    ],
    "status": "requested",
    "intent": "order",
    "code": {
        "coding": [
            {
                "system": "http://snomed.info/sct",
                "code": "103742009",
                "display": "Renewal of prescription"
            }
        ]
    },
    "focus": {
        "reference": "#b269d1d7-1acf-47bb-8b3c-e38b583d9a07"
    },
    "for": {
        "reference": "Patient/9000000009",
        "identifier": {
            "system": "https://fhir.nhs.uk/Id/nhs-number",
            "value": "9000000009"
        },
        "display": "Jane Smith"
    },
    "authoredOn": "2022-10-13T09:20:27.000Z",
    "lastModified": "2022-10-13T09:20:27.000Z",
    "requester": {
        "reference": "Patient/9000000009",
        "identifier": {
            "system": "https://fhir.nhs.uk/Id/nhs-number",
            "value": "9000000009"
        },
        "display": "Jane Smith"
    },
    "note": [
        {
            "authorString": "Patient",
            "text": "ran out of previous prescription"
        }
    ]
}
edtu1 commented 1 year ago

Cheers Kevin, I'll make these changes