xlatesubstring error

Clovertech Forums Cloverleaf xlatesubstring error

  • Creator
    Topic
  • #119003
    Rich
    Participant

      I’m trying to pull the A off of the MRN, ex. A0004567.  I’m using Cloverleaf 6.0

      I tried xlatsubstring and received the following error:

      Tcl callout error
      xlateStrSubstring 1 end:

      errorCode: NONE

      errorInfo:
      bad type “st”: must be c, d, v, or x
      while executing
      “xpmstore $xlateId $outAdd $outType [string range $inValue $_first $_last]”
      (procedure “xlateStrSubstring” line 15)
      invoked from within
      “xlateStrSubstring 1 end”

      How can I pull the leading A?

       

      Thank you!

    Viewing 4 reply threads
    • Author
      Replies
      • #119004
        Alfred Cox
        Participant

          We do a similar tcl in a couple of our xlates. It looks like this:

          set xlateOutVals [string range $xlateInVals 1 end]

          • #119005
            Rich
            Participant

              I’ve never used TCL translate, but that looks like a good solution.  How do I get the PID.3.1 value into the code, then into the PID segment again?

          • #119006
            Alfred Cox
            Participant

              normal copy statement with PID-3.1 in source and destination with that code in preproc window.

              • #119007
                Rich
                Participant

                  That worked perfectly, thank you!

              • #119010
                Charlie Bursell
                Participant

                  If you continue to use the statement like:

                  set xlateOutVals [string range $xlateInVals 1 end]

                  You will get burned sooner or later if the field contains spaces.  It should be:

                  set xlateOutVals

                    ]

                  1. #119011
                    Jeff Dawson
                    Participant

                      We are using CIS 6.2.6.1 and the xlateStrSubstring function appears to be working, when you were trying it does your PID-3 field have multiple components?

                      Source: 0(0).PID(0).#3(0).[0]

                      Action: xlateStrSubstring 1 end

                      Destination: 0(0).PID(0).#3(0).[0]

                      Result: 0(0).PID(0).#3(0) “Patient ID (Internal ID)” : >0004567^^^MRN^MRN<

                      I’m thinking for the reply above it should be sent back as a list if using tcl don’t think the reply came all the way through.

                      inside the brackets would look like:

                      set xlateOutVals <open bracket> list <open bracket> string range $xlateInVals 1 end <close bracket> <close bracket>

                      Also took a screenshot and attached.

                      Jeff

                      Attachments:
                      You must be logged in to view attached files.
                      • #119013
                        Charlie Bursell
                        Participant

                          Seems my post was truncated.  Should be:

                          set xlateOutVals 

                            ]

                        • #119014
                          Charlie Bursell
                          Participant

                            I thought I would pass this on for those that may be dumb as me about how to use the forum  🙂

                            According to head guru Rob Abbott:

                            The forum uses “bbcode” for markups, it uses square brackets for things like bold or whatever.

                            So when posting snippets of code and having problems

                            Try wrapping that with [code]your text here[/code]

                             

                            Thanks Rob

                        Viewing 4 reply threads
                        • You must be logged in to reply to this topic.