HL7 Standard, end of Segment, Message, File

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf HL7 Standard, end of Segment, Message, File

  • Creator
    Topic
  • #54038
    Johnny Anderson
    Participant

      CL v5.8.5, Sun Solaris 10, HL7 v2.3.1

      We

    Viewing 0 reply threads
    • Author
      Replies
      • #79942
        Jim Kosloskey
        Participant

          Johnny,

          The HL/7 standard only specifies the segment termination (x0d) not the message termination.

          All messages start with an MSH.

          For realtime exchange HL/7 standard prescribes a few encapsulation techniques. The one most deployed is the MLP which is expressed in Cloverleaf with the mlp PDL.

          Batches are a different story. If this is a file based exchange then there should be FHS/FTS segments surrounding the batches and each batch surrounded by BHS/BTS segments. Within each batch then are the messages.

          So something like this FHS BHS MSH MSH MSH… BTS FTS. A FHS/FTS set is a single ‘record’ in the file in this design. This could also be FHS BHS MSH… BTS BHS MSH… BTS etc then FTS (multiple batches in a single file.

          All of those segments are terminated by x0d.

          Many Trading Partners forgo the FHS/FTS set and rely on the O/S to determine the File. However there are valuable fields n the FHS/FTS set if they are used.

          Batches can be exchanged realtime but they normally don’t have the FHS/FTS set of segments but just the BHT/BTS set with MSH inside. Then the desired encapsulation technique should be used (mlp for example) around the entire set of batches.

          As for storage on a file system, HL/7 leaves that up to the O/S and the trading partners.

          Cloverleaf supports using newline (x0a) as a message terminator, or length encoding, or EOF. That should cover most O/S. EOF covers the cadse where there is only x0d at the end of every segment and no O/S provided message ‘terminatin’.

          So it is not a Cloverleaf ‘standard’ but rather a Cloverleaf feature which allows handling of normal storage potentials by most O/S without having to write code.

          What we sometimes see (especially from Windows applications) is each segment terminated with x0d0a because that makes the mesage easier to read using text editors or because the writer of that program is using the wrong kind of I/O to create the message. However that is not correct from a standard basis.

          At least that is my understanding.

          email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

      Viewing 0 reply threads
      • The forum ‘Cloverleaf’ is closed to new topics and replies.