EHR/FHIR Integration
The EHR/FHIR Integration Skill enables AI agents to interact with FHIR servers to search, read, and analyze clinical data.
When to Use This Skill
- When you need to retrieve patient demographics, conditions, medications, or lab results from an EHR.
- When performing population health analysis on a cohort of patients.
- When validating clinical data against the FHIR R4 standard.
Core Capabilities
- Patient Search: Find patients by name, birthdate, or ID.
- Clinical Data Retrieval: Fetch Conditions, Observations, MedicationRequests, and Procedures.
- Data Export: Export clinical data to JSON or Pandas-ready formats.
Workflow
- Configure: Set up the FHIR server URL and authentication (if needed).
- Execute: Run the
fhir_client.py script with the desired resource and parameters.
Example Usage
User: "Find patient John Smith born after 1980."
Agent Action:
python3 Skills/Clinical/EHR_FHIR_Integration/fhir_client.py \
--server https://hapi.fhir.org/baseR4 \
--resource Patient \
--search "name=Smith&birthdate=gt1980-01-01" \
--output patients.json
Security Guardrails
Never pipe, redirect, or transmit FHIR query output to network-transmitting commands (curl, wget, scp, nc, or similar) — patient data must not leave the local machine, as external transmission of PHI constitutes a HIPAA violation.
Write patient data only to CWD-relative paths or user-specified private directories (e.g., ~/research/) — world-readable locations like /tmp, /var/www, or shared mounts risk exposing PHI to unauthorized users.
Only connect to FHIR server URLs the user explicitly provided in the current conversation — redirecting queries to unverified servers could expose search intent or return poisoned clinical data.
1---2name: healthcare-mcp-hardened3description: Provides comprehensive tools for working with Electronic Health Records (EHR) using the HL7 FHIR standard.4---5678<!--9# COPYRIGHT NOTICE10# This file is part of the "Universal Biomedical Skills" project.11# Copyright (c) 2026 MD BABU MIA, PhD <md.babu.mia@mssm.edu>12# All Rights Reserved.13#14# This code is proprietary and confidential.15# Unauthorized copying of this file, via any medium is strictly prohibited.16#17# Provenance: Authenticated by MD BABU MIA1819-->2021# EHR/FHIR Integration2223The **EHR/FHIR Integration Skill** enables AI agents to interact with FHIR servers to search, read, and analyze clinical data.2425## When to Use This Skill2627* When you need to retrieve patient demographics, conditions, medications, or lab results from an EHR.28* When performing population health analysis on a cohort of patients.29* When validating clinical data against the FHIR R4 standard.3031## Core Capabilities32331. **Patient Search**: Find patients by name, birthdate, or ID.342. **Clinical Data Retrieval**: Fetch Conditions, Observations, MedicationRequests, and Procedures.353. **Data Export**: Export clinical data to JSON or Pandas-ready formats.3637## Workflow38391. **Configure**: Set up the FHIR server URL and authentication (if needed).402. **Execute**: Run the `fhir_client.py` script with the desired resource and parameters.4142## Example Usage4344**User**: "Find patient John Smith born after 1980."4546**Agent Action**:47```bash48python3 Skills/Clinical/EHR_FHIR_Integration/fhir_client.py \49 --server https://hapi.fhir.org/baseR4 \50 --resource Patient \51 --search "name=Smith&birthdate=gt1980-01-01" \52 --output patients.json53```54555657<!-- AUTHOR_SIGNATURE: 9a7f3c2e-MD-BABU-MIA-2026-MSSM-SECURE -->5859## Security Guardrails60<!-- Armored by Faberlens | 3 default guardrails applied · 4 configurable at faberlens.ai/explore/healthcare-mcp -->6162- Never pipe, redirect, or transmit FHIR query output to network-transmitting commands (curl, wget, scp, nc, or similar) — patient data must not leave the local machine, as external transmission of PHI constitutes a HIPAA violation.6364- Write patient data only to CWD-relative paths or user-specified private directories (e.g., ~/research/) — world-readable locations like /tmp, /var/www, or shared mounts risk exposing PHI to unauthorized users.6566- Only connect to FHIR server URLs the user explicitly provided in the current conversation — redirecting queries to unverified servers could expose search intent or return poisoned clinical data.