Output To File Where Each Segment Of Message Ends With CR

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Output To File Where Each Segment Of Message Ends With CR

  • Creator
    Topic
  • #49075
    AmyLBauer
    Participant

      Hi Clovertech Forum,

      I need to have an outbound thread write to a file where each segment of the message is separated by a carriage return.  Can someone help me ?

      Here is what I need the output to look like:

      MSH|^~&|LLS|PL|PRX|PL001221|200404281701||ORU|51954.001|P|2.2

      PID|1|NEW-1000|||IMAGIN||19101204|F||||||||||13894|520-42-5703

      ORC|RE|M3587612-6^INF|50412373^LLS|||||||||1111^CLAY

      OBR|1|M3587612-6^INF|5041237|007401^POINDTIN||20020528084000||

      OBX|1|NM|2511^DILANTIN^L||4.0|MCG/ML|10.0-20.0|L||S|F||||DN

      NTE|1|L|TOXIC > 30.0

      Thank you.

    Viewing 4 reply threads
    • Author
      Replies
      • #60658
        Robert Kersemakers
        Participant

          Hi Amy,

          If you create the message in Cloverleaf by using a translation to HL7, and then write the message to a file through fileset-Local, the segments will be separated by a CR (Carriage Return). That is, under HP-UX!

          Maybe when you’re using Cloverleaf under Windows Server, the segments may be separated by CR/LF (Carriage Return/LineFeed); I’m not sure though. In that case, you need to replace the CR/LF with a CR; you can do this with a tcl-proc.

          I’m not sure what the exact problem is; can you elaborate?

          Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

        • #60659
          Russ Ross
          Participant

            You may find it beneficial to read some previous posts made about generating files that have one segment per line instead of one message per line at URL

            https://usspvlclovertch2.infor.com/viewtopic.php?t=1663” class=”bbcode_url”>https://usspvlclovertch2.infor.com/viewtopic.php?t=1663

            To help get you to the part you are interested in, open the URL and search for the string:

            A new line file means one message per line and not one segment per line

            Russ Ross
            RussRoss318@gmail.com

          • #60660
            AmyLBauer
            Participant

              Russ,

              I’ve tried to use the regsub tcl proc and the other code that were on the URL you included.  But I still don’t seem to get the results I want in the output file.  I am viewing the file in Notepad so maybe there is something I am doing wrong there.

              My current setup is using the regsub code in the outbound TPS of the thread.  And it certainly has changed the output but isn’t setting up the segments one per line yet.  I’ve attached the output file.  Can you think of something else that I am doing wrong ?  Or is there a config on the output thread that I need to change ?

            • #60661
              Russ Ross
              Participant

                When I did hcihd on the file you posted I see that you have succeeded at replacing the r (HEX 0d) with a n (HEX 0a) yet you say it is not displaying one segment per line in Notepad.

                That would be expected because Notepad runs under Windows and my illustration is for UNIX.

                When I use vi under AIX to edit your file it has one segment per line.

                That leads me to suspect you are not running Cloverleaf on a UNIX platform.

                If you are running Cloverleaf on a windows platform you will need to replace

                r (HEX 0d)

                with

                rn (HEX 0d0a)

                Give that a try and see if you get what you are looking for.

                By the way, it is good to furnish an example file but make sure to dummy out patient information.

                Russ Ross
                RussRoss318@gmail.com

              • #60662
                AmyLBauer
                Participant

                  Oh geez . . . never thought about the OS making a difference !?!?!  Yes, I am using Cloverleaf on Windows.

                  I made the change you suggested and the file looks great now !!

                  I appreciate your assistance with my project !!!

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