Patient Red Flags & Emergency Safety Checker
check_red_flagsScreens a patient consultation envelope for acute emergencies, critical drug interactions, treatment conflicts, and missing mandatory data before clinical action.
Instructions
Evaluates a patient clinical consultation envelope against multi-layered safety guardrails, detecting acute life-threatening emergencies, critical drug-drug interactions, inter-skill treatment conflicts, and missing mandatory data.
When to use:
Screening clinical consultation envelopes for acute medical emergencies, vital sign decompensation, red flags, or contraindicated treatment plans.
When NOT to use:
Computing specific numerical clinical risk scores like CHA2DS2-VA or eGFR (use calculate_clinical_score instead).
Screening isolated medication lists without patient context (use check_drug_interactions instead).
Redacting patient identifiers or personal health information (use scrub_phi instead).
Managing longitudinal patient records or EHR persistence (use external FHIR/EHR systems instead).
Parameter constraints & formats:
'envelope': Consultation payload structured as:
patient_id: Anonymized audit tracking ID (e.g. 'PT-8921').
demographics: Evaluates age-stratified risks, biological sex, and pregnancy contraindications.
observations: Presenting symptoms scanned for acute emergency triggers.
active_medications: Current medications evaluated for critical co-prescribing DDIs.
vital_signs: Screened against clinical shock, sepsis, and vital decompensation thresholds.
proposed_plan: Proposed intervention cross-checked against clinical contraindications.
Behavioral guarantees & return states:
Deterministic evaluation pipeline sequentially checking acute emergencies, critical DDIs, missing data, and treatment conflicts.
Auth & limits: Fully local execution; requires no API keys, credentials, or network auth, with zero rate limits.
Verdict outcomes: gate_status returns 'PASSED_PROCEED', 'SAFE_ABSTENTION_EMERGENCY_ESCALATION' (with immediate emergency redirection and contacts), or 'SAFE_ABSTENTION_DATA_DEFICIT'. Missing vitals safely trigger data deficit status without throwing uncaught exceptions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| envelope | Yes | Standardized clinical consultation envelope containing patient context, vital signs, lab observations, active medications, and proposed recommendations. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| timestamp | Yes | ISO 8601 execution timestamp of the safety check. | |
| verdict_id | Yes | Unique cryptographic audit tracking identifier for the safety verdict. | |
| action_plan | Yes | Structured immediate management plan with patient-safe wording and clinician summary. | |
| gate_status | Yes | Overall safety outcome. | |
| governance_banner | Yes | Mandatory clinical governance advisory banner. | |
| red_flags_detected | Yes | List of triggered acute red flags with severity and escalation targets. | |
| inter_skill_conflicts | No | Cross-specialty contradictory treatment plans (e.g. anticoagulation in active bleeding). | |
| provenance_violations | No | Data provenance boundary violations or unverified claims. | |
| critical_ddis_detected | Yes | List of severe or fatal drug-drug interactions detected across active medications. | |
| missing_mandatory_data | Yes | Mandatory demographic or clinical data fields absent from the patient envelope. |