Homepage › Clovertech Forums › Read Only Archives › Cloverleaf › Cloverleaf › How do I create an HL7 variant to insert FHS/BHS before MSH?
- This topic has 11 replies, 5 voices, and was last updated 16 years, 10 months ago by Barb Dozier.
-
CreatorTopic
-
October 11, 2007 at 10:17 pm #49585Justin OlsonParticipant
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
-
CreatorTopic
-
AuthorReplies
-
-
October 12, 2007 at 11:15 am #62594James CobaneParticipant
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
-
October 12, 2007 at 3:34 pm #62595Barb DozierParticipant
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
-
October 12, 2007 at 4:25 pm #62596Justin OlsonParticipant
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. -
October 16, 2007 at 2:34 pm #62597Barb DozierParticipant
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
}
-
October 30, 2007 at 7:57 pm #62598Rick PritchettParticipant
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? -
October 31, 2007 at 1:07 pm #62599Barb DozierParticipant
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
-
November 1, 2007 at 3:37 pm #62600Rick PritchettParticipant
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. -
November 1, 2007 at 5:05 pm #62601Mike GriegerParticipant
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. -
November 1, 2007 at 5:22 pm #62602Barb DozierParticipant
What do you mean and how do you do it “outside the GUI”? Barb
-
November 2, 2007 at 1:21 pm #62603Mike GriegerParticipant
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.
-
November 27, 2007 at 2:17 pm #62604Barb DozierParticipant
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
-
-
AuthorReplies
- The forum ‘Cloverleaf’ is closed to new topics and replies.