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

Implement partial prefetch functionality #536

Open
c-schuler opened this issue Jun 23, 2022 · 1 comment
Open

Implement partial prefetch functionality #536

c-schuler opened this issue Jun 23, 2022 · 1 comment
Labels
cds-hooks Cds-hooks implementation enhancement New feature or request

Comments

@c-schuler
Copy link
Contributor

According to the Cds Hooks specification:

It is the CDS Service's responsibility to check prefetched data against its template to determine what requests were satisfied (if any) and to manually retrieve any additional necessary data. If the CDS Service is unable to obtain required data because it cannot access the FHIR server and the request did not contain the necessary prefetch keys, the service SHALL respond with an HTTP 412 Precondition Failed status code.

However, the latest release of the cqf-ruler (v0.5.0) does not support partial prefetched data and assumes that if a prefetch is present, it is complete and will not attempt further retrieval.

@c-schuler
Copy link
Contributor Author

c-schuler commented Jun 23, 2022

There are several factors to consider when implementing this functionality:

  • A prefetch item may be intentionally left blank for "exploratory" evaluation. For example, "what would happen if we did X with Patient Y?"
    • If we callback for data that was intentionally left null, we risk not performing the intended calculation
  • Data-requirements may be split into separate prefetch items if the url is too long
    • If a given data-requirement can be split across M prefetch statements, it's actually an error to only fill one of those.
  • Data-requirements are gathered and collapsed across the entire CQL library. Meaning "[Condition : X]" and "[Condition: Y]" may both end up as the same data-requirements
    • Therefore, one prefetch Item may correspond to N different retrieves.
  • It is not currently possible to link a prefetch item with a specific retrieve in the CQL
    • We need a way to record (or regenerate as needed) the full end-to-end CQL Retrieve to prefetch mapping so that the DataProvider can use that information to return the prefetched data or call back to the source FHIR server as required
    • If we callback for data that's already prefetched, we risk duplicates and therefore bad results

@c-schuler c-schuler added enhancement New feature or request and removed bug Something isn't working labels Jun 23, 2022
@JPercival JPercival added 13 and removed 13 labels Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cds-hooks Cds-hooks implementation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants