hapi-fhir

How to search on FHIR using the field on reference resource


I want to return search results of medicationRequest using the episodeOfCare id. An episodeOfCare is available on on encounter resource which is a reference on medicationRequest resource. Would anyone help me on how to to search for medication requests using the episode of care ID? Thanks


Solution

  • You would use chain searching for querying the medicationRequest by EpisodeOfCare.id: {base}/MedicationRequest?encounter.episode-of-care._id=123