2

Can anyone provide some insight on the required syntax to use to search LOINC using FHIR for a specific string in the labs descriptive text portion of an Observation resource?

Is this even possible?

The documentation is all over the place and I can't find an example for this generic kind of search.

I found similar examples here: https://www.hl7.org/fhir/2015Sep/valueset-operations.html

Such as: GET "[base]/ValueSet/23/$validate-code?system=http://loinc.org&code=1963-8&display=test"

But none of them are providing a general enough case to do a global search of the LOINC system for a specific string in an Observation resource.

None of my attempts to use the FHIR UI here, http://polaris.i3l.gatech.edu:8080/gt-fhir-webapp/search?serverId=gatechreadonly&resource=Observation , have been successful. I keep getting a 500 Internal Server Error because I don't know the correct syntax to use for the value part of the search, and I can't find any documentation out of all the copious documents online that explains this very simple concept.

Can anyone provide some insight?

Totally frustrated at this point.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Teksysta
  • 25
  • 3
  • Need a bit of clarification on what you're trying to do. You say you want to search "all of LOINC" but you're searching against Observation - which will only have a single LOINC code. Can you explain the "global search of the LOINC system" piece and how that applies to searching an Observation? – Lloyd McKenzie Oct 29 '15 at 05:20
  • I need to find all observations in our database with references to creatinine tests using the FHIR UI. – Teksysta Oct 29 '15 at 22:09
  • What I need to know is the correct syntax to search a FHIR database for Observations that have a specific value? – Teksysta Oct 30 '15 at 02:24

1 Answers1

3
Observation?code=12345-6

or

Observation?code=http://loinc.org|12345-6

where 12345-6 is whatever LOINC code you want to look for (e.g. 39802-4)

The second ensures you'll only match on LOINC codes as opposed to codes from other systems, though given the relatively unique format of LOINC codes, you're mostly safe without including that.

If you want to search for a set of codes, then you can separate the codes or the tuples with commas: E.g.

Observation?code=12345-6,12345-7

or

Observation?code=http://loinc.org|12345-6,http://loinc.org|123456

If you expect to search by a really long list of codes frequently, you can define a value set that includes all the desired codes and then filter by value set:

Observation?code:in=http://somwhere.org/whatever/ValueSet/123

Note: for readability, I haven't escaped the URL contents, but you'll need to escape the URL values appropriately.

Chris Grenz
  • 161
  • 9
Lloyd McKenzie
  • 6,345
  • 1
  • 13
  • 10