Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Bob, I am new to the HL7/CF integration world, and I noticed this posting that looks to be addressing exactly what I'm trying to achieve. Do you have any working examples that you feel comfortable sharing? I know it's been over 3 years since you addressed these issues on the Adobe forum, but any help would be greatly appreciated.
Thank you
Ed
Copy link to clipboard
Copied
Hello,
We re-wrote an hl7 interface to use a .net app instead of CF, as doing so in CF proved unreliable. Check out the software from Symphonia to add some great .dll's to your .net app for message processing.
We use the .net app to save the message into a table, acknowledge the message etc. Once its in the database it just text in a big string...
BUT, poking around I found some old code from many many many years ago when it was attempted within CF ( not my code, or know who to attribute):
it may provide some inspiration. this code took the message and other code saved the string into the database...
but stil I would recommned against doing it in cf
<cfscript>
function createsocket(port) {
// Create a server socket, and start listening.
// get a socket object
getsocket = CreateObject("java", "java.net.ServerSocket");
try{
getsocket.init(port);
// wait for external connection
socket = getsocket.accept();
}
// If socket pre-exists from a previous program failure, attempt to connect to it, rather than create it.
// This code does not actually seem to connect, but does result in the socket dying within about 15 seconds
// so that the next invocation of this program can run cleanly.
// A restart of the CF application service will also kill any leftover sockets.
catch (any excpt) {
socket = CreateObject("java", "java.net.Socket");
socket.init('127.0.0.1',port);
}
// get an InputStreamReader object
inputsr = CreateObject("java", "java.io.InputStreamReader");
// call the InputStreamReader constructor
inputsr.init(socket.getInputStream());
// get a BufferedReader object
input = CreateObject("java", "java.io.BufferedReader");
// call the BufferedReader constructor
input.init(inputsr);
// get a PrintWriter object
printWriter = CreateObject("java", "java.io.PrintWriter");
// call the PrintWriter constructor
printWriter.init(socket.getOutputStream(), true);
return 'OK';
}
function getMsg() {
// Read a complete HL7 message from the socket.
f_hl7_msg = input.readLine();
while (input.ready())
{
f_hl7_msg = f_hl7_msg & Chr(13) & Chr(10) & input.readLine();
}
return f_hl7_msg;
}
function sendAck(msg_id, src, resp) {
// Construct and Send the ACK
thistime = DateFormat(Now(),'yyyymmdd') & TimeFormat(Now(),'HHmmss');
msg_seg = 'MSH|^~\&|' &
src & '|' &
'|' &
resp & '|' &
'|' &
thistime & '|' &
'|' &
'ACK' & '|' &
msg_id & '|' &
'P' & '|' &
'2.3.1' & '||||';
msa_seg = 'MSA' & '|' &
'AA' & '|' &
msg_id & '|' &
'Message Processed Successfully';
hl7_ack = CHR(11) &
msg_seg & CHR(13) &
msa_seg & CHR(13) &
CHR(28) & CHR(13);
printWriter.println(hl7_ack);
}
function closePort() {
printWriter.close();
input.close();
socket.close();
}
</cfscript>
Copy link to clipboard
Copied
Scott, thank you for taking the time to look into this. I was able to accomplish exactly what I was trying to do by working with someone who new a bit more Java than I did. What we did was duplicate the demo event gateway listener in Coldfusion's default instance copied it, renamed it and modified it to deal with HL7 messages. We also created a cfg file to allow us to select the HL7 message that we were interested in picking up as they were sent across a specified port. We did this all with CF8 and a retrofitted Java component. We may actually decide to sell this one, because I believe there is a need out there for HL7/CF plug-in-play functionality.
Again thank you for taking the time to respond to my inquiry. These types of forums keep us all in business!
Copy link to clipboard
Copied
Dan, Your knowledge on this matter seems a bit beyond mine. I know this is an old post, but do you have an example of your code? I am attempting a HL7 to CF8 interface (socket gateway), and I'm having the same issue with the acknowledgement response. I'm getting the messages, but i get tons of them because the E*Gate engine never receives a response telling it to stop attempting. Any help would be greatly appreciated.