work-with-cds-hooks

Implement CDS Hooks services in Rust using typed hook contexts and protocol models.

51|19|Updated Jan 4, 2025
One-click install
npx skills add https://github.com/HeliosSoftware/hfs --skill work-with-cds-hooks-heliossoftware
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: work-with-cds-hooks
Source: https://github.com/HeliosSoftware/hfs/tree/main/.agents/skills/work-with-cds-hooks
Command: npx skills add https://github.com/HeliosSoftware/hfs --skill work-with-cds-hooks-heliossoftware

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building HL7 CDS Hooks services requires correctly modeling the protocol's request/response types, hook contexts, and card structures, which is error-prone when done by hand. This Skill guides work in the helios-cds-hooks Rust crate, which provides complete protocol types and compile-time validated hook contexts. ## Core Features & Use Cases - Complete protocol types: Request, response, discovery, Card, Suggestion, Action, Link, and Feedback models with full serde support, conforming to CDS Hooks v3.0.0-ballot. - Strongly-typed hook contexts: Compile-time validated contexts for standard hooks such as patient-view, order-select, order-sign, encounter-start, and appointment-book. - Service trait and builders: Implement the CdsHooksService async trait with card/response builder helpers, framework-agnostic for Axum, Actix, and others. - Use Case: Build a clinical decision support service that returns suggestion cards when a clinician opens a patient chart, by implementing CdsHooksService with a PatientViewContext. ## Quick Start Ask the AI to implement a CdsHooksService for the patient-view hook in the helios-cds-hooks crate that returns a greeting card.

Frequently Asked Questions about work-with-cds-hooks

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement a CDS Hooks service in Rust?▼

Implement the CdsHooksService async trait from the helios-cds-hooks crate, setting the associated Context type to a typed hook context like PatientViewContext. Provide a definition returning hook, id, title, and description, then handle requests returning cards.

What CDS Hooks are supported by helios-cds-hooks?▼

The crate provides strongly-typed contexts for patient-view, order-select, order-sign, encounter-start, encounter-discharge, appointment-book, order-dispatch, allergyintolerance-create, medication-refill, and problem-list-item-create, each with a HOOK_NAME constant.

Does helios-cds-hooks work with Axum or Actix web frameworks?▼

Yes, the library is framework-agnostic and works with Axum, Actix, or other Rust HTTP frameworks. You mount CdsHooksService implementations in a router exposing GET /cds-services for discovery and POST /cds-services/{id} per service.

Is the CDS Hooks library integrated into the hfs FHIR server?▼

No, helios-cds-hooks is a standalone protocol library and is not currently wired into the hfs server. You must expose services yourself by mounting them in an HTTP router with discovery and invocation endpoints.

How are CDS Hooks errors mapped to HTTP status codes?▼

The CdsHooksError type provides a status_code() method that maps error variants to appropriate HTTP status codes. Use this when returning errors from your service handler to produce correct HTTP responses.