CRD
The Payerbox CRD implementation enables real-time communication between EHR systems and payers to determine documentation and prior authorization requirements at the point of care. Built on the HL7 Da Vinci Coverage Requirements Discovery Implementation Guide.
When combined with DTR and PAS, CRD ensures providers are informed of coverage requirements early in the workflow, reducing claim denials and improving the authorization process.
Payerbox implements Da Vinci CRD STU 2.0.1. See Compliance / CMS-0057 for the regulatory context.
How CDS Hooks work in CRD
CRD uses CDS Hooks 2.0 to invoke Payerbox at clinically meaningful workflow events. All hooks follow the same processing pipeline:
- Receive Hook Request — EHR sends a CDS Hooks request (e.g.,
order-sign,order-select) with context data and prefetch resources. - Validate request structure — request body validated against the CDS Hooks schema.
- Validate FHIR resources —
draftOrdersandprefetchresources validated against Aidbox. - Persist resources — the validated request-side resources are persisted to Aidbox for audit and reference.
- Fetch missing resources — references not present in
prefetchare fetched recursively from the EHR'sfhirServerusingfhirAuthorization, then merged into the request's prefetch map for the decision call (not persisted). - Proxy to the Decision Service — the enriched request is forwarded to the Decision Service (external to Payerbox), which returns Cards with coverage requirements, documentation needs, or prior-authorization information.
Decision Service
The decision-making service is external to Payerbox — the payer operates it and configures its URL via:
CDS_DECISION_SERVICE_URL=https://your-decision-service.example.com
The service holds the payer's coverage rules: medical policy, formulary tiers, network status, member benefits. Payerbox does not ship these rules.
For a complete local setup example, see Quickstart: Run locally.
Required headers
Operators can require specific HTTP headers on every inbound hook request via a comma-separated allowlist. When any listed header is missing or blank, Payerbox rejects the request with 400 and an OperationOutcome before reaching the Decision Service. Discovery (GET /cds-services) is not gated — only hook POSTs.
CDS_REQUIRED_HEADERS=x-client-id
Header names are case-insensitive. Default (unset) — no header validation, requests pass through.
Enabled hooks
To advertise only a subset of the supported hooks — useful while the upstream Decision Service is implementing CRD incrementally — operators can pass a comma-separated allowlist of hook ids. When set, GET /cds-services returns only the listed ids and POST /cds-services/<other-id> returns 404 with an OperationOutcome.
CDS_ENABLED_HOOKS=order-sign-crd,order-select-crd
Valid ids are order-sign-crd, order-select-crd, order-dispatch-crd, appointment-book-crd; matching is case-insensitive. Default (unset) — all four hooks are exposed.
Supported hooks
| Hook | When it fires | Reference |
|---|---|---|
order-sign | A clinician is about to sign one or more orders | CDS Hooks spec |
order-select | A clinician selects orders from a list (pre-sign) | CDS Hooks spec |
order-dispatch | Orders are dispatched to a specific performer | CDS Hooks spec |
appointment-book | An appointment is being scheduled | CDS Hooks spec |
The full list of services exposed by Payerbox is returned by GET /cds-services.
Authentication
CRD CDS Hooks endpoints use SMART Backend Services Authorization. The payer admin provisions Client credentials per EHR integration. The EHR may also include fhirAuthorization (OAuth bearer token) in each hook request, used by Payerbox to call back into the EHR's FHIR endpoint when prefetch is incomplete.
See API Reference / Authentication for the onboarding and token exchange flow.
Example
A typical order-sign interaction:
POST /cds-services/order-sign-crd
Content-Type: application/json
Accept: application/json
{
"hook": "order-sign",
"hookInstance": "d1577c69-dfbe-44ad-ba6d-3e05e953b2ea",
"context": {
"userId": "PractitionerRole/123",
"patientId": "1288992",
"draftOrders": {
"resourceType": "Bundle",
"entry": [
{ "resource": { "resourceType": "MedicationRequest", "id": "mr-103", "status": "draft", "intent": "order" } }
]
}
}
}
{
"cards": [
{
"summary": "Prior Authorization required for this medication",
"detail": "Follow the attached link for documentation.",
"indicator": "warning",
"source": { "label": "CRD Decision Service" },
"links": [
{ "label": "Launch DTR to complete Questionnaire", "url": "https://dtr.example.org/launch", "type": "smart" }
]
}
]
}
Full Context tables, Request Parameters, and per-hook examples: order-sign, order-select, order-dispatch, appointment-book.