FHIR Chat · Filtering records within a resource · implementers

Stream: implementers

Topic: Filtering records within a resource


view this post on Zulip James Dinsmore (Oct 11 2021 at 15:53):

We need to filter the records within a FHIR resource based on whether an EHR application is active or inactive. Is it more appropriate to use a custom operation or a _list to accomplish this need?

view this post on Zulip Lloyd McKenzie (Oct 11 2021 at 17:54):

Can you explain what you mean by "records within a FHIR resource"? Typically each resource is a single record. What's the relationship of the records to the EHR application? How are you representing the application?

view this post on Zulip James Dinsmore (Oct 11 2021 at 20:57):

@Lloyd McKenzie we use the Organization endpoint to list facilities within an HIS. Each facility represents a single record/resource. Each facility has applications that can be activated or inactivated. We want to exclude all Organization resources that do not have a specific application activated.

view this post on Zulip Lloyd McKenzie (Oct 11 2021 at 21:05):

Ok, and are you representing applications as Device instances? When you say "specific application" are you referring to a particular instance (i.e. multiple organizations running the same instance) or do you mean application 'type'?

view this post on Zulip James Dinsmore (Oct 11 2021 at 21:22):

@Lloyd McKenzie the applications are not represented in the FHIR bundle. The filtering would be done at a database layer without needing to use any data within the FHIR bundle. Each organization can toggle on and off the same list of applications (so multiple organizations would not run the same instance).

view this post on Zulip Daniel Venton (Oct 11 2021 at 21:29):

How do you handle @Search returns Organization/X, but then organization x turns off the application. Does the @Read operation return a 404, the record exists but not active? 200 Return the row anyway? etc.

view this post on Zulip Lloyd McKenzie (Oct 11 2021 at 21:40):

If it's outside FHIR, then you can do whatever you like - so I think I'm missing part of the problem...

view this post on Zulip James Dinsmore (Oct 12 2021 at 13:36):

@Daniel Venton toggling off and on the application would work the same as any other Boolean search parameter.

@Lloyd McKenzie if we need to include a custom extension in the FHIR to notate active applications we can.

We are only using FHIR requests to generate the list of Organization resources.

We are trying to avoid needing to create a custom API to generate a list of Organization id's to then search by.

I hope this clears things up.

view this post on Zulip Daniel Venton (Oct 12 2021 at 13:48):

I think we're getting closer to the problem definition. "You want to Search for Organization Resources where a linked Application property (active) is true"?
What type of resource is Application? How are these application resources linked to the organization resource?

view this post on Zulip Lloyd McKenzie (Oct 12 2021 at 14:49):

If you want to throw a custom extension on Organization and define a custom SearchParameter on that extension to allow you to filter on it. (Though you need to get the server to support that custom SearchParameter.)


Last updated: Apr 12 2022 at 19:14 UTC