Java HL7段顺序

Java HL7段顺序,java,parsing,hl7,hapi,hl7-v2,Java,Parsing,Hl7,Hapi,Hl7 V2,我正在按以下顺序解析SIU S14: MSH 学校 PID PV1 RGS 困扰 人工智能 虽然它解析时没有错误,但我无法从AIS段检索数据。但当我在AIL之前移动AIS段时,一切似乎都很好。那么HL7中的段顺序是否重要呢?HL7消息中的段顺序是由消息类型预先确定的。在未经请求的计划信息消息中,AIS段必须位于AIL之前 SIU^S12-S24,S26,S27^SIU_S12: Schedule Information Unsolicited 但这两个段及其段组都是可选的。因此,仅包含A

我正在按以下顺序解析SIU S14:

MSH
学校
PID
PV1
RGS
困扰
人工智能


虽然它解析时没有错误,但我无法从AIS段检索数据。但当我在AIL之前移动AIS段时,一切似乎都很好。那么HL7中的段顺序是否重要呢?

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

SIU^S12-S24,S26,S27^SIU_S12: Schedule Information Unsolicited


但这两个段及其段组都是可选的。因此,仅包含AIL且不包含AIS段的消息在语法上是正常的。当HL7消息打开时,在完整的消息之后允许有额外的或本地定义的段。为了检索这些额外的数据,您需要一个适应的模板。

这在HL7中无关紧要。HAPI的文档说明了什么?请在
  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