Skip to content

Commit d677c25

Browse files
committed
update readme scopes related text to reflect smart app v2 scopes per AC.
1 parent d13d9e9 commit d677c25

1 file changed

Lines changed: 36 additions & 21 deletions

File tree

readme.md

Lines changed: 36 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -215,29 +215,44 @@ app.get('api/bluebutton/callback', async (req: Request, res: Response) => {
215215
// Check the scope of the current access token:
216216
const scopes: string[] = authToken.scope;
217217
// iterate scope entries here or check if a permission is in the scope
218-
if (authToken.scope.index("patient/Patient.read") > -1) {
219-
// patient info access granted
218+
if (authToken.scope.index("patient/Patient.r") > -1) {
219+
// patient read access (patient/Patient.r) granted,
220+
// similarly can check patient search permission: patient/Patient.s, or
221+
// patient read and search permission: patient/Patient.rs
220222
}
221223

222-
/**
223-
* 1. Access token scope with demographic info:
224-
*
225-
* scope: [
226-
* "patient/Coverage.read",
227-
* "patient/ExplanationOfBenefit.read",
228-
* "patient/Patient.read",
229-
* "profile",
230-
* "openid",
231-
* ]
232-
*
233-
* 2. Access token scope without demographic info:
234-
*
235-
* scope: [
236-
* "patient/Coverage.read",
237-
* "patient/ExplanationOfBenefit.read",
238-
* "openid",
239-
* ]
240-
*/
224+
/** Example scopes (SMART App v2 scopes)
225+
*
226+
* 1. Access token scope with demographic info:
227+
*
228+
* scope: [
229+
* "profile",
230+
* "openid",
231+
* "patient/Patient.r",
232+
* "patient/Patient.s",
233+
* "patient/Patient.rs",
234+
* "patient/ExplanationOfBenefit.r",
235+
* "patient/ExplanationOfBenefit.s",
236+
* "patient/ExplanationOfBenefit.rs",
237+
* "patient/Coverage.r",
238+
* "patient/Coverage.s",
239+
* "patient/Coverage.rs",
240+
* "launch/patient",
241+
* ]
242+
*
243+
* 2. Access token scope without demographic info:
244+
*
245+
* scope: [
246+
* "openid",
247+
* "patient/ExplanationOfBenefit.r",
248+
* "patient/ExplanationOfBenefit.s",
249+
* "patient/ExplanationOfBenefit.rs",
250+
* "patient/Coverage.r",
251+
* "patient/Coverage.s",
252+
* "patient/Coverage.rs",
253+
* "launch/patient",
254+
* ]
255+
*/
241256

242257
// Data flow: After access granted,
243258
// your app logic can fetch the beneficiary's data in specific ways.

0 commit comments

Comments
 (0)