Roma Bunga · Sep 25, 2018

Wireshark with ensemble


We see a lot of TCPIP connection error for few of the components not sure if it is a network glitch at the source/target or is it with us. And most of the times these errors are very transient and vanish on their own and the connection gets re established and the messages get processed. Here is the error we mostly see

ERROR <Ens>ErrTCPTerminatedReadTimeoutExpired: TCP Read timeout (30) expired waiting for terminator SegTerminatorAscii=13, on |TCP|50007|10620, data received =''


ERROR <Ens>ErrOutConnectionLost: Lost HL7 Read connection to - detected via ERROR #5002: Cache error: <READ>zReadLine+11 ^%IO.DeviceStream.1

Just wanted to check if anyone has used wireshark to get past this problem and to infer the issues lies. Can someone guide me on how to setup wireshark on ensemble or healthshare? What the do's and dont?

Any kind of documentation/manual/video pertaining to this will be very helpful.



1 936
Discussion (2)2
Log in or sign up to continue

Any documentation on how to use/setup wireshark will do. It is a tool outside of Ensemble. So these are a good start:

The one thing you want to look out for is that you are quite possibly going to be capturing PHI, so you should keep that in mind before sharing the traces you captured.


If you have never used Wireshark before or haven't a deep understanding of the TCP/IP suite of protocols then Wireshark might be overkill for your needs.  I have only used it in a Lab or Development environment. You also have to consider the disk storage requirements and governance issues around full-packet capture eg. HPIAA, PCI-DSS. You might want to check  Eduard Lebedyuk's article on Debugging Web for additional tools and tips.

For troubleshooting these issues, we enable a monitoring global that records every character recieved within the TCP Stream

  do USE read *CHAR:2 else  do WAIT
 goto START
 if ^AC=1 CHAR'=-1 set X=^AC1,^AC1(X+1)="*"_$char(CHAR)_"*"_CHAR_"*",^AC1=X+1 ; Monitor character by character
 set ^CALLED("CHARMON")=$ZD(+$H,4)_"*"_$ZT($P($H,",",2))_"*"_CHAR

You can try a re-connect using $ZTRAP or try-catch. In this example, we do a maximum of 10 re-connect attempts

 set $ZT="ERROR"
 if ($ZE["<READ>")
     if (ERRORCOUNT<11)
         set ^TCPLOG("ERROR",$ZD(+$H,4),$ZT($P($H,",",2)),ERRORCOUNT)=$ZE
         close "|TCP|"_PORT
         hang 30 goto OPEN 
      else do ^%ET }
 else  do ^%ET }

You might also look at extending the TCP timeout value to see if that makes a difference to the volume of errors. Check out this Ensemble Example of a SOAP Web Service