Implement a CDS Hooks appointment-book service that checks prior authorization requirements and formulary coverage before an appointment is confirmed and returns actionable cards
Register the hook service in your discovery endpoint at /.well-known/cds-services returning a services array entry with hook set to appointment-book, and define a prefetch template that requests the draft Appointment resource and the patient's active Coverage resources
In the hook handler, extract the Appointment resource from the context object using the appointments key, identify the service type code and performing provider from the Appointment, and use the patient's Coverage to determine the applicable payer and plan
Query the payer's prior authorization requirements by calling the Da Vinci CRD endpoint or a payer formulary API using the coverage member ID extracted from the prefetched Coverage resource, passing the procedure or service type code from the Appointment
If prior authorization is required, return a CDS Hooks card with indicator warning, a human-readable summary message, and a suggestion object that carries a create action adding a Task resource to the patient chart flagging the prior authorization need
If the service involves a medication with formulary implications, return a separate card with a SMART app link action pointing to a formulary check SMART app, passing the appointment context in the appContext parameter so the app can pre-populate the drug lookup
Include a source object in every card with a label and url pointing to the payer's coverage policy or formulary, so the clinician can review the underlying policy before taking action
Known gotchas
The appointment-book hook fires before the appointment is saved, so the Appointment resource in the context will have a status of proposed; your service must not assume the appointment is confirmed and must not create downstream workflows that depend on a confirmed appointment ID
CDS Hooks requires your service to respond within a timeout defined by the EHR, typically five seconds; prior authorization lookups that require payer API calls must be parallelized or prefetch-cached to avoid exceeding the timeout and having your cards silently dropped
EHRs are not required to display all returned cards or to honor suggestion actions; design the card summary to be independently actionable even if the suggestion is ignored, so the clinician has enough information to take manual action
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