FHIR Chat · Observation search · hapi

Stream: hapi

Topic: Observation search


view this post on Zulip Dexter (Jun 16 2021 at 10:01):

Is it possible to search for an Observation based on the interpretation code?
The Observation doc page doesn't list this attribute, so my understanding is it's not possible. Is there an alternative way?

view this post on Zulip Grahame Grieve (Jun 16 2021 at 10:21):

You can define your own search parameters

view this post on Zulip Dexter (Jun 16 2021 at 10:23):

I tried creating a search parameter for a different usecase previously, and it didn't work well. I'll give that a go again, thanks!
Using the default docker container should work, correct?

view this post on Zulip Dexter (Jun 18 2021 at 11:35):

Grahame Grieve said:

You can define your own search parameters

I have this JSON Path for finding all observations with a given interpretation code.

$.resource..interpretation[:].coding[:].code

Would something like this be correct for the top-level interpretation?
Observation.Interpretation.Where(Code = "HIGH")

view this post on Zulip Grahame Grieve (Jun 18 2021 at 12:54):

correct where?

view this post on Zulip Dexter (Jun 18 2021 at 12:56):

For an Observation, on the 'expression' part of the SearchParameter JSON POST body?

view this post on Zulip Grahame Grieve (Jun 18 2021 at 12:59):

SearchParameter.expression is FHIRPath, which is case sensitive, so it would be

view this post on Zulip Grahame Grieve (Jun 18 2021 at 13:03):

Observation.interpretation.where(code.coding.where(code in "H" | "HU" | "HH).exists())

and maybe HX?

view this post on Zulip Dexter (Jun 18 2021 at 13:04):

I assume this doesn't work when there's interpretations inside components? Then I'd need some form of Union, correct?

view this post on Zulip Dexter (Jun 18 2021 at 13:04):

If you don't mind me asking, in code in "H" | "HU" | "HH, why the H | HU | HH?

view this post on Zulip Grahame Grieve (Jun 18 2021 at 13:38):

yes you'd need a union

view this post on Zulip Grahame Grieve (Jun 18 2021 at 13:38):

did you look at the possible codes for interpretation?

view this post on Zulip Dexter (Jun 18 2021 at 13:39):

We're using High, normal, low for now. My bad forgot there were more. Thanks!

view this post on Zulip Dexter (Jun 18 2021 at 13:41):

So if I'm using a union, it'd be something like this?

Observation.interpretation.where(code.coding.where(code in "H" | "HU" | "HH).exists()).union(
    Observation.components.where(interpretation.where(
        code.coding.where(code in "H" | "HU" | "HH).exists())
    )
)

view this post on Zulip Grahame Grieve (Jun 18 2021 at 21:53):

feels about right

view this post on Zulip Dexter (Jun 21 2021 at 04:27):

Thanks! I'll give that a go!


Last updated: Apr 12 2022 at 19:14 UTC