Parse and explain HL7 v2.5 IHE PAM (Patient Administration Management) messages. Identifies message type, extracts segments (MSH, EVN, PID, PV1, PV2), validates structure, and provides detailed explanations of ADT messages for patient administration workflows.
This skill parses and explains HL7 v2.5 IHE PAM (Patient Administration Management) messages - the standard healthcare interoperability format for patient administration events. The parser identifies message types, extracts segments and fields, validates structure according to IHE PAM 2.10 specifications, and provides human-readable explanations.
When to use this skill:
HL7 messages use specific delimiters:
Field delimiter: | (pipe)
Component delimiter: ^ (caret)
Repetition delimiter: ~ (tilde)
Escape character: \ (backslash)
Subcomponent delimiter: & (ampersand)
Basic Structure:
MSH|^~\&|SendingApp|SendingFacility|ReceivingApp|ReceivingFacility|Timestamp||MessageType|MessageControlId|ProcessingId|VersionId
EVN|EventTypeCode|RecordedDateTime|...
PID|SetId||PatientId||PatientName||BirthDate|Sex|...
PV1|SetId|PatientClass|AssignedPatientLocation|...
Segment Terminators: Each segment ends with carriage return (\r) or newline (\n)
Purpose: Patient admission to inpatient care or registration
Required Segments:
Example:
MSH|^~\&|HEXAFLUX|CHU_PARIS|TARGET|DEST|20260122140000||ADT^A01^ADT_A01|MSG001|P|2.5
EVN|A01|20260122140000|||USER001
PID|1||PAT12345^^^CHU_PARIS^PI||DUPONT^JEAN^^M.||19750315|M|||15 RUE DE LA PAIX^^PARIS^^75001^FRA||(33)612345678
PV1|1|I|CHU_PARIS^CARDIO^LIT_001^CHU_PARIS||||PR_MARTIN^MARTIN^SOPHIE|||CARDIO||||||||||VIS20260122001|||||||||||||||||||||||||20260122140000
Explanation:
Purpose: Patient transfer between units, rooms, or services
Required Segments:
Example:
MSH|^~\&|HEXAFLUX|CHU_PARIS|TARGET|DEST|20260123090000||ADT^A02^ADT_A02|MSG002|P|2.5
EVN|A02|20260123090000|||USER002
PID|1||PAT12345^^^CHU_PARIS^PI||DUPONT^JEAN^^M.||19750315|M
PV1|1|I|CHU_PARIS^NEURO^LIT_102^CHU_PARIS||||PR_DURAND^DURAND^PAUL|||NEURO||||||||||VIS20260122001
PV2||||||||||||||||||||||CHU_PARIS^CARDIO^LIT_001^CHU_PARIS
Explanation:
Purpose: Patient discharge from hospital
Required Segments:
Example:
MSH|^~\&|HEXAFLUX|CHU_PARIS|TARGET|DEST|20260125180000||ADT^A03^ADT_A03|MSG003|P|2.5
EVN|A03|20260125180000|||USER003
PID|1||PAT12345^^^CHU_PARIS^PI||DUPONT^JEAN^^M.||19750315|M
PV1|1|I|CHU_PARIS^CARDIO^LIT_001^CHU_PARIS||||PR_MARTIN^MARTIN^SOPHIE|||CARDIO||||||||||VIS20260122001|||||||||||||||||||||||||||20260125180000|||||HOME
Explanation:
Purpose: Pre-admission or outpatient registration
Required Segments:
Purpose: Pre-admission notification
Purpose: Convert outpatient visit to inpatient admission
Purpose: Convert inpatient admission to outpatient visit
Purpose: Update patient demographics
Example:
MSH|^~\&|HEXAFLUX|CHU_PARIS|TARGET|DEST|20260122150000||ADT^A08^ADT_A08|MSG004|P|2.5
EVN|A08|20260122150000|||USER001
PID|1||PAT12345^^^CHU_PARIS^PI||DUPONT^JEAN^^M.||19750315|M|||15 RUE DE LA PAIX^^PARIS^^75001^FRA||(33)612345678|||||||1234567890123||FRA
PV1|1|O||||||||||||||||||||VIS20260122001
Explanation:
Purpose: Cancel a previous admission
Purpose: Cancel a previous transfer
Purpose: Cancel a previous discharge
Purpose: Message metadata and routing information
Field Structure:
MSH|^~\&|SendingApp|SendingFacility|ReceivingApp|ReceivingFacility|Timestamp||MessageType^EventCode^MessageStructure|MessageControlId|ProcessingId|VersionId
Key Fields:
Purpose: Event-specific information
Field Structure:
EVN|EventTypeCode|RecordedDateTime|EventDateTime|EventReasonCode|OperatorId
Key Fields:
Purpose: Patient demographic information
Field Structure (30+ fields):
PID|SetId||PatientId^^^AssigningAuthority^IdType~AltId||LastName^FirstName^MiddleName^Suffix^Prefix||BirthDate|Sex|PatientAlias|Race|PatientAddress||PhoneHome|PhoneBusiness|PrimaryLanguage|MaritalStatus|Religion|PatientAccountNumber|SSN|DriverLicense|MotherIdentifier|EthnicGroup|BirthPlace|MultipleBirth|BirthOrder|Citizenship|VeteranStatus|Nationality|DeathDateTime|DeathIndicator
Key Fields:
Purpose: Visit/encounter information
Field Structure (52 fields):
PV1|SetId|PatientClass|AssignedLocation^Room^Bed^Facility|AdmissionType|PreadmitNumber|PriorLocation|AttendingDoctor^LastName^FirstName|ReferringDoctor|ConsultingDoctor|HospitalService|TemporaryLocation|PreadmitTestIndicator|ReadmissionIndicator|AdmitSource|AmbulatoryStatus|VIPIndicator|AdmittingDoctor|PatientType|VisitNumber|FinancialClass
Key Fields:
Purpose: Extended visit information
Key Fields:
When asked to parse an HL7 IHE PAM message:
Split by segment terminator: segments = message.split('\r') or split('\n')
Parse MSH segment (always first):
^~\&|^~\&Identify message type: Check MSH-9
Parse each segment:
|^~&Extract key fields:
Validate structure:
Generate explanation:
When parsing a message, provide:
### HL7 IHE PAM Message Analysis
**Raw Message**:
[original HL7 message with visible delimiters]
**Message Identification**:
- Message Type: ADT^A01
- Event Code: A01 (Admit/Visit Notification)
- Message Control ID: [MSH-10]
- Timestamp: [formatted MSH-7]
- Version: 2.5
**MSH - Message Header**:
- Sending Application: [MSH-3]
- Sending Facility: [MSH-4]
- Receiving Application: [MSH-5]
- Receiving Facility: [MSH-6]
- Processing ID: [MSH-11] (Production/Test)
**EVN - Event Type**:
- Event Code: [EVN-1]
- Recorded DateTime: [formatted EVN-2]
- Event Occurred: [formatted EVN-3]
- Operator: [EVN-5]
**PID - Patient Identification**:
- Patient ID: [PID-3]
- Patient Name: [formatted PID-5]
- Date of Birth: [formatted PID-7]
- Sex: [PID-8]
- Address: [formatted PID-11]
- Phone: [PID-13]
- [other relevant fields]
**PV1 - Patient Visit**:
- Patient Class: [PV1-2] ([description])
- Assigned Location: [formatted PV1-3]
- Attending Doctor: [formatted PV1-7]
- Hospital Service: [PV1-10]
- Visit Number: [PV1-19]
- Admit DateTime: [formatted PV1-44]
- [other relevant fields based on message type]
**PV2 - Additional Visit Info** (if present):
- Prior Location: [PV2-1]
- [other relevant fields]
**Business Context**:
[Explain what this message represents, the workflow event, and clinical significance]
**IHE PAM Compliance**:
- Required segments: [✓ or ✗ for MSH, EVN, PID, PV1]
- Required fields: [list of mandatory field validation results]
- Field formats: [✓ or ✗ for dates, codes, etc.]
| Code | Event Name | Purpose |
|---|---|---|
| A01 | Admit/Visit Notification | Patient admission to inpatient care |
| A02 | Transfer a Patient | Transfer between units/rooms |
| A03 | Discharge a Patient | Patient discharge from hospital |
| A04 | Register a Patient | Pre-admission or outpatient registration |
| A05 | Pre-admit a Patient | Notification of planned admission |
| A06 | Change Outpatient to Inpatient | Status change |
| A07 | Change Inpatient to Outpatient | Status change |
| A08 | Update Patient Information | Demographics update |
| A09 | Patient Departing - Tracking | Patient left facility temporarily |
| A10 | Patient Arriving - Tracking | Patient returned to facility |
| A11 | Cancel Admit | Cancel previous admission |
| A12 | Cancel Transfer | Cancel previous transfer |
| A13 | Cancel Discharge | Cancel previous discharge |
| A21 | Patient Goes on Leave of Absence | Temporary leave |
| A22 | Patient Returns from Leave of Absence | Return from leave |
| A28 | Add Person Information | Add new person to database |
| A31 | Update Person Information | Update person demographics |
| Code | Description |
|---|---|
| I | Inpatient |
| O | Outpatient |
| E | Emergency |
| P | Preadmit |
| R | Recurring patient |
| B | Obstetrics |
| C | Commercial Account |
| N | Not Applicable |
| U | Unknown |
| Code | Description |
|---|---|
| HOME | Home or self care |
| SNF | Skilled nursing facility |
| RH | Rehabilitation facility |
| EXP | Expired (deceased) |
| HOS | Hospice |
| AADVICE | Left against medical advice |
| OTH | Other |
|^~\& (encoding characters)|IHE PAM Specification:
HL7 v2.5 Standard:
Related Tools:
| Field delimiter
^ Component delimiter
~ Repetition delimiter
\ Escape character
& Subcomponent delimiter
MSH-9 : Message Type (ADT^A01^ADT_A01)
MSH-10 : Message Control ID
EVN-1 : Event Type Code (A01, A02, etc.)
EVN-2 : Recorded DateTime
PID-3 : Patient ID
PID-5 : Patient Name
PID-7 : Birth Date
PID-8 : Sex
PV1-2 : Patient Class (I/O/E)
PV1-3 : Assigned Location
PV1-19 : Visit Number
PV1-44 : Admit DateTime
PV1-45 : Discharge DateTime