AleDeclerk

hl7-healthcare

1
0
# Install this skill:
npx skills add AleDeclerk/hl7-healthcare

Or install specific skill: npx add-skill https://github.com/AleDeclerk/hl7-healthcare

# Description

>

# SKILL.md


name: hl7-healthcare
description: >
Generate, validate, parse, and transmit HL7 v2 messages for healthcare interoperability workflows.
Use this skill whenever the user needs to work with HL7 messages of any type — including ADT^A04
(patient/donor registration), ORM^O01 (lab orders), ORU^R01 (results), and ACK (acknowledgments).
Also trigger for MLLP transport, SoftBank/Epic/Beaker integration, anonymous donor workflows,
ISBT-128 product registration, or any task involving healthcare system messaging, HL7 segment
construction, field mapping, or clinical interoperability. Even if the user just says "build an
HL7 message" or "send a result to Epic", use this skill.


HL7 Healthcare Interoperability Skill

Generates, validates, parses, and transmits HL7 v2.x messages. Designed for clinical lab,
stem cell, and hospital integration workflows — including anonymous donor handling (FACT/JACIE, FDA 21 CFR Part 1271).


Supported Message Types

Message Trigger Event Use Case
ADT^A04 Register patient Anonymous donor registration in SoftBank
ORM^O01 Lab order Test panel generation in Epic Beaker
ORU^R01 Observation result Results from SoftBank → Epic chart routing
ACK Acknowledgment MLLP response validation

Quick Start

1. Generate a message

# ADT^A04 — anonymous donor registration
python scripts/generate_adt_a04.py \
  --din "W000055508D001" \
  --donor-id "DONOR-2026-0042" \
  --sending-app "VERITAS" \
  --sending-facility "LSU_SCL" \
  --receiving-app "SOFTBANK" \
  --receiving-facility "LSU"

# ORM^O01 — lab order panel
python scripts/generate_orm_o01.py \
  --donor-id "DONOR-2026-0042" \
  --din "W000055508D001" \
  --product-type "PBSC" \
  --output orders.hl7

# ORU^R01 — results routing to Epic
python scripts/generate_oru_r01.py \
  --donor-id "DONOR-2026-0042" \
  --recipient-mrn "MRN123456" \
  --din "W000055508D001" \
  --results results.json \
  --output oru_result.hl7

2. Validate a message

python scripts/validate_hl7.py --file message.hl7
python scripts/validate_hl7.py --stdin < message.hl7

3. Parse / inspect a message

python scripts/parse_hl7.py --file message.hl7 --segment PID
python scripts/parse_hl7.py --file message.hl7 --all

4. Send via MLLP

python scripts/mllp_sender.py \
  --host softbank.lsu.edu \
  --port 2575 \
  --file message.hl7 \
  --timeout 10

Anonymous Donor Rules (LSU / FDA 21 CFR Part 1271)

When registering an anonymous HSC donor, strictly follow these field rules:

PID Field Value Reason
PID-3 (ID) DIN as primary, Donor ID as secondary ICCBBA traceability
PID-5 (Name) ANONYMOUS^DONOR No real name — regulatory
PID-7 (DOB) 00010101 Placeholder — no real DOB
PID-8 (Sex) U Unknown — no real sex
PID-19 (SSN) empty Never populate

The recipient's MRN must never appear in any ADT or ORM segment. It lives only in the
encrypted linking table, hashed as SHA-256 in audit events.


LOINC Codes — HSC Standard Panel

Test LOINC Code Unit Normal Range
CD34+ count 18207-3 10⁶/kg 2.0 – 5.0
ABO group 883-9 See table
Rh type 10331-7 Pos / Neg
WBC count 6690-2 10³/µL Lab-specific
Sterility 600-7 Negative
CMV IgG 13949-3 Neg (donor screen)
HIV-1/2 Ab 7917-8 Non-reactive
HBsAg 5196-1 Non-reactive
HCV Ab 16128-1 Non-reactive
HTLV-I/II 31201-7 Non-reactive
Syphilis 20507-0 Non-reactive

For bone marrow (BM) and cord blood (CB) product types, read references/product_panels.md
for the product-specific order sets.


HL7 Segment Reference

For full field-by-field documentation of each message type:
- ADT^A04 → references/adt_a04.md
- ORM^O01 → references/orm_o01.md
- ORU^R01 → references/oru_r01.md


MLLP Framing

HL7 v2 over TCP uses MLLP (Minimal Lower Layer Protocol) framing:

<VT> [HL7 message bytes] <FS><CR>
  • <VT> = 0x0B — Start Block character
  • <FS> = 0x1C — End Data character
  • <CR> = 0x0D — Carriage Return

The mllp_sender.py script handles framing automatically. For raw integration, see references/mllp_protocol.md.


Validation Rules

validate_hl7.py checks:
1. MSH segment present and correctly delimited (|^~\&)
2. Message type in supported set
3. Required segments present for message type
4. PID-3 (Patient ID) non-empty
5. Timestamp format valid (YYYYMMDDHHMMSS)
6. For ADT^A04 anonymous donor: PID-5 must be ANONYMOUS^DONOR, PID-7 must be 00010101
7. No MRN-like identifiers in ORM/ADT segments (anonymous donor safety check)
8. ACK code parsing (AA=accepted, AE=error, AR=rejected)


Error Handling

All scripts exit with:
- 0 — success
- 1 — validation error (message printed to stderr)
- 2 — network/MLLP error
- 3 — parse error

Scripts log to stdout in structured JSON when --json flag is passed, useful for agent integration.


File Layout

hl7-healthcare/
├── SKILL.md                    ← You are here
├── scripts/
│   ├── generate_adt_a04.py     ← Build ADT^A04 messages
│   ├── generate_orm_o01.py     ← Build ORM^O01 lab order panels
│   ├── generate_oru_r01.py     ← Build ORU^R01 result messages
│   ├── validate_hl7.py         ← Validate any HL7 v2 message
│   ├── parse_hl7.py            ← Parse and inspect HL7 messages
│   └── mllp_sender.py          ← Transmit via MLLP over TCP
├── references/
│   ├── adt_a04.md              ← ADT^A04 field reference
│   ├── orm_o01.md              ← ORM^O01 field reference
│   ├── oru_r01.md              ← ORU^R01 field reference
│   ├── product_panels.md       ← HSC product-type order sets
│   └── mllp_protocol.md        ← MLLP framing specification
└── examples/
    ├── anonymous_donor_registration.hl7
    ├── lab_order_panel_pbsc.hl7
    └── results_routing_to_epic.hl7

# README.md

hl7-healthcare

Claude Agent Skill — Generate, validate, parse, and transmit HL7 v2 messages for healthcare interoperability workflows.

Built for clinical lab, stem cell, and hospital integration use cases — including anonymous donor handling compliant with FDA 21 CFR Part 1271 and FACT/JACIE standards.


What this skill does

  • Generates ADT^A04, ORM^O01, and ORU^R01 messages with correct field mapping
  • Validates any HL7 v2 message for structural correctness and anonymous donor compliance
  • Parses messages into human-readable segment/field breakdowns
  • Transmits messages via MLLP over TCP (SoftBank, Epic Beaker, WellSky, etc.)

Supported Message Types

Message Use Case
ADT^A04 Register anonymous HSC donor in SoftBank
ORM^O01 Generate lab order panels in Epic Beaker
ORU^R01 Route donor results to recipient's Epic chart
ACK Parse MLLP acknowledgment responses

Install

# Claude Code — global install
git clone https://github.com/YOUR_USERNAME/hl7-healthcare ~/.claude/skills/hl7-healthcare

# Claude Code — project install
git clone https://github.com/YOUR_USERNAME/hl7-healthcare .claude/skills/hl7-healthcare

Claude will automatically discover and use the skill for HL7-related tasks.

Requirements

  • Python 3.8+
  • No external dependencies (stdlib only)

Quick Start

# 1. Generate anonymous donor registration message
python scripts/generate_adt_a04.py \
  --din "W000055508D001" \
  --donor-id "DONOR-2026-0042" \
  --output donor_reg.hl7

# 2. Validate it
python scripts/validate_hl7.py --file donor_reg.hl7 --check-anonymous

# 3. Send via MLLP
python scripts/mllp_sender.py \
  --host softbank.lsu.edu \
  --port 2575 \
  --file donor_reg.hl7

# 4. Generate lab order panel (PBSC, skip ABO already done by NMDP)
python scripts/generate_orm_o01.py \
  --donor-id "DONOR-2026-0042" \
  --din "W000055508D001" \
  --product-type PBSC \
  --skip-tests "883-9,10331-7" \
  --output orders.hl7

# 5. Route results to Epic
python scripts/generate_oru_r01.py \
  --donor-id "DONOR-2026-0042" \
  --recipient-mrn "MRN123456" \
  --din "W000055508D001" \
  --results-file results.json \
  --output result_message.hl7

File Layout

hl7-healthcare/
├── SKILL.md                        ← Claude skill instructions
├── README.md                       ← This file
├── scripts/
│   ├── generate_adt_a04.py         ← Anonymous donor registration (ADT^A04)
│   ├── generate_orm_o01.py         ← Lab order panel (ORM^O01)
│   ├── generate_oru_r01.py         ← Results routing (ORU^R01)
│   ├── validate_hl7.py             ← Message validator
│   ├── parse_hl7.py                ← Message parser / inspector
│   └── mllp_sender.py              ← MLLP TCP transport
├── references/
│   ├── adt_a04.md                  ← ADT^A04 field reference
│   └── orm_oru_reference.md        ← ORM^O01 + ORU^R01 field reference
└── examples/
    ├── anonymous_donor_registration.hl7
    ├── lab_order_panel_pbsc.hl7
    └── results_routing_to_epic.hl7

Regulatory Context

This skill was built for the LSU Stem Cell Lab / Veritas Automata HSC orchestration project. It enforces:

  • FDA 21 CFR Part 1271 — donor anonymity (no real name, DOB, SSN in donor messages)
  • FACT/JACIE — audit trail, chain of custody
  • ICCBBA ISBT-128 — DIN format validation
  • HL7 v2.5.1 — standard messaging

Contributing

PRs welcome. For healthcare-specific changes, please include a reference to the relevant regulatory requirement.

License

MIT

# Supported AI Coding Agents

This skill is compatible with the SKILL.md standard and works with all major AI coding agents:

Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.