Changing Case for Addresses

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Changing Case for Addresses

  • Creator
    Topic
  • #52090
    Greg Tataryn
    Participant

      We have set up interfaces between our physician practices and the hospital (Allscripts PM for the practices and McKesson Passport/STAR for the hospital).  In Allscripts we keep everything in mixed/proper case but star keeps everything in all caps.  Going from Allscripts to the hospital we need to change names, addresses, etc to caps and on the other side change them all back to proper case.

      I have some TCL code set up in the XLT file going to Allscripts that changes the names to proper case, but I cannot get the addresses to change to proper case and I am guessing it is because of the numbers.  Anyone have any suggestions?

    Viewing 9 reply threads
    • Author
      Replies
      • #73022
        Vince Angulo
        Participant

          I would guess that because the address has spaces after the 1st number, Tcl expects you to treat it as a list when you apply the toupper statement.

        • #73023
          Greg Tataryn
          Participant

            Vince Angulo wrote:

            I would guess that because the address has spaces after the 1st number, Tcl expects you to treat it as a list when you apply the toupper statement.

            You’ll have to fogive me as I am not very good with TCL (getting better every day though).  Could you give me an example of how I would treat it as a list?

          • #73024
            Robert Milfajt
            Participant

              Greg,

              When you say the address does not change, are you talking about the street address only, or the address as a whole, street 1^street 2^city^state^zip.

              If the former, it could be a problem with your code, so it would be nice to see what you are doing.

              If the latter, you need to treat each sub field, street 1, street 2, city, state, zip as separate subfields.

              In either case a screen shot of your XLT and TCL would be helpful to help get you to the correct answer.

              Robert Milfajt
              Northwestern Medicine
              Chicago, IL

            • #73025

              Greg, can you please paste your tcl code here along with same sample input and the desired output?

              -- Max Drown (Infor)

            • #73026
              Greg Tataryn
              Participant

                Max Drown wrote:

                Greg, can you please paste your tcl code here along with same sample input and the desired output?

                In my XLT file I have a line to copy PID:11.1 to PID:11.1 and another for PID:11.2 (the two address lines).  I have a TCL pre proc set up in that line with the following code:

                Code:

                set xlateOutVals [string toupper $xlateInVals]

                I have also tried

                Code:

                lset xlateOutVals [string toupper [lrange $xlateInVals 0 end]]

                Neither seem to work.  Suggestions?

              • #73027
                Charlie Bursell
                Participant

                  Try this:

                  set xlateOutVals

                    ]]

                  1. #73028
                    Greg Tataryn
                    Participant

                      Charlie Bursell wrote:

                      Try this:

                      set xlateOutVals

                        ]]

                        Not quite what I was looking to do.  Changing to upper case is working fine going one way, coming back the other way I have to change from upper case to title case and that is where I am running into some trouble.  I have tried a couple of different ways and all I seem to end up with is everything in lower case.

                      1. #73029
                        Charlie Bursell
                        Participant

                          Then you would need some a priori knowledge of what you are dealing with.  Changing the command “string toupper” to “string totitle” would work but only for the first word if there are multiples.

                          For example string totitle “JOE BROWN”  would return “Joe brown”.  Probably not what you want.  

                          So the question is do you want every word to begin with capital letter or only certain words and if so how to identify which?

                          Remember, a computer is a stupid, rule based machine.  No shades of grey just black and white.  Or is that Black and White  ðŸ˜€

                        • #73030
                          Greg Tataryn
                          Participant

                            All words would need to have the first letter capitalized.  I think the problem is, since it is an address field the numbers are throwing it off.

                            Coming into the engine it would look something like “2122 MANCHESTER EXPRESSWAY” I need it to be “2122 Manchester Expressway” and right now, using the code above and just changing toupper to totitle I am getting “2122 manchester expressway”

                          • #73031
                            Charlie Bursell
                            Participant

                              Try this.

                              set inp [lindex $xlateInVals 0]

                              foreach el $inp {

                                 set el [string totitle $el]

                                 lappend outList $el

                              }

                              set xlateOutVals

                                If you have weird addresses it may not always be exactly right but will work for all normal addresses

                                We can treat the address as a list since even though it is a string it is space separated

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