hpk-parser

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

HPK Message Parser and Explainer

HPK消息解析器与解释工具

Overview

概述

This skill parses and explains HPK (Healthcare Protocol Kernel) messages - a proprietary pipe-delimited healthcare message format used in the Hexagone system for French healthcare environments. The parser supports 100+ message types across multiple domains (patient administration, supply chain, inventory, financial, organizational), identifies message types, extracts all fields, validates structure, and provides human-readable explanations based on the official HPK dictionary and specifications.
Primary Sources of Truth:
  1. HPK Dictionary (
    @erp-pas/hpk-dictionary
    ) - GitLab repository with complete message schemas, field definitions, and validation rules
  2. HPK ADT Message Specification - Comprehensive field definitions for patient administration messages
  3. HPK GEF Specification - Workflow integration and economic/financial management messages
Coverage:
  • Patient Administration: Identity (ID), Movements (MV), Coverage (CV) - 12+ message types
  • Supply Chain: Products (PR), Suppliers (FO), Markets (MA), Orders (CO), Deliveries (LI), Receptions (RO) - 20+ message types
  • Financial: Invoices (FA), Miscellaneous Receipts (RD) - 4+ message types
  • Inventory: Stock movements (SO), Asset inventory (IM) - 5+ message types
  • Organizational: Structures (ST), Users (UT) - 6+ message types
  • Requests: Creation requests (DD) - 2+ message types
When to use this skill:
  • Parse and explain any HPK message (raw text input from any system domain)
  • Identify HPK message type and mode (ID|M1|C, MV|M2|C, PR|M0|C, etc.)
  • Extract and label all HPK fields according to specification
  • Validate HPK message structure, field count, and data types
  • Understand HPK business rules and field mappings
  • Debug HPK message issues or data quality problems
  • Document HPK message examples with explanations
  • Verify HPK dictionary compliance and field definitions
  • Map HPK messages to HL7 v2.5 or IHE PAM equivalents
  • Analyze HPK message flows in Hexagone WEB integration scenarios
  • Support development of HPK message generators or parsers
  • Troubleshoot Hexagone WEB to external system interfaces
本工具用于解析和解释HPK(Healthcare Protocol Kernel)消息——这是法国医疗环境中Hexagone系统使用的专有竖线分隔医疗消息格式。解析器支持多领域的100余种消息类型(患者管理、供应链、库存、财务、组织结构等),可识别消息类型、提取所有字段、验证结构,并基于官方HPK字典和规范提供易读的解释说明。
权威数据源:
  1. HPK字典 (
    @erp-pas/hpk-dictionary
    ) - GitLab仓库,包含完整的消息 schema、字段定义和验证规则
  2. HPK ADT消息规范 - 患者管理消息的完整字段定义
  3. HPK GEF规范 - 工作流集成及经济/财务管理消息规范
覆盖范围:
  • 患者管理: 身份(ID)、流转(MV)、保险覆盖(CV) - 12余种消息类型
  • 供应链: 产品(PR)、供应商(FO)、市场(MA)、订单(CO)、配送(LI)、收货(RO) - 20余种消息类型
  • 财务: 发票(FA)、杂项收款(RD) - 4余种消息类型
  • 库存: 库存流转(SO)、资产盘点(IM) - 5余种消息类型
  • 组织结构: 机构(ST)、用户(UT) - 6余种消息类型
  • 请求: 创建请求(DD) - 2余种消息类型
适用场景:
  • 解析和解释任意HPK消息(来自任意系统域的原始文本输入)
  • 识别HPK消息类型和模式(ID|M1|C、MV|M2|C、PR|M0|C等)
  • 按照规范提取并标记所有HPK字段
  • 验证HPK消息结构、字段数量和数据类型
  • 理解HPK业务规则和字段映射关系
  • 调试HPK消息问题或数据质量问题
  • 附带解释说明文档化HPK消息示例
  • 验证HPK字典合规性和字段定义
  • 将HPK消息映射为HL7 v2.5或IHE PAM等效格式
  • 分析Hexagone WEB集成场景中的HPK消息流
  • 支持HPK消息生成器或解析器的开发
  • 排查Hexagone WEB与外部系统的接口问题

HPK Message Format

HPK消息格式

HPK messages use pipe (
|
) as field delimiter with the following structure:
Type|Message|Mode|Emetteur|Date|User|...additional fields...
Core Fields (positions 0-5):
  • Field 0: Message Type (
    ID
    = Identity,
    MV
    = Movement,
    CV
    = Coverage)
  • Field 1: Message Code (
    M1
    ,
    M2
    ,
    M3
    ,
    M6
    ,
    M8
    ,
    M9
    ,
    MT
    ,
    CE
    ,
    B1
    , etc.)
  • Field 2: Mode (
    C
    = Creation,
    M
    = Modification,
    D
    = Deletion)
  • Field 3: Emetteur (Sender/Source System)
  • Field 4: Date/Time (format:
    YYYYMMDDHHmmss
    )
  • Field 5: User ID
HPK消息使用竖线 (
|
) 作为字段分隔符,结构如下:
Type|Message|Mode|Emetteur|Date|User|...附加字段...
核心字段(位置0-5):
  • 字段0: 消息类型 (
    ID
    = 身份、
    MV
    = 流转、
    CV
    = 保险覆盖)
  • 字段1: 消息代码 (
    M1
    M2
    M3
    M6
    M8
    M9
    MT
    CE
    B1
    等)
  • 字段2: 模式 (
    C
    = 创建、
    M
    = 修改、
    D
    = 删除)
  • 字段3: Emetteur(发送方/源系统)
  • 字段4: 日期/时间(格式:
    YYYYMMDDHHmmss
  • 字段5: 用户ID

Message Types

消息类型

Identity Messages (ID|*)

身份消息 (ID|*)

ID|M1 - Patient Identity (Creation/Modification)

ID|M1 - 患者身份(创建/修改)

Purpose: Patient demographic information (registration)
Field Structure (38 fields total):
0:  Type (ID)
1:  Message (M1)
2:  Mode (C/M/D)
3:  Emetteur (Sender)
4:  Date (YYYYMMDDHHmmss)
5:  User
6:  IPP (Patient ID)
7:  Nom (Last Name)
8:  Prénom (First Name)
9:  Date de naissance (YYYYMMDD)
10: Sexe (M/F/U)
11: Adresse
12: Code postal
13: Ville
14: Pays
15: Téléphone
16: Téléphone portable
17: Email
18: Nom de naissance
19: Prénom usuel
20: Situation familiale
21: Nombre d'enfants
22: Profession
23: Médecin traitant
24: Établissement de naissance
25: Ville de naissance
26: Pays de naissance
27: Nationalité
28: INS (Identifiant National de Santé)
29: INS-C (Calcul)
30: NIR (Numéro de Sécurité Sociale)
31: Clé NIR
32: OID NIR
33: Matricule d'identité
34: Pays identité
35: Date décès (YYYYMMDD)
36: Indicateur de décès
37: Commentaire
Example:
ID|M1|C|HEXAGONE|20260122120000|USER001|PAT12345|DUPONT|JEAN|19750315|M|15 RUE DE LA PAIX|75001|PARIS|FRA|0612345678||||||||||||||||||||||||||||||
Explanation:
  • Type: Identity message
  • Code: M1 (Patient demographics)
  • Mode: C (Creation - new patient registration)
  • Patient: DUPONT JEAN, born 15/03/1975, Male
  • Contact: 06 12 34 56 78, 15 RUE DE LA PAIX, 75001 PARIS, France
  • System: Message from HEXAGONE system, user USER001, timestamp 22/01/2026 12:00:00
用途: 患者人口统计信息(注册)
字段结构(共38个字段):
0:  Type (ID)
1:  Message (M1)
2:  Mode (C/M/D)
3:  Emetteur (发送方)
4:  Date (YYYYMMDDHHmmss)
5:  User
6:  IPP(患者ID)
7:  Nom(姓氏)
8:  Prénom(名字)
9:  Date de naissance(YYYYMMDD)
10: Sexe(M/F/U)
11: Adresse(地址)
12: Code postal(邮政编码)
13: Ville(城市)
14: Pays(国家)
15: Téléphone(电话)
16: Téléphone portable(移动电话)
17: Email(邮箱)
18: Nom de naissance(婚前姓氏)
19: Prénom usuel(常用名)
20: Situation familiale(家庭状况)
21: Nombre d'enfants(子女数量)
22: Profession(职业)
23: Médecin traitant(主治医生)
24: Établissement de naissance(出生地机构)
25: Ville de naissance(出生城市)
26: Pays de naissance(出生国家)
27: Nationalité(国籍)
28: INS(全国健康ID)
29: INS-C(计算值)
30: NIR(社保号)
31: Clé NIR(社保号校验位)
32: OID NIR(社保号OID)
33: Matricule d'identité(身份编号)
34: Pays identité(身份所属国家)
35: Date décès(死亡日期,YYYYMMDD)
36: Indicateur de décès(死亡标识)
37: Commentaire(备注)
示例:
ID|M1|C|HEXAGONE|20260122120000|USER001|PAT12345|DUPONT|JEAN|19750315|M|15 RUE DE LA PAIX|75001|PARIS|FRA|0612345678||||||||||||||||||||||||||||||
解释:
  • 类型: 身份消息
  • 代码: M1(患者人口统计信息)
  • 模式: C(创建 - 新患者注册)
  • 患者: DUPONT JEAN,1975年3月15日出生,男性
  • 联系方式: 06 12 34 56 78,法国巴黎市和平街15号,邮编75001
  • 系统: 消息来自HEXAGONE系统,用户USER001,时间戳2026年1月22日12:00:00

ID|MT - Treating Physician

ID|MT - 主治医生

Purpose: Assign or update patient's treating physician (médecin traitant)
Field Structure (13 fields total):
0:  Type (ID)
1:  Message (MT)
2:  Mode (C/M/D)
3:  Emetteur
4:  Date
5:  User
6:  IPP
7:  Code médecin traitant
8:  Nom médecin traitant
9:  Prénom médecin traitant
10: Spécialité
11: Date début
12: Date fin
Example:
ID|MT|C|HEXAGONE|20260122120000|USER001|PAT12345|PR_MARTIN|MARTIN|SOPHIE|CARDIOLOGUE|20260122||
Explanation:
  • Type: Identity message
  • Code: MT (Médecin Traitant - Treating Physician)
  • Mode: C (Creation - assign new treating physician)
  • Patient: PAT12345
  • Physician: Dr. MARTIN SOPHIE, Cardiologist, code PR_MARTIN
  • Effective: From 22/01/2026 (no end date)
用途: 分配或更新患者的主治医生(médecin traitant)
字段结构(共13个字段):
0:  Type (ID)
1:  Message (MT)
2:  Mode (C/M/D)
3:  Emetteur
4:  Date
5:  User
6:  IPP
7:  Code médecin traitant(主治医生代码)
8:  Nom médecin traitant(主治医生姓氏)
9:  Prénom médecin traitant(主治医生名字)
10: Spécialité(专科)
11: Date début(生效日期)
12: Date fin(失效日期)
示例:
ID|MT|C|HEXAGONE|20260122120000|USER001|PAT12345|PR_MARTIN|MARTIN|SOPHIE|CARDIOLOGUE|20260122||
解释:
  • 类型: 身份消息
  • 代码: MT(主治医生)
  • 模式: C(创建 - 分配新主治医生)
  • 患者: PAT12345
  • 医生: MARTIN SOPHIE医生,心脏病专科,代码PR_MARTIN
  • 生效时间: 2026年1月22日起(无失效日期)

ID|CE - Informed Consent

ID|CE - 知情同意

Purpose: Record patient consent for treatment/data processing
Field Structure (11 fields total):
0:  Type (ID)
1:  Message (CE)
2:  Mode (C/M/D)
3:  Emetteur
4:  Date
5:  User
6:  IPP
7:  Type consentement
8:  Statut (OUI/NON)
9:  Date début validité
10: Date fin validité
用途: 记录患者对治疗/数据处理的同意情况
字段结构(共11个字段):
0:  Type (ID)
1:  Message (CE)
2:  Mode (C/M/D)
3:  Emetteur
4:  Date
5:  User
6:  IPP
7:  Type consentement(同意类型)
8:  Statut(OUI/NON,是/否)
9:  Date début validité(生效日期)
10: Date fin validité(失效日期)

Movement Messages (MV|*)

流转消息 (MV|*)

MV|M2 - Patient Admission

MV|M2 - 患者入院

Purpose: Hospital admission (admission hospitalière)
Field Structure (19 fields total):
0:  Type (MV)
1:  Message (M2)
2:  Mode (C/M/D)
3:  Emetteur
4:  Date
5:  User
6:  IPP
7:  Numéro de séjour (Visit ID)
8:  Date/heure entrée (YYYYMMDDHHmmss)
9:  Mode d'entrée (URGENCE/MUTATION/DOMICILE)
10: Établissement
11: Service
12: Unité fonctionnelle (UF)
13: Lit
14: Médecin responsable
15: Provenance
16: Type hospitalisation
17: Mode de traitement
18: Motif d'admission
Example:
MV|M2|C|HEXAGONE|20260122140000|USER001|PAT12345|VIS20260122001|20260122140000|URGENCE|CHU_PARIS|CARDIO|UF_CARDIO_01|LIT_001|PR_MARTIN|||||||
Explanation:
  • Type: Movement message
  • Code: M2 (Hospital admission)
  • Mode: C (Creation - new admission)
  • Patient: PAT12345
  • Visit: VIS20260122001 (unique visit identifier)
  • Admission: 22/01/2026 14:00:00 via Emergency Department
  • Location: CHU_PARIS, Cardiology service, UF_CARDIO_01, Bed LIT_001
  • Care Team: Attending physician PR_MARTIN
用途: 住院登记(admission hospitalière)
字段结构(共19个字段):
0:  Type (MV)
1:  Message (M2)
2:  Mode (C/M/D)
3:  Emetteur
4:  Date
5:  User
6:  IPP
7:  Numéro de séjour(就诊ID)
8:  Date/heure entrée(入院日期/时间,YYYYMMDDHHmmss)
9:  Mode d'entrée(入院方式:URGENCE/急诊、MUTATION/转院、DOMICILE/居家)
10: Établissement(机构)
11: Service(科室)
12: Unité fonctionnelle (UF,功能单元)
13: Lit(床位)
14: Médecin responsable(责任医生)
15: Provenance(来源)
16: Type hospitalisation(住院类型)
17: Mode de traitement(治疗模式)
18: Motif d'admission(入院原因)
示例:
MV|M2|C|HEXAGONE|20260122140000|USER001|PAT12345|VIS20260122001|20260122140000|URGENCE|CHU_PARIS|CARDIO|UF_CARDIO_01|LIT_001|PR_MARTIN|||||||
解释:
  • 类型: 流转消息
  • 代码: M2(住院登记)
  • 模式: C(创建 - 新入院)
  • 患者: PAT12345
  • 就诊: VIS20260122001(唯一就诊标识)
  • 入院: 2026年1月22日14:00:00,急诊入院
  • 位置: 巴黎大学医院(CHU_PARIS),心脏病科,功能单元UF_CARDIO_01,床位LIT_001
  • 医疗团队: 责任医生PR_MARTIN

MV|M3 - Status Change

MV|M3 - 状态变更

Purpose: Change in patient administrative status
Field Structure:
0-5:  Common fields (Type, Message, Mode, Emetteur, Date, User)
6:    IPP
7:    Numéro de séjour
8:    Ancien statut
9:    Nouveau statut
10:   Date changement statut
11:   Motif changement
用途: 患者行政状态变更
字段结构:
0-5:  通用字段(Type、Message、Mode、Emetteur、Date、User)
6:    IPP
7:    Numéro de séjour(就诊ID)
8:    Ancien statut(原状态)
9:    Nouveau statut(新状态)
10:   Date changement statut(状态变更日期)
11:   Motif changement(变更原因)

MV|M6 - Unit Entry/Transfer

MV|M6 - 单元/科室转移

Purpose: Patient transfer between units or services
Field Structure (18 fields total):
0:  Type (MV)
1:  Message (M6)
2:  Mode (C/M/D)
3:  Emetteur
4:  Date
5:  User
6:  IPP
7:  Numéro de séjour
8:  Nouvelle UF
9:  Nouveau lit
10: Nouveau service
11: Ancienne UF
12: Ancien lit
13: Ancien service
14: Date/heure mouvement
15: Mode de transfert
16: Nouveau médecin responsable
17: Motif de transfert
Example:
MV|M6|C|HEXAGONE|20260123090000|USER002|PAT12345|VIS20260122001|UF_NEURO_01|LIT_102|NEURO|UF_CARDIO_01|LIT_001|CARDIO||||||
Explanation:
  • Type: Movement message
  • Code: M6 (Unit transfer)
  • Mode: C (Creation - new transfer event)
  • Patient: PAT12345 in visit VIS20260122001
  • From: Cardiology UF_CARDIO_01, Bed LIT_001
  • To: Neurology UF_NEURO_01, Bed LIT_102
  • Timestamp: 23/01/2026 09:00:00
用途: 患者在单元或科室间转移
字段结构(共18个字段):
0:  Type (MV)
1:  Message (M6)
2:  Mode (C/M/D)
3:  Emetteur
4:  Date
5:  User
6:  IPP
7:  Numéro de séjour(就诊ID)
8:  Nouvelle UF(新功能单元)
9:  Nouveau lit(新床位)
10: Nouveau service(新科室)
11: Ancienne UF(原功能单元)
12: Ancien lit(原床位)
13: Ancien service(原科室)
14: Date/heure mouvement(转移日期/时间)
15: Mode de transfert(转移方式)
16: Nouveau médecin responsable(新责任医生)
17: Motif de transfert(转移原因)
示例:
MV|M6|C|HEXAGONE|20260123090000|USER002|PAT12345|VIS20260122001|UF_NEURO_01|LIT_102|NEURO|UF_CARDIO_01|LIT_001|CARDIO||||||
解释:
  • 类型: 流转消息
  • 代码: M6(单元转移)
  • 模式: C(创建 - 新转移事件)
  • 患者: PAT12345,就诊ID为VIS20260122001
  • 原位置: 心脏病科,功能单元UF_CARDIO_01,床位LIT_001
  • 新位置: 神经内科,功能单元UF_NEURO_01,床位LIT_102
  • 时间戳: 2026年1月23日09:00:00

MV|M8 - Unit Exit

MV|M8 - 功能单元转出

Purpose: Exit from functional unit (without discharge)
Field Structure:
0-5:  Common fields
6:    IPP
7:    Numéro de séjour
8:    UF de sortie
9:    Date/heure sortie UF
10:   Destination
11:   Mode de sortie
用途: 从功能单元转出(未出院)
字段结构:
0-5:  通用字段
6:    IPP
7:    Numéro de séjour(就诊ID)
8:    UF de sortie(转出功能单元)
9:    Date/heure sortie UF(转出日期/时间)
10:   Destination(目的地)
11:   Mode de sortie(转出方式)

MV|M9 - Hospital Discharge

MV|M9 - 患者出院

Purpose: Patient discharge from hospital
Field Structure (14 fields total):
0:  Type (MV)
1:  Message (M9)
2:  Mode (C/M/D)
3:  Emetteur
4:  Date
5:  User
6:  IPP
7:  Numéro de séjour
8:  Date/heure sortie (YYYYMMDDHHmmss)
9:  Mode de sortie (DOMICILE/MUTATION/DECES)
10: Destination
11: État à la sortie (AMELIORE/STATIONNAIRE/AGGRAVE)
12: Médecin ayant autorisé la sortie
13: Motif de sortie
Example:
MV|M9|C|HEXAGONE|20260125180000|USER003|PAT12345|VIS20260122001|20260125180000|DOMICILE||AMELIORE||||
Explanation:
  • Type: Movement message
  • Code: M9 (Hospital discharge)
  • Mode: C (Creation - new discharge event)
  • Patient: PAT12345, visit VIS20260122001
  • Discharge: 25/01/2026 18:00:00
  • Destination: DOMICILE (Home)
  • Status: AMELIORE (Improved condition)
用途: 患者出院
字段结构(共14个字段):
0:  Type (MV)
1:  Message (M9)
2:  Mode (C/M/D)
3:  Emetteur
4:  Date
5:  User
6:  IPP
7:  Numéro de séjour(就诊ID)
8:  Date/heure sortie(出院日期/时间,YYYYMMDDHHmmss)
9:  Mode de sortie(出院方式:DOMICILE/居家、MUTATION/转院、DECES/死亡)
10: Destination(目的地)
11: État à la sortie(出院状态:AMELIORE/好转、STATIONNAIRE/稳定、AGGRAVE/恶化)
12: Médecin ayant autorisé la sortie(授权出院医生)
13: Motif de sortie(出院原因)
示例:
MV|M9|C|HEXAGONE|20260125180000|USER003|PAT12345|VIS20260122001|20260125180000|DOMICILE||AMELIORE||||
解释:
  • 类型: 流转消息
  • 代码: M9(患者出院)
  • 模式: C(创建 - 新出院事件)
  • 患者: PAT12345,就诊ID为VIS20260122001
  • 出院: 2026年1月25日18:00:00
  • 目的地: DOMICILE(居家)
  • 状态: AMELIORE(病情好转)

MV|B1 - Urgency/Box Movement

MV|B1 - 急诊区域转移

Purpose: Emergency department box movement
Field Structure:
0-5:  Common fields
6:    IPP
7:    Numéro de passage aux urgences
8:    Box de départ
9:    Box d'arrivée
10:   Date/heure mouvement
11:   Motif
用途: 急诊科室区域内转移
字段结构:
0-5:  通用字段
6:    IPP
7:    Numéro de passage aux urgences(急诊就诊号)
8:    Box de départ(原急诊区域)
9:    Box d'arrivée(新急诊区域)
10:   Date/heure mouvement(转移日期/时间)
11:   Motif(原因)

MV|MT - Temporary Movement

MV|MT - 临时流转

Purpose: Temporary patient movement (exam, procedure)
Field Structure:
0-5:  Common fields
6:    IPP
7:    Numéro de séjour
8:    Lieu de départ
9:    Lieu d'arrivée
10:   Date/heure départ
11:   Date/heure retour prévue
12:   Motif (EXAMEN/BLOC/RADIOLOGIE)
用途: 患者临时流转(检查、手术)
字段结构:
0-5:  通用字段
6:    IPP
7:    Numéro de séjour(就诊ID)
8:    Lieu de départ(出发位置)
9:    Lieu d'arrivée(到达位置)
10:   Date/heure départ(出发日期/时间)
11:   Date/heure retour prévue(预计返回日期/时间)
12:   Motif(原因:EXAMEN/检查、BLOC/手术、RADIOLOGIE/放射)

Coverage Messages (CV|*)

保险覆盖消息 (CV|*)

CV|M1 - Insurance Coverage

CV|M1 - 保险覆盖信息

Purpose: Patient insurance and coverage information
Field Structure (20 fields total):
0:  Type (CV)
1:  Message (M1)
2:  Mode (C/M/D)
3:  Emetteur
4:  Date
5:  User
6:  IPP
7:  Organisme payeur
8:  Code régime
9:  Caisse
10: Centre
11: Numéro adhérent
12: Clé adhérent
13: Rang bénéficiaire
14: Date début droits
15: Date fin droits
16: Type couverture (CPAM/MUTUELLE/AME)
17: Taux de remboursement
18: ALD (Affection Longue Durée)
19: CMU/CMUC
Example:
CV|M1|C|HEXAGONE|20260122120000|USER001|PAT12345|CPAM75|01|750|001|1234567890|12|00|20260101|20261231|CPAM|100|OUI|NON
Explanation:
  • Type: Coverage message
  • Code: M1 (Insurance information)
  • Patient: PAT12345
  • Insurer: CPAM 75 (Paris Social Security), code 01/750/001
  • Member: #1234567890, key 12, rank 00 (primary insured)
  • Validity: 01/01/2026 to 31/12/2026
  • Coverage: CPAM (National Health Insurance), 100% reimbursement
  • Special: ALD (Long-term condition) = YES, CMU = NO
用途: 患者保险及覆盖范围信息
字段结构(共20个字段):
0:  Type (CV)
1:  Message (M1)
2:  Mode (C/M/D)
3:  Emetteur
4:  Date
5:  User
6:  IPP
7:  Organisme payeur(付款机构)
8:  Code régime(保险方案代码)
9:  Caisse(保险基金)
10: Centre(中心)
11: Numéro adhérent(会员编号)
12: Clé adhérent(会员校验位)
13: Rang bénéficiaire(受益人等级)
14: Date début droits(权益生效日期)
15: Date fin droits(权益失效日期)
16: Type couverture(覆盖类型:CPAM/国家医保、MUTUELLE/补充保险、AME/医疗救助)
17: Taux de remboursement(报销比例)
18: ALD(Affection Longue Durée,长期慢性病)
19: CMU/CMUC(Couverture Maladie Universelle,全民医保)
示例:
CV|M1|C|HEXAGONE|20260122120000|USER001|PAT12345|CPAM75|01|750|001|1234567890|12|00|20260101|20261231|CPAM|100|OUI|NON
解释:
  • 类型: 保险覆盖消息
  • 代码: M1(保险信息)
  • 患者: PAT12345
  • 保险公司: CPAM 75(巴黎国家医保基金),代码01/750/001
  • 会员: 编号1234567890,校验位12,等级00(主投保人)
  • 有效期: 2026年1月1日至2026年12月31日
  • 覆盖范围: CPAM(国家医保),报销比例100%
  • 特殊情况: ALD(长期慢性病)= 是,CMU(全民医保)= 否

Parsing Logic

解析逻辑

When asked to parse an HPK message:
当解析HPK消息时:

Step 1: Split and Identify

步骤1: 拆分与识别

  1. Split by pipe delimiter:
    fields = message.split('|')
  2. Identify message type: Check fields[0], fields[1], and fields[2]
    • Type: fields[0] (ID, MV, CV, PR, FO, MA, CO, LI, RO, FA, SO, RD, IM, DD, UT, ST)
    • Message code: fields[1] (M1, M2, M3, M6, M8, M9, MT, CE, B1, etc.)
    • Mode: fields[2] (C=Creation, M=Modification, S/D=Suppression/Deletion)
  3. Look up in HPK Dictionary: Use message key
    {Type}|{Message}
    to get field definitions from
    @erp-pas/hpk-dictionary
  1. 按竖线分隔拆分:
    fields = message.split('|')
  2. 识别消息类型: 检查fields[0]、fields[1]和fields[2]
    • 类型: fields[0](ID、MV、CV、PR、FO、MA、CO、LI、RO、FA、SO、RD、IM、DD、UT、ST)
    • 消息代码: fields[1](M1、M2、M3、M6、M8、M9、MT、CE、B1等)
    • 模式: fields[2](C=创建、M=修改、S/D=删除)
  3. 查询HPK字典: 使用消息键
    {Type}|{Message}
    @erp-pas/hpk-dictionary
    获取字段定义

Step 2: Extract Base Fields

步骤2: 提取基础字段

Extract standard header fields (always present in positions 0-5):
PositionFieldFormatDescription
0Type2 charsMessage category
1Message2 charsSpecific message type
2Mode1 charOperation (C/M/S/D)
3Emetteur15 charsSender system
4Date16 charsTimestamp (YYYYMMDDHHMISSnn)
5User50 charsUser identifier
提取标准头部字段(始终位于0-5位):
位置字段格式描述
0Type2字符消息类别
1Message2字符具体消息类型
2Mode1字符操作类型(C/M/S/D)
3Emetteur15字符发送方系统
4Date16字符时间戳(YYYYMMDDHHMISSnn)
5User50字符用户标识

Step 3: Extract Type-Specific Fields

步骤3: 提取类型专属字段

Based on message type, extract remaining fields:
ID|M1 (Identity - fields 6-37):
  • 6: IPP (Patient ID)
  • 7: Nom (Last Name)
  • 8: Prénom (First Name)
  • 9: Date de naissance (YYYYMMDD)
  • 10: Sexe (M/F/U)
  • 11-37: Additional demographic fields
MV|M2 (Admission - fields 6-18):
  • 6: IPP
  • 7: Numéro de séjour (Visit ID)
  • 8: Date/heure entrée
  • 9: Mode d'entrée
  • 10-18: Location and care team details
MV|M6 (Transfer - fields 6-17):
  • 6: IPP
  • 7: Numéro de séjour
  • 8-10: New location (UF, Bed, Service)
  • 11-13: Previous location
  • 14-17: Transfer details
MV|M9 (Discharge - fields 6-13):
  • 6: IPP
  • 7: Numéro de séjour
  • 8: Date/heure sortie
  • 9: Mode de sortie
  • 10-13: Discharge details
CV|M1 (Coverage - fields 6-19):
  • 6: IPP
  • 7-19: Insurance and coverage details
根据消息类型提取剩余字段:
ID|M1(身份 - 字段6-37):
  • 6: IPP(患者ID)
  • 7: Nom(姓氏)
  • 8: Prénom(名字)
  • 9: Date de naissance(YYYYMMDD)
  • 10: Sexe(M/F/U)
  • 11-37: 附加人口统计字段
MV|M2(入院 - 字段6-18):
  • 6: IPP
  • 7: Numéro de séjour(就诊ID)
  • 8: Date/heure entrée(入院日期/时间)
  • 9: Mode d'entrée(入院方式)
  • 10-18: 位置和医疗团队详情
MV|M6(转移 - 字段6-17):
  • 6: IPP
  • 7: Numéro de séjour(就诊ID)
  • 8-10: 新位置(功能单元、床位、科室)
  • 11-13: 原位置
  • 14-17: 转移详情
MV|M9(出院 - 字段6-13):
  • 6: IPP
  • 7: Numéro de séjour(就诊ID)
  • 8: Date/heure sortie(出院日期/时间)
  • 9: Mode de sortie(出院方式)
  • 10-13: 出院详情
CV|M1(保险覆盖 - 字段6-19):
  • 6: IPP
  • 7-19: 保险及覆盖范围详情

Step 4: Format Data

步骤4: 格式化数据

Apply formatting based on data types:
  1. Date fields (YYYYMMDD):
    • Parse:
      20260122
      22/01/2026
    • Validation: Check valid date
  2. DateTime fields (YYYYMMDDHHMISSnn):
    • Parse:
      20260122140530
      22/01/2026 14:05:30
    • nn = centiseconds (usually ignored in display)
  3. Enumerated values:
    • Gender: M (Male), F (Female), U (Unknown)
    • Mode: C (Creation), M (Modification), S/D (Suppression)
    • Entry modes: URGENCE, MUTATION, DOMICILE, etc.
  4. Empty fields:
    • Empty string or consecutive pipes
      ||
    • Display as "Not provided" or leave blank
根据数据类型应用格式化规则:
  1. 日期字段(YYYYMMDD):
    • 解析:
      20260122
      22/01/2026
    • 验证: 检查日期有效性
  2. 日期时间字段(YYYYMMDDHHMISSnn):
    • 解析:
      20260122140530
      22/01/2026 14:05:30
    • nn = 厘秒(显示时通常忽略)
  3. 枚举值:
    • 性别: M(男)、F(女)、U(未知)
    • 模式: C(创建)、M(修改)、S/D(删除)
    • 入院方式: URGENCE、MUTATION、DOMICILE等
  4. 空字段:
    • 空字符串或连续竖线
      ||
    • 显示为“未提供”或留空

Step 5: Validate Message

步骤5: 验证消息

Using HPK Dictionary definitions:
  1. Field count validation:
    expected_count = len(dictionary[message_key].fields)
    actual_count = len(fields)
    if actual_count != expected_count:
        warn("Field count mismatch")
  2. Required field validation:
    for field_def in dictionary[message_key].fields:
        if field_def.isMandatory and not fields[field_def.position]:
            error(f"Missing required field: {field_def.description}")
  3. Type validation:
    • Date: Check format YYYYMMDD and valid date
    • Number: Check numeric and within range
    • String: Check length <= maximum
  4. Length validation:
    if len(field_value) > field_def.length:
        warn(f"Field exceeds maximum length: {field_def.description}")
使用HPK字典定义进行验证:
  1. 字段数量验证:
    expected_count = len(dictionary[message_key].fields)
    actual_count = len(fields)
    if actual_count != expected_count:
        warn("字段数量不匹配")
  2. 必填字段验证:
    for field_def in dictionary[message_key].fields:
        if field_def.isMandatory and not fields[field_def.position]:
            error(f"缺失必填字段: {field_def.description}")
  3. 类型验证:
    • 日期: 检查格式为YYYYMMDD且日期有效
    • 数字: 检查为数字且在范围内
    • 字符串: 检查长度不超过最大值
  4. 长度验证:
    if len(field_value) > field_def.length:
        warn(f"字段超过最大长度: {field_def.description}")

Step 6: Generate Explanation

步骤6: 生成解释说明

Provide context and interpretation:
  1. Message purpose: Describe what this message does
  2. Operation type: Explain C/M/S/D mode
  3. Key data points: Highlight important clinical/administrative data
  4. Business context: Explain workflow implications
  5. Related messages: Mention typical message sequences
提供上下文和解读:
  1. 消息用途: 描述该消息的作用
  2. 操作类型: 解释C/M/S/D模式
  3. 关键数据点: 突出重要临床/行政数据
  4. 业务上下文: 解释工作流影响
  5. 相关消息: 提及典型消息序列

Validation Rules

验证规则

Structural Validation

结构验证

  1. Message format: Must start with valid Type|Message|Mode pattern
  2. Uppercase header: First 6 fields must be uppercase
  3. Pipe delimiter: Fields separated by
    |
    (ASCII 124)
  4. No spaces: Empty fields represented as
    ||
    not
    | |
  5. Trailing pipes: May have trailing pipes for optional fields
  1. 消息格式: 必须以有效的Type|Message|Mode模式开头
  2. 头部大写: 前6个字段必须为大写
  3. 竖线分隔符: 字段使用
    |
    (ASCII 124)分隔
  4. 无空格: 空字段用
    ||
    表示,而非
    | |
  5. 尾部竖线: 可选字段可保留尾部竖线

Field-Level Validation

字段级验证

From HPK Dictionary
isMandatory
and
type
properties:
  1. Required fields: Must not be empty if
    isMandatory: true
  2. Date format: Must match YYYYMMDD or YYYYMMDDHHMISSnn
  3. Numeric fields: Must contain only digits (and decimal point if applicable)
  4. Length limits: Must not exceed
    length
    property from dictionary
  5. Enumerated values: Must match allowed values (check
    comment
    field)
基于HPK字典的
isMandatory
type
属性:
  1. 必填字段: 如果
    isMandatory: true
    ,则字段不能为空
  2. 日期格式: 必须匹配YYYYMMDD或YYYYMMDDHHMISSnn格式
  3. 数字字段: 必须仅包含数字(如需可含小数点)
  4. 长度限制: 不得超过字典中
    length
    属性定义的最大值
  5. 枚举值: 必须匹配允许的值(查看
    comment
    字段)

Business Logic Validation

业务逻辑验证

From HPK specifications and business rules:
  1. IPP consistency: Same IPP across related messages in a sequence
  2. Visit number: MV messages for same episode must share visit number
  3. Date sequences:
    • Admission date ≤ Transfer date ≤ Discharge date
    • Start date ≤ End date for coverage periods
  4. Location references: Service/Unit/Bed must exist in organizational structure
  5. Practitioner references: Physician codes must be valid in system
基于HPK规范和业务规则:
  1. IPP一致性: 同序列相关消息的IPP必须一致
  2. 就诊号: 同一诊疗周期的MV消息必须共享就诊号
  3. 日期序列:
    • 入院日期 ≤ 转移日期 ≤ 出院日期
    • 保险覆盖开始日期 ≤ 结束日期
  4. 位置引用: 科室/单元/床位必须存在于组织结构中
  5. 医护人员引用: 医生代码必须在系统中有效

Data Quality Checks

数据质量检查

  1. Date reasonableness:
    • Birth date not in future
    • Admission date within reasonable range
    • Not more than 120 years old (unless special case)
  2. Identifier formats:
    • IPP: Check format and checksum (if applicable)
    • NIR: 15 digits (13 + 2 key) with Luhn validation
    • FINESS: 9 digits for facilities
  3. Code validity:
    • Gender codes: M, F, U only
    • Country codes: ISO 3166-1 alpha-3 (FRA, etc.)
    • Insurance regime codes: Check against référentiel
  1. 日期合理性:
    • 出生日期不能是未来日期
    • 入院日期需在合理范围内
    • 年龄不超过120岁(特殊情况除外)
  2. 标识格式:
    • IPP: 检查格式和校验和(如适用)
    • NIR: 15位数字(13位+2位校验位),需通过Luhn验证
    • FINESS: 机构标识为9位数字
  3. 代码有效性:
    • 性别代码: 仅允许M、F、U
    • 国家代码: ISO 3166-1 alpha-3(如FRA等)
    • 保险方案代码: 对照参考库检查

Error Reporting

错误报告

When validation fails, report:
markdown
**Validation Issues**:
**Error**: Missing required field at position 7 (Last Name)
⚠️  **Warning**: Field 9 (Birth Date) exceeds maximum length
⚠️  **Warning**: Field count mismatch - expected 38, got 35
ℹ️  **Info**: Optional field 16 (Mobile phone) not provided
Severity levels:
  • Error (❌): Message cannot be processed
  • Warning (⚠️): Message may have issues but can be processed
  • Info (ℹ️): Optional fields or minor issues
验证失败时,按以下格式报告:
markdown
**验证问题**:
**错误**: 位置7(姓氏)缺失必填字段
⚠️  **警告**: 位置9(出生日期)超过最大长度
⚠️  **警告**: 字段数量不匹配 - 预期38个,实际35个
ℹ️  **信息**: 可选字段16(移动电话)未提供
严重级别:
  • 错误 (❌): 消息无法处理
  • 警告 (⚠️): 消息可能存在问题但可处理
  • 信息 (ℹ️): 可选字段或次要问题

Example Output Format

示例输出格式

When parsing a message, provide:
markdown
undefined
解析消息时,提供以下格式输出:
markdown
undefined

HPK Message Analysis

HPK消息分析

Raw Message:
[original HPK message]
Message Identification:
  • Type: [ID/MV/CV]
  • Code: [M1/M2/M6/M9/etc.]
  • Full Name: [descriptive name]
  • Operation: [Creation/Modification/Deletion]
Core Fields:
  • Sender System: [emetteur]
  • Timestamp: [formatted date/time]
  • User: [user ID]
[Type]-Specific Fields: [List all relevant fields with labels and values]
Business Context: [Explain what this message represents and its purpose]
Validation:
  • Field count: [actual] (expected: [expected for this type])
  • Required fields: [✓ or ✗ for each required field]
  • Date formats: [✓ or ✗]
  • Enumerated values: [✓ or ✗]
undefined
原始消息:
[原始HPK消息]
消息标识:
  • 类型: [ID/MV/CV]
  • 代码: [M1/M2/M6/M9等]
  • 全名: [描述性名称]
  • 操作: [创建/修改/删除]
核心字段:
  • 发送方系统: [emetteur]
  • 时间戳: [格式化日期/时间]
  • 用户: [用户ID]
[类型]专属字段: [列出所有相关字段的标签和值]
业务上下文: [解释该消息代表的含义和用途]
验证结果:
  • 字段数量: [实际数量](预期: [该类型预期数量])
  • 必填字段: [每个必填字段的✓或✗]
  • 日期格式: [✓或✗]
  • 枚举值: [✓或✗]
undefined

HPK Dictionary Integration

HPK字典集成

GitLab Repository

GitLab仓库

Repository: https://gitlab-erp-pas.dedalus.lan/erp-pas/hexagone/hpk-dictionary
Package:
@erp-pas/hpk-dictionary
(NPM)
Version: 1.0.5+
Purpose: Authoritative source of truth for all HPK message definitions
仓库地址: https://gitlab-erp-pas.dedalus.lan/erp-pas/hexagone/hpk-dictionary
:
@erp-pas/hpk-dictionary
(NPM)
版本: 1.0.5+
用途: 所有HPK消息定义的权威数据源

Dictionary Structure

字典结构

The HPK dictionary is an NPM package that provides comprehensive message definitions for the Hexagone healthcare system. Each message type includes:
javascript
{
  description: String,        // Human-readable message description
  fields: Array[{
    position: Number,         // Field position (1-based)
    description: String,      // Field description
    length: Number,          // Maximum field length
    type: String,            // Data type (String, Number, Date, etc.)
    isMandatory: Boolean,    // Required field flag
    comment: String          // Additional notes/rules
  }]
}
HPK字典是一个NPM包,为Hexagone医疗系统提供全面的消息定义。每种消息类型包含:
javascript
{
  description: String,        // 易读的消息描述
  fields: Array[{
    position: Number,         // 字段位置(从1开始)
    description: String,      // 字段描述
    length: Number,          // 字段最大长度
    type: String,            // 数据类型(String、Number、Date等)
    isMandatory: Boolean,    // 必填字段标识
    comment: String          // 附加说明/规则
  }]
}

Dictionary Access Example

字典访问示例

javascript
const hpk = require('@erp-pas/hpk-dictionary')

// Access message definition
const idM1 = hpk.segments['ID|M1']
console.log(idM1.description)  // "Suppression Identité Patient"

// Iterate through field definitions
idM1.fields.forEach(field => {
  console.log(`${field.position}. ${field.description} (${field.type}, max: ${field.length})`)
  if (field.isMandatory) console.log('   ⚠️  Required')
})
javascript
const hpk = require('@erp-pas/hpk-dictionary')

// 访问消息定义
const idM1 = hpk.segments['ID|M1']
console.log(idM1.description)  // "患者身份创建/修改"

// 遍历字段定义
idM1.fields.forEach(field => {
  console.log(`${field.position}. ${field.description} (${field.type}, 最大长度: ${field.length})`)
  if (field.isMandatory) console.log('   ⚠️  必填')
})

Message Categories in Dictionary

字典中的消息类别

The HPK dictionary defines 100+ message types across these domains:
HPK字典定义了100余种消息类型,涵盖以下领域:

Identity & User Management (ID, UT)

身份与用户管理(ID、UT)

  • ID|M1: Patient identity creation/modification
  • ID|MT: Treating physician assignment
  • ID|CE: Informed consent
  • UT|A1: User account management
  • ID|M1: 患者身份创建/修改
  • ID|MT: 主治医生分配
  • ID|CE: 知情同意
  • UT|A1: 用户账号管理

Patient Movements (MV)

患者流转(MV)

  • MV|M2: Hospital admission
  • MV|M3: Administrative status change
  • MV|M6: Unit/service transfer
  • MV|M8: Functional unit exit
  • MV|M9: Hospital discharge
  • MV|B1: Emergency box movement
  • MV|MT: Temporary movement (exam, procedure)
  • MV|M2: 住院登记
  • MV|M3: 行政状态变更
  • MV|M6: 单元/科室转移
  • MV|M8: 功能单元转出
  • MV|M9: 患者出院
  • MV|B1: 急诊区域转移
  • MV|MT: 临时流转(检查、手术)

Coverage & Financial (CV, FA)

保险覆盖与财务(CV、FA)

  • CV|M1: Insurance coverage information
  • FA|FE: Invoice header
  • FA|FL: Invoice lines
  • CV|M1: 保险覆盖信息
  • FA|FE: 发票头部
  • FA|FL: 发票明细

Organizational Structure (ST)

组织结构(ST)

  • ST|EJ: Legal establishment (Établissement Juridique)
  • ST|EG: Geographic establishment (Établissement Géographique)
  • ST|BA: Building (Bâtiment)
  • ST|ET: Floor (Étage)
  • ST|CH: Room (Chambre)
  • ST|EJ: 法律实体(Établissement Juridique)
  • ST|EG: 地理机构(Établissement Géographique)
  • ST|BA: 建筑(Bâtiment)
  • ST|ET: 楼层(Étage)
  • ST|CH: 房间(Chambre)

Supply Chain Management (PR, FO, MA, CO, LI, RO)

供应链管理(PR、FO、MA、CO、LI、RO)

  • PR|M0-M5: Product management
  • FO|M1-M3: Supplier management
  • MA|M1-M3: Contract/market management
  • CO|M1-M2: Orders
  • LI|M1-M2: External deliveries
  • RO|M1-M2: Receptions
  • PR|M0-M5: 产品管理
  • FO|M1-M3: 供应商管理
  • MA|M1-M3: 合同/市场管理
  • CO|M1-M2: 订单
  • LI|M1-M2: 外部配送
  • RO|M1-M2: 收货

Inventory & Stock (SO, IM)

库存与仓储(SO、IM)

  • SO|S1: Stock output
  • SO|I1: Inventory
  • SO|T1: Stock transfer
  • SO|L1: Pre-established lists
  • IM|M1: Asset inventory
  • SO|S1: 库存出库
  • SO|I1: 库存盘点
  • SO|T1: 库存转移
  • SO|L1: 预设清单
  • IM|M1: 资产盘点

Miscellaneous (RD, DD)

杂项(RD、DD)

  • RD|E1/L1: Miscellaneous receipts
  • DD|M1/K1: Request messages
  • RD|E1/L1: 杂项收款
  • DD|M1/K1: 请求消息

Using Dictionary for Validation

使用字典进行验证

When parsing HPK messages, use the dictionary to:
  1. Validate field count: Check actual vs. expected field count from dictionary
  2. Verify required fields: Use
    isMandatory
    flag to ensure all required fields present
  3. Type validation: Use
    type
    field to validate data format (Date, Number, String)
  4. Length validation: Use
    length
    field to ensure values don't exceed maximum
  5. Business rules: Use
    comment
    field for additional validation logic
解析HPK消息时,使用字典完成以下操作:
  1. 验证字段数量: 检查实际字段数与字典中预期数量是否一致
  2. 验证必填字段: 使用
    isMandatory
    标识确保所有必填字段存在
  3. 类型验证: 使用
    type
    字段验证数据格式(Date、Number、String)
  4. 长度验证: 使用
    length
    字段确保值不超过最大长度
  5. 业务规则: 使用
    comment
    字段获取额外验证逻辑

Field Type Reference

字段类型参考

From HPK dictionary:
  • String: Text fields (alphanumeric)
  • Number: Numeric fields (may include decimal precision like
    9999.99
    )
  • Date: Date fields (YYYYMMDD or YYYYMMDDHHMISSnn format)
  • Boolean: True/False values (represented as T/F or O/N in French: Oui/Non)
来自HPK字典:
  • String: 文本字段(字母数字)
  • Number: 数字字段(如需可含小数精度,如
    9999.99
  • Date: 日期字段(YYYYMMDD或YYYYMMDDHHMISSnn格式)
  • Boolean: 布尔值(在法语环境中用T/F或O/N表示:Oui/Non)

Reference Documentation

参考文档

Primary Source of Truth:
Internal Documentation:
  • HPK ADT Message Specification - Complete field definitions and business rules for ADT messages
  • HPK GEF Specification - Workflow and integration details for economic and financial management
Related Standards (for context):
权威数据源:
  • HPK字典仓库 - 完整的消息定义,包含字段schema、验证规则和数据类型
内部文档:
  • HPK ADT消息规范 - ADT消息的完整字段定义和业务规则
  • HPK GEF规范 - 经济和财务管理的工作流与集成细节
相关标准(供参考):

Important Notes

重要说明

Message Format Standards

消息格式标准

  1. First 6 fields MUST be uppercase (Type, Message, Mode, Emetteur, Date, User)
  2. Pipe separator: Use
    |
    as field delimiter
  3. Empty fields: Represented by consecutive pipes
    ||
    (no spaces)
  4. Maximum lengths: Specified in dictionary - do not exceed
  5. Date format: YYYYMMDDHHMISSnn (where nn = centiseconds)
  1. 前6个字段必须大写(Type、Message、Mode、Emetteur、Date、User)
  2. 竖线分隔符: 使用
    |
    作为字段分隔符
  3. 空字段: 用连续竖线
    ||
    表示(无空格)
  4. 最大长度: 遵循字典中指定的长度限制
  5. 日期格式: YYYYMMDDHHMISSnn(其中nn=厘秒)

HPK to HL7 Mapping

HPK到HL7映射

Standard Message Mappings

标准消息映射

HPK messages are often mapped to HL7 v2.5 / IHE PAM format for interoperability. The fixtures directory contains examples of these mappings.
HPK消息通常会映射为HL7 v2.5 / IHE PAM格式以实现互操作性。fixtures目录包含这些映射的示例。

Identity Messages (ID) → HL7 ADT Messages

身份消息(ID)→ HL7 ADT消息

HPK MessageHL7 MessageIHE EventDescription
ID|M1|CADT^A28Patient AddRegister new patient
ID|M1|MADT^A31Patient UpdateUpdate patient demographics
ID|M1|DADT^A29Patient DeleteDelete patient record
ID|MT|CADT^A28-Add/update treating physician
ID|CE|CADT^A28-Record informed consent
HPK消息HL7消息IHE事件描述
ID|M1|CADT^A28患者添加注册新患者
ID|M1|MADT^A31患者更新更新患者人口统计信息
ID|M1|DADT^A29患者删除删除患者记录
ID|MT|CADT^A28-添加/更新主治医生
ID|CE|CADT^A28-记录知情同意

Movement Messages (MV) → HL7 ADT Messages

流转消息(MV)→ HL7 ADT消息

HPK MessageHL7 MessageIHE EventDescription
MV|M2|CADT^A01Admit Patient [ITI-31]Hospital admission
MV|M3|CADT^A06-Status change (to outpatient)
MV|M6|CADT^A02Transfer Patient [ITI-32]Unit/service transfer
MV|M8|CADT^A02-Unit exit (internal transfer)
MV|M9|CADT^A03Discharge Patient [ITI-33]Hospital discharge
MV|B1|CADT^A02-Emergency box movement
MV|MT|CADT^A09/A10-Temporary leave/return
HPK消息HL7消息IHE事件描述
MV|M2|CADT^A01患者入院 [ITI-31]住院登记
MV|M3|CADT^A06-状态变更(转为门诊)
MV|M6|CADT^A02患者转移 [ITI-32]单元/科室转移
MV|M8|CADT^A02-单元转出(内部转移)
MV|M9|CADT^A03患者出院 [ITI-33]患者出院
MV|B1|CADT^A02-急诊区域转移
MV|MT|CADT^A09/A10-临时离开/返回

Coverage Messages (CV) → HL7 Segments

保险覆盖消息(CV)→ HL7段

HPK MessageHL7 SegmentsDescription
CV|M1|CIN1 + IN2Primary insurance
CV|M1|MIN1 + IN2Insurance update
HPK消息HL7段描述
CV|M1|CIN1 + IN2主保险
CV|M1|MIN1 + IN2保险更新

Key Field Mappings

关键字段映射

HPK ID|M1 → HL7 ADT PID Segment

HPK ID|M1 → HL7 ADT PID段

HPK Field (Position)HPK DescriptionHL7 FieldHL7 Description
6IPPPID-3Patient Identifier List
7NomPID-5.1Patient Name - Family Name
8PrénomPID-5.2Patient Name - Given Name
9Date de naissancePID-7Date/Time of Birth
10SexePID-8Administrative Sex
11-14Adresse, CP, Ville, PaysPID-11Patient Address
15-16TéléphonePID-13Phone Number - Home
28INSPID-3National Health ID (OID 1.2.250.1.213.1.4.8)
30-31NIR + CléPID-3Social Security Number (OID 1.2.250.1.213.1.4.10)
HPK字段(位置)HPK描述HL7字段HL7描述
6IPPPID-3患者标识列表
7NomPID-5.1患者姓名 - 姓氏
8PrénomPID-5.2患者姓名 - 名字
9Date de naissancePID-7出生日期/时间
10SexePID-8行政性别
11-14Adresse、CP、Ville、PaysPID-11患者地址
15-16TéléphonePID-13家庭电话
28INSPID-3全国健康ID(OID 1.2.250.1.213.1.4.8)
30-31NIR + CléPID-3社保号(OID 1.2.250.1.213.1.4.10)

HPK MV|M2 → HL7 ADT PV1 Segment

HPK MV|M2 → HL7 ADT PV1段

HPK Field (Position)HPK DescriptionHL7 FieldHL7 Description
7Numéro de séjourPV1-19Visit Number
8Date/heure entréePV1-44Admit Date/Time
9Mode d'entréePV1-4Admission Type
10ÉtablissementPV1-3.1Assigned Patient Location - Facility
11ServicePV1-3.2Assigned Patient Location - Building
12Unité fonctionnellePV1-3.3Assigned Patient Location - Floor
13LitPV1-3.4Assigned Patient Location - Bed
14Médecin responsablePV1-7Attending Doctor
HPK字段(位置)HPK描述HL7字段HL7描述
7Numéro de séjourPV1-19就诊号
8Date/heure entréePV1-44入院日期/时间
9Mode d'entréePV1-4入院类型
10ÉtablissementPV1-3.1分配患者位置 - 机构
11ServicePV1-3.2分配患者位置 - 建筑
12Unité fonctionnellePV1-3.3分配患者位置 - 楼层
13LitPV1-3.4分配患者位置 - 床位
14Médecin responsablePV1-7责任医生

HPK MV|M9 → HL7 ADT PV1 Segment

HPK MV|M9 → HL7 ADT PV1段

HPK Field (Position)HPK DescriptionHL7 FieldHL7 Description
8Date/heure sortiePV1-45Discharge Date/Time
9Mode de sortiePV1-36Discharge Disposition
11État à la sortiePV1-52Patient Condition Code
HPK字段(位置)HPK描述HL7字段HL7描述
8Date/heure sortiePV1-45出院日期/时间
9Mode de sortiePV1-36出院去向
11État à la sortiePV1-52患者状态代码

Integration Patterns

集成模式

Pattern 1: Hexagone WEB → Service Echange → External System

模式1: Hexagone WEB → 交换服务 → 外部系统

[Hexagone WEB] --HPK--> [Service Echange] --HPK/HL7--> [External System]
                        [HPK Dictionary]
                        [Mapping Rules]
Flow:
  1. Event occurs in Hexagone WEB (admission, transfer, discharge)
  2. HPK message generated using dictionary definitions
  3. Message stored in Oracle database queue
  4. Service Echange/Hexaflux processes message
  5. Message transformed to HL7 (if needed) using mapping rules
  6. Message sent to external system via configured connector
  7. Acknowledgment received and logged
[Hexagone WEB] --HPK--> [交换服务] --HPK/HL7--> [外部系统]
                        [HPK字典]
                        [映射规则]
流程:
  1. Hexagone WEB中发生事件(入院、转移、出院)
  2. 使用字典定义生成HPK消息
  3. 消息存储到Oracle数据库队列
  4. 交换服务/Hexaflux处理消息
  5. 根据映射规则将消息转换为HL7(如需)
  6. 通过配置的连接器发送消息到外部系统
  7. 接收并记录确认信息

Pattern 2: External System → Hexagone WEB (Synchronous)

模式2: 外部系统 → Hexagone WEB(同步)

[External System] --Request--> [Hexagone WEB API] --HPK Event--> [Database]
                                 [HPK Message]
                              [Service Echange] --HPK--> [Other Systems]
Flow:
  1. External system makes synchronous request to Hexagone WEB
  2. Hexagone WEB processes request and updates database
  3. Database trigger generates HPK message
  4. Message prioritized (high priority for synchronous requests)
  5. Service Echange broadcasts message to other systems
  6. Response returned to original requester
[外部系统] --请求--> [Hexagone WEB API] --HPK事件--> [数据库]
                                 [HPK消息]
                              [交换服务] --HPK--> [其他系统]
流程:
  1. 外部系统向Hexagone WEB发起同步请求
  2. Hexagone WEB处理请求并更新数据库
  3. 数据库触发器生成HPK消息
  4. 消息被标记为高优先级(同步请求优先级高)
  5. 交换服务将消息广播到其他系统
  6. 向原始请求方返回响应

Pattern 3: Message Sequencing

模式3: 消息序列

Typical HPK message sequences for common workflows:
New Patient Admission:
1. ID|M1|C    - Register patient identity
2. CV|M1|C    - Add insurance coverage
3. MV|M2|C    - Admit patient to hospital
4. [Optional] ID|MT|C - Assign treating physician
Patient Transfer:
1. MV|M8|C    - Exit from current unit
2. MV|M6|C    - Transfer to new unit
3. [If needed] MV|M3|C - Status change
Patient Discharge:
1. MV|M9|C    - Discharge from hospital
2. [Optional] ID|M1|M - Update address if changed
3. [Optional] CV|M1|M - Update coverage end date
常见工作流的典型HPK消息序列:
新患者入院:
1. ID|M1|C    - 注册患者身份
2. CV|M1|C    - 添加保险覆盖
3. MV|M2|C    - 住院登记
4. [可选] ID|MT|C - 分配主治医生
患者转移:
1. MV|M8|C    - 从当前单元转出
2. MV|M6|C    - 转移到新单元
3. [如需] MV|M3|C - 状态变更
患者出院:
1. MV|M9|C    - 患者出院
2. [可选] ID|M1|M - 如有变更更新地址
3. [可选] CV|M1|M - 更新保险覆盖结束日期

OID References (French Healthcare)

OID参考(法国医疗)

Important OIDs for HPK to HL7 mapping:
Identifier TypeOIDDescription
INS-C1.2.250.1.213.1.4.8Identifiant National de Santé Calculé
INS-A1.2.250.1.213.1.4.9Identifiant National de Santé Attesté
NIR1.2.250.1.213.1.4.10Numéro de Sécurité Sociale
IPP1.2.250.1.213.1.4.2Identifiant Permanent du Patient (local)
FINESS1.2.250.1.71.4.2.2Identifiant Établissement
RPPS1.2.250.1.71.4.2.1Répertoire Partagé des Professionnels de Santé
HPK到HL7映射的重要OID:
标识类型OID描述
INS-C1.2.250.1.213.1.4.8计算得出的全国健康ID
INS-A1.2.250.1.213.1.4.9认证的全国健康ID
NIR1.2.250.1.213.1.4.10社保号
IPP1.2.250.1.213.1.4.2患者永久ID(本地)
FINESS1.2.250.1.71.4.2.2机构标识
RPPS1.2.250.1.71.4.2.1医疗从业者共享目录

Troubleshooting Common Issues

常见问题排查

Issue 1: Field Count Mismatch

问题1: 字段数量不匹配

Symptom: Message has fewer/more fields than expected
Expected 38 fields for ID|M1, got 35
Causes:
  • Missing trailing pipes for optional fields
  • Extra pipes in text data (address, names)
  • Message truncated during transmission
Solution:
  1. Check HPK dictionary for expected field count
  2. Verify all required fields present
  3. Check for unescaped pipes in data
  4. Add missing trailing pipes for optional fields
症状: 消息字段数与预期不符
ID|M1预期38个字段,实际35个
原因:
  • 可选字段缺失尾部竖线
  • 文本数据中存在额外竖线(地址、姓名)
  • 传输过程中消息被截断
解决方案:
  1. 查看HPK字典获取预期字段数
  2. 验证所有必填字段是否存在
  3. 检查数据中是否有未转义的竖线
  4. 为可选字段添加缺失的尾部竖线

Issue 2: Date Format Errors

问题2: 日期格式错误

Symptom: Invalid date format or parsing errors
Field 9 (Birth Date): "1975/03/15" - expected YYYYMMDD
Causes:
  • Wrong date format (slashes instead of numeric)
  • Invalid date values (e.g., 20260231)
  • Missing leading zeros
Solution:
  1. Verify format is exactly YYYYMMDD (8 digits)
  2. For DateTime: YYYYMMDDHHMISSnn (16 digits)
  3. Validate date is real (no Feb 31, etc.)
  4. Pad with zeros if needed (e.g., "2026315" → "20260315")
症状: 日期格式无效或解析错误
字段9(出生日期): "1975/03/15" - 预期格式为YYYYMMDD
原因:
  • 日期格式错误(使用斜杠而非纯数字)
  • 日期值无效(如20260231)
  • 缺少前导零
解决方案:
  1. 确保格式严格为YYYYMMDD(8位数字)
  2. 日期时间格式为YYYYMMDDHHMISSnn(16位数字)
  3. 验证日期有效性(如2月无31日)
  4. 必要时补零(如"2026315" → "20260315")

Issue 3: Uppercase Requirement

问题3: 大写要求

Symptom: Message rejected by receiver
Field 3 (Emetteur): "Hexagone" - must be uppercase
Causes:
  • Mixed case in header fields (positions 0-5)
  • Case sensitive validation in receiving system
Solution:
  1. Convert first 6 fields to uppercase
  2. Keep patient names in proper case (fields 7-8 in ID|M1)
  3. Check specification for case requirements per field
症状: 消息被接收方拒绝
字段3(Emetteur): "Hexagone" - 必须为大写
原因:
  • 头部字段(0-5位)大小写混合
  • 接收系统验证区分大小写
解决方案:
  1. 将前6个字段转换为大写
  2. 患者姓名保持正确大小写(ID|M1的7-8字段)
  3. 检查每个字段的大小写要求规范

Issue 4: Empty vs Missing Fields

问题4: 空字段与缺失字段

Symptom: Required field appears empty
Field 7 (Last Name): "" - required field missing
Causes:
  • Consecutive pipes
    ||
    instead of value
  • Space character
     
    interpreted as empty
  • Null vs empty string handling
Solution:
  1. For required fields: must contain non-empty value
  2. For optional fields: use
    ||
    (consecutive pipes)
  3. Never use spaces to represent empty:
    | |
    is wrong
  4. Trim whitespace from field values
症状: 必填字段显示为空
字段7(姓氏): "" - 必填字段缺失
原因:
  • 使用连续竖线
    ||
    代替有效值
  • 空格字符
     
    被解析为空
  • Null与空字符串处理不一致
解决方案:
  1. 必填字段必须包含非空值
  2. 可选字段使用
    ||
    (连续竖线)表示
  3. 绝不能用空格表示空字段:
    | |
    是错误格式
  4. 去除字段值的首尾空格

Issue 5: Character Encoding

问题5: 字符编码

Symptom: Special characters corrupted
"Hôpital" appears as "H?pital"
Causes:
  • UTF-8 vs ISO-8859-1 encoding mismatch
  • Accented characters not properly encoded
Solution:
  1. Verify encoding specification (usually UTF-8 or ISO-8859-1)
  2. Ensure consistent encoding throughout pipeline
  3. Test with accented characters: é, è, à, ô, ç
  4. Consider normalization for comparison (remove accents)
症状: 特殊字符损坏
"Hôpital"显示为"H?pital"
原因:
  • UTF-8与ISO-8859-1编码不匹配
  • 带重音的字符未正确编码
解决方案:
  1. 验证编码规范(通常为UTF-8或ISO-8859-1)
  2. 确保整个流程编码一致
  3. 使用带重音字符测试: é、è、à、ô、ç
  4. 可考虑标准化处理以便比较(去除重音)

Practical Usage Examples

实际使用示例

Example 1: Parse Identity Message

示例1: 解析身份消息

Input:
ID|M1|C|HEXAGONE|20260122120000|USER001|PAT12345|DUPONT|JEAN|19750315|M|15 RUE DE LA PAIX|75001|PARIS|FRA|0612345678||||||||||||||||||||||||||||||||||||||
Expected Output:
markdown
undefined
输入:
ID|M1|C|HEXAGONE|20260122120000|USER001|PAT12345|DUPONT|JEAN|19750315|M|15 RUE DE LA PAIX|75001|PARIS|FRA|0612345678||||||||||||||||||||||||||||||||||||||
预期输出:
markdown
undefined

HPK Message Analysis

HPK消息分析

Message Type: ID|M1|C - Patient Identity Creation
Core Information:
  • System: HEXAGONE
  • Timestamp: 22/01/2026 12:00:00
  • User: USER001
  • Operation: Creation (new patient registration)
Patient Demographics:
  • IPP: PAT12345
  • Name: DUPONT JEAN
  • Birth Date: 15/03/1975 (50 years old)
  • Gender: Male
  • Address: 15 RUE DE LA PAIX, 75001 PARIS, France
  • Phone: 06 12 34 56 78
Business Context: This message registers a new patient in the system. The IPP (PAT12345) will be used to identify this patient in all subsequent messages (admissions, transfers, etc.). The message was generated by USER001 on 22/01/2026 at 12:00.
Validation: ✓ All required fields present, correct format
undefined
消息类型: ID|M1|C - 患者身份创建
核心信息:
  • 系统: HEXAGONE
  • 时间戳: 22/01/2026 12:00:00
  • 用户: USER001
  • 操作: 创建(新患者注册)
患者人口统计信息:
  • IPP: PAT12345
  • 姓名: DUPONT JEAN
  • 出生日期: 15/03/1975(50岁)
  • 性别: 男
  • 地址: 法国巴黎市和平街15号,邮编75001
  • 电话: 06 12 34 56 78
业务上下文: 该消息在系统中注册新患者。IPP(PAT12345)将用于后续所有相关消息(入院、转移等)中标识该患者。消息由USER001于2026年1月22日12:00生成。
验证结果: ✓ 所有必填字段存在,格式正确
undefined

Example 2: Parse Admission Message

示例2: 解析入院消息

Input:
MV|M2|C|HEXAGONE|20260122140000|USER001|PAT12345|VIS20260122001|20260122140000|URGENCE|CHU_PARIS|CARDIO|UF_CARDIO_01|LIT_001|PR_MARTIN|||||||
Expected Output:
markdown
undefined
输入:
MV|M2|C|HEXAGONE|20260122140000|USER001|PAT12345|VIS20260122001|20260122140000|URGENCE|CHU_PARIS|CARDIO|UF_CARDIO_01|LIT_001|PR_MARTIN|||||||
预期输出:
markdown
undefined

HPK Message Analysis

HPK消息分析

Message Type: MV|M2|C - Patient Admission
Core Information:
  • System: HEXAGONE
  • Timestamp: 22/01/2026 14:00:00
  • User: USER001
  • Operation: Creation (new admission)
Patient & Visit:
  • IPP: PAT12345
  • Visit Number: VIS20260122001
  • Admission Date/Time: 22/01/2026 14:00:00
Admission Details:
  • Entry Mode: URGENCE (Emergency admission)
  • Facility: CHU_PARIS
  • Service: CARDIO (Cardiology)
  • Functional Unit: UF_CARDIO_01
  • Bed: LIT_001
  • Attending Physician: PR_MARTIN
Business Context: Patient PAT12345 admitted to CHU Paris Cardiology department via emergency room on 22/01/2026 at 14:00. The visit is assigned number VIS20260122001 which will track all movements during this hospital stay. Patient assigned to bed LIT_001 in functional unit UF_CARDIO_01 under care of Dr. PR_MARTIN.
HL7 Mapping: Maps to ADT^A01 (Admit Patient) - IHE PAM [ITI-31]
Validation: ✓ All required fields present
undefined
消息类型: MV|M2|C - 患者入院
核心信息:
  • 系统: HEXAGONE
  • 时间戳: 22/01/2026 14:00:00
  • 用户: USER001
  • 操作: 创建(新入院)
患者与就诊:
  • IPP: PAT12345
  • 就诊号: VIS20260122001
  • 入院日期/时间: 22/01/2026 14:00:00
入院详情:
  • 入院方式: URGENCE(急诊)
  • 机构: CHU_PARIS
  • 科室: CARDIO(心脏病科)
  • 功能单元: UF_CARDIO_01
  • 床位: LIT_001
  • 责任医生: PR_MARTIN
业务上下文: 患者PAT12345于2026年1月22日14:00通过急诊入院巴黎大学医院心脏病科。就诊号VIS20260122001将用于追踪本次住院期间的所有流转。患者被分配到功能单元UF_CARDIO_01的LIT_001床位,由PR_MARTIN医生负责治疗。
HL7映射: 对应ADT^A01(患者入院)- IHE PAM [ITI-31]
验证结果: ✓ 所有必填字段存在
undefined

Example 3: Parse Message Sequence

示例3: 解析消息序列

Input (Multiple Messages):
1. ID|M1|C|HEXAGONE|20260122120000|USER001|PAT12345|DUPONT|JEAN|19750315|M|...
2. CV|M1|C|HEXAGONE|20260122120100|USER001|PAT12345|CPAM75|01|750|...
3. MV|M2|C|HEXAGONE|20260122140000|USER002|PAT12345|VIS001|20260122140000|URGENCE|...
4. MV|M6|C|HEXAGONE|20260123090000|USER003|PAT12345|VIS001|UF_NEURO|...
5. MV|M9|C|HEXAGONE|20260125180000|USER002|PAT12345|VIS001|20260125180000|DOMICILE|...
Expected Output:
markdown
undefined
输入(多条消息):
1. ID|M1|C|HEXAGONE|20260122120000|USER001|PAT12345|DUPONT|JEAN|19750315|M|...
2. CV|M1|C|HEXAGONE|20260122120100|USER001|PAT12345|CPAM75|01|750|...
3. MV|M2|C|HEXAGONE|20260122140000|USER002|PAT12345|VIS001|20260122140000|URGENCE|...
4. MV|M6|C|HEXAGONE|20260123090000|USER003|PAT12345|VIS001|UF_NEURO|...
5. MV|M9|C|HEXAGONE|20260125180000|USER002|PAT12345|VIS001|20260125180000|DOMICILE|...
预期输出:
markdown
undefined

HPK Message Sequence Analysis

HPK消息序列分析

Workflow: Complete Patient Episode
Timeline:
22/01/2026 12:00 - Patient Registration (ID|M1|C)
  • Patient DUPONT JEAN (IPP: PAT12345) registered by USER001
22/01/2026 12:01 - Insurance Added (CV|M1|C) [+1 min]
  • CPAM Paris coverage added by USER001
22/01/2026 14:00 - Emergency Admission (MV|M2|C) [+2h]
  • Admitted via emergency, Visit: VIS001 by USER002
23/01/2026 09:00 - Transfer (MV|M6|C) [+19h]
  • Transferred to Neurology by USER003
25/01/2026 18:00 - Discharge (MV|M9|C) [+2d 9h]
  • Discharged home by USER002
Summary:
  • Episode duration: 3 days 6 hours
  • Visit VIS001 completed
  • 3 users involved
  • ✓ Logical sequence maintained
  • ✓ Chronological order correct
HL7 Equivalent: ADT^A28 → ADT^A28 → ADT^A01 → ADT^A02 → ADT^A03
undefined
工作流: 完整患者诊疗周期
时间线:
2026年1月22日12:00 - 患者注册(ID|M1|C)
  • 患者DUPONT JEAN(IPP: PAT12345)由USER001注册
2026年1月22日12:01 - 添加保险(CV|M1|C) [+1分钟]
  • USER001添加巴黎CPAM保险覆盖
2026年1月22日14:00 - 急诊入院(MV|M2|C) [+2小时]
  • USER002为患者办理急诊入院,就诊号VIS001
2026年1月23日09:00 - 科室转移(MV|M6|C) [+19小时]
  • USER003将患者转移到神经内科
2026年1月25日18:00 - 患者出院(MV|M9|C) [+2天9小时]
  • USER002为患者办理居家出院
总结:
  • 诊疗周期时长: 3天6小时
  • 就诊VIS001已完成
  • 涉及3名用户
  • ✓ 逻辑序列保持一致
  • ✓ 时间顺序正确
HL7等效序列: ADT^A28 → ADT^A28 → ADT^A01 → ADT^A02 → ADT^A03
undefined

Quick Reference

快速参考

Core Message Types

核心消息类型

Patient Administration (ID, MV, CV)

患者管理(ID、MV、CV)

HPK MessageFull NamePurposeHL7 Equivalent
ID|M1|C/M/DPatient IdentityPatient demographics and registrationADT^A28/A31/A29
ID|MT|C/M/DTreating PhysicianAssign/update médecin traitantADT^A28
ID|CE|C/M/DInformed ConsentRecord patient consentADT^A28
MV|M2|C/M/DAdmissionHospital admissionADT^A01
MV|M3|C/M/DStatus ChangeAdministrative status changeADT^A06
MV|M6|C/M/DTransferUnit/service transferADT^A02
MV|M8|C/M/DUnit ExitExit from functional unitADT^A02
MV|M9|C/M/DDischargeHospital dischargeADT^A03
MV|B1|C/M/DBox MovementEmergency department box movementADT^A02
MV|MT|C/M/DTemporary MovementTemporary movement (exam, procedure)ADT^A09/A10
CV|M1|C/M/DCoverageInsurance and coverage informationIN1/IN2
HPK消息全名用途HL7等效格式
ID|M1|C/M/D患者身份患者人口统计信息与注册ADT^A28/A31/A29
ID|MT|C/M/D主治医生分配/更新主治医生ADT^A28
ID|CE|C/M/D知情同意记录患者同意情况ADT^A28
MV|M2|C/M/D入院住院登记ADT^A01
MV|M3|C/M/D状态变更行政状态变更ADT^A06
MV|M6|C/M/D转移单元/科室转移ADT^A02
MV|M8|C/M/D单元转出从功能单元转出ADT^A02
MV|M9|C/M/D出院患者出院ADT^A03
MV|B1|C/M/D急诊区域转移急诊科室区域内转移ADT^A02
MV|MT|C/M/D临时流转临时流转(检查、手术)ADT^A09/A10
CV|M1|C/M/D保险覆盖保险及覆盖范围信息IN1/IN2

User Management (UT)

用户管理(UT)

HPK MessageFull NamePurpose
UT|A1|C/M/SUser AccountCreate/modify/delete user accounts
HPK消息全名用途
UT|A1|C/M/S用户账号创建/修改/删除用户账号

Organizational Structure (ST)

组织结构(ST)

HPK MessageFull NamePurpose
ST|EJ|C/MLegal EstablishmentÉtablissement Juridique (legal entity)
ST|EG|C/MGeographic EstablishmentÉtablissement Géographique (physical site)
ST|BA|C/M/SBuildingBâtiment (building structure)
ST|ET|C/M/SFloorÉtage (floor level)
ST|CH|C/M/SRoomChambre/Pièce (room/space)
HPK消息全名用途
ST|EJ|C/M法律实体Établissement Juridique(法律实体)
ST|EG|C/M地理机构Établissement Géographique(物理机构)
ST|BA|C/M/S建筑Bâtiment(建筑)
ST|ET|C/M/S楼层Étage(楼层)
ST|CH|C/M/S房间Chambre/Pièce(房间/空间)

Supply Chain - Products & Suppliers (PR, FO)

供应链 - 产品与供应商(PR、FO)

HPK MessageFull NamePurpose
PR|M0|C/M/SProduct - General DataGeneral product information
PR|M1|C/M/SProduct - Pharmacy InfoPharmacy-specific product data
PR|M2|C/M/SProduct - Therapeutic BookTherapeutic formulary information
PR|M3|C/M/SProduct - Accounting InfoAccounting and financial data
PR|M4|C/M/SProduct - Economic InfoEconomic management information
PR|M5|C/M/SProduct - Store InfoStore/warehouse information
FO|M1|C/M/SSupplier - General InfoGeneral supplier information
FO|M2|C/M/SSupplier - Bank DetailsBank domiciliation details
FO|M3|C/M/SSupplier - Order PointsOrder contact points
HPK消息全名用途
PR|M0|C/M/S产品 - 通用数据产品通用信息
PR|M1|C/M/S产品 - 药房信息药房专属产品数据
PR|M2|C/M/S产品 - 治疗目录治疗 formulary 信息
PR|M3|C/M/S产品 - 财务信息财务数据
PR|M4|C/M/S产品 - 经济信息经济管理信息
PR|M5|C/M/S产品 - 仓储信息仓库/存储信息
FO|M1|C/M/S供应商 - 通用信息供应商通用信息
FO|M2|C/M/S供应商 - 银行详情银行账户信息
FO|M3|C/M/S供应商 - 联系点订单联系点

Supply Chain - Orders & Deliveries (MA, CO, LI, RO)

供应链 - 订单与配送(MA、CO、LI、RO)

HPK MessageFull NamePurpose
MA|M1|C/M/SMarket - HeaderContract/market header
MA|M2|C/M/SMarket - LinesContract/market line items
MA|M3|C/M/SMarket - SuppliersSuppliers by market
CO|M1|C/M/SOrder - HeaderPurchase order header
CO|M2|C/M/SOrder - LinesPurchase order line items
LI|M1|C/MDelivery - LinesExternal delivery lines
LI|M2|C/MDelivery - Lot LinesDelivery lines with lot management
RO|M1|C/M/SReception - LinesReception lines
RO|M2|C/MReception - Lot LinesReception lines with lot management
HPK消息全名用途
MA|M1|C/M/S市场 - 头部合同/市场头部
MA|M2|C/M/S市场 - 明细合同/市场明细
MA|M3|C/M/S市场 - 供应商按市场分类的供应商
CO|M1|C/M/S订单 - 头部采购订单头部
CO|M2|C/M/S订单 - 明细采购订单明细
LI|M1|C/M配送 - 明细外部配送明细
LI|M2|C/M配送 - 批次明细带批次管理的配送明细
RO|M1|C/M/S收货 - 明细收货明细
RO|M2|C/M收货 - 批次明细带批次管理的收货明细

Financial (FA, RD)

财务(FA、RD)

HPK MessageFull NamePurpose
FA|FE|CInvoice - HeaderFacture Entête (invoice header)
FA|FL|CInvoice - LinesFacture Lignes (invoice line items)
RD|E1|CMisc Receipt - HeaderRecettes diverses header
RD|L1|CMisc Receipt - LinesRecettes diverses line items
HPK消息全名用途
FA|FE|C发票 - 头部发票头部
FA|FL|C发票 - 明细发票明细
RD|E1|C杂项收款 - 头部杂项收款头部
RD|L1|C杂项收款 - 明细杂项收款明细

Inventory & Stock (SO, IM)

库存与仓储(SO、IM)

HPK MessageFull NamePurpose
SO|S1|CStock OutputSortie (stock withdrawal)
SO|I1|CInventoryInventaire (stock count)
SO|T1|CStock TransferTransfert (internal transfer)
SO|L1|CPre-established ListsListes pré établies
IM|M1|CAsset InventoryInventaire mobilier (asset tracking)
HPK消息全名用途
SO|S1|C库存出库库存出库
SO|I1|C库存盘点库存盘点
SO|T1|C库存转移内部库存转移
SO|L1|C预设清单预设清单
IM|M1|C资产盘点资产追踪

Requests (DD)

请求(DD)

HPK MessageFull NamePurpose
DD|M1|CIdentity RequestDemande de création identité
DD|K1|CAct RequestDemande de création acte
HPK消息全名用途
DD|M1|C身份请求身份创建请求
DD|K1|C操作请求操作创建请求

Operation Modes

操作模式

ModeFrenchEnglishDescription
CCréationCreationCreate new record
MModificationModificationUpdate existing record
SSuppressionDeletionDelete/remove record
DDeletionDeletionDelete (alternate notation)
模式法语英语描述
CCréationCreation创建新记录
MModificationModification更新现有记录
SSuppressionDeletion删除记录
DDeletionDeletion删除(替代表示)

Common Field Patterns

常见字段模式

Standard Header (all messages):
Type|Message|Mode|Emetteur|Date|User|...
Date Formats:
  • Short date:
    YYYYMMDD
    (e.g.,
    20260122
    )
  • Full timestamp:
    YYYYMMDDHHMISSnn
    (e.g.,
    20260122140530
    )
  • nn = centiseconds (1/100 second)
Gender Codes:
  • M
    = Male (Masculin)
  • F
    = Female (Féminin)
  • U
    = Unknown (Inconnu)
French Administrative Terms:
  • IPP = Identifiant Permanent du Patient (Patient Permanent ID)
  • INS = Identifiant National de Santé (National Health ID)
  • NIR = Numéro d'Inscription au Répertoire (Social Security Number)
  • UF = Unité Fonctionnelle (Functional Unit)
  • FINESS = Fichier National des Établissements Sanitaires et Sociaux
  • CPAM = Caisse Primaire d'Assurance Maladie (Health Insurance Fund)
  • ALD = Affection Longue Durée (Long-term Condition)
  • CMU = Couverture Maladie Universelle (Universal Health Coverage)
标准头部(所有消息):
Type|Message|Mode|Emetteur|Date|User|...
日期格式:
  • 短日期:
    YYYYMMDD
    (如
    20260122
  • 完整时间戳:
    YYYYMMDDHHMISSnn
    (如
    20260122140530
  • nn = 厘秒(1/100秒)
性别代码:
  • M
    = 男(Masculin)
  • F
    = 女(Féminin)
  • U
    = 未知(Inconnu)
法国行政术语:
  • IPP = Identifiant Permanent du Patient(患者永久ID)
  • INS = Identifiant National de Santé(全国健康ID)
  • NIR = Numéro d'Inscription au Répertoire(社保号)
  • UF = Unité Fonctionnelle(功能单元)
  • FINESS = Fichier National des Établissements Sanitaires et Sociaux(全国卫生与社会机构文件)
  • CPAM = Caisse Primaire d'Assurance Maladie(国家医保基金)
  • ALD = Affection Longue Durée(长期慢性病)
  • CMU = Couverture Maladie Universelle(全民医保)