Multiple resource parameters in 'Query' resource for getting results in messaging paradigm

StackOverflow https://stackoverflow.com//questions/24021718

  •  21-12-2019
  •  | 
  •  

Question

I want to use Query resource to get list of documents back from repository in binary format. Repository maintains Document Reference resource and Patient details. My parameters are based on

  1. DocumentReference.type
  2. DocumentReference.subject.Patient.identifier.value@value
  3. DocumentReference.subject.Patient.identifier.system@value

This is what my guess the parameters will look like -

<parameter url="http://nhs.uk/fhir/query#_type">
  <valueString value="DocumentReference"/>
</parameter>
<parameter url="http://nhs.uk/fhir/query#type">
  <valueString value="EndofLifeCareRecord"/>
</parameter>
<parameter url="http://nhs.uk/fhir/query#subject:Patient.identifier.value">
  <valueString value="12345"/>
</parameter>
<parameter url="http://nhs.uk/fhir/query#subject:Patient.identifier.system">
  <valueString value="http://nhs.uk/fhir/nhs-number/"/>
</parameter>

My Questions -

  1. Is the above parameter construct correct considering that I am using message paradigm (not REST)?
  2. How response will be constructed, i.e. Document Resource will be populated with subject (i.e. Patient). Will it be a contained resource?
Was it helpful?

Solution

if you are using the parameters defined in the specification, then the URL for them is http://hl7.org/fhir/query. If you are defining the parameters yourself - which seems to be case for 3 of 4 of them (is that what you meant to do?) then you provide your own namespace, as you have. The format of the parameters is correct.

In terms of the response, it's a bundle with a message header resource, and a query resource that contains references to the resources that constitute the result set for the query, and those resources must be in the bundle. The document resource refers to the subject (patient) by URL, and you have 3 choices for where to put the patient resource:

  1. contained in the document reference resource
  2. in the bundle
  3. on a server elsewhere

I think that #3 doesn't work in your case, so you pick between #1 and #2. Contained resources are always a bad idea - they handicap subsequent usage of the resource by de-identifying it. So you should only ever use contained resources when you have to, because you don't have enough information to construct an identified resource - and that would be a very bad idea for your patient resource. Very bad idea indeed.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top