LinuxForHealth / FHIR

The LinuxForHealth FHIR® Server and related projects
https://linuxforhealth.github.io/FHIR
Apache License 2.0
330 stars 157 forks source link

Add an option to restrict Whole System History api to return only certain resource types #2972

Closed mpayne2 closed 2 years ago

mpayne2 commented 2 years ago

Is your feature request related to a problem? Please describe. When I'm only interested in the history of one resource type, the Whole System History api returns all resource types and requires me to page through all the resources to find them. This would cause a lot of paging if the FHIR server contains millions of records.

Describe the solution you'd like Allow an option on the Whole System History api to pass in the resourceType and only return entries of that resource type.

Preferably just support the type-level history interaction defined at https://www.hl7.org/fhir/http.html#history

Describe alternatives you've considered Page through all the resources on the client and filter out everything but that resourceType.

Acceptance Criteria

  1. GIVEN a Whole System History api call WHEN the api has a resourceType option specified THEN only entries with that resourceType are returned in the bundle

Additional context This is for a service looking for Consents being stored in the FHIR server and need to be registered in Consent Manager. We are looking at using the Whole System History api to detect create, updates, and deletes of consents in order to get the consents in Consent Manager in sync with the FHIR server

d0roppe commented 2 years ago

Verified that it only includes the resource type that you restrict with the _type= parameter. Closing issue