I have a question regarding the appContext passed in the link array of a card. According to the CDS Hooks specification documentation, "
The appContext
field and value will be sent to the SMART app as part of the OAuth 2.0 access token response, alongside the other SMART launch parameters when the SMART app is launched." However, when trying to pass even a simple string in the appContext, nothing comes through as part of the session token response in the SMART app. The link type is 'smart', in accordance with the documentation.
For example, the expected behavior is as follows. The card sent is something like this
cards: [
{
summary: 'summary goes here',
indicator: 'info',
detail: 'detail goes here',
source: {
label: 'some label here',
url: 'some url here',
icon: 'some icon here'
},
links: [
{
label: 'some label here',
type: 'smart',
appContext: 'foo'
}
]
}
]
So when I click the url to launch the SMART app and inspect the request session tokenResponse object, I would expect to see something like this:
tokenResponse:
{ need_patient_banner: true,
smart_style_url: 'https://launch.smarthealthit.org/smart-style.json',
patient: 'smart-1098667',
refresh_token: 'token here',
token_type: 'bearer',
scope: 'openid profile offline_access launch patient/*.*',
expires_in: 3600,
id_token: 'id token here',
access_token: 'access token here', appContext: 'foo' }
Instead I see this:
tokenResponse:
{ need_patient_banner: true,
smart_style_url: 'https://launch.smarthealthit.org/smart-style.json',
patient: 'smart-1098667',
refresh_token: 'token here',
token_type: 'bearer',
scope: 'openid profile offline_access launch patient/*.*',
expires_in: 3600,
id_token: 'id token here',
access_token: 'access token here' }
No appContext. Does anyone have any insight into what I may be doing wrong here?
Thanks!