converting multiple NTE segments to multple OBX segments

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf converting multiple NTE segments to multple OBX segments

  • Creator
    Topic
  • #48093
    John Paddock
    Participant

      Hello all,

      This is my first posting – we just did a partial go-live with QDX 5.3 running on Windows.

      Here’s my question – for textual results, our lab vendor sends messages containing one OBX with multiple NTE. Our HIS needs the messages to contain only OBX segments. We set up a pre tcl proc on the thread that converts any instance of “NTE” to “OBX”, but if it catches a word with the letters NTE is changes those as well.

      Here’s the code in the tcl proc:

      regsub -all “NTE” $msg “OBX” msg

      echo $msg

      Is there another way to do this? Thanks.

    Viewing 5 reply threads
    • Author
      Replies
      • #57604
        Anonymous
        Participant

          The best way it to look for the | following the segment ID that will eliminate the problem that you’re seeing.

          regsub -all {NTE|} $segment OBX| segment

          The regsub above should do the job for you…

          Thanks

          Jeff DeJournett

        • #57605
          Ian Kreitenstein
          Participant

            The following may work:

            regsub — ^NTE| $msg OBX| msg_out

            Regards,

            Ian

          • #57606
            John Perks
            Participant

              Alter your regular expression to include the preceding segment delimiter, e.g.

              regsub -all “x0dNTE” $msg “x0dOBX” $msg

              If you look for the field delimiter (|} following the segment identifier (NTE), ignoring the preceding segment delimiter (x0d), you could alter fields which end in “NTE”.

              Try it at the TCL command line to test it.

            • #57607
              Anonymous
              Participant

                That’s a good point for the fileds that may end with NTE… I’d say that on the safe side you can look for x0dNTE| and that would guarante that you only get the NTE segments and not some other piece of data… Definetly overkill but if your in need of 100% accuracy the more information to search on the better…

              • #57608
                John Perks
                Participant

                  Although the regsub command is “quick and dirty”, I have a few cautions that only you can answer, since you know the data and your downstream application.

                  Obviously the NTE and OBX segment layouts are different, but the corresponding field sizes are different in the standard HL7 definitions; so watch for truncations.

                  Also, by changing one segment type to another, the message may no longer match the variant.

                  If you are already using an xlate, the safest way would be to build new OBXs from the NTEs.  It might not be simple, depending on the inbound segments, you may have to manually manipulate an index variable to get your segments in a specific order in your outbound message.

                • #57609
                  Jim Kosloskey
                  Participant

                    John,

                    I think you can do t5his right in the Xlate without using Tcl.

                    I am en route back from the User conference. If you want to discuss this when I return Monday 10/24/2005, email me at chiliman@comcast.net with your telephone number – we can chat.

                    Jim Kosloskey

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

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