HL7 to frl ?

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf HL7 to frl ?

  • Creator
    Topic
  • #49485
    Rick Pritchett
    Participant

      I use the folloing proc to strip off the unwanted segments off of a batch file and send the messages through to the engine.  The file is generated with the right number of messages but in the net moitor staus window i get 1 failed message before the 3 messages go through. Any ideas?

      proc seg_strip { args } {

      global HciConnName

       set mode [keylget args MODE]

       switch -exact — $mode {

       start {

       return “”

      }

       run {

       set mh [keylget args MSGID]

       set msgLIST [split [msgget $mh] r]

       set dispList

         #set msgLIST [split [msgget $mh] r]

         set newmsg {}

         set nmh {}

         set nmsg {}

         set counter 0

         

         foreach msg $msgLIST {

         set VAR [string range  $msg 0 2]

         if {[string equal $VAR BTS] || [string equal $VAR BHS] ||

                          [string equal $VAR FTS]} {

                                   

                                #DO nothing!

                       

                          } elseif {[string equal $VAR MSH]} {

                                 if {$counter > 0} {

                                     # means you encounter start of new message so time to build the message

                                     # join your newmsg list with r and do the set nmh [msgcopy $mh] and msgset                                 # and lappend for dispList

                                        set nmh [msgcopy $mh]

                               set nmsg [join $newmsg r]

                                        msgset $nmh $nmsg

                              lappend newmsg $msg  

                                        incr counter

                                 } else {

                                         set nmh [msgcopy $mh]

                                         set nmsg

                                         lappend newmsg $msg

                                         incr counter

                                 }

                       } else {

                                  lappend newmsg $msg                

                         

                       }

        }

        # join your newmsg list with r and do the set nmh [msgcopy $mh] and msgset and lappend for dispList

           

                         set nmh [msgcopy $mh]

                         set nmsg [join $newmsg r]

                         msgset $nmh $nmsg

                         lappend dispList “CONTINUE $nmh”

           

        }

        return $dispList

        }

        }

        shutdown {

         return “”

        }

         }

    Viewing 9 reply threads
    • Author
      Replies
      • #62158
        Michael Hertel
        Participant

          Look in your process log.

          You’ll find the answer there.

        • #62159
          Rick Pritchett
          Participant

            thats just it nothing is in the procees or error file files about it.

          • #62160
            Tom Rioux
            Participant

              Shouldn’t you include in the code below to check for the FHS segment?  Or is the file not coming in with that?

              if {[string equal $VAR BTS] || [string equal $VAR BHS] ||

                               [string equal $VAR FTS]}

              Let me know if this helps…

              Tom Rioux

              Baylor Health Care Systems

            • #62161
              Rick Pritchett
              Participant

                it does but is thrown out since it is not translated

              • #62162
                Tom Rioux
                Participant

                  then shouldn’t the code read:

                  if {[string equal $VAR BTS] || [string equal $VAR BHS] ||

                       [string equal $VAR FHS] || [string equal $VAR FTS]}

                • #62163
                  Michael Hertel
                  Participant

                    What is the code in the error database?

                    The error really should be in the process log too.

                  • #62164
                    Rick Pritchett
                    Participant

                      the error output

                      [/code]

                    • #62165
                      Tom Rioux
                      Participant

                        Try changing that IF statement and the error probably will go away.   Appears to me your code is missing the FHS segment and Cloverleaf is seeing this segment as a message, hence the “unsupported trxid”.

                      • #62166
                        Rick Pritchett
                        Participant

                          I added that to the IF statement but it still returns that error.  Could it have anything to do with the blank lines in the file?

                        • #62167
                          Rob Abbott
                          Keymaster

                            Yes, the blank lines are being treated as messages or segments (depending on where they appear in the file, I suppose) since you aren’t stripping them out.

                            Add [string equal “$VAR” “”] to your IF statement and the problem should go away.

                            Rob Abbott
                            Cloverleaf Emeritus

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