Delete Segment Using Xlate (Second FT1)

Clovertech Forums Cloverleaf Delete Segment Using Xlate (Second FT1)

  • Creator
    Topic
  • #120738
    Todd Hamilton
    Participant

      Using CLv19, In order to delete a segment using an Xlate you would use the PATHCOPY @null approach.  For example, to delete a PV1 segment you would do the following:
      <pre>Action: PATHCOPY
      Source: @null
      Destination: 0(0).PV1(0)
      Result: PV1 segment deleted</pre>
      Unfortunately, this method does not work when attempting to delete the second FT1 in a message. What am I doing wrong?
      <pre>Action: PATHCOPY
      Source: @null
      Destination: 1(1).FT1(0)
      Result: All FT1 fields are deleted but FT1 segment header remains.</pre>
       

       

      todd.hamilton.omaha@gmail.com
      (402) 660-2787

    Viewing 5 reply threads
    • Author
      Replies
      • #120739

        1(1).FT1(0)

        The trailing (0) is the iteration of the segment in this case. The 0 means the 1st iteration, it’s hardcoded.

        So, try this instead: 1(1).FT1

        That would get rid of all FT 1 segments.

        If you are looping and want to get ride of specific segments only, the use an iteration variable like (%s1) and 1(1).FT1(%s1)

        -- Max Drown (Infor)

      • #120740
        James Cobane
        Participant

          You may want to check the outbound variant definition and ensure that the FT1 is not marked as ‘Required’. I wouldn’t expect it to be but usually when I’ve seen a segment still being produced after nulling it out, it is because the variant had the segment as required.

          Jim Cobane – Henry Ford Health

        • #120741
          Keith McLeod
          Participant

            If you were to run the testing tool using HL7 Test with the variant used in the XLate, how would it display the paths you would like to delete?  Also if you delete a required segment in a group like {OBX [{NTE}]} deleting the OBX and an NTE exists, the outbound variant will enforce the need to have the OBX segment even if it is blank or a stub.  Are there other Segments with your FT1 segment?  The pathcopy is very powerful in that pathcopy @null –> 1 will delete all segments where the path begins with 1.

            Can you consider only building the FT1 group based on a condition? Are you only deleting the second instance?

            There are several ways to get rid of the FT1 stub, however not sure I would recommend just deleting the FT1 segment if other segments are associated with it.

            Hope this helps some….

             

          • #120742
            Jim Kosloskey
            Participant

              Is the case you have more than 2 FT1 Groups (FT1 is almost always a Group) and you want to get rid of just the second FT1 Group.

              Or do you want to get rid of all of the FT1 Groups?

              I suspect because you are doing things this way there is a BULKCOPY involved – is there?

               

               

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

            • #120743
              Todd Hamilton
              Participant

                Thank you all for your input.  Very helpful.

                Jim, Yes, I am using BULKCOPY. I only want to delete the second group.  (The Second FT1 Group). Good question.

                Keith, Your question prompted me to look at the complete path.  That was one of my issues.  I was not referencing the path correctly.

                James, Your input helped me resolve my issue.  Once I created a new variant with an optional FT1, I was able to move forward.

                Max, Thank you for the Path information. That helped me work toward the solution.

                Solution:

                1. Use a variant to make the FT1 optional.  Otherwise, it will keep adding the blank FT1.
                2. Make sure you use the right path when referencing the segment you want to delete.

                todd.hamilton.omaha@gmail.com
                (402) 660-2787

              • #120744
                Jim Kosloskey
                Participant

                  Todd,

                  Just so you know, this could be done without changing the variant.

                  With the FT1 Group Required (per the standard) and a BULKCOPY in place, one could do a PATHCOPY to null all FT1 groups then ITERATE over the IB PATHCOPYng only the Groups wanted.

                  This way, the next person does not need to be aware the FT1 Group is defined non-standard for the OB and moreover, should the variant need to be used by others, they could rely on the structure being standard.

                  if no BULKCOPY, then ITERATE and PATHCOPY only the groups wanted.

                  Just another option…

                  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.