Pathcopy for a segment

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Pathcopy for a segment

  • Creator
    Topic
  • #49938
    Ruth Chong
    Participant

    Hi All experts out there…..

    i need help, i am trying to use pathcopy to get rid of the OBX segment but I do not seem to be able to get rid of the word “OBX” in the segment

    say for example

    My input is below

    ORC|1|….|

    OBR|1| ……|

    OBX|1|123|this is testing

    OBX|2|124| This is second one

    My output will be omitting the OBX after plucking in some value from the OBX segment….

    ORC |1|

    OBR|1|…|this is testing

    How can i achieve this using pathcopy? I am using iterate for segment OBX…and within the iterate, i have IF condition to check..

    a pathcopy to copy @null to 2(%g1).1(%g2).1(0).0(%g3).OBX(%s1)

    My output is as shown below, this is not what i want,

    ORC|1|…

    OBR|1|…|this is testing

    OBX

    OBX

    My desirable output is

    ORC|1|..

    OBR|1|…|this is testing

    HELP!!!!

    Thanks millions

Viewing 3 reply threads
  • Author
    Replies
    • #64180
      Robert Kersemakers
      Participant

      Hi Ruth,

      Check your HL7 variant: most likely the OBX segment is not ‘optional’ and will therefore always be shown.

      Making it optional should solve your problem.

      Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

    • #64181
      Keith McLeod
      Participant

      If it is not the optional setting on you outbound variant, try shortening the path of the OBX from 2(%g1).1(%g2).1(0).0(%g3).OBX(%s1) to 2(%g1).1(%g2).1(0).0(%g3).OBX

      The pathcopy statement will use as much of the path as you provide.  So if your goal is to eliminate all OBX segments based on an IF condition you might try this without the iterate for the OBX. Hope this helps….. One more thing if you want to eliniate both the OBX and NTE or AKA %g3, if you shorten the path to 2(%g1).1(%g2).1(0).0(%g3), this would eliminate all segments in %g3 group by pathcopying @null to it.

    • #64182
      Ruth Chong
      Participant

      Keith McLeod wrote:

      If it is not the optional setting on you outbound variant, try shortening the path of the OBX from 2(%g1).1(%g2).1(0).0(%g3).OBX(%s1) to 2(%g1).1(%g2).1(0).0(%g3).OBX

      The pathcopy statement will use as much of the path as you provide.

    • #64183
      Keith McLeod
      Participant

      Typically the OBX segment repeats as part of a group.  In most cases this group would be your %g3 group or the third group iterate that you define.

      If this is structured as an ORU type message, your groups will generally be constructed like:

      MSH

      { # Opens repeating PID Group

          PID # %g1

          { # Opens repeating ORC Group

               ORC # %g2

               { # Opens repeating OBX Group

                    OBX # %g3 Note OBX repeats as part of Group, not a segment.

                   [{NTE}]

               } # Closes Repeating OBX Group

          } # Closes repeating ORC Group

      } # Closes repeating PID Group

      Notice above the OBX does not directly have the {} around it signifying that it repeats, but the Group does.  Also since [] are not present, this means it is required.

      In this case, the segment OBX only repeats as part of a group.  Also as you develop each nested basis, the previous %g1, %g2, etc. must be included in the basis.  You may want to review the variant of your outbound, highlight in your HL7 variant tool the ‘{‘ where the OBX group begins and make it optional.  This would add Braces around both OBX and NTE. The result you are getting is very characteristic of the OBX segment  on th eoutbound variant being required.

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

Forum Statistics

Registered Users
5,126
Forums
28
Topics
9,296
Replies
34,439
Topic Tags
287
Empty Topic Tags
10