Skip to content
This repository has been archived by the owner on Dec 8, 2017. It is now read-only.
This repository has been archived by the owner on Dec 8, 2017. It is now read-only.

Decide expectations for preFetch behavior #9

Closed
jmandel opened this issue Mar 17, 2016 · 3 comments
Closed

Decide expectations for preFetch behavior #9

jmandel opened this issue Mar 17, 2016 · 3 comments

Comments

@jmandel
Copy link
Member

jmandel commented Mar 17, 2016

Is this optional for EHRs? Can an EHR provide pre-fetch data for some queries but not others? Does an app need to fallback to REST queries when pre-fetch data are missing?

@dmccallie
Copy link

I think pre-fetch should be optional, and should be based on best effort rather than a formal query definition. Partial pre-fetch should be allowed also. For example, perhaps Patient and Encounter resources are readily available to the EHR's triggering mechanism. Those could be shared via pre-fetch, even if other data is not readily available (and must be queried with app-triggered FHIR calls.)

@jmandel
Copy link
Member Author

jmandel commented Mar 18, 2016

"Partial" is a slight issue, in that we'd need a way for the EHR to explicitly indicate which requests it was attempting to fulfill, and which ones it was skipping. As currently specified, the only way a client can tell which preFetch "asks" have been fulfilled is by iterating over the in-order list of responses, and correlating them one by one with requests.

Example

CDS Service has pre-fetch request of:

preFetch: [
  "Patient/{{Patient.id}}",
  "MedicationOrder?patient={{Patient.id}}"
]

EHR supplies it with data like:

[{
  "name": "preFetchData",
  "resource": {
      "resourceType": "Bundle",
      "entry: [
        // two resources in bundle:
        {}, // response to GET Patient (a Patient resource)
        {} // response to GET MedicationOrder (a Bundle of MedicationOrders)
      ]
    }
}]

Now the client looks at the order of entries, and matches them up one-by-one with its requests. If we can allowed the EHR to simply skip some preFetch entries, it would need to include some kind of placeholder in the response. Otherwise the client would be able to tell which thing was missing without deep inspection and guesswork.

But if we made that rule, I'd be okay with partial responses.

Anyway, I'm resigned to the notion that apps will need to detect missing data and fall back to FHIR API requests to fill the gaps. I think we can automate that logic with a (totally optional and totally generic) proxy (see #3) for developers who prefer to avoid this pain.

@kpshek
Copy link
Contributor

kpshek commented Sep 12, 2016

Closing this issue in favor of issue cds-hooks/docs#5

@kpshek kpshek closed this as completed Sep 12, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants