Currently I am developing a FHIR Search API using HAPI FHIR (Java).
In the FHIR resource MedicationRequest in HAPI FHIR (Java), I want to include the Medication resource inline under MedicationRequest.medication[x], instead of as a Reference. I have provided a snippet below.
//code
@IncludeParam(allow = { "MedicationRequest:medication" }) Set<Include> theIncludes
// url
/MedicationRequest?_include=MedicationRequest:medication&status=stopped,active
However, when I hit the url the response does not include the Medication resource inline.
If I use _include=*, then I get the desired outcome. Medication is included inline, along with the other References.
// code
@IncludeParam(allow = { "*" }) Set<Include> theIncludes
// url
/MedicationRequest?_include=*&status=stopped,active
Can anyone please help me in understanding why I am not getting desired outcome when I am using _include=MedicationRequest:medication?