Skip to content

Launch Context ​

Launch Context management configures SMART App Launch context parameters per user. These values are injected into access tokens as claims, enabling SMART apps to receive patient, encounter, and other context on launch.

Accessing ​

Navigate to SMART Config in the admin sidebar, then select the Launch Context tab. The tab has three nested views:

Context Overview ​

Displays all users who have launch context attributes configured, showing:

  • Username and user ID
  • Assigned fhirUser reference
  • Patient and encounter in context
  • Additional context (intent, tenant, fhirContext)

Template Library ​

Pre-built launch context templates for common clinical workflows:

  • EHR Launch with Patient -- sets patient context for EHR-launched apps
  • Standalone Patient Access -- configures patient self-access context
  • Practitioner with Encounter -- sets both patient and encounter context
  • Custom templates for specific workflow needs

User Contexts ​

Configure launch context attributes for individual users:

Core SMART Context Attributes ​

AttributeToken ClaimDescription
fhirUserfhirUserFHIR resource representing the user (e.g., Practitioner/123, Patient/456)
PatientpatientPatient ID in context for patient-scoped launches
EncounterencounterEncounter ID in context
fhirContextfhirContextArray of FHIR resource references providing additional context

Extended Attributes ​

AttributeToken ClaimDescription
Intentsmart_intentWorkflow intent string (e.g., reconcile-medications, order-sign)
Need Patient Bannersmart_need_patient_bannerWhether the app should display a patient identification banner
Style URLsmart_style_urlURL to CSS stylesheet for app branding
Tenantsmart_tenantTenant identifier for multi-tenant deployments

API Endpoints ​

MethodEndpointDescription
GET/admin/launch-contexts/List all users with launch context
POST/admin/launch-contexts/:userId/fhir-user/:fhirUserIdSet fhirUser for a user
POST/admin/launch-contexts/:userId/patient/:patientIdSet patient context
POST/admin/launch-contexts/:userId/encounter/:encounterIdSet encounter context
POST/admin/launch-contexts/:userId/fhir-contextSet fhirContext array
DELETE/admin/launch-contexts/:userId/fhir-userRemove fhirUser
DELETE/admin/launch-contexts/:userId/patientRemove patient context
DELETE/admin/launch-contexts/:userId/encounterRemove encounter context
DELETE/admin/launch-contexts/:userId/fhir-contextRemove fhirContext
PUT/admin/launch-contexts/:userId/intentSet intent
PUT/admin/launch-contexts/:userId/need-patient-bannerSet need_patient_banner
PUT/admin/launch-contexts/:userId/smart-style-urlSet style URL
PUT/admin/launch-contexts/:userId/tenantSet tenant
DELETE/admin/launch-contexts/:userId/intentRemove intent
DELETE/admin/launch-contexts/:userId/need-patient-bannerRemove need_patient_banner
DELETE/admin/launch-contexts/:userId/smart-style-urlRemove style URL
DELETE/admin/launch-contexts/:userId/tenantRemove tenant

How It Works ​

Launch context values are stored as Keycloak user attributes. When a user authenticates and receives a token, Keycloak's SMART scope mappers read these attributes and inject them as token claims. SMART apps then receive these claims in the token response or via introspection.

For example, setting patient=Patient/123 for a user means any SMART app launched with launch/patient scope will receive "patient": "Patient/123" in the token response.

See Scope Management for configuring the SMART scope mappers that read these attributes.

Proxy Smart — Healthcare Interoperability Platform