HL7/Test Connectivity

From VistApedia
Jump to: navigation, search

Testing VistA HL7 on a FOIA VistA Instance

Sam Habiel Oct 15 
Is there an easy way to check that the VistA HL7 system works? For example, can you send it a "ping" and it would respond back that it's running? 

Steven McPhelan    Oct 15 
Years ago there was an HL7 Ping option.  Was it an actual option or just a APO call I do not remember.  Its purpose was to validate that all the VistA files and network connections were  set up properly and working.  I will see if I can find it.  In the meantime you could search  all HL* routine for 'ping'.
Paul Wesley Oct 15 
RE: [External] Re: [Hardhats] Testing VistA HL7 on a FOIA VistA Instance
This is what has been working for connectivity to an external , or same system, port.
D CALL^%ZISTCP(VFDIPADD,VFDIPORT,5) S VFDPOP=POP

That is just an IP address with port check. There is much more than that that has to be checked before it is called operational.
Paul Wesley DSS Senior Engineer Development
(office)        561-847-5965
(home)         505-218-2516

Sam Habiel    Oct 15 
Re: [External] Re: [Hardhats] Testing VistA HL7 on a FOIA VistA Instance

Okay. I managed to step through the source code, and combined all suggestions to do this: 
@test "HL7 Listener works" { 
run mumps -run %XCMD 'D CALL^%ZISTCP("127.0.0.1",5001) U IO W 
$C(11)_"MSH^PING^OSEHRA"_$C(10,28,13) R X:1 C IO U 0 W X' 
[ $(expr "$output" : ".*OSEHRA.*") -ne 0 ] 

Ben Irwin    Oct 15 
I don't know the difference between the HL7 server and the RPC Broker, but I use the following to make sure that the RPC Broker is running.
W $$TEST^XWBTCPMT("14.0.0.21",9235,1),!

Steven McPhelan    Oct 15 
I will look for it.  It was years ago.  It sent an HL7 massage and waited for an HL7 reply thus proving the viability the configuration.  

Adam Adam    Oct 16 
Sam, 
Are you looking for a MUMPS-Based test to just determine if a HL LOGICAL LINK is flagged as active, or a remote TCP-Based test to actually receive an HL7 message (ACK or ERR) from VistA? 
For egress interfaces, you can use $$CHKLL^HLUTIL(institution) call, where "institution" is the Institution IEN, Station Number, or Institution Name. If the Logical Link is active, outbound, and has the INSTITUTION field populated, then it will return a 1. All other results returns a 0. (Obviously, there's some cases that this API call doesn't catch, so it's probably not as robust as it needs to be).
For ingress interfaces, I think you'd need a valid Sending/Receiving Application combo to get an actual message returned. I believe an invalid Application in an incoming MSH will log an error, but not return that error to the initiating client. 
Personally, what I do to test (especially when setting up new interfaces) is to point an outbound interface to an IP/Port combo on my workstation, then I launch a nifty little bastardized C/C++ socket app that I wrote that will display incoming HL7 messages in the console AND log them to a text file. Make sure the interface requires an ACK. Then you can register a single demo RA EXAM and the interface will continue to resend the same ORM every 5 seconds until an ACK is received. Of course, that all is a bit more involved than just a simple command to return a boolean. 
You could try to initialize the HL7 variables for a known protocol. For instance:
 
K HL D INIT^HLFNC2($O(^ORD(101,"B","RA REG",0)),.HL)

W $G(HL)

If the call to INIT^HLFNC2 completes without an error, HL will have been Killed (and thus undefined). If there's an error, then the HL variable will contain that error.

14^Server Application Missing in Protocol File
15^No Client
et cetera
Sam Habiel     
I am looking for this: "a remote TCP-Based test to actually receive an 
HL7 message (ACK or ERR) from VistA?" Ideally, I would send a message 
(like a QRY message) and would get a meaningful response back. 
Unfortunately, I couldn't find an easy message to send to VistA. For 
now, I send the VistA custom ping message.