Care Gap Detection & Advocacy Models
Relevant source files
The following files were used as context for generating this wiki page:
- artifacts/api-server/src/intelligence/hospice/careGapModel.ts
- artifacts/api-server/src/intelligence/hospice/escalationCoaching.ts
- artifacts/api-server/src/intelligence/hospice/redFlags.ts
- artifacts/api-server/src/routes/anthropic/systemPrompt.ts
- artifacts/api-server/src/intelligence/hospice/documentationCoach.ts
- attached_assets/Pasted-Build-the-next-major-intelligence-architecture-for-Hosp_1774852812580.txt
The Care Gap Detection & Advocacy Models represent a critical layer of the Hospice Roadmap intelligence architecture designed to identify deficiencies in professional hospice care and empower caregivers to advocate for appropriate support. Unlike standard clinical educational tools, these models focus on recognizing when service delivery fails to meet expected standards—such as delayed callbacks, poor symptom management, or inadequate equipment delivery—and providing structured communication scripts and documentation guidance to resolve these gaps.
Sources: attached_assets/Pasted-Build-the-next-major-intelligence-architecture-for-Hosp_1774852812580.txt, artifacts/api-server/src/routes/anthropic/systemPrompt.ts:792-796
Architecture Overview
The system operates as part of a layered intelligence engine that processes user input and patient context to identify "Care Gap Signals." These signals are used by the AI planner to inject specific advocacy grounded context into the model's response.
System Components
| Component | Responsibility |
|---|---|
| Care Gap Model | Identifies specific types of service failure (e.g., symptom management gaps, equipment delays). |
| Red Flags | Defines critical scenarios requiring immediate escalation to hospice or emergency services. |
| Escalation Coaching | Provides the user with specific scripts and logical steps for navigating difficult conversations with hospice staff. |
| Documentation Coach | Teaches users how to log clinical data and service failures to build a factual foundation for advocacy. |
Sources: attached_assets/Pasted-Build-the-next-major-intelligence-architecture-for-Hosp_1774852812580.txt, replit.md
Care Gap Detection Logic
The intelligence engine monitors for specific CareGapType signals within user messages or patient history. These signals trigger specialized guidance on what "good" support should look like versus the current experience.
Recognized Care Gap Types
- Poor Education/No Preparation: Failure to explain the dying process or equipment use.
- Communication Gaps: Delayed callbacks or vague after-hours support.
- Clinical Gaps: Inadequate symptom management or comfort kit confusion.
- Logistical Gaps: Equipment delivery delays or supply shortages.
- Emotional Abandonment: Family feels abandoned during critical transitions or time of death.
Sources: attached_assets/Pasted-Build-the-next-major-intelligence-architecture-for-Hosp_1774852812580.txt, artifacts/api-server/src/routes/anthropic/systemPrompt.ts:792-796
The diagram above illustrates how the system transitions from standard clinical guidance to an advocacy-focused response when a care gap signal is detected.
Advocacy and Escalation Coaching
When a gap is detected, the system provides "Escalation Coaching." This involves teaching the user how to communicate effectively with medical professionals using structured formats like SBAR (Situation, Background, Assessment, Recommendation).
Advocacy Scripting (SBAR)
The AI assistant is instructed to generate ready-to-read scripts for caregivers to use when calling hospice. These scripts ensure that the caregiver provides factual, clinical information that is difficult for providers to dismiss.
This sequence shows the intended intervention of the AI to bridge the communication gap between the caregiver and the professional team.
Sources: artifacts/api-server/src/routes/anthropic/systemPrompt.ts:768-790, artifacts/api-server/src/intelligence/hospice/escalationCoaching.ts
Documentation as Advocacy
A core pillar of the advocacy model is the Documentation Coach. It provides specific instructions on how to track data to prevent service failures or to support a formal complaint.
Key Documentation Areas
- Symptom Logs: Tracking severity (0-10), medication given, and response time.
- Call Logs: Recording dates, times, names of staff, and promised actions.
- Decline Logs: Documenting physical changes (e.g., mottling) to justify higher levels of care.
- Care Failures: Explicitly logging missed visits or delayed callbacks for formal reporting.
Sources: artifacts/api-server/src/intelligence/hospice/documentationCoach.ts:1-68
Documentation Guide Structure
export interface DocumentationGuide {
situation: string;
tags: string[];
whatToDocument: string[];
howToOrganize: string;
exampleEntry: string;
whyItMatters: string;
}
Sources: artifacts/api-server/src/intelligence/hospice/documentationCoach.ts:3-10
Red Flags and Safety Logic
The model includes a "Red Flag" system that bypasses standard advocacy if the situation is physically dangerous. In these cases, the system is instructed to lead with immediate urgency.
| Urgency Level | Criteria | Required Action |
|---|---|---|
| Critical | Choking, major bleeding, or caregiver emergency. | Instruct to call 911 immediately. |
| Urgent | Uncontrolled pain, sudden breathing changes, or equipment failure. | Instruct to call the hospice on-call line immediately. |
Sources: artifacts/api-server/src/intelligence/hospice/redFlags.ts, artifacts/api-server/src/routes/anthropic/systemPrompt.ts:742-756
Summary
The Care Gap Detection & Advocacy Models transition the Hospice Roadmap from a passive educational app to an active expert system. By identifying clinical and service deficiencies and providing caregivers with structured documentation and communication tools, the system ensures that the patient’s rights and comfort remain the priority, even when professional services falter. This model is grounded in the "What Matters Most" framework, ensuring every advocacy step is tied directly to the patient's recorded goals of care.
Sources: artifacts/api-server/src/routes/anthropic/systemPrompt.ts:792-815, attached_assets/Pasted-Build-the-next-major-intelligence-architecture-for-Hosp_1774852812580.txt