Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Relative Dates in Prefetch #658

Open
msargent56 opened this issue Jul 22, 2024 · 0 comments
Open

Support for Relative Dates in Prefetch #658

msargent56 opened this issue Jul 22, 2024 · 0 comments

Comments

@msargent56
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant