Issue with tcl code use on Lab messages with multi OBRs

Clovertech Forums Read Only Archives Cloverleaf Tcl Library Issue with tcl code use on Lab messages with multi OBRs

  • Creator
    Topic
  • #51929
    Marsha Parks
    Participant

      We have identified an issue with our Lab Results that contain multiple OBRs in the message.  In the process of splitting it out and rebuilding the message in the format the downstream system expects, we loose part of the result.

      This is code that has been on our interface engine for years and the person who wrote the code, no longer works here.  They are not many comments and since it is Micro Lab result, it gets a little more complicated on what they are trying to do.  I am at a loss to figure out which piece is really causing the issue.  I will admit, I am not a tcl expert by any means.

      In general, I can see we are building a new message and formatting for each OBR that is present.  When I run this code through the testing tool, I notice for each message there is a continue and then it lists the message.  When you get to OBR 6, it has 2 messages together before you see the final continue with the last OBR.  

      What am I missing here?  Can anyone help?

      Marsha

    Viewing 3 reply threads
    • Author
      Replies
      • #72338
        Gary Atkinson
        Participant

          Have you tried building this out in an Xlate?

        • #72339
          Marsha Parks
          Participant

            No, I was trying not to got back into full build.  I know there is something simple in there that is not clearing the message replace or one the the set varibles.  I just keep missing it.  

            this is a patient safety issue since it drops one of the results, so using the existing code the builds everything is the best option to turn it around the quickest.  I just need to find the error….

          • #72340
            Tom Rioux
            Participant

              Marsha,

              I will have to admit that I was the one who wrote this code while at Methodist.  I know it isn’t the cleanest piece of code and I apologize that it isn’t well documented.   To my defense  ðŸ˜³ , this Micro interface was put into prod before the interface was ready or tested and all of the changes were done “on the fly”…including this code.   At some point you may want to research a cleaner way, maybe as in an xlate as someone suggested.

              With that being said, I have taken a look at the code and I think I have found the issue.  Find the following piece of code:

              foreach num $count {

                     set MIC_txt “”

                     set KB_txt “”

                     set BP_txt “”

                     set org_txt “”

                     set obr4 “”

                     set newmicmsg “”

                     set newkbmsg “”

                     set newpbmsg “”

              Add the last line of code and that should clear up the concating of the two messages together.   If you have any further questions regarding the code, please don’t hestiate to ask.  I will try to assist as time permits. (We are in the phases of integrated testing for a new facility right now so time is precious).

              Thanks…..

              Tom Rioux

            • #72341
              Marsha Parks
              Participant

                Thanks Tom.  

                Some things don’t change.  We are still rushed to do projects and they go before they are fully tested.  We all do what we can at the time.  What I find hard, is the analysts can’t even tell us what they need it to do if we rewrite it.  I will give this a try.  Thanks 🙂

                Marsha

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