CDCgov / prime-reportstream

ReportStream is a public intermediary tool for delivery of data between different parts of the healthcare ecosystem.
https://reportstream.cdc.gov
Creative Commons Zero v1.0 Universal
71 stars 39 forks source link

FHIR Transform: Implement Resource "Prune" Feature #14548

Closed arnejduranovic closed 2 weeks ago

arnejduranovic commented 4 months ago

User Story

As a writer of receiver-based FHIR enrichments, I want the ability to REMOVE resources from a bundle that match a particular FHIR expression, so that I can create a bundle that meets a receiver's Observation filtering requirements.

Description/Use Case

Presently ReportStream's FHIR expressions allow for SELECTING resources and their properties in a FHIR bundle and setting their value. This ticket aims to now implement the ability to remove resources as well that match a particular "resource" expression.

This ticket does not define the syntax that shall be used in the .yml file, but the following is an example of something that could work:

  - name: sr-specimen-collection-bodysite-display
    resource: 'Bundle.entry.resource.ofType(Specimen)'
    condition: '%resource.collection.bodySite.coding.display.exists().not()'
    value: [ '%remove' ]

The above config would remove all Specimen resources that did not have a display value for collection.bodySite.coding

Risks/Impacts/Considerations

Dev Notes

Screenshot 2024-07-16 at 10 19 37 AM

Acceptance Criteria

Andrey-Glazkv commented 4 months ago

Hey team! Please add your planning poker estimate with Zenhub @adegolier @arnejduranovic @brick-green @david-navapbc @jack-h-wang @jalbinson @JFisk42 @mkalish @thetaurean