Implement a CDS Hooks order-sign service that returns a system-action suggestion to automatically add a monitoring lab order when a high-risk medication is signed
Register the hook service with hook type order-sign and define a prefetch template that retrieves the patient's current MedicationRequest resources and most recent relevant laboratory Observation resources to avoid redundant monitoring order placement
In the hook handler, extract the draftOrders Bundle from the hook context and examine each MedicationRequest resource in the bundle for medication codes matching your high-risk medication list, using RxNorm or NDC codes to identify the trigger medications
For each trigger medication found, check the prefetched Observation resources to determine whether a monitoring lab has been ordered or resulted within the required monitoring interval; skip card generation if recent monitoring is already present
Construct a CDS Hooks card with a system-actions array containing one action with type create and a FHIR ServiceRequest resource as the resource payload, specifying the monitoring lab order with appropriate LOINC order code, intent, and subject reference
Set the card indicator to warning and write a clear summary explaining which medication triggered the monitoring requirement and what the monitoring parameter is, so the clinician can understand the automated action before accepting or overriding it
Implement the CDS Hooks feedback endpoint to receive override reason codes when clinicians dismiss the card, and log the override to support retrospective quality review and rule refinement
Known gotchas
System-action suggestions in order-sign are automatically applied by EHRs that support them without requiring clinician confirmation; verify that the EHR's CDS Hooks implementation correctly prompts for confirmation or applies the action silently before deploying to avoid unintended order creation
The draftOrders Bundle in order-sign context may contain multiple MedicationRequests when the clinician is signing a batch of orders; iterating only the first resource will miss monitoring requirements triggered by other orders in the batch
A system action that creates a ServiceRequest will generate a monitoring order in the patient's chart immediately on card acceptance; if the monitoring lab has already been ordered by another provider in a different session, the automated creation results in a duplicate order
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