Moving a segment

  • Creator
    Topic
  • #51074
    Kevin Wade
    Participant

    I am working with LabCorp and they want the DG1 segment to follow the GT1 segment. I have the ability to do this in Epic but when the message gets to Cloverleaf it reverts back to the HL7 Standard. Is this something that can be done with TCL code? If so has anyone done this that could help me set it up on our system? We are short on time for this one so any help would greatly be appreciated.

Viewing 4 reply threads
  • Author
    Replies
    • #68694
      Tom Rioux
      Participant

      Is this a raw route or do you have an Xlate on this?   It can be done with tcl or in an xlate.  Let us know.

      Thanks…Tom

    • #68695
      Nate Kruse
      Participant

      This was written very quickly (heading home for the day) and was not tested…if you have some tcl knowledge, you’ll see that I’m saving the DG1 segments and not applying them to the outbound message until a GT1 segment is encountered.  Again, it was written quickly and there may be better ways of doing it.

      set SavedDG1 “”

      set skip FALSE

      set segments [split $msg r] ;# Get segments

      set outbuf “”         ;# Holds outbound message

      foreach seg $segments {

        if {[string equal $seg “”]} { continue }    ;# Just in case

        set segtype [csubstr $seg 0 3]    ;# segment name

        set skip FALSE

        if {[string equal $segtype GT1]} {

             set seg $seg$SavedDG1

             set SavedDG1 “”

        }

        if {[string equal $segtype DG1]} {

            append SavedDG1 $seg      ;#append due to multiple DG1 segments

            set skip TRUE

        }

       

         if {[string equal skip FALSE]} {

             append outbuf ${seg}

         }

      }    

      msgset $mh $outbuf

      return “{CONTINUE $mh}”

    • #68696
      Kevin Wade
      Participant

      This has an xlate on it.

    • #68697
      Tom Rioux
      Participant

      If this is an xlate, then simply take the original outbound variant and make a copy of it (just in case the original variant is used elsewhere).  Modify the new copied variant by placing the DG1 after the GT1 segment and reconfigure your xlate to use the new copied variant.  Depending on your variant and xlate structure, be sure to check your xlate for any changes to the field notations in the DG1 segment.

      I’ve done this in my test environment and it works!

      Hope this helps….Tom

    • #68698
      John Mercogliano
      Participant

      Kevin,

       If you have a xlate, your problem is probably either your varient or lack of.  You need to have an outbound varient for your translate that has the DG1 segment in the correct place or it will get moved back to it’s default location as defined in the HL7 definition you configured for your translation.  Welcome to the epic->labcorp world.  

       We have had our interface up between Labcorp and epic for about a year now.  It was a bumpy ride so if you have any questions let me know.

      John Mercogliano
      Sentara Healthcare
      Hampton Roads, VA

Viewing 4 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