-
Notifications
You must be signed in to change notification settings - Fork 4
Build a preFetch Proxy #3
Comments
I can take this. It'll be a week or so before I have something back though. |
OK, that'd be totally awesome @mattberther! Of course the syntax above is for the old API; the updated set of calls to expose would be:
|
The first call would actually be
Right? |
You caught us mid-edit: we're updating the spec to drop |
@jmandel @kpshek - take a peek at https://github.com/cds-hooks/cds-prefetch-proxy and let me know if this is what you had in mind. |
This looks like exactly what I had in mind, quite! Thanks so much for putting this together. Three tiny notes:
|
Thanks for the feedback. Ill go through and update to use url-join for consistency. I dont believe labels are swapped. https://github.com/cds-hooks/cds-prefetch-proxy/blob/c40f5c7e7f54aade5eb4fd68338ed2b52a306936/test/integration-test.js#L140 should query the FHIR server and it does so by removing the prefetch key prior to submitting the request to the proxy. The absence of the prefetch key (and the presence of it on the service discovery) leads the proxy to query the FHIR server for the resource(s). No concern at all about using Travis CI. My apologies - I didnt see that you all were already using it. |
Hmm, maybe I'm just having trouble parsing the description in your labels -- your explanation here makes perfect sense sense, but I can't see how it corresponds to
I'd expect "query the FHIR server's if any prefech data is missing from the service request" Re: Travis, you didn't miss anything here; it's just the tool that @kpshek and I have use in other (non CDS Hooks) projects :) |
Re: labels, indeed youre right. That's what happens when I respond late. Sorry. Re: Travis, if you want to authorize Travis to the organization, Ill get the builds moved over. |
I've taken two steps:
|
Thanks @jmandel - Ive updated all but two repos to build from travis. I havent done docker-stack or cds-service-example-csharp yet because im not sure how to do docker or csharp builds with travis. Ill continue to research. |
Also just pushed a couple commits which should address your original points (url concatenation and test verbiage). cds-hooks/cds-prefetch-proxy@bf888ea Ill close this issue out and we can track subsequent issues against the prefetch proxy on that repo. |
An open question is how app developers should deal with uncertainty about the availability of preFetch data. If an app developer has to code defensively and write two code paths (one for the case where preFetch data are supplied by the EHR, and one of the case where they aren't), this leads to duplicated effort and mistakes.
This task: build a generic proxy (e.g. deployable via Docker) that takes the URL of an underlying service, and exposes a gateway in front of it. The service exposes two API call:
cds-hook-metadata
call arrives, simply proxy the the metadata from the actual service.cds-hook
call arrives, use the actual service's metadata to determine which preFetch data are expected. Then examine the payload to determine if the data have been supplied to the EHR. If so, just pass the request to the actual service. Otherwise, call the EHR directly, issuing the necessary queries to assemble the requiredpreFetchData
. Then, after assembling the necessary payload, pass the updated request to the actual service.Deployment details
https://prefetch-proxy.cds-hooks.org
The text was updated successfully, but these errors were encountered: