Testing an XLT Pre Proc for a COPY action

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Testing an XLT Pre Proc for a COPY action

  • Creator
    Topic
  • #50171
    Jon Blanchard
    Participant

    In an Xlate, I created a COPY action and set the Pre Proc to the tcl proc called field_ScrubHL7AndOtherSpecialChars.  The proc contains the following code:

    Code:

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

      lassign $xlateInVals InputData
      set InputData [string map {\T\ AND \N\ ” ” \F\ ” ” \H\ ” ” \R\ ” ” \E\ ” ” \S\ ” “} $InputData]
      set InputData [string map {/ ” ” \ ” ” % ” ” $ ” ” ! ” “} $InputData]
      set InputData [string trimright $InputData]
      set xlateOutVals [list $InputData]
      }

    To test this tcl proc, I brought up the Testing Tool and set up the following:

  • Procs = field_ScrubHL7AndOtherSpecialChars

    Data File = field_scrub_test_data.txt

    Run Mode

    New Line Terminated

    Caller Context = xlt_pre


  • The data file contains several lines of single field test data to test the above proc.  The output after clicking the Run Command button is:

    Code:

    Please Wait ……
    Command Issued: hcitpstest -r run -f nl -c xlt_pre S:/quovadx/qdx5.5/integrator/pms/data/field_scrub_test_data.txt “field_ScrubHL7AndOtherSpecialChars”
    Command output:

    [0:TEST] Tcl error:
    msgId = message0
    proc = ‘field_ScrubHL7AndOtherSpecialChars’
    args = ”
    result = ‘wrong # args: should be “field_ScrubHL7AndOtherSpecialChars”‘
    errorInfo: ‘
    wrong # args: should be “field_ScrubHL7AndOtherSpecialChars”
       while executing
    “field_ScrubHL7AndOtherSpecialChars {MSGID message0} {CONTEXT xlt_pre} {ARGS {}} {MODE run} {VERSION 3.0}”‘

    I know that the base tcl code works and the xlt wrapper is a clone from another xlt proc, so the question is how to set up the Testing Tool to correctly handle this as a XLT Pre Proc.  Can anyone give me a direction to go with this?

    Thanks.

    Migration Consultant
    Coffee Regional Medical Center
    Eastern Time Zone

Viewing 3 reply threads
  • Author
    Replies
    • #65096
      Robert Milfajt
      Participant

      I am not sure xlt_pre is the correct context.  xlt_pre is the pre_proc you see in the route screen for a particular xlate for a route.  Hence the arguments passed in being MODE=run, MSGID=message0, etc.

      Your script is a TCL proc that runs in the procs for a particular COPY command, which is a totally different context, which is called from within an Xlate.

      I am not sure how you would configure the testing tool to show the functioning of this particular proc, but you could test the translation via the tester tool to prove this is working.

      Bob

      Robert Milfajt
      Northwestern Medicine
      Chicago, IL

    • #65097
      Tom Rioux
      Participant

      Why don’t you try putting some echo statements in your tcl fragment code then test the xlate with your data file.   You can tell by the results of the echo statements if the desired information is being passed to, translated, and passed out of your tcl fragment.

      Thanks…

      Tom Rioux

    • #65098
      Jon Blanchard
      Participant

      Guys:

      Thanks for your ideas.  I went ahead and tested the Xlates with the Pre Proc and it works, so I am able to move forward with my current project.

      In the Testing Tool, what is the xlt-pre Caller Context used for?  Other similar contexts are xlt-post, xlt-raw and xlt-gen.  Perhaps I assumed too much.

      Migration Consultant
      Coffee Regional Medical Center
      Eastern Time Zone

    • #65099
      Charlie Bursell
      Participant

      You are confusng an xlt_pre TPS proc with the PRE proc portion of an Xlate action.  The xlt_pre TPS proc goies in the route prior to the route action.  The other PRE is embedded within an Xlate action and has no context.

      The only way to test the latter type of proc is via hcixlttest (Command line or GUI)

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

Forums

Forum Statistics

Registered Users
5,115
Forums
28
Topics
9,290
Replies
34,426
Topic Tags
286
Empty Topic Tags
10