Problem with CONCAT of repeating OBX field to single field

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Problem with CONCAT of repeating OBX field to single field

  • Creator
    Topic
  • #51943
    Gordon Koch
    Participant

      I am trying to concat multiple OBX.5 fields into a single OBX.5 with the following:

      Source:

      ~1(0).1(0).5(0).0(0).OBX(0).#5(0)

      1(0).1(0).5(0).0(0).OBX(%s1).#5(0)

      Destination:

      1(0).1(0).5(0).0(0).OBX(0).#5(0)

      However the data in the first OBX.5 field repeats twice in my output and and I still get an undesired second iteration of the OBX segment. This setup works for me with NTE.3 in a different Xlate, so I do not know why it is not working here. Any suggestions?

      Thank You.

    Viewing 9 reply threads
    • Author
      Replies
      • #72426
        Gary Atkinson
        Participant

          use your field iteration in the segment iteration.

        • #72427
          Ryan Spires
          Participant

            Couple things to check…

            Make sure you are doing the logic inside the iteration for the OBX segment.

            (I am assuming you are wrapping multiple OBX’s into a single OBX)

            Make sure you are using the concat

            If you are doing a bulk or path copy of the OBX Seg, you may need (before the concat) do a pathcopy of @null to  1(0).1(0).5(0).0(0).OBX(%s1)

            To wipe out the contents that would otherwise be mapped… (this would be done inside your Segment iterate as well.

            When you do that you will need to map the other fields you want in the OBX field by field or those will get wiped out as well.

          • #72428
            Gordon Koch
            Participant

              Thanks guys for your input. I added the @null action prior to my CONCAT, and now the data in the first OBX.5 field no longer repeats in my output. However I still get a “blank” OBX segment (nothing in OBX.5) for each of the subsequent iterates. Gary, I am not sure what you mean by using the field iteration in the segment iteration. Getting closer…

              Thanks

            • #72429
              Ryan Spires
              Participant

                Are you wanting to eliminate the subsequent OBX’s alltogether…

                If so, it sounds like you are doing a bulkcopy, or a pathcopy within the segment iterate…

                If you have a pathcopy using the iteration variables of the segment, you could remove it…

                if you are doing a bulk copy, then you can use the pathcopy using source of @null and destination of the OBX segment within the iterate (and use your iteration variable) it will null all subsequent OBX segs being sent outbound.

                Ryan

              • #72430
                Gary Atkinson
                Participant

                  I thought you wanted to take multiple OBX:5 fields into multiple OBX segments.

                • #72431
                  Gordon Koch
                  Participant

                    Thanks Ryan. It was the PATHCOPY giving me the unwanted OBX segments. One more mystery…

                    I need to hardcode something within the CONCAT’ed OBX.5 field. I just added =WORD to the top row of my source, and now this hardcoded word repeats twice at the beginning. Any thoughts as to why it is looping…

                    Thanks.

                  • #72432
                    Ryan Spires
                    Participant

                      are you adding that before the segment iterate or within it?

                      If you want at the top, I suspect you would want to add before the iterate.

                    • #72433
                      Gordon Koch
                      Participant

                        Hello Ryan,

                        I have it at the top within the CONCAT action:

                        Source

                        =Transfusion Reaction Extended Work-up

                        ~1(0).1(0).5(0).0(0).OBX(0).#5(0)

                        1(0).1(0).5(0).0(0).OBX(%s1).#5(0)

                        I get this output:

                        1(0).1(0).5(0).0(0).OBX(0)  :  >|||||Transfusion Reaction Extended Work-up~Transfusion Reaction Extended Work-up~~Non-hemolytic Allergic Transfusion Reaction~No Bacterial Contamination noted after 7 days<

                        Again, the removing the PATHCOPY got rid of the extra segment and everything was fine until I needed to hardcode the comment at the beginning.

                        Thanks

                      • #72434
                        Ryan Spires
                        Participant

                          if the hardcoding is in the iterate with the concat action, it will put the hardcoding into the data with each iteration.

                          move your hardcoding our into its own copy command above the iterate.

                          Inside the iterate when you use the

                          concat

                          ~1(0).1(0).5(0).0(0).OBX(0).#5(0)

                          1(0).1(0).5(0).0(0).OBX(%s1).#5(0)

                          it will pull what you have hardcoded. the first time but not each subsequent time.

                        • #72435
                          Gordon Koch
                          Participant

                            Got it. That makes sense about the hardcoding repeating with each iterate. I will make the change later. Thanks Ryan for all your help…

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