Receive the DTR SMART app launch context from the CRD card link; extract the launch parameters including the order context and the payer-specific Questionnaire canonical URL
Retrieve the payer's Questionnaire resource (FHIR R4 Questionnaire with DTR extensions) from the payer's FHIR endpoint using the canonical URL; the Questionnaire contains CQL expressions in 'cqf-expression' extensions on each item
Fetch the referenced CQL Library resources linked in the Questionnaire's 'cqf-library' extension; compile the CQL and prepare the terminology and data access layer using the patient's FHIR data from the EHR
Execute each CQL expression against the EHR FHIR data for the patient and encounter context; populated answers auto-fill the corresponding QuestionnaireResponse items
Present unfilled items to the clinician for manual completion; validate the completed QuestionnaireResponse against the Questionnaire constraints (required items, answer value sets)
Store the completed QuestionnaireResponse on the EHR FHIR server and attach it to the order or task; optionally submit it to the payer's PAS endpoint as a supporting document for the prior authorization
Known gotchas
CQL libraries referenced by the Questionnaire may use value sets that require a terminology server; if your CQL engine cannot resolve value set expansion at runtime, CQL expressions will fail silently or return null, leaving items blank
DTR requires the SMART app to access both the payer's FHIR endpoint (for Questionnaire/Library) and the EHR's FHIR endpoint (for patient data); the app must manage two separate authorization contexts simultaneously
Payer-authored CQL may reference data elements that are not populated in every EHR (e.g., specific Observation codes or DocumentReference categories); test with representative patient records to identify which items will consistently require manual entry
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp