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

Server always prompt the user to select a patient #1

Open
jmandel opened this issue Feb 7, 2015 · 10 comments
Open

Server always prompt the user to select a patient #1

jmandel opened this issue Feb 7, 2015 · 10 comments

Comments

@jmandel
Copy link
Member

jmandel commented Feb 7, 2015

michelemottini commented 7 hours ago
..event if there is no launch\patient' scope

@jmandel
Copy link
Member Author

jmandel commented Feb 7, 2015

@michelemottini can you give some background about how you've installed/configured, and how you're invoking the service? Are you using it in concert with SMART's api-server?

@michelemottini
Copy link

I am writing a SMART+FHIR app. I am testing it on your sandbox: I registered it as described here. I go through the authentication sequence, using the FHIR server at https://fhir-api.smartplatforms.org

If at step 2 I set scope to user/*.* launch the app is re-directed to select a patient, if the scope is just user/*.* there is no patient selection. I would expect to get the patient selection with a scope user/*.* launch/patient; on the other hand specifying just launch does not make much sense probably - and my immediate problem has been solved.

As I reported separately, if the scope is just user/*.read (that is all the app really needs) instead than user/*.* the authentication fails with an 'invalid_scope' error.

@jmandel
Copy link
Member Author

jmandel commented Feb 7, 2015

For testing against our live sandbox, please use user/*.* for the moment (the commit above adds a "user/*.read" scope, but we haven't pushed the change to our sandbox environment yet).

Can you share the URL that your app is redirecting to, in order to start the launch? That should help us reproduce the issue. (e.g. /authorize?client_id=xxx&scope=xx.....

Thanks,

Josh

@michelemottini
Copy link

Here is the URL with launch in the scope (causing the issue):

https://authorize.smartplatforms.org/authorize?response_type=code&client_id=a8076d0c-d6cc-4bfc-bdf9-3115bb469ace&redirect_uri=http%3A%2F%2Flocalhost%3A50126%2FPublic%2FPDemo%2FPDemo.html&scope=user%2F*.*%20launch

@jmandel
Copy link
Member Author

jmandel commented Feb 7, 2015

Thanks @michelemottini, that helps. The behavior is a bug and we'll fix it.

That said, you shouldn't actually pass the launch scope to the authorize endpoint in this way. Are you trying to launch your app via the "EHR-based launch flow" (i.e. from existing EHR context) or the "Standalone launch flow" (starting from the app, rather than the EHR)?

For the former, you'll need to use the launch id sent by the EHR (e.g. launch:123). For the latter, you only need to provide a launch parameter if you actually want some kind of context for your launch (e.g. for patient context, pass launch/patient). If you don't want any launch context, just omit the parameter.

@michelemottini
Copy link

Thanks @jmandel .

I am implementing a standalone launch flow. It is a patient demographic query app, so it does not need any patient context.

Yes, I am omitting the launch scope now. I realized after the fact that it does not make sense to have it like that, I was just copying blindly from the list of available scopes

@michelemottini
Copy link

The app is now open-sourced here and hosted here

@jmandel
Copy link
Member Author

jmandel commented Feb 9, 2015

Cool! Just tried it from fhir.smartplatforms.org (custom app, App
ID="a8076d0c-d6cc-4bfc-bdf9-3115bb469ace", LaunchURL="
https://demo.careevolution.com/PDemo/PDemo.html").

On Mon, Feb 9, 2015 at 7:22 AM, Michele Mottini notifications@github.com
wrote:

The app is now open-sourced here
https://github.com/CareEvolution/Public/tree/master/PDemo and hosted
here https://demo.careevolution.com/PDemo/PDemo.html

Reply to this email directly or view it on GitHub
#1 (comment)
.

@nschwertner
Copy link
Member

Looks great! The gender filter didn't work for me (returns empty results set for "male" or "female"). Is this DSTU1 or DSTU2 based?

@michelemottini
Copy link

Looks great! The gender filter didn't work for me (returns empty results
set for "male" or "female").

Thanks!
The gender filter has a namespace (system URI) by default - that does not
match the namespace in the db, if you get rid of it in the configuration
the filter will work

CareEvolution/PublicFHIRDemos#5

Is this DSTU1 or DSTU2 based?

DSTU1


Reply to this email directly or view it on GitHub
#1 (comment)
.

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

3 participants