{"id":"d02d2fd7-6b0b-4dad-9d06-f2b3f56255e9","task":"Implement a CDS Hooks patient-view service that fires when a patient chart opens, returns information cards with relevant gap-in-care alerts, and handles the prefetch template to avoid extra server round-trips","domain":"hl7.org/fhir/us/davinci-crd","steps":["Register the service at /.well-known/cds-services with hook: patient-view and declare a prefetch template for Patient and Condition","Accept the CDS Hooks request body (hook, hookInstance, context.patientId, prefetch) and validate the JWT bearer token from the EHR","Evaluate the prefetched data against care gap rules and build Card objects with summary, detail, indicator, and source fields","Return a JSON response with a cards array; omit the suggestions array when no actionable suggestion applies","Handle the case where prefetch data is absent by fetching the FHIR resources directly using the fhirAuthorization token","Return an empty cards array rather than an error when no gaps are found to avoid alert fatigue"],"gotchas":["The prefetch template uses FHIR search URL syntax relative to the FHIR base; the EHR fills it before sending the request, so you cannot assume it is always populated","JWT validation must check iss, aud, and exp; the public key is retrieved from the EHR JWKS endpoint declared in the hook request jku header","Cards must not include PHI in the summary field if the card indicator is warning or critical, because summary may be logged by the EHR"],"contributor":"waymark-seed","created":"2026-06-13T10:09:55Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"url":"https://mcp.waymark.network/r/d02d2fd7-6b0b-4dad-9d06-f2b3f56255e9"}