Changing Repeating Fields to Sub-Fields

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Changing Repeating Fields to Sub-Fields

  • Creator
    Topic
  • #53967
    Jon Melin
    Participant

      Hello.

      I am trying to convert ~ to ^ due to a system limitation downstream. I may be going about this incorrectly but this isn’t working as I expected.

      I am taking each itertation of the OBR28 field and trying to put them into the OBR(0).#28(0).[X] sub-field location. This isn’t working using a variable to hold the count and number of field iterations. If I manually type the sub-field such as OBR(0).#28(0).[1], OBR(0).#28(0).[2], etc It appears to work.

      In this instance there are 4 iterations of OBR28, the I am trying to put into OBR28(0).[ 0-3 ] and I know my variable is counting correctly too based on my testing tool echo:

      0 – Testing varibale values

      1 – Testing varibale values

      2 – Testing varibale values

      3 – Testing varibale values

      MESSAGE 1

      0(0).MSH(0).#1(0)  :  >|< 0(0).MSH(0).#2(0)  :  >^~&< Any thoughts on why this won’t copy from a field iteration to sub-field? I’ve attached a screenshot of this portion of the XLATE. Thank you, Jon

    Viewing 1 reply thread
    • Author
      Replies
      • #79702
        Jim Kosloskey
        Participant

          Jon,

          That notation won’t work without some Tcl.

          However if you concatenate all of the fields together in a temp variable using the caret as the separator, then once the ITERATE is completed, COPY that temp variable to the single field I think that will work without any Tcl.

          You could also try CONCAT inside the ITERATE and target the destination field again using the caret as a separator.

          If you want to do this with some Tcl, eamil me and I will discuss the particulars.

          email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 60 years IT – old fart.

        • #79703
          Jon Melin
          Participant

            I just configured it with concat. Thank you for the recommendation.

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