A023 - Schema doesn't match return values

Hi,

We are calling the A023 - Get A&G Worklist, and the schema in the documentation (which matches the A008 schema) shows that there should be a “contained” array in the response. However, the data we get back does not contain the “contained” array, and everything is in the “entry” array.

We are trying to retrieve the patient’s NHSNumber from the contained array and this is throwing an error.

A008 looks like this:

A023 looks like this:

Can you help please?

Thanks

Jim

Hi Jim,

There are two different ways the Patient and Practitioner references are resolved, depending on the worklist you are retrieving:

  1. Referrals for Review - indirectly via a contained reference to a Patient resource
  2. All other worklists (referral and advice) - directly via the Reference.identifier

The reason for the difference is simply that the Referrals for Review worklist was implemented first and afterwards we discovered there is a much simpler way to provide an identifier.

Note: The documentation in the schema does state in the notes that the Patient/Practitioner resources are only included in he contained section for the Referrals for Review worklist.

Referrals for Review
The Extension-eRS-<worklist-name>-WorkListItem-1 complex extension on the List.entry contains a patient extension. For example:

{
    "url": "patient",
    "valueReference": {
        "reference": "#Patient-9462979626"
    }
}

The # in the reference signifies a contained resource. Therefore you can look up the resource with that ID (e.g. Patient-9462979626) in the contained section.

There you will fine a Patient resource. For example:

{
    "id": "Patient-9462979626",
    "resourceType": "Patient"
    "identifier": [
        {
            "system": "http://fhir.nhs.net/Id/nhs-number",
            "value": "9462979626"
        }
    ...
}

You cant take the NHS Number from the Patient.identifier.

All other worklists
The Extension-eRS-<worklist-name>-WorkListItem-1 complex extension on the List.entry contains a patient extension. For example:

{
    "url": "patient",
    "valueReference": {
        "identifier": {
            "system": "http://fhir.nhs.net/Id/nhs-number",
            "value": "1000000001"
    }
}

Here there is no reference attribute, instead the identifer is included inline.

You cant take the NHS Number directly from the identifier.

Conclusion
If you want to handle these differences generically I would suggest searching for the identifier as follows:

  1. If the valueReference on the patient (or practitioner) extension has an identifier field then use this.
  2. If not, then there should be a reference field on valueReference that references a contained resource from which you can source it.

Regards,

Adam.

Ok, thanks for clarifying