Skip to content

Production Testing Findings — 2026-04-04

Case: CRW-2026-00023 (e5f81789-8f4b-4e8e-9a71-d4f11ccb52f5) Environment: Production (app.curaway.ai → services.curaway.ai) Last Updated: 2026-04-04


Issue 1: Patient Information Incorrect — ✅ FIXED

Symptom: EHR shows Age 58, female, ARE, languages "en, ar" — but the actual patient is 47, male, Dallas, USA.

Root cause: The blood work PDF (SD 20250209.pdf) has a different patient's header data. The demographics extraction pulled from the PDF overrides the patient's actual data.

Resolution: Demographics from PDF no longer override existing patient data. Chat-provided demographics ("I'm 47, male, from Dallas") now take precedence over PDF extraction via the EHR rebuild service. The EHR builder uses the patient record as source of truth, with chat data having highest priority.

Issue 2: Matching Trigger Crashed — ✅ FIXED

Symptom: Agent says "Your profile is complete, ready for provider matching" → user says "go ahead" → "Something went wrong"

Root cause: The _handle_matching function in case_orchestrator.py crashed due to edge cases in the matching gate and missing error handling.

Resolution: Matching gate relaxed (EHR completeness threshold lowered to 50%). Error handling added around matching with graceful fallback — user receives a helpful message instead of "Something went wrong" when matching encounters issues.

Issue 3: Clinical Info from Chat Not in EHR — ✅ FIXED

Symptom: Agent collected: Metformin 500mg, Thyronorm 75mcg, Aspirin 81mg, Type 2 Diabetes, Hypothyroidism, age 47, male, Dallas — BUT EHR shows: medications=[], age=58, gender=female

Root cause chain: 1. Chat extractor runs on every turn and extracts structured data ✅ 2. Extracted data saved to case.extra_metadata ✅ 3. EHR builder was not rebuilding after chat turns 4. Demographics from PDF were overriding chat-provided demographics

Resolution: EHR rebuild service (app/services/ehr_rebuild_service.py) now runs synchronously at every write point (chat extraction, document upload, clinical extraction). Medications from extra_metadata flow into EHR medical_history.medications. Chat-provided demographics override PDF-extracted ones.

Issue 4: Language Codes Not Names — ✅ FIXED

Symptom: EHR shows "en, ar" instead of "English, Arabic"

Resolution: Language name mapping applied in EHR endpoint response. Full language names (e.g., "English", "Arabic") are now returned instead of ISO codes.

Issue 5: Procedure Requirements Source — DEFERRED

Current: Agents read from PostgreSQL procedure_requirements table (simple string arrays) Should be: Agents should read from Neo4j REQUIRES_TEST relationships (has validity_days, source_acceptance, on_site_required)

Status: Documented for future sprint. Requires routing case_service.get_procedure_requirements() through graph_service.get_procedure_requirements_enhanced() for the rich metadata (validity_days, source_acceptance, on_site_required).


Summary

Issue Status Fix
#1 Demographics incorrect ✅ FIXED Chat takes precedence via EHR rebuild
#2 Matching crashed ✅ FIXED Gate relaxed, error handling added
#3 Clinical info not in EHR ✅ FIXED EHR rebuild at every write point
#4 Language codes ✅ FIXED Full names in EHR response
#5 Procedure requirements source DEFERRED Future sprint — Neo4j graph source