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.