/healthclaw-guardrails:healthex-export-redactedfrom healthclaw-guardrails
Exports clinical data from HealthEx via MCP with in-process PHI redaction. Produces JSON/NDJSON bundles for downstream import. Supports headless cron and Telegram bot invocation.
Ships in healthclaw-guardrails. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
scripts/export_healthex_mcp.py is the current HealthEx pull path. It:
https://api.healthex.io/mcpupdate_records + check_records_status to refreshget_health_summary, get_conditions,
get_medications, get_allergies, get_immunizations, get_vitals,
get_labs, get_procedures, get_visits, search_clinical_notes)scripts/healthclaw_redact.py, which mirrors the HealthClaw guardrail
proxy's redaction rulesThe raw MCP response is never written. Only the redacted payload goes to disk.
# Set the HealthEx token (use macOS Keychain on the Mac mini)
export HEALTHEX_AUTH_TOKEN="$(security find-generic-password -s healthex -w)"
# Default — all tools, local redaction, single JSON file
python scripts/export_healthex_mcp.py \
--tenant-id my-tenant \
--output exports/healthex-$(date +%Y-%m-%d).json
# NDJSON (one line per FHIR resource — easier to diff / grep)
python scripts/export_healthex_mcp.py \
--tenant-id my-tenant \
--output exports/healthex-$(date +%Y-%m-%d).ndjson
# Only the tools you need
python scripts/export_healthex_mcp.py \
--tenant-id my-tenant \
--output exports/labs-only.json \
--tools get_labs get_conditions
# Proxy mode — redact via a running HealthClaw guardrail server instead
python scripts/export_healthex_mcp.py \
--tenant-id my-tenant \
--output exports/snap.json \
--redact-mode proxy \
--healthclaw-url https://healthclaw.io
# Synthetic-only escape hatch (keeps PHI in output — NEVER use on real data)
python scripts/export_healthex_mcp.py \
--tenant-id desktop-demo \
--output exports/demo-raw.json \
--no-redact
| Field | Rule |
|---|---|
HumanName.given / family / text | Collapsed to initials ("E. V.") |
Address.line / city / postalCode | Dropped (state + country kept) |
Identifier.value (MRN, member, subscriber) | SHA-256, optional HEALTHCLAW_REDACT_SALT |
birthDate | Truncated to YYYY |
telecom[].value (phone / email / fax / sms) | Replaced with "***" |
Patient.photo | Removed entirely |
text.div narrative | Emptied |
note[] (Condition / Observation / …) | Emptied |
| Generic flat-dict PHI keys (ssn, dob, …) | Wiped at any nesting depth |
code.coding, valueQuantity, dates | Preserved — clinical signal intact |
_meta.redaction_stats in the output counts every redaction performed.
Bots call this via the /export slash command registered in
scripts/bot_commands.py → cmd_export(). The bot resolves
HEALTHEX_AUTH_TOKEN from (1) environment, (2) macOS Keychain service
healthex. Output lands in ~/.healthclaw/exports/healthex-<date>.json.
Typical end-to-end flow over Telegram:
/export — pulls HealthEx, redacts, writes bundle/import <path printed by /export> — ingests into local HealthClaw/conditions / /labs / /summary — agent reads from local storetests/test_healthclaw_redact.py exercises both the redaction rules and the
end-to-end export flow against a mocked MCP session. Part of the CI suite:
uv run python -m pytest tests/test_healthclaw_redact.py -v
For a one-off CLI check without pytest, scripts/smoke_test.py runs the same
assertions and prints a redaction summary.
healthex-export (legacy)The older healthex-export skill and scripts/export_healthex_legacy.py
pull from the local HealthClaw FHIR store via direct REST. Keep for
tenant-to-tenant copies. Use this skill when the source of truth is
HealthEx itself and you want the MCP SDK + in-process redaction.
What SKILL.md sets; muted values are Claude Code's defaults
14 skills in this plugin
/check-sourcesSurvey ALL connected health data sources at once. Use when the patient asks: (1) "what's connected" or "what services are linked", (2) "check all my services / all my data", (3) "do you have my records" or "what records do you have", (4) "did my data come through from <Fasten/MEDENT/HealthEx/Health Bank One/Flexpa/Epic/wearables>". Calls fhir_get_token (for protected tenants) then sources_check, and presents connection status + record counts by type. Connection status and counts only — never clinical values.
/curatrHealthClaw Curatr (healthclaw.io) — patient-facing FHIR data quality evaluation and correction. Use when: (1) Evaluating a patient's health record for coding issues (deprecated code systems, invalid codes, missing required fields), (2) Presenting issues in plain language with clinical impact, (3) Applying patient-approved corrections with full Provenance tracking, (4) Preparing a structured correction request for the patient's healthcare provider. Supports FHIR R4 US Core v9 resources: Condition, AllergyIntolerance, MedicationRequest, Immunization, Procedure, DiagnosticReport — with ICD-10-CM, SNOMED CT, LOINC, CVX, and RxNorm validation via public terminology APIs.
/fasten-connectUse this skill whenever connecting a patient's real health records from EHR systems (Epic, Cerner, Athena) or the TEFCA national network into HealthClaw Guardrails. Covers: Fasten Stitch widget embed, org_connection_id registration, EHI export job tracking, NDJSON ingestion status, TEFCA IAS identity-verified multi-provider retrieval, and post-import Curatr quality scan workflow.npx claudepluginhub aks129/healthclawguardrails --plugin healthclaw-guardrailsOther plugins' skills for the same job