Closed vlad-ignatov closed 1 year ago
I think this makes sense as an expedited workflow. However, assuming this is in response to Dan/Josh's request for a second export-endpoint that automatically kicks off the export, this is different from what I thought their request was. I thought they were asking for a workflow where there is no form, just a generic export-all-the-data endpoint that kicks off the second you click export button and authorize via SMART.
Happy to approve this functionality, but can you clarify whether or not we are on different pages regarding Dan and Josh's request?
I think they asked for both of these separately. One was to kinda show the form directly as part of the export launch sequence and another proposal was to have separate "direct" endpoint for developers to test their clients against. This PR allows the server to control how "simplified" the flow is by sending one or two parameters in the Link header and the client can fork both ways. In other words, we can easily change this in the future if J and D have other ideas.
The other "no form" request I have yet to figure out. I am not sure if it should use the same auth. Maybe it should be based on backend-services so that it really does not require human interaction. In any case, I see that as separate issue. Did you understand them differently?
Just a quick patch to render the form directly instead of asking the user. The "redirect from kick-off" approach doesn't work with Ajax POST, but this might be the next best thing.
The server will now tell you who the patient is so that we can even skip the first form login, and send you a
behavior=automatic
param to tell you to render the form without asking the user - https://github.com/smart-on-fhir/ehi-server/blob/main/lib/EHIGateway.ts#L182