substring failing

Clovertech Forums Cloverleaf substring failing

  • Creator
    Topic
  • #117414
    Rich
    Participant

      Team,

      See attached image.  This substring function is causing the xlate to fail.  I don’t understand why.

      Thank you in advance for your help!

      Attachments:
      You must be logged in to view attached files.
    Viewing 5 reply threads
    • Author
      Replies
      • #117416
        Jared Parish
        Participant

          What version of Cloverleaf?  What error are you receiving?

          - Jared Parish

          • #117417
            Rich
            Participant

              I’m using 6.0, and I’m not receiving an error, it just doesn’t pass messages unless I deactivate the substring.

            • #117418
              Rich
              Participant

                To clarify, The substring is toward the end of my xlate, and it just stops processing the xlate, and no message is sent.

            • #117419
              Jared Parish
              Participant

                Could this be your issue? Archive KB 1550447

                <td class=”KBDefaultLabel_Bold”>Description:
                <td class=”KBDefaultLabel”>Hello,

                Using the STRING function, xlateStrLength to determine the length of a string in his xlate. Your encountering the following error:

                Tcl callout error

                xlateStrLength:
                errorCode: NONE
                errorInfo:
                bad type “st”: must be c, d, v, or x
                while executing
                “xpmstore $xlateId $outAdd $outType [string length $inValue] ”
                (procedure “xlateStrLength” line 7)
                invoked from within
                “xlateStrLength”

                <td class=”KBDefaultLabel_Bold”>Work Around:
                <td class=”KBDefaultLabel”>Workaround is to set outType to c
                <td class=”KBDefaultLabel_Bold”>Resolution:
                <td class=”KBDefaultLabel”>Reported as a bug and will be addressed in a later version or patch.

                 

                - Jared Parish

                • #117421
                  Rich
                  Participant

                    Since I’m not using string length, I don’t think so, but you did make me think of something.  The value I’m trying to get in PID.13.6 is phone number in the format of 1234567.  Could that be the issue, and if so, What do I use to parse just the first three digits?

                     

                    Thanks,

                    -> Rich

                  • #117422
                    Jim Kosloskey
                    Participant

                      You could just use 0 and 2 (I think that function is zero based if not then 1 and 3).

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

                    • #117424
                      Rich
                      Participant

                        Jim,

                        I’ve tried 0 2 and 1 3

                        Both fail in the exact same way.  The odd thing is that I’ve got other xlates using the same function in the same way that do not fail.  I’ve also tried removing the line, and recreating it.  I’m befuddled!  The only difference is that I’m dealing with numeric values instead of alpha characters.

                      • #117425
                        Jim Kosloskey
                        Participant

                          So is the input a field with components or subcomponents?

                          Eg |^123456| or |&123456| or the like?

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

                        • #117426
                          Rich
                          Participant

                            Jim,

                            I’m parsing  PH^^^601^1234567|

                            into (601)123-4567

                            So, component level only.

                          • #117427
                            Jim Kosloskey
                            Participant

                              So should the component value in the Source be [4] and not [6]?

                              If you echo out the Source value as it is what do you get?

                              • This reply was modified 4 years, 5 months ago by Jim Kosloskey. Reason: Change [5] to [4]

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

                            • #117430
                              Rich
                              Participant

                                How do I echo out the value?

                                 

                                Thanks!

                              • #117434
                                Jim Kosloskey
                                Participant

                                  Refer to David Perry’s post below to echo out the value. But I think you have the incorrect value in the component notation.

                                  My theory is the temp variable which is the target is being created in this Action (it did not exist before this Action). You are pointing to a non-existent input value by using the incorrect component value so the STRING Action does not populate the temp variable at all.

                                  I think then the CONCAT has issues with the non existent temp variable.

                                  To prove the point before adjusting the component value, you could add a COPY Action copying @null to the temp variable (@AD??) at the beginning of your Xlate. That will establish the existence of the temp variable so if the STRING Action does nothing the CONCAT will still find the temp variable (which has a value of null).

                                  Of course, I could be way off base on that, but I am fairly sure you don’t have the correct value in the component notation.

                                   

                                  To validate what it should be, run the input message through the HL/7 tester for your variant with the ‘noise’ level turned up so you can see hat the value should be in the address path for that component. The value shown there is what you should use in your Xlate.

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

                                • #117440
                                  Rich
                                  Participant

                                    If I

                                    copy 0(0).PID(0).#13(0).[5] to @AC

                                    then copy 0(0).PID(0).#13(0).[6] to @AD then

                                    Concat: =(
                                    @AC
                                    =)
                                    @AD

                                    I get (601)551XXXX – redacted number

                                    so I know the segment is correct.  However, as soon as I try to

                                    xlateStrSubstring 0 2 with an input of @AD and output to @AE it fails.

                                    All I can conclude is that we have a failure trying to substring a numeric value.  I even tried putting @null in both @AE and @AF to make sure it had a value.  The message still fails to send.  Unfortunately, my testing tool is acting up and I’m unable to echo out values.

                                    Thoughts?

                                  • #117441
                                    Jim Kosloskey
                                    Participant

                                      OK if echo is not working, another trick is you can find unused fields in the OB message and COPY data items (IB or temp variables) you want to know the values of to those fields. Then those unused fields will contain the values.

                                      If that does not shed any light and you have exhausted the various options for resolution perhaps contacting support is in order.

                                      I don’t have access to Cloverleaf so unfortunately I cannot try to duplicate what you have.

                                      Maybe someone who has the same release you are on may be willing to try to duplicate your effort.

                                      If you think it would help, feel free to email me and I will try to work directly with you so I can look over your shoulder at your system.

                                       

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

                                  • #117420
                                    Jim Kosloskey
                                    Participant

                                      Have you tried replacing end-4 with a fixed number just to see if that gets past the issue?

                                      Is this happening in the testing tool?

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

                                      • #117423
                                        Rich
                                        Participant

                                          Jim,

                                          I’m using this xlate to reformat the phone number as (999)999-9999.  In the testing tool, it just leave the field that should be populated by my concatenate as a blank.  I’ve tried putting constants in the variables in my concatenate, and see that that part is working fine.

                                      • #117433
                                        Anonymous

                                          Add this to the PreProc and let us know the output:

                                          echo “inVals: $xlateInVals”
                                          echo “inTypes: $xlateInTypes”

                                        • #117443
                                          Charlie Bursell
                                          Participant

                                            Simplify to one xlate action:

                                            copy In: PID.13.5 and PID.13.6   Out: PID.13

                                            lassign $xlateInVals pre post

                                            set pre ($pre)

                                            set post [string range $post 0 2]-[string range $post 3 end]

                                            set xlateOutVals

                                            1. #117536
                                              Jim Kosloskey
                                              Participant

                                                Rich,

                                                So did you ever get this resolved? Is this a bug with numerics?

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

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