how to keep spaces between values in results on obx field

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf how to keep spaces between values in results on obx field

  • Creator
    Topic
  • #48568
    Nancy McDaniel
    Participant

      I have a result value that I need to add spaces and another data field into obx field 5.

      ex. obx field 5 contains a value AMIKACIN, I want to pad a specific number of spaces and then add another field (from obx 8 – abnormal flag) and put all of this into obx field 5.

      I have tried doing this several ways in my translation but it keeps wanting to strip out imbedded spaces.  Is there any way to maintain these imbedded spaces?  In my tcl code, I can display the new value with imbedded spaces but it is getting stripped when copied to outbound message.

      Appreciate any ideas on this.

      thanks,

      Nancy

    Viewing 2 reply threads
    • Author
      Replies
      • #59021
        Robert Kersemakers
        Participant

          Hi Nancy,

          I think you need to check your tcl code whether the xlateOutVals is structured as a list.

          If you do something like:

          Code:

          set field “This is a test”
          set xlateOutVals $field


          then xlateOutvals will look at as a list, where every word will be seen as a list element because they are separated by a space. So xlateOutVals will have 4 elements!

          What you need to do is:

          Code:

          set field “This is a test”
          set xlateOutVals [list $field]


          This way will be seen as one list element.

          Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

        • #59022
          Jim Kosloskey
          Participant

            Nancy,

            Maybe I am not clearly understanding your need but I think a CONCAT will do the trick.

            As I understand it you have two fields: OBX-5 (which might contain the value AMIKACIN) and OBX-? (the abnormal flag – let’s say it has a value of Y). Then betweem these two fields you want some finite number of spaces (let’s say 2).

            So you want a resulting OBX-5 field to have ‘AMIKACIN  Y’.

            A CONCAT with this in the Source list substitute the correct address path for the OBX references:

            OBX-5

            =  <--there are two spaces here OBX-?    <--- this is the abnormal flag field. The destinatiom would be OBX-5. I don’t think there is any need for Tcl – unless you need a variable rather than fixed number of spaces. I tested this on CL5.2 Patch2 and it worked fine. Jim Kosloskey

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

          • #59023
            Nancy McDaniel
            Participant

              Robert, thanks for that suggestion. I believe that will work.

              Jim, I am doing a concat. The problem in needing tcl code is I need to format the data in the text field so that my abnormal flag is also in a specific location (ex. 50) no matter how long my test description is.  

              thanks,

              Nancy

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