EHR launched SMART on FHIR app that identifies provider authored imaging reports and uses lexical logic to find paired pathology reports. Allows for easy correlation of imaging findings to their subsequent biopsy proven pathology reports. A tool to help radiologists better understand the accuracy of their reads.
- Create an account in MELD
- Spin up an R4 sandbox.
- Upload application specs from the RadCheck application manifesto found in the sample-data folder. Deselect the Patient Scoped App option. Paste the client ID into the config.json file.
- Upload test patients from the rad path test bundle found in the sample-data folder.
- Start the app locally (see below).
- Launch the RadCheck app from within MELD. Select a provider. Select Launch without a patient.
A modern React implementation of a SMART on FHIR application demonstrating the EHR launch flow for provider-facing clinical applications. Note that this implementation is completely client-side and can be hosted on any static file server.
Healthcare providers need applications that seamlessly integrate with their Electronic Health Record (EHR) systems. This repository demonstrates how to build a SMART on FHIR app that:
- Launches from within an EHR: Providers can access the app directly from their EHR workflow without separate logins
- Maintains clinical context: Automatically receives the current patient and encounter information from the EHR
- Handles secure authentication: Implements the OAuth 2.0 flow with PKCE (Proof Key for Code Exchange) for enhanced security
- Manages token lifecycle: Includes token refresh functionality to maintain sessions without re-authentication
I've provided two example deployments for testing: smart-provider-ehr-launch-app-epic.foureighteen.dev and smart-provider-ehr-launch-app-cerner.foureighteen.dev.
Note that clicking on these links will not work directly - they need to be launched from the SMART App Launcher or a compatible EHR environment. This means you'll need configure a Cerner or Epic sandbox account first, and use the above links as the launch URL in the SMART App Launcher.
This app implements the SMART App Launch Framework EHR launch sequence:
- EHR initiates launch: The EHR launches the app with
iss(FHIR server URL) andlaunch(opaque identifier) parameters - App discovers endpoints: Uses the FHIR server's
.well-known/smart-configurationto find OAuth endpoints - Authorization request: Redirects to the EHR's authorization server with:
- Client ID
- Requested scopes (patient/*.read, launch, openid, etc.)
- PKCE code challenge for security
- Launch context from the EHR
- Authorization response: EHR redirects back with an authorization code
- Token exchange: App exchanges the code for access and refresh tokens
- API access: App can now make FHIR API calls with the access token
- TypeScript & React: Built with modern tooling for type safety and developer experience
- PKCE Security: Implements Proof Key for Code Exchange to prevent authorization code interception
- Token Management: React Context-based token storage with automatic expiry tracking
- Refresh Token Support: Refreshes expired tokens to maintain user sessions
Tested with:
- SMART App Launcher - Reference implementation
- Cerner's Code Console Sandbox
- Epic's SMART on FHIR Sandbox (Must be logged in to see)
- HL7 SMART App Launch - Official specification
- Cerner's SMART on FHIR Tutorial - Implementation guide (outdated, but useful for context)
- Node.js 22+ and npm
- Access to the (SMART Launcher or an account with either Cerner Code Console) or Epic UserWeb
npm installEdit src/environment/config.json to configure your app:
{
"CLIENT_ID": "your-client-id", // This is a PUBLIC client ID, meant to be used in untrusted clients like web browsers
"BASE_URL": "http://localhost:5173",
"STORAGE_TYPE": "local", // or "session"
"SMART_SCOPES": [
"launch",
"fhirUser",
"profile",
"openid",
"patient/*.rs",
"user/*.rs",
"online_access"
],
"STORAGE_KEYS": {
"OAUTH_STATE": "oauth2-state",
"CODE_VERIFIER": "code-verifier",
"TOKEN_DATA": "token-data",
"AUTHORIZATION_URL": "authorization-url",
"TOKEN_URL": "token-url",
"FHIR_BASE_URL": "fhir-base-url"
}
}npm run devThis starts the development server at http://localhost:5173/.
You can test the app on localhost using the SMART App Launcher
- Go to SMART App Launcher
- Select a patient and practitioner
- Enter your app's launch URL:
http://localhost:5173/auth/smart/login - Click "Launch"
The app will receive the launch parameters and guide you through the OAuth flow.
You can register your app with Cerner's Code Console:

Here are settings you can use to configure your app. Note that we use the live demo url here, but you can replace it with the localhost URL if you want to test locally.


