FHIR Chat · AND search · questionnaire

Stream: questionnaire

Topic: AND search


view this post on Zulip erwin foxtree (Dec 13 2021 at 16:42):

Hi, I'm trying to search a Hapi FHIR server for questionnaires that match both a particular cpt code ("focus") and coverage code ("program").

The Hapi server has two questionnaires having a useContext that looks as follows:

"useContext": [ {
        "code": {
          "system": "http://terminology.hl7.org/CodeSystem/usage-context-type",
          "code": "program"
        },
        "valueCodeableConcept": {
          "coding": [ {
            "system": "http://XYZ",
            "code": "105"
          } ]
        }
      }, {
        "code": {
          "system": "http://terminology.hl7.org/CodeSystem/usage-context-type",
          "code": "focus"
        },
        "valueCodeableConcept": {
          "coding": [ {
            "system": "http://www.ama-assn.org/go/cpt",
            "code": "70480"
          } ]
        }
      } ],

(Both fragments are identical for each questionnaire, except for the program code being "105" vs "104")

Each of the following searches returns one or the other questionnaire:

http://localhost:8080/cqf-ruler-r4/fhir/Questionnaire?context-type-value=focus$http://www.ama-assn.org/go/cpt|70480&context-type-value=program$http://XYZ|104

http://localhost:8080/cqf-ruler-r4/fhir/Questionnaire?context-type-value=focus$http://www.ama-assn.org/go/cpt|70480&context-type-value=program$http://XYZ|105

However, the if I replace "program" with "focus" in the URLs, I still get the same results, eg:

http://localhost:8080/cqf-ruler-r4/fhir/Questionnaire?context-type-value=focus$http://www.ama-assn.org/go/cpt|70480&context-type-value=focus$http://XYZ|105
(^this should return 0 results?)

...what's the correct way to yield the intersection / "AND" results for both focus and program?

view this post on Zulip Paul Lynch (Dec 13 2021 at 16:55):

That sounds like a bug in HAPI to me. I would not expect context-type-value=focus$http://XYZ|105 to find anything.

view this post on Zulip Lloyd McKenzie (Dec 13 2021 at 23:00):

You should be getting the intersection now... What do you see in the 'self' link returned by the HAPI server? Is it paying attention to both parameters?

view this post on Zulip erwin foxtree (Dec 14 2021 at 17:45):

Thanks for all the replies. I'm dealing w/ an inherited, somewhat complicated codebase that's similar to the set of microservices associated w/ the https://github.com/HL7-DaVinci/prior-auth reference implementation.

It's difficult to to ascertain whether this is actually problem w/ the cqf-ruler service, or something else.

However, the following search appears to behave correctly:

http://localhost:8080/cqf-ruler-r4/search?serverId=home&pretty=true&_summary=&resource=Questionnaire&param.0.0=http%3A%2F%2Fwww.ama-assn.org%2Fgo%2Fcpt&param.0.1=70480&param.0.name=context&param.0.type=token&param.1.0=http%3A%2F%2FXYZ&param.1.1=105&param.1.name=context&param.1.type=token

Stripping out the empty values, for clarity:

http://localhost:8080/cqf-ruler-r4/search?serverId=home&

resource=Questionnaire&

param.0.0=http%3A%2F%2Fwww.ama-assn.org%2Fgo%2Fcpt&
param.0.1=70480&
param.0.name=context&
param.0.type=token&

param.1.0=http%3A%2F%2FXYZ&
param.1.1=105&
param.1.name=context&
param.1.type=token&

view this post on Zulip erwin foxtree (Dec 14 2021 at 17:46):

(I am wondering about where this search param notation comes from, and whether it's an official part of any FHIR spec...)

view this post on Zulip Lloyd McKenzie (Dec 14 2021 at 17:58):

Well, technically you're allowed to make up your own SearchParameter definitions, so it's theoretically possible to do this in FHIR, though the notion that there's a whole bunch of grouped parameters that are organized based on the parameter name is completely foreign to FHIR. It's certainly nothing 'standard' or that a regular FHIR server would recognize without a bunch of customization.

view this post on Zulip erwin foxtree (Dec 14 2021 at 18:20):

This is one of the results after using the search-query builder at http://localhost:8080/cqf-ruler-r4/resource?resource=Questionnaire

view this post on Zulip erwin foxtree (Dec 14 2021 at 18:21):

(context, vs context-type and context-type-value)

view this post on Zulip erwin foxtree (Dec 14 2021 at 18:21):

image.png

view this post on Zulip erwin foxtree (Dec 14 2021 at 18:22):

You should be getting the intersection now... What do you see in the 'self' link returned by the HAPI server? Is it paying attention to both parameters?

The self link in the questionnaire resource looks normal, AFAICT:
http://ABC/Questionnaire/<Condition>Program105

and the bundle self link is:
http://localhost:8080/cqf-ruler-r4/fhir/Questionnaire?context-type-value=focus%24http%3A%2F%2Fwww.ama-assn.org%2Fgo%2Fcpt%7C70480&context-type-value=focus%24http%3A%2F%2FXYZ%7C105

(which is properly escaped, but: still yields 1 hit)

view this post on Zulip Lloyd McKenzie (Dec 14 2021 at 21:07):

Have you tried asking on #hapi ?


Last updated: Apr 12 2022 at 19:14 UTC