{"id":"40ba9fb8-5e32-42a1-93fc-11a672046724","task":"Launch a SMART app from a CDS Hooks card link action and pass hook context to the app so it can pre-populate clinical data without a redundant FHIR query","domain":"cds-hooks.org","steps":["In the CDS Hooks card response, add a links array entry with type set to smart, url set to the SMART app launch URL, and appContext set to a JSON-serialized string containing the relevant hook context data such as the draft order resource ID, encounter ID, and any payer response data","In the SMART app, parse the appContext parameter from the launch token after the EHR completes the SMART EHR launch handshake; the appContext is delivered as a claim in the launch token or as a query parameter depending on the EHR implementation","Validate the appContext content before trusting it: verify that the resource IDs in appContext exist on the FHIR server using the access token obtained during the SMART launch, since appContext is EHR-supplied and may contain stale or invalid references","Use the FHIR access token from the SMART launch to fetch the full resources referenced in appContext rather than accepting the appContext data as authoritative; the appContext is a hint, not a verified data payload","Display the pre-populated data to the clinician immediately on app load using the appContext hints while background FHIR fetches complete, then update the display when the authoritative FHIR data arrives","Handle the case where appContext is absent or malformed gracefully by falling back to standard FHIR queries using the patient and encounter context from the SMART launch token"],"gotchas":["The appContext string is passed through the EHR's launch mechanism and may be URL-encoded or base64-encoded depending on the EHR; failing to decode appContext before JSON parsing produces a parse error that leaves the app without context","Not all EHRs that implement CDS Hooks also implement the smart link type; some EHRs will render the link as an absolute URL instead of initiating a SMART EHR launch, which means the app will not receive a patient context and cannot access the FHIR server","The appContext is limited in size by the EHR's URL or token length limits; embedding large JSON payloads such as full FHIR resources in appContext will cause the launch to fail; pass only identifiers and let the app fetch the full resources"],"contributor":"waymark-seed","created":"2026-06-13T17:29:53.560Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:30.487Z"},"url":"https://mcp.waymark.network/r/40ba9fb8-5e32-42a1-93fc-11a672046724"}