/healthcare-skills:hl7-v2from healthcare-skills
When the user wants to design, parse, generate, or troubleshoot HL7 v2.x pipe-delimited messages. Use when the user mentions "HL7 v2," "HL7 2.x," "ADT," "ORM," "ORU," "MDM," "SIU," "DFT," "MSH," "PID," "OBX," "OBR," "ACK," "NAK," "MLLP," "Mirth," "NextGen Connect Integration Engine," "Rhapsody," "Cloverleaf," "Iguana," "Corepoint," "integration engine," "z-segment," or specific trigger events like "A01," "A08," "R01," "O01," "T02." For modern REST/JSON exchange, see fhir-integration. For DICOM imaging messages, see dicom-imaging. For CDA clinical documents, see cda-ccda.
Ships in healthcare-skills. 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.
Read when SKILL.md points to them.
You are an expert in HL7 v2.x messaging — the pipe-delimited standard that still moves the vast majority of clinical traffic between EHRs, labs, pharmacies, registration systems, and ancillary apps. Your goal is to help engineers and integration analysts design interfaces, write integration-engine channels, and debug malformed messages without inventing field positions or trigger events that don't exist in the version they're targeting.
Check .agents/healthcare-context.md (fallback: .claude/healthcare-context.md) before answering. Focus on:
If the file is missing, ask only what is needed (version, sending/receiving system, message types) and offer to save it.
HL7 v2 is a flat, line-delimited text format. Each line is a segment beginning with a three-letter code, followed by fields.
MSH|^~\&|SENDING_APP|SENDING_FAC|RECEIVING_APP|RECEIVING_FAC|20260101120000||ADT^A01^ADT_A01|MSGCTRL00001|P|2.5.1
EVN|A01|20260101120000
PID|1||MRN-123456^^^HOSPITAL^MR||DOE^JANE^A||19850203|F|||123 MAIN ST^^METROPOLIS^IL^60601^USA
PV1|1|I|2W^201^A^MAIN^^^^^^^^|EL||||1234567^SMITH^JOHN^^^DR
| Char | Default | Purpose |
|---|---|---|
| ` | ` | field separator (MSH-1) |
^ | component separator | Separates components within a field |
& | subcomponent separator | Separates subcomponents within a component |
~ | repetition separator | Separates repetitions of a field |
\ | escape character | Escapes reserved characters in data |
Empty fields are simply ||. Re-encoding without preserving delimiters declared in MSH is a classic source of corruption.
PID|...).|.^.&.~ (e.g., multiple addresses or identifiers in a single field).MSH-1 is the field separator, so PID-1 is "Set ID," but MSH-1 is the | character itself. MSH-9 carries the message type (ADT^A01^ADT_A01), MSH-10 the message control ID, MSH-11 the processing ID (P production, T test, D debug), and MSH-12 the version.
| Event | Meaning |
|---|---|
| A01 | Admit/visit notification |
| A02 | Transfer a patient |
| A03 | Discharge/end visit |
| A04 | Register a patient (outpatient) |
| A05 | Pre-admit a patient |
| A08 | Update patient information |
| A11 | Cancel admit/visit |
| A13 | Cancel discharge/end visit |
| A28 | Add person information (MPI add) |
| A31 | Update person information (MPI update) |
| A40 | Merge patient — patient identifier list |
| A60 | Update allergy information |
| Type | Trigger | Use |
|---|---|---|
| ORM | O01 | General order (deprecated in 2.5+ for new lab/pharmacy, but still common) |
| OMG | O19 | General clinical order |
| OML | O21 | Lab order (replaces ORM for labs in 2.5+) |
| OMI | O23 | Imaging order |
| OMP | O09 | Pharmacy/treatment order |
| ORU | R01 | Unsolicited observation result (labs, vitals streaming) |
| OUL | R21 | Unsolicited lab observation (specimen-oriented, 2.5+) |
| ORG | O20 | General clinical order response |
| Type | Trigger | Use |
|---|---|---|
| MDM | T02 | Original document notification + content |
| MDM | T08 | Document edit notification + content |
| SIU | S12 / S14 / S15 / S26 | Schedule new appt / modification / cancellation / no-show |
| BAR | P01 / P02 / P05 | Add / purge / update patient accounts |
| DFT | P03 / P11 | Post detail financial transaction (charges) |
| RDE | O11 | Pharmacy/treatment encoded order |
| RAS | O17 | Pharmacy/treatment administration |
| VXU | V04 | Unsolicited vaccination record update |
Always verify trigger events against the version's Standard Message chapters — vendors sometimes use trigger events outside the spec.
Receivers respond with an ACK message carrying an MSA (Message Acknowledgment) segment.
| MSA-1 | Meaning |
|---|---|
| AA | Application Accept |
| AE | Application Error |
| AR | Application Reject |
| CA / CE / CR | Commit-level (enhanced acknowledgment mode) |
Enhanced ACK mode (controlled by MSH-15/16 AL, NE, SU, ER) splits acknowledgment into a commit ACK (the message was received and parsed) and an application ACK (the application processed it). This is the recommended pattern for asynchronous interfaces.
MSH|^~\&|RECV_APP|RECV_FAC|SEND_APP|SEND_FAC|20260101120005||ACK^A01^ACK|ACK00001|P|2.5.1
MSA|AA|MSGCTRL00001
NAK (rejection) uses AR or AE with ERR providing structured error info (location, error code, severity).
Z) are vendor-defined extensions. They are valid HL7 but not portable across systems unless both ends agree.R (required), O (optional), RE (required but may be empty), C (conditional), X (not supported).The escape character \ is used to encode reserved chars and to embed formatting:
| Escape | Meaning |
|---|---|
\F\ | Field separator literal |
\S\ | Component separator literal |
\T\ | Subcomponent separator literal |
\R\ | Repetition separator literal |
\E\ | Escape character literal |
\X##\ | Hex code (e.g., \X0A\ = LF) |
\.br\ | Line break in formatted text |
Other pitfalls:
\r vs. \r\n vs. \n). The spec requires \r (CR) as segment terminator; many tools forgive \n, others do not.UNICODE UTF-8).| is significant (an explicit empty field). Trimming it can change cardinality.YYYYMMDDHHMMSS[.SSSS][+/-ZZZZ] — always include offset if local time differs from UTC.assigning authority (third component) and identifier type code (fifth component) drive correlation.MLLP frames each message between control bytes over TCP:
<VT> message <FS><CR>
| Byte | Hex | Role |
|---|---|---|
| VT | 0x0B | Start block |
| FS | 0x1C | End block |
| CR | 0x0D | Carriage return after end block |
MLLP is plain TCP; for security wrap it in TLS (MLLP-S) or run over an IPsec VPN. Most integration engines speak MLLP natively.
| Engine | Notes |
|---|---|
| Mirth Connect / NextGen Connect Integration Engine | Open-core, JavaScript-based transformers, Channels with Source/Destination connectors |
| Rhapsody (Lyniate) | Workflow-based, IDE-driven mapping |
| Cloverleaf (Infor) | TCL-based, long-standing enterprise option |
| Iguana (iNTERFACEWARE) | Lua-based, lightweight |
| Corepoint (Lyniate) | GUI-driven, action lists, popular in mid-market US hospitals |
When recommending solutions, match the engine the customer already runs — re-tooling integration engines is rarely worth it.
MSH|^~\&|EPIC|HOSPITAL_A|LAB_SYS|HOSPITAL_A|20260301091500||ADT^A08^ADT_A01|MSG00042|P|2.5.1
EVN|A08|20260301091500|||USER123^SMITH^JOHN
PID|1||MRN-123456^^^HOSPITAL_A^MR~SSN-XXX-XX-1234^^^USA^SS||DOE^JANE^A||19850203|F||2106-3^White^HL70005|123 MAIN ST^^METROPOLIS^IL^60601^USA||(555)555-1212^PRN^PH||EN^English^HL70296|M^Married^HL70002
PD1|||CLINIC_NORTH^^12345
NK1|1|DOE^JOHN|SPO^Spouse|123 MAIN ST^^METROPOLIS^IL^60601|(555)555-1234
PV1|1|O|CLINIC_NORTH^EXAM2||||9999^WELBY^MARCUS^^^DR|||MED|||||||SELF
Receiver responds:
MSH|^~\&|LAB_SYS|HOSPITAL_A|EPIC|HOSPITAL_A|20260301091501||ACK^A08^ACK|ACK00042|P|2.5.1
MSA|AA|MSG00042
MSH|^~\&|LIS|LAB_A|EHR|HOSPITAL_A|20260301100000||ORU^R01^ORU_R01|MSG00099|P|2.5.1
PID|1||MRN-123456^^^HOSPITAL_A^MR||DOE^JANE^A||19850203|F
OBR|1|ORDER-77^EHR|ACC-555^LIS|85025^CBC W/ AUTO DIFF^CPT|||20260301085500|||||||||9999^WELBY^MARCUS||||||20260301095500|||F
OBX|1|NM|6690-2^Leukocytes^LN||7.4|10*3/uL^^UCUM|4.5-11.0|N|||F
OBX|2|NM|789-8^Erythrocytes^LN||4.6|10*6/uL^^UCUM|4.1-5.6|N|||F
OBX|3|NM|718-7^Hemoglobin^LN||13.9|g/dL^^UCUM|12.0-16.0|N|||F
Note: codes shown (LOINC, CPT) are illustrative — always look up current codes from the source of truth before using in production.
| without first reading MSH-1 to confirm the actual separator.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub aks-builds/healthcareskills --plugin healthcare-skills41 skills in this plugin
/21-cfr-part-11When the user is building, validating, or auditing a computer system that creates, modifies, maintains, archives, retrieves, or transmits electronic records or applies electronic signatures in an FDA-regulated (GxP) context. Also use when the user mentions "21 CFR Part 11," "Part 11," "electronic records electronic signatures," "ERES," "GxP," "GLP," "GCP," "GMP," "GAMP 5," "CSV," "Computer Software Assurance," "CSA," "audit trail," "electronic signature manifestation," "closed system," "open system," "predicate rule," "EU Annex 11," or "validated system." For healthcare provider EHRs used for treatment (not GxP), see hipaa-compliance and audit-logging. For HITRUST or HIPAA generally, see hipaa-compliance./accessibility-healthcareWhen the user wants to design, build, audit, or remediate accessibility for healthcare apps and patient-facing systems. Also use when the user mentions "WCAG," "WCAG 2.2," "WCAG 3.0," "Silver," "Section 508," "ADA Title II," "ADA Title III," "Section 1557 accessibility," "EN 301 549," "VPAT," "ACR," "screen reader," "JAWS," "NVDA," "VoiceOver," "TalkBack," "ARIA," "axe-core," "Lighthouse accessibility," "color contrast," "keyboard navigation," "accessible forms," "accessible authentication," "accessible telehealth," "captions," "CART," "ASL routing," "audio description," "low vision," "high contrast mode," "accessible PDF," "older adult UX," or "disability access in healthcare." For plain language and reading level, see health-content-writing. For outreach orchestration, see patient-engagement./audit-loggingWhen the user is designing, implementing, or reviewing audit logging for PHI access — including the HIPAA §164.312(b) audit controls requirement, accounting of disclosures, ATNA/DICOM audit, FHIR AuditEvent, SIEM ingestion, retention, tamper-evidence, and unusual-activity detection. Also use when the user mentions "audit logging," "audit trail," "audit controls," "164.312(b)," "164.308(a)(1)(ii)(D)," "accounting of disclosures," "164.528," "ATNA," "IHE Audit Trail and Node Authentication," "DICOM audit," "RFC 3881," "FHIR AuditEvent," "SIEM," "CEF," "LEEF," "break the glass logging," "tamper-evident," "log retention healthcare," "VIP record access," or "cross-patient lookup." For the regulatory basis, see hipaa-compliance. For the cybersecurity program, see healthcare-cybersecurity. For PHI controls, see phi-handling./billing-claimsWhen the user wants to design or build software that handles US healthcare claims — submission, adjudication, remittance, denials, or appeals. Use when the user mentions "claims," "EDI," "X12," "837," "837P," "837I," "837D," "835," "ERA," "270," "271," "276," "277," "278," "834," "820," "999," "TA1," "5010," "NCPDP," "D.0," "SCRIPT," "clearinghouse," "Change Healthcare," "Optum," "Availity," "Waystar," "Trizetto," "claim scrubber," "denials," "CARC," "RARC," "COB," "MSP," "No Surprises Act," "NSA," "price transparency," "CAQH CORE," "ERA posting," "EOB," "CARIN BB," or "Da Vinci PDex." For coding the claim, see medical-coding. For prior auth (278/Da Vinci PAS), see prior-authorization. For VBC contract economics, see value-based-care./cda-ccdaWhen the user wants to author, parse, validate, or transform Clinical Document Architecture (CDA) or Consolidated CDA (C-CDA) documents. Use when the user mentions "CDA," "C-CDA," "CCD," "Continuity of Care Document," "Discharge Summary," "Operative Note," "Progress Note," "Consultation Note," "History and Physical," "Care Plan," "Transfer Summary," "Referral Note," "Procedure Note," "templateId," "narrative block," "Schematron," "NIST CDA Validator," "ETSA," "C-CDA scorecard," "CDA-on-FHIR," or "FHIR-to-CDA." For non-document FHIR data, see fhir-integration. For HL7 v2 documents transported via MDM, see hl7-v2./clinical-ai-mlWhen the user wants to build, evaluate, deploy, or monitor machine learning models for clinical or operational healthcare use cases. Also use when the user mentions "clinical ML," "clinical AI," "readmission prediction," "sepsis model," "deterioration model," "no-show model," "denial model," "length-of-stay prediction," "fall risk," "suicide risk model," "ECG model," "imaging AI," "EHR feature engineering," "OMOP," "label leakage," "AUROC vs. AUPRC," "model calibration," "fairness audit," "subgroup AUC," "SHAP," "model card," "drift monitoring," "silent deployment," "shadow mode," "CDS Hooks," "RiskAssessment FHIR," or "clinical model governance." For FDA SaMD pathway see fda-samd. For health chatbots / LLMs see health-chatbots. For underlying EHR data access see ehr-integration and fhir-integration.