HL7 to X12

  • Creator
    Topic
  • #49117
    Kathy Riggle
    Participant

      This is my first venture into the world of X12.

      I will be receiving ORM’s throughout the day, and need to turn them into a file. At the end of the day, before I FTP the file, I need to assign a number to the whole file, count the number of PO1 segments in the file, and count the number of GS segments.

      Before I started, I wondered if anyone has already done this and has a Tcl they could share.

      Thanks.

      Kathy

    Viewing 3 reply threads
    • Author
      Replies
      • #60784
        Charlie Bursell
        Participant

          Easy  ðŸ˜‰

          Define the OB protocol as UPoC.  Use both read and write protocol.  In the write protocol append you messages.  In the read protocol, when it kicks off via the timer, count your segments, do your thing and send it on.

        • #60785
          Kathy Riggle
          Participant

            Charlie –

            Thanks for the protocol information. My next issue is how to count the segments.

            Kathy

          • #60786
            Charlie Bursell
            Participant

              Usea regsub.  For example if you segment separator is a tilde and you are counting PO1 segments do something like:

              set count [regsub -all {~PO1} $buffer {} {}]

            • #60787
              Kathy Riggle
              Participant

                Charlie –

                Thanks. I did look at regsub, but wasn’t sure if that was the right way to go. I appreciate the assist!

                Kathy

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