Split, foreach segment issue

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Split, foreach segment issue

  • Creator
    Topic
  • #52777
    Johnny Anderson
    Participant

      CL v5.8, HL7 v2.5.1, Sun, Solaris 10.

      See tclproc/log attachment.  Objective is to read i/p HL7 file, count MSH segments, at count 200, write

      FHS to o/p file followed by i/p MSH-OBX segments.  There

    Viewing 3 reply threads
    • Author
      Replies
      • #75439
        David Barr
        Participant

          From the log file, it looks like your input file doesn’t use r as the segment terminator.

        • #75440
          Johnny Anderson
          Participant

            Attachment shows CR and LF at end of every segment.

          • #75441
            Robert Kersemakers
            Participant

              Hi Johnny,

              But still: the log shows that the result of your ‘set msg_list [split $hl7_ip_rec r]’ is only one element. So either the split command is incorrect (which is doesn’t appear to be) or $hl7_ip_rec doesn’t contain any r.

              I would focus on the contents of $hl7_ip_rec just before the split command.

              Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

            • #75442
              Johnny Anderson
              Participant

                Thanks David and Robert.  Your advice set me on the right trail to the solution.  Which is: set msg_list [split $hl7_ip_rec “rn”]. 😀

                Seems simple now but I used a lot of time trying to get a regsub to help.  It did not.

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