FHIR Chat · Proper way of using "include" & what to expect? · implementers

Stream: implementers

Topic: Proper way of using "include" & what to expect?


view this post on Zulip Mike C. (Sep 12 2019 at 18:25):

Good Afternoon FHIR Folks!

I am writing this post to hopefully get some clarification on the "_include" query parameter, and what to expect from the resultant Bundle returned from the server. For this, I am using the HAPI baseR4 test server ( http://hapi.fhir.org/baseR4/ ).

I am a bit confused working with it now, as it seems to return to me only the base resource called is returned in the bundle and no additional resources that were requested with the _include command.

The baseR4 server seems to reflect that this is a possibility, per their capability statement (see image below):

pasted image

However, none of my calls seem to retrieve a Patient resource in the same bundle as the Condition resource called, despite the Condition resource in question clearly having a Patient reference as an element under "subject".

The following queries were, for me, unsuccessful:
- http://hapi.fhir.org/baseR4/Condition/17926?_include=Condition:subject
- http://hapi.fhir.org/baseR4/Condition/17926?_include=Condition.subject (I have seen folks using the single dot . syntax so I figured I would try it)
- http://hapi.fhir.org/baseR4/Condition/17926?_include=Condition:patient
- http://hapi.fhir.org/baseR4/Condition/17926?_include=Condition.patient
- http://hapi.fhir.org/baseR4/Condition/17926?_include=Patient

For all the above endpoints, I am simply returned the single Condition resource (see image below - notice that there is indeed a Patient reference in the "subject" element" )
pasted image

I noticed that this gentleman had found a way to get the entire base resource as well as the "included" resource in his response bundle. This is what I am shooting for: https://github.com/FHIR/fhir.js/issues/121#issuecomment-419844202

I have a feeling there is a simple, small step that I am not utilizing, so I thought I would broach the subject with this community because you all have been so helpful and patient in the past. I look forward to any and all advice I can get on this! Cheers
- Mike

view this post on Zulip Michele Mottini (Sep 12 2019 at 18:29):

It must be a search: http://hapi.fhir.org/baseR4/Condition?_id=17926&_include=Condition:subject

view this post on Zulip Mike C. (Sep 12 2019 at 19:08):

It must be a search: http://hapi.fhir.org/baseR4/Condition?_id=17926&_include=Condition:subject

Michele, thank you - this helps a lot.

Just one follow-up question: what is the difference between calling Condition:subject and Condition:patient? I noticed that both of those are supported on that HAPI server's capability statement.

view this post on Zulip Michele Mottini (Sep 12 2019 at 19:12):

I think Condition:patient should include only Patients, whereas Condition:subject both Patients and Groups (the Condition.subject element can reference either)

view this post on Zulip Mike C. (Sep 12 2019 at 19:13):

I think Condition:patient should include only Patients, whereas Condition:subject both Patients and Groups (the Condition.subject element can reference either)

Thank you, Michele. Your advice has been invaluable!

view this post on Zulip Gino Canessa (Sep 12 2019 at 19:17):

Just one follow-up question: what is the difference between calling Condition:subject and Condition:patient? I noticed that both of those are supported on that HAPI server's capability statement.

Welcome to the world of Search! In this case, patient is a search parameter which resolves to a Condition.subject where the subject is a Patient resource.


Last updated: Apr 12 2022 at 19:14 UTC