MED PULSE: AI-Assisted Medical Triage Architecture
The Architectural Friction (The Problem)
Medical tourism and telehealth platforms require AI-assisted triage to scale, but sending raw patient records to public AI APIs creates catastrophic HIPAA and GDPR exposure. Relying on standard, insecure SaaS tools for patient data routing is a massive medical and legal liability.
The iHexe Execution (The Solution)
This demonstration details a self-hosted, zero-trust architecture. A custom Python service aggressively strips all identifying Protected Health Information (PHI) at the edge before any AI model is engaged. The anonymized telemetry is routed to an LLM for specialist-matching, then securely reconstructed inside a private, encrypted environment. The entire pipeline is orchestrated via self-hosted n8n, bypassing public integration tools entirely to ensure absolute data isolation.
DOB: 1982-11-04
SSN: 991-00-4821
DOB: [REDACTED]
SSN: [REDACTED]
Status: EMR UPDATED < 2.5s
The iHexe Clinical Protocol
Agentic AI Triage & PHI Sanitization (MCP)
We engineered cognitive triage without the legal risk. We deployed a custom Python Model Context Protocol (MCP) server within the client's private AWS subnet. When a patient uploads a medical file, our local MCP layer aggressively scans and redacts all PHI (names, SSNs, addresses) before passing the anonymized clinical data to the LLM for specialist matching. The AI predicts the required orthopedic or oncology department, and the MCP reconstructs the encrypted payload internally.
Encrypted n8n Orchestration
Healthcare logistics require military-grade routing. We completely avoided public Zapier/Make integrations. Instead, we deployed self-hosted n8n directly inside the client's Virtual Private Cloud (VPC). When the AI agent determines the correct hospital, an n8n webhook securely intercepts the decision, translates it into HL7/FHIR healthcare standards, and instantly updates the destination hospital's Electronic Medical Record (EMR) system over a heavily encrypted TLS 1.3 tunnel.
The AWS HIPAA Vault & DB Isolation
Data must be mathematically inaccessible to unauthorized actors. We architected the underlying PostgreSQL database utilizing AWS KMS (Key Management Service) for AES-256 encryption at rest. Every patient profile, visa application, and surgical schedule is cryptographically isolated. Even if a server breach occurred, the extracted data would be useless cryptographic noise.
# Python Model Context Protocol (MCP) Server: Local AWS Subnet PHI Redactor # Utilizes Microsoft Presidio Analyzer & Anonymizer to strip PHI before LLM Context from presidio_analyzer import AnalyzerEngine from presidio_anonymizer import AnonymizerEngine from presidio_anonymizer.entities import OperatorConfig from mcp.server import Server# Anonymize PHI with secure placeholder masks anonymized_result = anonymizer.anonymize( text=raw_report_text, analyzer_results=results, operators={ "PERSON": OperatorConfig("replace", {"new_value": "[PATIENT_NAME_REDACTED]"}), "DATE_TIME": OperatorConfig("replace", {"new_value": "[DOB_REDACTED]"}), "US_SSN": OperatorConfig("replace", {"new_value": "[SSN_REDACTED]"}), } )return { "sanitized_clinical_text": anonymized_result.text, "phi_entity_count": len(results), "compliance_status": "HIPAA_SAFE_0_PHI_LEAKS" }
Want this pipeline engineered for your healthcare platform?
Let's discuss your compliance and architecture requirements.