Teksysta
Teksysta

Reputation: 35

Can't figure out how to search LOINC using FHIR for a specific test by name?

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.

Upvotes: 3

Views: 1707

Answers (1)

Lloyd McKenzie
Lloyd McKenzie

Reputation: 6803

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.

Upvotes: 3

Related Questions