我正在使用以下分段顺序来解析SIU S14:MSHSCHPIDPV1RGSAILAIS
尽管解析没有错误,但我无法从AIS段中检索数据。但是,当我将AIS段移到AIL之前时,一切似乎都正常。那么分段顺序在HL7中重要吗?

最佳答案

HL7消息中的段顺序由消息类型预先确定。在计划信息中,未经请求的消息中, AIS 段必须位于 AIL 之前。

SIU^S12-S24,S26,S27^SIU_S12: Schedule Information Unsolicited
  MSH   Message Header
  SCH   Schedule Activity Information
    [ { TQ1 } ] Timing/Quantity
    [ { NTE } ] Notes and Comments for the SCH
  [ {   --- PATIENT begin
      PID   Patient Identification
      [ PD1 ]   Additional Demographics
      [ PV1 ]   Patient Visit
      [ PV2 ]   Patient Visit - Additional Info
      [ { OBX } ]   Observation/Result
      [ { DG1 } ]   Diagnosis
  } ]   --- PATIENT end
  {     --- RESOURCES begin
    RGS      Resource Group Segment
    [ { --- SERVICE begin
        AIS     Appointment Information - Service
        [ { NTE } ] Notes and Comments for the AIS
    } ] --- SERVICE end
    [ { --- GENERAL_RESOURCE begin
        AIG      Appointment Information - General Resource
        [ { NTE } ] Notes and Comments for the AIG
    } ] --- GENERAL_RESOURCE end
    [ { --- LOCATION_RESOURCE begin
        AIL      Appointment Information - Location Resource
        [ { NTE } ] Notes and Comments for the AIL
    } ] --- LOCATION_RESOURCE end
    [ { --- PERSONNEL_RESOURCE begin
        AIP   Appointment Information - Personnel Resource
        [ { NTE } ] Notes and Comments for the AIP
    } ] --- PERSONNEL_RESOURCE end
  } --- RESOURCES end

但是,两个细分以及各自的细分组都是可选的。因此,仅使用 AIL 而没有 AIS 段的消息在语法上是可以的。随着HL7消息的打开,一条完整的消息之后还会有其他或本地定义的段。要检索此其他数据,您需要一个经过调整的模板。

09-15 16:12