FHIR Chat · Defining custom queries · IG creation

Stream: IG creation

Topic: Defining custom queries


view this post on Zulip Jean Duteau (Mar 09 2021 at 21:51):

I am venturing into some new space and am defining some custom queries for an IG. I created the OperationDefinition and it is represented quite nicely. I'm using a query instead of an operation because I want all of the standard search parameters to be available. They aren't listed on the generated page for the query definition, but I'm assuming that all of the standard search parameters for queries in general as well as the search parameters for the specific resource (Practitioner, Organization, or Location in my case) would all be accepted? Or do I have to list those specifically?

view this post on Zulip Jean Duteau (Mar 09 2021 at 21:55):

I'm sort of confused by this line in the specification about named queries:

For named queries, all the standard search parameters are automatically in scope (though servers do not need to support them unless explicitly documented).

If I don't document the parameters, then they may or may not be in scope. If I do document them, then they are definitely in scope. How do I indicate that these parameters are in scope but these other ones aren't?

view this post on Zulip Eric Haas (Mar 09 2021 at 23:57):

I have documented the supported SPs in the OD comments or intro. although I never really understood the difference between an operation and query since they both use OD.

view this post on Zulip Eric Haas (Mar 10 2021 at 00:04):

so have defined an operation and said could use standard SP like _count etc and still invoked as an operation.

GET /Patient/$foo&_count=6

view this post on Zulip Eric Haas (Mar 10 2021 at 00:06):

truth be told I don't recall ever seeing any queries being specified only operations...

view this post on Zulip Lloyd McKenzie (Mar 10 2021 at 00:29):

Query you can invoke using the search mechanism. I.e. Patient?_query=foo&parm1=a&param2=b. All of the standard stuff like _sort, _elements, etc. is fully available.

view this post on Zulip Lloyd McKenzie (Mar 10 2021 at 00:29):

So is paging

view this post on Zulip Lloyd McKenzie (Mar 10 2021 at 00:29):

With a regular operation, you don't get that stuff.

view this post on Zulip Jean Duteau (Mar 10 2021 at 04:20):

Lloyd McKenzie said:

Query you can invoke using the search mechanism. I.e. Patient?_query=foo&parm1=a&param2=b. All of the standard stuff like _sort, _elements, etc. is fully available.

And that line from the spec that I quoted - is that just saying that not all servers support all standard search parameters, so if I want to guarantee support for them, I need to be explicit?

Since it is a search, do you get all the resource search parameters as well?

view this post on Zulip Lloyd McKenzie (Mar 10 2021 at 04:22):

That, I don't know. @Grahame Grieve @Rob Hausam?

view this post on Zulip Jean Duteau (Mar 10 2021 at 04:26):

so I think that, to be safe, a defined query should specify all of the search parameters that it expects can be used with it.

view this post on Zulip Rob Hausam (Mar 10 2021 at 05:37):

I think that I have the same interpretation as @Jean Duteau.


Last updated: Apr 12 2022 at 19:14 UTC