pulling ORC 13.1 field

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf pulling ORC 13.1 field

  • Creator
    Topic
  • #49451
    Duy Nguyen
    Participant

      I have been running around in circles trying to pull the value of this field with my TCL code but whenever I run the testing tool and ECHO out the value of the field, it comes up empty or pulls up something else.

      Would you guys see if I made a mistake somewhere because I’ve used similar code for other threads without any problems.

      Here is my tcl proc:


      proc labcorp_filter { args } {

         keylget args MODE mode               ;# Fetch mode

         set dispList {} ;# Nothing to return

         global HciConnName

         switch -exact — $mode {

             start {

                 # Perform special init functions

         # N.B.: there may or may not be a MSGID key in args

             }

             run {

         # ‘run’ mode always has a MSGID; fetch and process it

                 keylget args MSGID mh

             

               ## pull field and component separators

             

         set msg [msgget $mh]

                   set msg [split $msg r]

         set msh [lindex $msg 0]

         set fldsep [string index $msh 3]

         set subfldsep [string index $msh 4]

      echo The value of fldsep is       ********** $fldsep

      echo &&&&&&&&&&&&&&&&&&&

      echo The value of subfldsep is    ********** $subfldsep

      ## pull out ORC seg

       

                   

                   set orc [lmatch -regexp $msg ^ORC]

      echo TESTING ORC STUFF $orc

                   set orcFlds [split $orc $fldsep]

                   set orc13 [lindex $orcFlds 13]

      echo The value of ENTIRE ORC 13 FIELD IS::::::: $orc13

                   set orc13 [lindex [split $orc13 $subfldsep] 0]

                   echo The value of ORC13 is>>>>>>>>>>>>> $orc13

               ## check value in the Labcorp_ALLOW table

                   set disp CONTINUE

                   set disp [hcitbllookup Labcorp_ALLOW $orc13]

                   if {![string length $disp]} {set disp KILL}

           

             

      ## if disp returned by the tables is KILL, then echo to log

         if {[string equal $disp KILL]} {

                    set orc_msg “”

                    if {[info exists orc13]} {set orc_msg “- ORC.13 is $orc13”}

                    echo “WARNING- $HciConnName KILLING message”

                 }    

                 lappend dispList “$disp $mh”

             }

             time {

                 # Timer-based processing

         # N.B.: there may or may not be a MSGID key in args

             }

             

             shutdown {

         # Doing some clean-up work

      }

         }

         return $dispList

      }


      And here is some of my output from the testing tool:

      he value of subfldsep is ********** R

      TESTING ORC STUFF ORC|RE|201G5405110^LAB|201G5405110^LAB||||||200707230000|||C46028^SCHWIEBER^P^^^^^U

      The value of ENTIRE ORC 13 FIELD IS:::::::

      The value of ORC13 is>>>>>>>>>>>>>

      WARNING- TEST KILLING message

      The value of fldsep is ********** |

      &&&&&&&&&&&&&&&&&&&

      The value of subfldsep is ********** 1

      TESTING ORC STUFF

      The value of ENTIRE ORC 13 FIELD IS:::::::

      The value of ORC13 is>>>>>>>>>>>>>

      WARNING- TEST KILLING message

      The value of fldsep is ********** |

      &&&&&&&&&&&&&&&&&&&

      The value of subfldsep is ********** 1

      TESTING ORC STUFF

      The value of ENTIRE ORC 13 FIELD IS:::::::

      The value of ORC13 is>>>>>>>>>>>>>

      WARNING- TEST KILLING message

      The value of fldsep is ********** |

      &&&&&&&&&&&&&&&&&&&

      The value of subfldsep is ********** 1

      TESTING ORC STUFF

      The value of ENTIRE ORC 13 FIELD IS:::::::

      The value of ORC13 is>>>>>>>>>>>>>

      WARNING- TEST KILLING message

      The value of fldsep is ********** |

      &&&&&&&&&&&&&&&&&&&

      The value of subfldsep is ********** 2

      I am thinking the format  from the vendor must be different than the other vendors I have been accustomed to….It does look quite similar though when opening up the files in the text editor.

      Please advise.  Thank you….

    Viewing 21 reply threads
    • Author
      Replies
      • #62009
        Tom Rioux
        Participant

          Duy,

          Maybe my eyes are playing tricks on me, but in that ORC segment you echoed out, I don’t see an ORC13 field.  Remember when counting HL7 fields, the count starts at zero, so “ORC” would be 0, “RE” would be 1, and so forth.  I only count up to 12 fields with the 12th field being “C46028^SCHWIEBER^P^^^^^U “.  

          I’m assuming that is the field you are looking for.

          Let me know how it goes.

          Tom Rioux

        • #62010
          Michael Hertel
          Participant

            You are also failing in getting the subfldsep.

            he value of subfldsep is ********** R

            I don’t think you are looking for R.

            Start there.

          • #62011
            Duy Nguyen
            Participant

              Michael Hertel wrote:

              You are also failing in getting the subfldsep.

              he value of subfldsep is ********** R

              I don’t think you are looking for R.

              Start there.

              You’re partially right…I’m actually able to get the value of the subfield separator..but as the code goes through the data…it pulls different values.  Look at my output (in green) at the beginning below…thanks.

              The value of fldsep is ********** |

              &&&&&&&&&&&&&&&&&&&

              The value of subfldsep is ********** ^

              TESTING ORC STUFF

              The value of ENTIRE ORC 13 FIELD IS:::::::

              The value of ORC13 is>>>>>>>>>>>>>

              WARNING- TEST KILLING message

              The value of fldsep is ********** |

              &&&&&&&&&&&&&&&&&&&

              The value of subfldsep is ********** 1

              TESTING ORC STUFF

              The value of ENTIRE ORC 13 FIELD IS:::::::

              The value of ORC13 is>>>>>>>>>>>>>

              WARNING- TEST KILLING message

              The value of fldsep is ********** |

              &&&&&&&&&&&&&&&&&&&

              The value of subfldsep is ********** R

              TESTING ORC STUFF ORC|RE|16634402610^LAB|16634402610^LAB||||||200706150000|||D34432^BRAND^J^^^^^U

              The value of ENTIRE ORC 13 FIELD IS::::::: D34432^BRAND^J^^^^^U

              The value of ORC13 is>>>>>>>>>>>>> D34432^B

            • #62012
              Duy Nguyen
              Participant

                What bugs me even more is the part where it picks up:

                The value of ORC13 is>>>>>>>>>>>>> D34432^B

                In theory, the code should just pick up “D34432” and not include the “B”..but because somewhere, somehow, the subfield seperator VALUE is losing it’s original value of ” ^ ” and taking on a diff value of R or any other arbitrary value….this is messing everything up.

              • #62013
                Michael Hertel
                Participant

                  After:

                  set msg [msgget $mh]

                  Add:

                  echo >$msg< Then repost your output. Thanks!

                • #62014
                  Duy Nguyen
                  Participant

                    Michael Hertel wrote:

                    After:

                    set msg [msgget $mh]

                    Add:

                    echo >$msg< Then repost your output. Thanks!

                    I processed one record and I didn’t think it was sufficient to troubleshoot..so I processed all records in the testing tool and the output is very LARGE..so I only will paste a portion of it here…it should be enough.  thank you.

                    >MSH|^~&|1100|IZ|MLI|IZ000007|200707251709||ORU|0402|P|2.3|||AL< The value of fldsep is ********** | &&&&&&&&&&&&&&&&&&& The value of subfldsep is ********** ^ TESTING ORC STUFF The value of ENTIRE ORC 13 FIELD IS::::::: The value of ORC13 is>>>>>>>>>>>>>

                    WARNING- TEST KILLING message

                    >PID|1|96907|16634402610|96907|ABDI^ELHAM||19780916|F||||||||||35255379^^^XA^^F< The value of fldsep is ********** | &&&&&&&&&&&&&&&&&&& The value of subfldsep is ********** 1 TESTING ORC STUFF The value of ENTIRE ORC 13 FIELD IS::::::: The value of ORC13 is>>>>>>>>>>>>>

                    WARNING- TEST KILLING message

                    >ORC|RE|16634402610^LAB|16634402610^LAB||||||200706150000|||D34432^BRAND^J^^^^^U< The value of fldsep is ********** | &&&&&&&&&&&&&&&&&&& The value of subfldsep is ********** R TESTING ORC STUFF ORC|RE|16634402610^LAB|16634402610^LAB||||||200706150000|||D34432^BRAND^J^^^^^U The value of ENTIRE ORC 13 FIELD IS::::::: The value of ORC13 is>>>>>>>>>>>>>

                    WARNING- TEST KILLING message

                    >OBR|1|16634402610^LAB|16634402610^LAB|096206^Varicella-Zoster V Ab, IgG^L|||200706150000|||||||200706150000||D34432^BRAND^J^^^^^U||||16634402610||200707251709|||F< The value of fldsep is ********** | &&&&&&&&&&&&&&&&&&& The value of subfldsep is ********** 1 TESTING ORC STUFF The value of ENTIRE ORC 13 FIELD IS::::::: The value of ORC13 is>>>>>>>>>>>>>

                    WARNING- TEST KILLING message

                    >OBX|1|TX|096208^Varicella Zoster IgG^L||>1.09|index|0.00-0.90|H||N|F|19970211||200706181540|DA< The value of fldsep is ********** | &&&&&&&&&&&&&&&&&&& The value of subfldsep is ********** 1 TESTING ORC STUFF The value of ENTIRE ORC 13 FIELD IS::::::: The value of ORC13 is>>>>>>>>>>>>>

                    WARNING- TEST KILLING message

                    >NTE|1|L|~                               Negative          <0.91~                               Equivocal   0.91 - 1.09~                               Positive          >1.09< The value of fldsep is ********** | &&&&&&&&&&&&&&&&&&& The value of subfldsep is ********** 1 TESTING ORC STUFF The value of ENTIRE ORC 13 FIELD IS::::::: The value of ORC13 is>>>>>>>>>>>>>

                    WARNING- TEST KILLING message

                    >NTE|2|L|~Performed At:  DA, LabCorp Dallas~7777 Forest Lane Suite 350C  Dallas, TX 752300000~Celeste Vardaman MD     Phone:  9725667500< The value of fldsep is ********** | &&&&&&&&&&&&&&&&&&& The value of subfldsep is ********** 2 TESTING ORC STUFF The value of ENTIRE ORC 13 FIELD IS::::::: The value of ORC13 is>>>>>>>>>>>>>

                    WARNING- TEST KILLING message

                    >MSH|^~&|1100|IZ|MLI|IZ000007|200707251709||ORU|0403|P|2.3|||AL< The value of fldsep is ********** | &&&&&&&&&&&&&&&&&&& The value of subfldsep is ********** ^ TESTING ORC STUFF The value of ENTIRE ORC 13 FIELD IS::::::: The value of ORC13 is>>>>>>>>>>>>>

                    WARNING- TEST KILLING message

                    >PID|1|96476|17334404020|96476|ADAMS^SAMANTHA||19860822|F||||||||||35255379^^^XA^^F< The value of fldsep is ********** | &&&&&&&&&&&&&&&&&&& The value of subfldsep is ********** 1 TESTING ORC STUFF The value of ENTIRE ORC 13 FIELD IS::::::: The value of ORC13 is>>>>>>>>>>>>>

                    WARNING- TEST KILLING message

                    >ORC|RE|17334404020^LAB|17334404020^LAB||||||200706220000|||D34432^BRAND^J^^^^^U< The value of fldsep is ********** | &&&&&&&&&&&&&&&&&&& The value of subfldsep is ********** R TESTING ORC STUFF ORC|RE|17334404020^LAB|17334404020^LAB||||||200706220000|||D34432^BRAND^J^^^^^U The value of ENTIRE ORC 13 FIELD IS::::::: The value of ORC13 is>>>>>>>>>>>>>

                    WARNING- TEST KILLING message

                    >OBR|1|17334404020^LAB|17334404020^LAB|096206^Varicella-Zoster V Ab, IgG^L|||200706220000|||||||200706220000||D34432^BRAND^J^^^^^U||||17334404020||200707251709|||F< The value of fldsep is ********** | &&&&&&&&&&&&&&&&&&& The value of subfldsep is ********** 1 TESTING ORC STUFF The value of ENTIRE ORC 13 FIELD IS::::::: The value of ORC13 is>>>>>>>>>>>>>

                    WARNING- TEST KILLING message

                    >OBX|1|TX|096208^Varicella Zoster IgG^L||>1.09|index|0.00-0.90|H||N|F|19970211||200706251509|DA< The value of fldsep is ********** | &&&&&&&&&&&&&&&&&&& The value of subfldsep is ********** 1 TESTING ORC STUFF The value of ENTIRE ORC 13 FIELD IS::::::: The value of ORC13 is>>>>>>>>>>>>>

                    WARNING- TEST KILLING message

                    >NTE|1|L|~                               Negative          <0.91~                               Equivocal   0.91 - 1.09~                               Positive          >1.09< The value of fldsep is ********** | &&&&&&&&&&&&&&&&&&& The value of subfldsep is ********** 1 TESTING ORC STUFF The value of ENTIRE ORC 13 FIELD IS::::::: The value of ORC13 is>>>>>>>>>>>>>

                    WARNING- TEST KILLING message

                    >NTE|2|L|~Performed At:  DA, LabCorp Dallas~7777 Forest Lane Suite 350C  Dallas, TX 752300000~Celeste Vardaman MD     Phone:  9725667500< The value of fldsep is ********** | &&&&&&&&&&&&&&&&&&& The value of subfldsep is ********** 2 TESTING ORC STUFF The value of ENTIRE ORC 13 FIELD IS::::::: The value of ORC13 is>>>>>>>>>>>>>

                    WARNING- TEST KILLING message

                    >MSH|^~&|1100|IZ|MLI|IZ000007|200707251709||ORU|0404|P|2.3|||AL< The value of fldsep is ********** | &&&&&&&&&&&&&&&&&&& The value of subfldsep is ********** ^ TESTING ORC STUFF The value of ENTIRE ORC 13 FIELD IS::::::: The value of ORC13 is>>>>>>>>>>>>>

                    WARNING- TEST KILLING message

                    >PID|1|998394|16934403640|998394|ALLEN^JUSTIN||19830831|M||||||||||35255379^^^XA^^F< The value of fldsep is ********** | &&&&&&&&&&&&&&&&&&& The value of subfldsep is ********** 1 TESTING ORC STUFF The value of ENTIRE ORC 13 FIELD IS::::::: The value of ORC13 is>>>>>>>>>>>>>

                    WARNING- TEST KILLING message

                    >ORC|RE|16934403640^LAB|16934403640^LAB||||||200706180000|||D34432^BRAND^J^^^^^U< The value of fldsep is ********** | &&&&&&&&&&&&&&&&&&& The value of subfldsep is ********** R TESTING ORC STUFF ORC|RE|16934403640^LAB|16934403640^LAB||||||200706180000|||D34432^BRAND^J^^^^^U The value of ENTIRE ORC 13 FIELD IS::::::: The value of ORC13 is>>>>>>>>>>>>>

                    WARNING- TEST KILLING message

                    >OBR|1|16934403640^LAB|16934403640^LAB|096206^Varicella-Zoster V Ab, IgG^L|||200706181350|||||||200706180000||D34432^BRAND^J^^^^^U||||16934403640||200707251709|||F< The value of fldsep is ********** | &&&&&&&&&&&&&&&&&&& The value of subfldsep is ********** 1 TESTING ORC STUFF The value of ENTIRE ORC 13 FIELD IS::::::: The value of ORC13 is>>>>>>>>>>>>>

                    WARNING- TEST KILLING message

                    >OBX|1|TX|096208^Varicella Zoster IgG^L||>1.09|index|0.00-0.90|H||N|F|19970211||200706191327|DA< The value of fldsep is ********** | &&&&&&&&&&&&&&&&&&& The value of subfldsep is ********** 1 TESTING ORC STUFF The value of ENTIRE ORC 13 FIELD IS::::::: The value of ORC13 is>>>>>>>>>>>>>

                    WARNING- TEST KILLING message

                    >NTE|1|L|~                               Negative          <0.91~                               Equivocal   0.91 - 1.09~                               Positive          >1.09< The value of fldsep is ********** | &&&&&&&&&&&&&&&&&&& The value of subfldsep is ********** 1 TESTING ORC STUFF The value of ENTIRE ORC 13 FIELD IS::::::: The value of ORC13 is>>>>>>>>>>>>>

                    WARNING- TEST KILLING message

                    >NTE|2|L|~Performed At:  DA, LabCorp Dallas~7777 Forest Lane Suite 350C  Dallas, TX 752300000~Celeste Vardaman MD     Phone:  9725667500< The value of fldsep is ********** | &&&&&&&&&&&&&&&&&&& The value of subfldsep is ********** 2 TESTING ORC STUFF The value of ENTIRE ORC 13 FIELD IS::::::: The value of ORC13 is>>>>>>>>>>>>>

                    WARNING- TEST KILLING message

                    >MSH|^~&|1100|IZ|MLI|IZ000007|200707251709||ORU|0405|P|2.3|||AL< The value of fldsep is ********** | &&&&&&&&&&&&&&&&&&& The value of subfldsep is ********** ^ TESTING ORC STUFF The value of ENTIRE ORC 13 FIELD IS::::::: The value of ORC13 is>>>>>>>>>>>>>

                    WARNING- TEST KILLING message

                    >PID|1|97310|17334403990|97310|ALLEN^SARA||19850321|F||||||||||35255379^^^XA^^F< The value of fldsep is ********** | &&&&&&&&&&&&&&&&&&& The value of subfldsep is ********** 1 TESTING ORC STUFF The value of ENTIRE ORC 13 FIELD IS::::::: The value of ORC13 is>>>>>>>>>>>>>

                    WARNING- TEST KILLING message

                    >ORC|RE|17334403990^LAB|17334403990^LAB||||||200706220000|||D34432^BRAND^J^^^^^U< The value of fldsep is ********** | &&&&&&&&&&&&&&&&&&& The value of subfldsep is ********** R TESTING ORC STUFF ORC|RE|17334403990^LAB|17334403990^LAB||||||200706220000|||D34432^BRAND^J^^^^^U The value of ENTIRE ORC 13 FIELD IS::::::: The value of ORC13 is>>>>>>>>>>>>>

                    WARNING- TEST KILLING message

                    >OBR|1|17334403990^LAB|17334403990^LAB|096206^Varicella-Zoster V Ab, IgG^L|||200706220000|||||||200706220000||D34432^BRAND^J^^^^^U||||17334403990||200707251709|||F< The value of fldsep is ********** | &&&&&&&&&&&&&&&&&&& The value of subfldsep is ********** 1 TESTING ORC STUFF The value of ENTIRE ORC 13 FIELD IS::::::: The value of ORC13 is>>>>>>>>>>>>>

                    WARNING- TEST KILLING message

                    >OBX|1|TX|096208^Varicella Zoster IgG^L||>1.09|index|0.00-0.90|H||N|F|19970211||200706251509|DA< The value of fldsep is ********** | &&&&&&&&&&&&&&&&&&& The value of subfldsep is ********** 1 TESTING ORC STUFF The value of ENTIRE ORC 13 FIELD IS::::::: The value of ORC13 is>>>>>>>>>>>>>

                    WARNING- TEST KILLING message

                    >NTE|1|L|~                               Negative          <0.91~                               Equivocal   0.91 - 1.09~                               Positive          >1.09< The value of fldsep is ********** | &&&&&&&&&&&&&&&&&&& The value of subfldsep is ********** 1 TESTING ORC STUFF The value of ENTIRE ORC 13 FIELD IS::::::: The value of ORC13 is>>>>>>>>>>>>>

                    WARNING- TEST KILLING message

                    >NTE|2|L|~Performed At:  DA, LabCorp Dallas~7777 Forest Lane Suite 350C  Dallas, TX 752300000~Celeste Vardaman MD     Phone:  9725667500< The value of fldsep is ********** | &&&&&&&&&&&&&&&&&&& The value of subfldsep is ********** 2 TESTING ORC STUFF The value of ENTIRE ORC 13 FIELD IS::::::: The value of ORC13 is>>>>>>>>>>>>>

                    WARNING- TEST KILLING message

                    >MSH|^~&|1100|IZ|MLI|IZ000007|200707251709||ORU|0406|P|2.3|||AL< The value of fldsep is ********** | &&&&&&&&&&&&&&&&&&& The value of subfldsep is ********** ^ TESTING ORC STUFF The value of ENTIRE ORC 13 FIELD IS::::::: The value of ORC13 is>>>>>>>>>>>>>

                    WARNING- TEST KILLING message

                    >PID|1|92259|17734407900|92259|ARIE^DEVIN||19770930|M||||||||||35255379^^^XA^^F< The value of fldsep is ********** | &&&&&&&&&&&&&&&&&&& The value of subfldsep is ********** 1 TESTING ORC STUFF The value of ENTIRE ORC 13 FIELD IS::::::: The value of ORC13 is>>>>>>>>>>>>>

                    WARNING- TEST KILLING message

                  • #62015
                    Michael Hertel
                    Participant

                      The testing tool is processing one segment at a time as a single message.

                      This is obviously not what you want.

                      You need to check that the message format in your file matches your parse line. (len10, nl, eof)

                    • #62016
                      Duy Nguyen
                      Participant

                        Michael Hertel wrote:

                        The testing tool is processing one segment at a time as a single message.

                        This is obviously not what you want.

                        You need to check that the message format in your file matches your parse line. (len10, nl, eof)

                        I have run the tester using all 3 diff methods…len, nl, and eof with no success.  Any other ideas?

                      • #62017
                        Michael Hertel
                        Participant

                          Do a hex dump and see how the file is formatted.

                          Or better yet, save an inbound message using smat.

                          Then resend from smat to a file.

                          Smat will save as a len10 file.

                          So use the testing tool with len10 on that file.

                        • #62018
                          Duy Nguyen
                          Participant

                            Michael Hertel wrote:

                            Do a hex dump and see how the file is formatted.

                            Or better yet, save an inbound message using smat.

                            Then resend from smat to a file.

                            Smat will save as a len10 file.

                            So use the testing tool with len10 on that file.

                            I’m not sure of how to perform the hex dump, so I will go about this the smat to file method.  

                            The problem, however, is that it’s doing the same thing within the engine whenever I turn the engine noise on and view the logs later…we’re seeing the same thing.

                          • #62019
                            Michael Hertel
                            Participant

                              Well then you have a more basic problem to overcome.

                              You need to look at the source message before drivinging yourself crazy with the proc.

                              Is the source a file or a tcp connection?

                              If it’s a tcp connection the structure should be hl7message

                              If it’s a file, you should have: hl7message

                              In either case, each segment in the message should terminate with a

                              You probably knew that already, but just wanted to make sure.

                            • #62020
                              Duy Nguyen
                              Participant

                                Michael Hertel wrote:

                                Well then you have a more basic problem to overcome.

                                You need to look at the source message before drivinging yourself crazy with the proc.

                                Is the source a file or a tcp connection?

                                If it’s a tcp connection the structure should be hl7message

                                If it’s a file, you should have: hl7message

                                In either case, each segment in the message should terminate with a

                                You probably knew that already, but just wanted to make sure.

                                Michael, my thread is using FILE PROTOCOL and I don’t have the   within the file….is this causing the problem?

                              • #62021
                                Michael Hertel
                                Participant

                                  Yes, there needs to be some way to delimit the messages in the file if the file contains multiple messages and you are not using len10 logic. This is done by the use of ‘s.

                                  Another option is one message per file, but that is not always productive.

                                • #62022
                                  Duy Nguyen
                                  Participant

                                    Michael Hertel wrote:

                                    Yes, there needs to be some way to delimit the messages in the file if the file contains multiple messages and you are not using len10 logic. This is done by the use of ‘s.

                                    Another option is one message per file, but that is not always productive.

                                    So is this problem one that I should resolve or the vendor?  The vendor is submitting these lab results/orders to my system, which cloverleaf pulls….

                                  • #62023
                                    Michael Hertel
                                    Participant

                                      The vendor needs to resolve it. It will make your life much easier and you won’t have to worry about kludging.

                                      They call them standards for a reason.  ðŸ˜‰

                                    • #62024
                                      Duy Nguyen
                                      Participant

                                        Michael Hertel wrote:

                                        The vendor needs to resolve it. It will make your life much easier and you won’t have to worry about kludging.

                                        They call them standards for a reason.

                                      • #62025
                                        Michael Hertel
                                        Participant

                                          Yes tell them you want to see the messages formatted as:

                                          hl7message

                                          hl7message

                                          hl7message

                                          hl7message

                                          etc.

                                        • #62026
                                          Duy Nguyen
                                          Participant

                                            And also….

                                            Is this why I’m unable to “pull” the correct component/field/subfield seperators?

                                          • #62027
                                            Michael Hertel
                                            Participant

                                              Yes, because when you split with r, you don’t have all the segments to split on.

                                            • #62028
                                              Charlie Bursell
                                              Participant

                                                The cCoverleaf engine can do many things as well overcome vendor shortcomings.  Sometimes it’s esier to just do it your self.

                                                If you have a file of HL7 messages just butted together with no linefeed, it is simple to split them out.  It may be easier to write a separate proc that goes before your filter proc to deliver the messages one at a time.  Something like:

                                                run {

                                                   # Get IB message handle

                                                   keylget args MSGID mh

                                                   # Always KILL original

                                                   set dispList

                                                     # Get the IB message consisting of possibly multiple

                                                     # HL7 records. Place a linefeed character between each

                                                     # HL7 record

                                                     set ibMsgs [string map

                                                  [msgget $mh]]

                                                     # So the msgcopy will run much faster, remove all but

                                                     # meta data from the IB message handle

                                                     msgset $mh {}

                                                     # Loop through each HL7 record and create a Cloverleaf

                                                     # message for each

                                                     foreach msg [split $ibMsgs n] {

                                                         # Create new message handle with same meta data as input

                                                         set nmh [msgcopy $mh]

                                                         # Put in a single HL7 record

                                                         msgset $nmh $msg

                                                                # Put in list to continue it

                                                                lappend dispList “CONTINUE $nmh”

                                                            }

                                                            # Send them on

                                                            return $dispList

                                                        }

                                              • #62029
                                                Duy Nguyen
                                                Participant

                                                  Michael Hertel wrote:

                                                  Yes, because when you split with r, you don’t have all the segments to split on.

                                                  Michael,

                                                  Would you email me directly when you have the chance?  I want to ask you more about the “If it’s a tcp connection the structure should be hl7message

                                                  If it’s a file, you should have: hl7message

                                                  In either case, each segment in the message should terminate with a

                                                  and where to look for it using a text file editor.

                                                  Thanks.

                                                • #62030
                                                  Duy Nguyen
                                                  Participant

                                                    Charlie Bursell wrote:

                                                    The cCoverleaf engine can do many things as well overcome vendor shortcomings.

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