How do I create an HL7 variant to insert FHS/BHS before MSH?

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf How do I create an HL7 variant to insert FHS/BHS before MSH?

  • Creator
    Topic
  • #49585
    Justin Olson
    Participant

      I am trying to create a variant that will allow me to insert FHS and BHS prior to the MSH, but it will not let me.

      Does anyone have any tips?

      Thanks,

      Justin

    Viewing 10 reply threads
    • Author
      Replies
      • #62594
        James Cobane
        Participant

          Justin,

          You won’t be able to create a variant with the BHS/FHS as the HL7 configurator is based on a ‘message’ paradigm, where BHS/FHS are used for a ‘batch’ of HL7 messages.  You’ll need to create(or remove) the BHS/FHS segments in a tps proc.

          Hope this helps.

          Jim Cobane

          Henry Ford Health

        • #62595
          Barb Dozier
          Participant

            You are right, it won’t let you.  Or at least we found that creating a tcl script took care of the issue.  We had to create a file to send charges to meditech so we created a script that created the file and wrote the FHS/BHS segments at the same time.  When the end of the desired messages was identified, the script then inserts the BTS/FTS segments as well.

            Barb Dozier

          • #62596
            Justin Olson
            Participant

              Thank you both for your replies.  Is that script something that can be shared?  In the past when we’ve sent data to clients that use Meditech the clients apply these headers and trailers.  This will most likely not be the case here.

            • #62597
              Barb Dozier
              Participant

                Below is a section of code where we create the file and add the fhs/bhs segments.  This snippet is in the RUN section of a tps proc.  Hope this helps.

                 set slash “\”

                 set carrot “^”

                 set rep “~”

                 set sub “&”

                 set field “|”

                 set sendApp $systemName

                 set fhs “FHS”

                 set bhs “BHS”

                 set recApp “BAR”

                 set msgCtl “”

                 set segEnd r

                 

                 # set directory path

                 set root_path [exec env HCIROOT]

                 #echo “ROOTpath: $root_path”

                  set site_path [exec env HCISITEDIR]

                  #echo “SITEpath: $site_path”

                  append site_path “/billingOUT/”

                  #echo “SITEpath: $site_path”

                  ;# Get the time in system seconds

                  set systemTime [clock seconds]

                  ;# Set the time using the hour, minute and second descriptors.

                 set CurDate [clock format $systemTime -format {%Y%m%d}]

                 set CurDateTime [clock format $systemTime -format {%Y%m%d%H%M}]

                 #echo “CurDate: $CurDate”

                           

                 # set the user data… for the message

                 set filename [append systemName “.” $hosp “.” $CurDate]

                 set fullname $site_path$filename

                 if {![file exists $fullname] } {

                     echo “File doesn’t exist”

                     set curFileID [open $fullname a+]

                     puts $curFileID $fhs$field$carrot$rep$slash$sub$field$sendApp$field$hosp$field$recApp$field$hosp$field$CurDateTime$segEnd

                     puts $curFileID $bhs$field$carrot$rep$slash$sub$field$sendApp$field$field$field$field$CurDateTime$segEnd

                     close $curFileID

                 }

              • #62598
                Rick Pritchett
                Participant

                  Do you use a seperate proc to add the BTS and FTS segments.  (a pre and post proc).  Or do you do this all at once?

                • #62599
                  Barb Dozier
                  Participant

                    We actually do it separately.  Code section is basically the same but we add the trailer segments in the same script that we move the file where it needs to go.

                    Barb

                  • #62600
                    Rick Pritchett
                    Participant

                      Might i see the code to do this i am also interested in how you are moving the file.  I would like to use ftp as little as possible.  Before i used a simple bat file in the task manager to rename and another to move the file to a mapped drive.

                    • #62601
                      Mike Grieger
                      Participant

                        Though I also prefer to take care of headers/trailers in a tcl proc, it IS possible to add them to a variant.  You just have to add it manually, outside of the GUI.  Used to have this configuration on a billing interface.

                      • #62602
                        Barb Dozier
                        Participant

                          What do you mean and how do you do it “outside the GUI”?

                          Barb

                        • #62603
                          Mike Grieger
                          Participant

                            I mean manually edit the variant message type by using your text editor of choice (vi for Unix or notepad for Windows, etc.).  If we’re talking about the DFT message type, navigate to that variant/message type from command line, and edit it.

                            If that message type would be (as a simplified example):

                            MSH

                            PID

                            FT1

                            edit it to be

                            FHS

                            {

                              MHS

                              PID

                              FT1

                            }

                            FTS

                            Then the Xlate will recognize that structure.

                          • #62604
                            Barb Dozier
                            Participant

                              Our move process is actually a couple steps.  First we get all files into a central directory and then use Samba to move them off our AIX machine to the multiple resulting locations.

                              I’ve attempted to attached example scripts that we call from cron for this process.  If you have issues accessing them, please contact me directly.

                              Thanks, Barb

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