Stream: implementers
Topic: Expand Subject Reference when send GET request for Encounter
Dado Jelic (May 27 2021 at 14:30):
Hy, I'am new with FHIR.
Is it possible to expand Subject reference inside Ecnounter resurs, so I can get Encounter data and also Patient data in same JSON object with one GET HTTP request?
TNX
Michele Mottini (May 27 2021 at 14:38):
Yes, adding an _include=Encounter:patient
to the Encounter search will returns all Patient resource referenced by the returned Encounters - see http://hl7.org/fhir/search.html#include
Dado Jelic (May 27 2021 at 15:01):
TNX!
Lloyd McKenzie (May 27 2021 at 15:27):
Note that this won't 'expand' the content (that's not allowed), but it'll retrieve both resources in the search Bundle.
Dado Jelic (May 28 2021 at 10:48):
This only work on FHIR. On my project we need to use mock with JSON server parallel with FHIR. Is it possible to make something similar on mock? Don't know the logic of how '_include' works in the background?
Michele Mottini (May 28 2021 at 12:40):
Sorry, don't understand what you mean (and also: this is a FHIR forum . . . )
Yunwei Wang (May 28 2021 at 15:22):
If you use mock, then you don't need to worry how the_include works in the background. You mock the result which is a Bundle contains a Encounter and a Patient.
Last updated: Apr 12 2022 at 19:14 UTC