Skip to content

Support for Relative Dates in Prefetch #658

Description

@msargent56

Optimizing the prefetch template with query parameters can be impactful in its ability to limit the amount of data being generated by the CDS client and sent to the CDS service. Targeted filtering of prefetch can have a benefit to both performance (during CDS client request generation) and ensuring the CDS service does not need to receive more data than is necessary to perform its function.

In practice this has worked great but there is a limitation in interacting with dates since there isn't a great way to specify a time period relative to today.

For example, a CDS Service might have this pre-fetch:
{ "prefetch": { "meds": "MedicationRequest?patient={{context.patientId}}&status=active,completed" } }

However, the CDS Service may only care about recently completed medications. It would be beneficial if the CDS Hooks specification defined a way to communicate relative dates in the prefetch.

For example, having a way for the service to indicate it only cares about active or completed medications in the past 14 days.
{ "prefetch": { "meds": "MedicationRequest?patient={{context.patientId}}&status=active,completed&date=ge{{context.date.today(-14)}}" } }

Having the ability to specify relative dates in a similar manner to above would help avoid issues related to caching/manually pre-configuring prefetch templates.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions