FHIR Client for patient portal.

33 views
Skip to first unread message

Yuri Fukuda

unread,
Jul 3, 2025, 4:55:45 PMJul 3
to SMART on FHIR
Hello, 

I'm using fhirclient's  oauth2 functions.

I'm looking at iframe solution.
I want to show "Patient Login" with the popup
with password field where patient can enter. 

https://github.com/smart-on-fhir/client-js-examples/blob/master/browser/static/frame.html


But I'm getting "Select Patient" Looks like this is a Provider portal. 

Options that I pass is this. 

```
FHIR.oauth2.authorize({
redirectUri: <redirect URL here>,
clientId: 'whatever',
target: openPopup,
scope: 'launch launch/patient offline_access fhirUser profile user/*.* patient/*.*',
});

```

I want to show something like below in the iframe. 
https://launch.smarthealthit.org/ehr?app=https%3A%2F%2Flaunch.smarthealthit.org%2Fsample-app%2Flaunch%3Fiss%3Dhttps%253A%252F%252Flaunch.smarthealthit.org%252Fv%252Fr4%252Ffhir%26launch%3DWzEsIiIsIiIsIkFVVE8iLDAsMCwxLCIiLCIiLCIiLCIiLCIiLCIiLCIiLDAsMSwiIl0

Scope and Launch context in this link seems 404. 
https://docs.smarthealthit.org/authorization 

Does anyone know proper scope for Patient Login? 

Thanks in advance, 

Yuri


Jason Salsiccia

unread,
Jul 8, 2025, 12:18:51 PMJul 8
to SMART on FHIR
Hi Yuri,

I'm not familiar with this client, but it seems like you are attempting a standalone launch workflow here.   Try removing the launch/patient scope.  This scope is meant to instruct the EHR to establish patient context and because you are doing a standalone launch, the EHR can only do that by showing a patient picker.

- jason

Yuri Fukuda

unread,
Jul 10, 2025, 10:37:27 AMJul 10
to Jason Salsiccia, SMART on FHIR
Hi Jason, Thanks for the input, 

But if. i remove launch/patient

It now shows the error -  "patient" parameter is required. 


Current code is 

```
redirectUri: redirectUri,
clientId: 'whatever',
target: openPopup as any,
scope: 'launch offline_access fhirUser profile user/*.* patient/*.*',
});
```
Screenshot 2025-07-10 at 10.36.09 AM.png


--
You received this message because you are subscribed to the Google Groups "SMART on FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smart-on-fhi...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/smart-on-fhir/65243ffd-ace4-4250-8de0-f15a7df9d993n%40googlegroups.com.

Yuri Fukuda

unread,
Jul 10, 2025, 11:59:46 AMJul 10
to Jason Salsiccia, SMART on FHIR
Update! I figured it was base64 version of 
including 
{"k":"1"}
So the working version will be 
```
      FHIR.oauth2.authorize({
        iss: 'https://launch.smarthealthit.org/v/r4/sim/eyJrIjoiMSJ9/fhir',

        redirectUri: redirectUri,
        clientId: 'whatever',
        target: openPopup as any,
        scope: '*/*.read openid fhirUser offline_access launch/patient',
      });
 ```

Thanks for the support anyways!

Jason Salsiccia

unread,
Jul 10, 2025, 12:45:56 PMJul 10
to Yuri Fukuda, SMART on FHIR
Glad to see it working!
Reply all
Reply to author
Forward
0 new messages