Recommendations on tools for Unit Testing HL7 interfaces?

353 views
Skip to first unread message

Sam Habiel

unread,
Mar 31, 2020, 2:13:07 PM3/31/20
to hardhats
Does anybody have any good recommendations on tools one can use to
Unit Test HL7 interfaces? I am looking for something that I can script
to do the following:

1. Send message #1.
2. Check that you get this result back.
3. Send message #2.
4. Check that you get this result back.
etc.

I would like something external to VistA, as I don't see much point in
testing messages internally.

Right now, I can use netcat or Mirth to send messages, but that will
only get me to test message by message.

--Sam

Ben Irwin

unread,
Mar 31, 2020, 2:32:31 PM3/31/20
to Hardhats
Sam,

I am sorry, but I have used the following sample to run tests using Curl and Microsoft Excel.  The following example takes information from cells in an Excel spreadsheet, uses the data to build the Curl command, then run the Curl command, and place the returned result from Curl into the result column in the spreadsheet.  I can send an example Excel Spreadsheet if you are interested.

Sub Simple()

  Dim rangetoexport As Range
  Dim rowcounter As Long
  Dim columncounter As Long
  Dim CurlCommand
  Dim WSS As Object
  Set WSS = CreateObject("WScript.Shell")
  Dim WSSExec As Object
  
  Set rangetoexport = Selection
  
  For rowcounter = 2 To rangetoexport.Rows.Count
    
    CurlCommand = "cmd /c "
    CurlCommand = CurlCommand & "curl "
    CurlCommand = CurlCommand & "http://10.0.1.150:57772/csp/vdocs/wt/"
    CurlCommand = CurlCommand & rangetoexport(rowcounter, 2) & "/"
    CurlCommand = CurlCommand & rangetoexport(rowcounter, 3) & "/"
    CurlCommand = CurlCommand & rangetoexport(rowcounter, 4) & " "
    Set WSSExec = WSS.Exec(CurlCommand)
   
    Cells(rowcounter, rangetoexport.Columns.Count + 1) = WSSExec.StdOut.ReadAll
    
    Application.Wait (Now + TimeValue("0:00:05"))
    
  Next

End Sub

Kekoa

unread,
Apr 1, 2020, 11:11:37 PM4/1/20
to Hardhats
Create C# unit tests using leadtools hl7 sdk or pick your own open source hl7 sdk and roll your own test framework. 👍

K.S. Bhaskar

unread,
Apr 2, 2020, 10:18:50 AM4/2/20
to Hardhats

Sheng Jiang

unread,
May 11, 2020, 9:23:59 AM5/11/20
to Hardhats
mllp is a pretty simple format. 

echo -n -e "\x0b$(cat filename.hl7.txt)\x1c\x0d" ' | nc host port

the community for your script language probably already have some utility for mllp. if not, it's not hard to write one on top of a tcp client. 
Reply all
Reply to author
Forward
0 new messages