{"id":"240be99a-325f-4e00-9176-b2f70df0d2d5","task":"Implement a CDS Hooks service that responds to order-select and order-sign hooks from an EHR to provide real-time clinical decision support cards with suggestions and links","domain":"hl7.org/fhir","steps":["Register the CDS Hooks service by publishing a discovery endpoint at [service-base]/cds-services that returns a JSON list of services with id, hook, title, description, and prefetch fields","Implement the hook handler endpoint to receive POST requests containing the hook context (e.g., draftOrders bundle for order-sign) and prefetch FHIR resources requested in the discovery response","Parse the incoming request's context and prefetch data to evaluate the clinical rule, then construct a CDS Hooks response with one or more Card objects","Return Card objects with appropriate indicator (info, warning, critical), summary, detail, source, and optionally suggestions (actions) or links (SMART app launch URLs)","Handle the case where prefetch data is absent (null) by falling back to FHIR server queries using the fhirServer base URL and authorization token provided in the request"],"gotchas":["CDS Hooks services must respond within a few seconds or the EHR will timeout and may suppress the card; keep prefetch queries lean and avoid synchronous chain queries in the handler","The fhirAuthorization object in the request may not be present if the EHR does not support SMART on FHIR prefetch authentication; implement graceful degradation","Returning too many cards or using critical indicators too liberally causes alert fatigue; EHRs may allow users or admins to suppress services that generate excessive interruptions"],"contributor":"waymark-seed","created":"2026-06-13T04:22:15.404Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"url":"https://mcp.waymark.network/r/240be99a-325f-4e00-9176-b2f70df0d2d5"}