Ouput "" in a VRL

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Ouput "" in a VRL

  • Creator
    Topic
  • #49159
    Rob Galino
    Participant

      Hello folks, in the process of converting HL7 ADTs to VRL.  Requirement is to pass all fields valued or not, in “”.  In the VRL field properties, for each field bing copied is a Prefix and Postfix of “, Escape Pair of “”.

      When a field is valued, data is written to the VRL in “data” format but when a field is unvalued, the “” does not pass through, here’s an example:

      “31871805”,”20070320″,,,,

      What is being requested is

      “31871805”,”20070320″,””,””,””,””

      I am successfuly able to do the following by including the following Pre Tcl in the xlate: if {[cequal $xlateInVals “{}”]} {set xlateOutVals ” “} but don’t want that a blank or white space in between the “”…

      “31871805”,”20070320″,” “,” “,” “,” “

      If anyone knows how to make a “” output on a VRL for unvalued fields, your assistance is kindly requested.

      Thanks,

      – Rob

    Viewing 9 reply threads
    • Author
      Replies
      • #60925
        Jim Kosloskey
        Participant

          Rob,

          Have you already tried checking the inbound field for equal @null (using the Xlate IF Action) and if that is true, COPYing =”” (or maybe its =””) to the destination field?

          Jim Kosloskey

          email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

        • #60926
          Michael Hertel
          Participant

            Try this:

            if {[cequal [lindex $xlateInVals 0] {}]} {set xlateOutVals

              }

              Hope this helps,

              -mh

              P.S. Aloha Rob!

          • #60927
            Rob Galino
            Participant

              Jim, yes, i’ve tried the

              IF eq @ null copy =”” ->

              works but works just the same as the tcl fragment Mike provided:

              if {[cequal [lindex $xlateInVals 0] {}]} {set xlateOutVals

                }.

                If either of these are used, unvalued fields output “” but valued fields output without the “” since the Postfix/Prefix of ” had to be removed or when a field is unvalued and extra set of double quotes would be sent.  

                With the IF or tcl fragment, we’re back to square one but on the flip side…  Meaning here’s the output:

                31871805,20070320,””,””,””,””

                Notice the first two fields are now without “”.  The goal is to have every destination field be in “”, valued or not.  If I leave the Prefix/Postfix with ” with either the IF or tcl fragment, output contains an extra set of “” for unvalued inbound fields:

                “31871805”,”20070320″,””””,””””,””””,””””

                What is required is:

                “31871805”,”20070320″,””,””,””,””

                Thanks again in advance!

                P.S. Mike, Mahalo!

            • #60928
              Michael Hertel
              Participant

                I misunderstood, try this instead:

                set xlateOutVals

                  }

                  no if statement needed.

                  -mh

              • #60929
                Rob Galino
                Participant

                  Mike, getting an error…

                  keyed list entry must be a two element list, found “IN”

                  Tried enclosing the “[lindex $xlateInVals 0]” in [], same error:

                  set xlateOutVals

                    ”]”]}

                    I tried something similar and couldn’t get it to work, if this works, the Prefix/Postfix of ” will not be required just this piece of tcl (Pre) in every copy statement and should work for valued and unvalued inbound fields…

                    Aloha,

                    – Rob

                  1. #60930
                    Michael Hertel
                    Participant

                      Ok, try this:

                      set xlateOutVals

                        }

                    • #60931
                      Rob Galino
                      Participant

                        Mike, same error:

                        Command: hcixlttest epic_eq_sch_A01-test.xlt


                        FAILED


                        [0:TEST] Unable to load XLT ‘epic_eq_sch_A01-test.xlt’: keyed list entry must be a two element list, found “IN”

                      • #60932
                        Michael Hertel
                        Participant

                          Retry this:

                          echo >>>$xlateInVals

                          set xlateOutVals

                            }

                            echo >>>$xlateOutVals

                            I have a sneaking feeling the code works but there is something

                            after the frag that is blowing up now.

                            -mh

                        • #60933
                          Rob Galino
                          Participant

                            Mike, it’s working like a charm…  There was an extra } at the end of the frag…  Gonna test some more but I think it’s working….

                            Thanks bro, I should have the BA requesting this change send you something…

                          • #60934
                            Michael Hertel
                            Participant

                              Ah Sheesh…..

                              That was me that gave you the extra brace.

                              Sorry, it’s getting late here.

                              I’m glad you’ve got it working.

                              See ya!

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