hl7-pam-parser
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseHL7 IHE PAM Message Parser and Explainer
HL7 IHE PAM消息解析器与解释器
Overview
概述
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:
- Parse and explain any HL7 ADT message (raw HL7 text)
- Identify HL7 message type and event code (ADT^A01, ADT^A02, etc.)
- Extract and label all segments and fields (MSH, EVN, PID, PV1, PV2)
- Validate HL7 message structure and required fields
- Understand IHE PAM business rules and field mappings
- Debug HL7 message issues or data quality problems
- Document HL7 message examples with explanations
本工具可解析并解释HL7 v2.5 IHE PAM(患者管理)消息——这是用于患者管理事件的医疗互操作性标准格式。该解析器可识别消息类型,提取段和字段,根据IHE PAM 2.10规范验证结构,并提供易于理解的说明。
何时使用本工具:
- 解析并解释任何HL7 ADT消息(原始HL7文本)
- 识别HL7消息类型和事件代码(ADT^A01、ADT^A02等)
- 提取并标记所有段和字段(MSH、EVN、PID、PV1、PV2)
- 验证HL7消息结构和必填字段
- 理解IHE PAM业务规则和字段映射
- 调试HL7消息问题或数据质量问题
- 附带说明地记录HL7消息示例
HL7 v2.5 Message Format
HL7 v2.5消息格式
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 () or newline ()
\r\nHL7消息使用特定的分隔符:
Field delimiter: | (pipe)
Component delimiter: ^ (caret)
Repetition delimiter: ~ (tilde)
Escape character: \ (backslash)
Subcomponent delimiter: & (ampersand)基本结构:
MSH|^~\&|SendingApp|SendingFacility|ReceivingApp|ReceivingFacility|Timestamp||MessageType|MessageControlId|ProcessingId|VersionId
EVN|EventTypeCode|RecordedDateTime|...
PID|SetId||PatientId||PatientName||BirthDate|Sex|...
PV1|SetId|PatientClass|AssignedPatientLocation|...段终止符:每个段以回车符()或换行符()结尾
\r\nIHE PAM Message Types
IHE PAM消息类型
ADT Messages (Admit, Discharge, Transfer)
ADT消息(入院、出院、转院)
ADT^A01 - Admit/Visit Notification
ADT^A01 - 入院/就诊通知
Purpose: Patient admission to inpatient care or registration
Required Segments:
- MSH (Message Header)
- EVN (Event Type)
- PID (Patient Identification)
- PV1 (Patient Visit)
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|||||||||||||||||||||||||20260122140000Explanation:
- Event: A01 (Patient Admission)
- Patient: DUPONT JEAN (M.), born 15/03/1975
- Patient ID: PAT12345
- Visit: VIS20260122001
- Location: CHU_PARIS, Cardiology, Bed LIT_001
- Admission: 22/01/2026 14:00:00
- Patient Class: I (Inpatient)
- Attending: Dr. MARTIN SOPHIE
用途:患者住院或登记入院
必填段:
- MSH(消息头)
- EVN(事件类型)
- PID(患者标识)
- PV1(患者就诊)
示例:
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说明:
- 事件:A01(患者入院)
- 患者:DUPONT JEAN(先生),出生于1975年3月15日
- 患者ID:PAT12345
- 就诊编号:VIS20260122001
- 位置:CHU_PARIS医院,心脏科,LIT_001病床
- 入院时间:2026年1月22日14:00:00
- 患者类别:I(住院患者)
- 主治医生:MARTIN SOPHIE医生
ADT^A02 - Transfer a Patient
ADT^A02 - 患者转院
Purpose: Patient transfer between units, rooms, or services
Required Segments:
- MSH, EVN, PID, PV1
- PV2 (optional but recommended for prior location)
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_PARISExplanation:
- Event: A02 (Patient Transfer)
- Patient: PAT12345 (DUPONT JEAN)
- From: Cardiology, Bed LIT_001 (PV2-1: prior location)
- To: Neurology, Bed LIT_102 (PV1-3: assigned location)
- Transfer Time: 23/01/2026 09:00:00
用途:患者在科室、病房或服务之间转院
必填段:
- MSH、EVN、PID、PV1
- PV2(可选但推荐用于记录原位置)
示例:
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说明:
- 事件:A02(患者转院)
- 患者:PAT12345(DUPONT JEAN)
- 原位置:心脏科,LIT_001病床(PV2-1:原位置)
- 新位置:神经科,LIT_102病床(PV1-3:分配位置)
- 转院时间:2026年1月23日09:00:00
ADT^A03 - Discharge a Patient
ADT^A03 - 患者出院
Purpose: Patient discharge from hospital
Required Segments:
- MSH, EVN, PID, PV1
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|||||HOMEExplanation:
- Event: A03 (Patient Discharge)
- Patient: PAT12345 (DUPONT JEAN)
- Discharge Time: 25/01/2026 18:00:00 (PV1-45)
- Discharge Disposition: HOME (PV1-36)
- Visit: VIS20260122001
用途:患者出院
必填段:
- MSH、EVN、PID、PV1
示例:
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说明:
- 事件:A03(患者出院)
- 患者:PAT12345(DUPONT JEAN)
- 出院时间:2026年1月25日18:00:00(PV1-45)
- 出院去向:HOME(家中,PV1-36)
- 就诊编号:VIS20260122001
ADT^A04 - Register a Patient
ADT^A04 - 患者登记
Purpose: Pre-admission or outpatient registration
Required Segments:
- MSH, EVN, PID, PV1
用途:预入院或门诊登记
必填段:
- MSH、EVN、PID、PV1
ADT^A05 - Pre-admit a Patient
ADT^A05 - 患者预入院
Purpose: Pre-admission notification
用途:预入院通知
ADT^A06 - Change Outpatient to Inpatient
ADT^A06 - 门诊转住院
Purpose: Convert outpatient visit to inpatient admission
用途:将门诊就诊转为住院
ADT^A07 - Change Inpatient to Outpatient
ADT^A07 - 住院转门诊
Purpose: Convert inpatient admission to outpatient visit
用途:将住院转为门诊就诊
ADT^A08 - Update Patient Information
ADT^A08 - 更新患者信息
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||||||||||||||||||||VIS20260122001Explanation:
- Event: A08 (Update Patient Information)
- Patient: PAT12345 demographics updated
- Updated Fields: Address, phone, national identifier (NIR)
用途:更新患者人口统计信息
示例:
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说明:
- 事件:A08(更新患者信息)
- 患者:PAT12345的人口统计信息已更新
- 更新字段:地址、电话、国家标识符(NIR)
ADT^A11 - Cancel Admit
ADT^A11 - 取消入院
Purpose: Cancel a previous admission
用途:取消之前的入院操作
ADT^A12 - Cancel Transfer
ADT^A12 - 取消转院
Purpose: Cancel a previous transfer
用途:取消之前的转院操作
ADT^A13 - Cancel Discharge
ADT^A13 - 取消出院
Purpose: Cancel a previous discharge
用途:取消之前的出院操作
Segment Definitions
段定义
MSH - Message Header (Required)
MSH - 消息头(必填)
Purpose: Message metadata and routing information
Field Structure:
MSH|^~\&|SendingApp|SendingFacility|ReceivingApp|ReceivingFacility|Timestamp||MessageType^EventCode^MessageStructure|MessageControlId|ProcessingId|VersionIdKey Fields:
- MSH-3: Sending Application
- MSH-4: Sending Facility
- MSH-5: Receiving Application
- MSH-6: Receiving Facility
- MSH-7: Date/Time of Message (YYYYMMDDHHmmss)
- MSH-9: Message Type (ADT^A01^ADT_A01)
- MSH-10: Message Control ID (unique identifier)
- MSH-11: Processing ID (P=Production, T=Training, D=Debugging)
- MSH-12: Version ID (2.5)
用途:消息元数据和路由信息
字段结构:
MSH|^~\&|SendingApp|SendingFacility|ReceivingApp|ReceivingFacility|Timestamp||MessageType^EventCode^MessageStructure|MessageControlId|ProcessingId|VersionId关键字段:
- MSH-3:发送应用
- MSH-4:发送机构
- MSH-5:接收应用
- MSH-6:接收机构
- MSH-7:消息日期/时间(YYYYMMDDHHmmss)
- MSH-9:消息类型(ADT^A01^ADT_A01)
- MSH-10:消息控制ID(唯一标识符)
- MSH-11:处理ID(P=生产环境,T=测试环境,D=调试环境)
- MSH-12:版本ID(2.5)
EVN - Event Type (Required)
EVN - 事件类型(必填)
Purpose: Event-specific information
Field Structure:
EVN|EventTypeCode|RecordedDateTime|EventDateTime|EventReasonCode|OperatorIdKey Fields:
- EVN-1: Event Type Code (A01, A02, A03, etc.)
- EVN-2: Recorded Date/Time (when event was recorded)
- EVN-3: Event Occurred Date/Time (when event actually occurred)
- EVN-5: Operator ID (user who triggered the event)
用途:事件特定信息
字段结构:
EVN|EventTypeCode|RecordedDateTime|EventDateTime|EventReasonCode|OperatorId关键字段:
- EVN-1:事件类型代码(A01、A02、A03等)
- EVN-2:记录日期/时间(事件被记录的时间)
- EVN-3:事件发生日期/时间(事件实际发生的时间)
- EVN-5:操作员ID(触发事件的用户)
PID - Patient Identification (Required)
PID - 患者标识(必填)
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|DeathIndicatorKey Fields:
- PID-1: Set ID
- PID-3: Patient Identifier List (PatientId^^^Facility^PI)
- PID-5: Patient Name (LastName^FirstName^MiddleName^Suffix^Prefix)
- PID-7: Date of Birth (YYYYMMDD)
- PID-8: Sex (M/F/O/U)
- PID-11: Patient Address (Street^^City^^PostalCode^Country)
- PID-13: Phone Number - Home
- PID-14: Phone Number - Business
- PID-22: Ethnic Group
- PID-29: Death Date and Time
- PID-30: Death Indicator (Y/N)
用途:患者人口统计信息
字段结构(30+字段):
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关键字段:
- PID-1:集合ID
- PID-3:患者标识符列表(PatientId^^^机构^PI)
- PID-5:患者姓名(LastName^FirstName^MiddleName^Suffix^Prefix)
- PID-7:出生日期(YYYYMMDD)
- PID-8:性别(M/F/O/U)
- PID-11:患者地址(Street^^City^^PostalCode^Country)
- PID-13:家庭电话号码
- PID-14:工作电话号码
- PID-22:族群
- PID-29:死亡日期和时间
- PID-30:死亡标识(Y/N)
PV1 - Patient Visit (Required)
PV1 - 患者就诊(必填)
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|FinancialClassKey Fields:
- PV1-1: Set ID
- PV1-2: Patient Class (I=Inpatient, O=Outpatient, E=Emergency, R=Recurring)
- PV1-3: Assigned Patient Location (Facility^Service^Room^Bed)
- PV1-4: Admission Type (E=Emergency, R=Routine, etc.)
- PV1-6: Prior Patient Location (for transfers)
- PV1-7: Attending Doctor (DoctorId^LastName^FirstName)
- PV1-10: Hospital Service
- PV1-19: Visit Number (unique visit identifier)
- PV1-36: Discharge Disposition (HOME, SNF, EXP, etc.)
- PV1-44: Admit Date/Time
- PV1-45: Discharge Date/Time
用途:就诊/遭遇信息
字段结构(52字段):
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关键字段:
- PV1-1:集合ID
- PV1-2:患者类别(I=住院患者,O=门诊患者,E=急诊患者,R=复诊患者)
- PV1-3:分配的患者位置(机构^科室^病房^病床)
- PV1-4:入院类型(E=急诊,R=常规等)
- PV1-6:原患者位置(用于转院)
- PV1-7:主治医生(DoctorId^LastName^FirstName)
- PV1-10:医院科室
- PV1-19:就诊编号(唯一就诊标识符)
- PV1-36:出院去向(HOME、SNF、EXP等)
- PV1-44:入院日期/时间
- PV1-45:出院日期/时间
PV2 - Patient Visit - Additional Info (Optional)
PV2 - 患者就诊附加信息(可选)
Purpose: Extended visit information
Key Fields:
- PV2-1: Prior Pending Location (for transfers)
- PV2-3: Admit Reason
- PV2-8: Expected Discharge Date
- PV2-9: Expected Discharge Disposition
- PV2-47: Expected LOA Return Date/Time
用途:扩展的就诊信息
关键字段:
- PV2-1:原待分配位置(用于转院)
- PV2-3:入院原因
- PV2-8:预计出院日期
- PV2-9:预计出院去向
- PV2-47:预计休假返回日期/时间
IHE PAM Mandatory Fields
IHE PAM必填字段
Required for All ADT Messages
所有ADT消息必填
- MSH-3: Sending Application
- MSH-4: Sending Facility
- MSH-7: Date/Time of Message
- MSH-9: Message Type
- MSH-10: Message Control ID
- MSH-12: Version ID (2.5)
- EVN-1: Event Type Code
- EVN-2: Recorded Date/Time
- PID-3: Patient Identifier
- PID-5: Patient Name
- PID-7: Date of Birth
- PID-8: Sex
- MSH-3:发送应用
- MSH-4:发送机构
- MSH-7:消息日期/时间
- MSH-9:消息类型
- MSH-10:消息控制ID
- MSH-12:版本ID(2.5)
- EVN-1:事件类型代码
- EVN-2:记录日期/时间
- PID-3:患者标识符
- PID-5:患者姓名
- PID-7:出生日期
- PID-8:性别
Required for Admission/Transfer Messages (A01, A02)
入院/转院消息必填(A01、A02)
- PV1-2: Patient Class
- PV1-3: Assigned Patient Location
- PV1-19: Visit Number
- PV1-44: Admit Date/Time
- PV1-2:患者类别
- PV1-3:分配的患者位置
- PV1-19:就诊编号
- PV1-44:入院日期/时间
Required for Discharge Messages (A03)
出院消息必填(A03)
- PV1-36: Discharge Disposition
- PV1-45: Discharge Date/Time
- PV1-36:出院去向
- PV1-45:出院日期/时间
Parsing Logic
解析逻辑
When asked to parse an HL7 IHE PAM message:
-
Split by segment terminator:or
segments = message.split('\r')split('\n') -
Parse MSH segment (always first):
- Extract delimiters from MSH-2:
^~\& - Field delimiter:
| - Component delimiter:
^ - Repetition delimiter:
~ - Escape character:
\ - Subcomponent delimiter:
&
- Extract delimiters from MSH-2:
-
Identify message type: Check MSH-9
- ADT^A01 = Admission
- ADT^A02 = Transfer
- ADT^A03 = Discharge
- etc.
-
Parse each segment:
- Split by field delimiter
| - Parse components with
^ - Parse repetitions with
~ - Parse subcomponents with
&
- Split by field delimiter
-
Extract key fields:
- Patient ID (PID-3)
- Patient name (PID-5)
- Birth date (PID-7)
- Visit number (PV1-19)
- Location (PV1-3)
- Dates (PV1-44, PV1-45)
-
Validate structure:
- Check required segments present
- Check required fields populated
- Validate date formats (YYYYMMDD, YYYYMMDDHHmmss)
- Validate code values (patient class, sex, etc.)
-
Generate explanation:
- Identify message purpose
- Explain event type
- List key patient information
- Describe visit/encounter details
- Provide clinical context
当需要解析HL7 IHE PAM消息时:
-
按段终止符拆分:或
segments = message.split('\r')split('\n') -
解析MSH段(始终是第一段):
- 从MSH-2提取分隔符:
^~\& - 字段分隔符:
| - 组件分隔符:
^ - 重复分隔符:
~ - 转义字符:
\ - 子组件分隔符:
&
- 从MSH-2提取分隔符:
-
识别消息类型:检查MSH-9
- ADT^A01 = 入院
- ADT^A02 = 转院
- ADT^A03 = 出院
- 等
-
解析每个段:
- 按字段分隔符拆分
| - 用解析组件
^ - 用解析重复项
~ - 用解析子组件
&
- 按字段分隔符
-
提取关键字段:
- 患者ID(PID-3)
- 患者姓名(PID-5)
- 出生日期(PID-7)
- 就诊编号(PV1-19)
- 位置(PV1-3)
- 日期(PV1-44、PV1-45)
-
验证结构:
- 检查必填段是否存在
- 检查必填字段是否已填充
- 验证日期格式(YYYYMMDD、YYYYMMDDHHmmss)
- 验证代码值(患者类别、性别等)
-
生成说明:
- 识别消息用途
- 解释事件类型
- 列出关键患者信息
- 描述就诊/遭遇详情
- 提供临床背景
Example Output Format
示例输出格式
When parsing a message, provide:
markdown
undefined解析消息时,请提供:
markdown
undefinedHL7 IHE PAM Message Analysis
HL7 IHE PAM消息分析
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.]
undefined原始消息:
[包含可见分隔符的原始HL7消息]消息标识:
- 消息类型: ADT^A01
- 事件代码: A01(入院/就诊通知)
- 消息控制ID: [MSH-10]
- 时间戳: [格式化后的MSH-7]
- 版本: 2.5
MSH - 消息头:
- 发送应用: [MSH-3]
- 发送机构: [MSH-4]
- 接收应用: [MSH-5]
- 接收机构: [MSH-6]
- 处理ID: [MSH-11](生产/测试)
EVN - 事件类型:
- 事件代码: [EVN-1]
- 记录日期/时间: [格式化后的EVN-2]
- 事件发生时间: [格式化后的EVN-3]
- 操作员: [EVN-5]
PID - 患者标识:
- 患者ID: [PID-3]
- 患者姓名: [格式化后的PID-5]
- 出生日期: [格式化后的PID-7]
- 性别: [PID-8]
- 地址: [格式化后的PID-11]
- 电话: [PID-13]
- [其他相关字段]
PV1 - 患者就诊:
- 患者类别: [PV1-2]([描述])
- 分配位置: [格式化后的PV1-3]
- 主治医生: [格式化后的PV1-7]
- 医院科室: [PV1-10]
- 就诊编号: [PV1-19]
- 入院日期/时间: [格式化后的PV1-44]
- [其他与消息类型相关的字段]
PV2 - 附加就诊信息(如果存在):
- 原位置: [PV2-1]
- [其他相关字段]
业务背景:
[解释此消息代表什么、工作流事件以及临床意义]
IHE PAM合规性:
- 必填段: [MSH、EVN、PID、PV1的✓或✗]
- 必填字段: [必填字段验证结果列表]
- 字段格式: [日期、代码等的✓或✗]
undefinedCommon ADT Event Codes
常见ADT事件代码
| 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 |
| 代码 | 事件名称 | 用途 |
|---|---|---|
| A01 | 入院/就诊通知 | 患者住院 |
| A02 | 患者转院 | 科室/病房之间转院 |
| A03 | 患者出院 | 患者出院 |
| A04 | 患者登记 | 预入院或门诊登记 |
| A05 | 患者预入院 | 计划入院通知 |
| A06 | 门诊转住院 | 状态变更 |
| A07 | 住院转门诊 | 状态变更 |
| A08 | 更新患者信息 | 人口统计信息更新 |
| A09 | 患者离开 - 跟踪 | 患者暂时离开机构 |
| A10 | 患者返回 - 跟踪 | 患者返回机构 |
| A11 | 取消入院 | 取消之前的入院 |
| A12 | 取消转院 | 取消之前的转院 |
| A13 | 取消出院 | 取消之前的出院 |
| A21 | 患者休假 | 临时休假 |
| A22 | 患者休假返回 | 休假返回 |
| A28 | 添加人员信息 | 向数据库添加新人员 |
| A31 | 更新人员信息 | 更新人员人口统计信息 |
Patient Class Codes
患者类别代码
| Code | Description |
|---|---|
| I | Inpatient |
| O | Outpatient |
| E | Emergency |
| P | Preadmit |
| R | Recurring patient |
| B | Obstetrics |
| C | Commercial Account |
| N | Not Applicable |
| U | Unknown |
| 代码 | 描述 |
|---|---|
| I | 住院患者 |
| O | 门诊患者 |
| E | 急诊患者 |
| P | 预入院患者 |
| R | 复诊患者 |
| B | 产科患者 |
| C | 商业账户患者 |
| N | 不适用 |
| U | 未知 |
Discharge Disposition Codes
出院去向代码
| 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 |
| 代码 | 描述 |
|---|---|
| HOME | 家中/自我护理 |
| SNF | 专业护理机构 |
| RH | 康复机构 |
| EXP | 死亡 |
| HOS | 临终关怀机构 |
| AADVICE | 违反医嘱离开 |
| OTH | 其他 |
Validation Rules
验证规则
Message Structure
消息结构
- First segment MUST be MSH
- MSH-1 MUST be
| - MSH-2 MUST be (encoding characters)
^~\& - Segments MUST be separated by CR or LF
- Fields MUST be separated by
|
- 第一段必须是MSH
- MSH-1必须是
| - MSH-2必须是(编码字符)
^~\& - 段必须用CR或LF分隔
- 字段必须用分隔
|
Required Segments by Message Type
按消息类型划分的必填段
- A01, A04, A05: MSH, EVN, PID, PV1
- A02: MSH, EVN, PID, PV1 (PV2 recommended for prior location)
- A03: MSH, EVN, PID, PV1
- A08: MSH, EVN, PID (PV1 optional)
- A11, A12, A13: MSH, EVN, PID
- A01、A04、A05:MSH、EVN、PID、PV1
- A02:MSH、EVN、PID、PV1(PV2推荐用于记录原位置)
- A03:MSH、EVN、PID、PV1
- A08:MSH、EVN、PID(PV1可选)
- A11、A12、A13:MSH、EVN、PID
Date/Time Formats
日期/时间格式
- Date: YYYYMMDD
- DateTime: YYYYMMDDHHmmss or YYYYMMDDHHmmss.SSSS
- Time: HHmmss
- 日期:YYYYMMDD
- 日期时间:YYYYMMDDHHmmss 或 YYYYMMDDHHmmss.SSSS
- 时间:HHmmss
Patient Identifier Format
患者标识符格式
- PID-3: PatientId^^^AssigningAuthority^IdentifierType
- Example: PAT12345^^^CHU_PARIS^PI
- PID-3:PatientId^^^AssigningAuthority^IdentifierType
- 示例:PAT12345^^^CHU_PARIS^PI
Name Format
姓名格式
- PID-5: LastName^FirstName^MiddleName^Suffix^Prefix^Degree
- Example: DUPONT^JEAN^^M.
- PID-5:LastName^FirstName^MiddleName^Suffix^Prefix^Degree
- 示例:DUPONT^JEAN^^M.
Location Format
位置格式
- PV1-3: PointOfCare^Room^Bed^Facility^LocationStatus^PersonLocationType^Building
- Example: CHU_PARIS^CARDIO^LIT_001^CHU_PARIS
- PV1-3:PointOfCare^Room^Bed^Facility^LocationStatus^PersonLocationType^Building
- 示例:CHU_PARIS^CARDIO^LIT_001^CHU_PARIS
Reference Documentation
参考文档
IHE PAM Specification:
- French: https://github.com/Interop-Sante/ihe.iti.pam.fr
- International: https://profiles.ihe.net/ITI/TF/Volume1/ch-14.html
HL7 v2.5 Standard:
- Official: http://www.hl7.eu/HL7v2x/v25/std25/ch02.html
- Segments: http://www.hl7.eu/HL7v2x/v25/std25/ch03.html
- Data Types: http://www.hl7.eu/HL7v2x/v25/std25/ch02a.html
Related Tools:
- simple-hl7 (Node.js): https://github.com/Bugs5382/node-hl7-client
- HAPI (Java): https://hapifhir.github.io/hapi-hl7v2/
IHE PAM规范:
- 法语版:https://github.com/Interop-Sante/ihe.iti.pam.fr
- 国际版:https://profiles.ihe.net/ITI/TF/Volume1/ch-14.html
HL7 v2.5标准:
- 官方版:http://www.hl7.eu/HL7v2x/v25/std25/ch02.html
- 段:http://www.hl7.eu/HL7v2x/v25/std25/ch03.html
- 数据类型:http://www.hl7.eu/HL7v2x/v25/std25/ch02a.html
相关工具:
- simple-hl7(Node.js):https://github.com/Bugs5382/node-hl7-client
- HAPI(Java):https://hapifhir.github.io/hapi-hl7v2/
Quick Reference
快速参考
Delimiters
分隔符
| Field delimiter
^ Component delimiter
~ Repetition delimiter
\ Escape character
& Subcomponent delimiter| 字段分隔符
^ 组件分隔符
~ 重复分隔符
\ 转义字符
& 子组件分隔符Common Fields
常见字段
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 DateTimeMSH-9 : 消息类型(ADT^A01^ADT_A01)
MSH-10 : 消息控制ID
EVN-1 : 事件类型代码(A01、A02等)
EVN-2 : 记录日期/时间
PID-3 : 患者ID
PID-5 : 患者姓名
PID-7 : 出生日期
PID-8 : 性别
PV1-2 : 患者类别(I/O/E)
PV1-3 : 分配位置
PV1-19 : 就诊编号
PV1-44 : 入院日期/时间
PV1-45 : 出院日期/时间