Stream: implementers
Topic: Search query for multiple codes
Ville Lindholm (Jun 08 2017 at 16:29):
Hi! I'm looking at the examples for CDS hooks, and especially the prefetch
field where one can specify REST search commands to a FHIR server. I was wondering if someone could think of a way to search e.g. all Observations that belong to a specific patient and that includes some code out of a collection of codes? One code is easy, that's Observation?patient=someID&code=4548-4
, but if I have a group of codes, (say, 10) can I get away with doing one search instead of several? I didn't see any "or" operator in the docs, is there some other way?
Ville Lindholm (Jun 08 2017 at 16:30):
Maybe the cds-hooks stream would be better, but I guess this is more of a general FHIR question :)
Igor Sirkovich (Jun 08 2017 at 16:44):
@Ville Lindholm , I believe you can either use comma for hard coded enumeration, e.g. "...&code=4548-4,4548-5,4548-6" or, more elegant solution, use ":in" modifier with a ValueSet, e.g. "...&code:in=http://acme.org/fhir/ValueSet/cardiac-conditions". See http://www.hl7.org/fhir/STU3/search.html#token for examples.
Ville Lindholm (Jun 08 2017 at 17:04):
@Igor Sirkovich thanks, that's exactly what I was looking for! :)
Last updated: Apr 12 2022 at 19:14 UTC