xlt Proc and Translation results different

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf xlt Proc and Translation results different

  • Creator
    Topic
  • #51761
    Garrett Fletcher
    Participant

      Hello,

      I have a translation that uses a xlt proc. It puts a value of ‘Positive’ in a field if certain text is found.

      When I use this the message is not imported correctly in our Meditech system.

      When I do the same thing with IF and COPY statements in the translation configuarator Meditech imports the file correctly.

      I got a sample of each of the output file and compared them. They are exactly the same. I even compared the hex, and that is exactly the same.

      Has anyone else had a problem where the output of a Proc and of a Translation are treated differently in a recieving system? Here is my proc:

      Code:



      ######################################################################
      # Name: xltReplaceHPV
      # Purpose:
      # UPoC type: xltp
      # Args: none
      # Notes: All data is presented through special variables.  The initial
      # upvar in this proc provides access to the required variables.
      #
      # This proc style only works when called from a code fragment
      # within an XLT.
      #

      proc xltReplaceHPV {} {
         upvar xlateId       xlateId
       xlateInList   xlateInList
       xlateInTypes  xlateInTypes
       xlateInVals   xlateInVals
       xlateOutList  xlateOutList
       xlateOutTypes xlateOutTypes
       xlateOutVals  xlateOutVals

      set positive “HPV High Risk:  Positive”
      set negative “HPV High Risk:  Negative”

      if {[string match “*$positive*” $xlateInVals]} {
      set xlateOutVals Positive
      } elseif {[string match “*$negative*” $xlateInVals]} {
      set xlateOutVals Negative
      }

      }

    Viewing 2 reply threads
    • Author
      Replies
      • #71669
        Robert Kersemakers
        Participant

          Hi Garrett,

          There has to be a difference between the two outputs.  Are you sure they are the same??

          It shouldn’t matter if you use a proc or Xlate, as long as the output is the same. I do notice that you don’t treat xlateInVals and xlateOutVals as lists, but that shouldn’t be a problem here.

          So maybe the question should be: if the output is the same, why does Meditech treat it differently?

          Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

        • #71670
          Russ Ross
          Participant

            I haven’t seen the case where a proc or xlate that produce the same output are treated differently by the downstream system.

            Let’s hope that never is true else unit testing would be a foulacy.

            However, I have gotten confused by forgetting to cycle the process to pick up the changes I made and see a different result in the tester becuase it picks up my changes without needing to cycle the process.

            Sometimes I get so confused nothing makes sense so I walk away for a day and the next day redo everyhting and it seems to make sense and work.

            Cycling the process and shutting down and reopening the IDE when things don’t make sense have been techniques that sometimes help.

            If you do integration work long enough it is inevitable to go down a rabbit hole once in a while that seems like nonsense.

            Russ Ross
            RussRoss318@gmail.com

          • #71671
            Garrett Fletcher
            Participant

              Thanks everyone. It looks like this is going to be our recieving system that is to blame. It stopped accepting the messages that I am generating with the xlt now.

              Thanks for all of your help.

              Garrett

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