Hi Jim,
There are two different ways the Patient and Practitioner references are resolved, depending on the worklist you are retrieving:
- Referrals for Review - indirectly via a contained reference to a Patient resource
- 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:
- If the
valueReference
on the patient
(or practitioner
) extension has an identifier
field then use this.
- If not, then there should be a
reference
field on valueReference
that references a contained resource from which you can source it.
Regards,
Adam.