Question
Bukhtiar Ahmad · Feb 18

Finding message trace in router and edge messages log

I have lots of msg control id received from customers and i search these msg control id first in router to review the msgs and then search the same msg control id in the respective edge message viewer.

Is there a way i can generate the msg trace URLs for router and edge by using msg control id?

Product version: HealthShare 2020.1
00
2 0 1 72
Log in or sign up to continue

A visual trace URL takes the form of:

EnsPortal.VisualTrace.zen?SESSIONID=12818

You'll need to run some queries (once in the router namespace and once in the edge namespace) to find the session ID that corresponds to your control ID.

You can find messages with that control id by querying the search table.

First you need to get the search table property ID for the MSHControlID. Change the value of ClassExtent to match whatever your local search table class is if you're not using the default:

SELECT PropId from Ens_Config.SearchTableProp WHERE ClassExtent='EnsLib.HL7.SearchTable' AND Name='MSHControlID'

Let's say that returns a PropId of 1

You can then query the search table for the control ID you're looking for where PropValue is the control id. If you have a custom search table you'll need to use your custom table name here instead of the default EnsLib_HL7.SearchTable:

SELECT DocId FROM EnsLib_HL7.SearchTable WHERE PropId=1 AND PropValue='123456789'

This gives you the ID for the message body. Let's say it returned a DocId of 98765. You can then query the message header table to get the session ID that that message body belongs to:

SELECT DISTINCT(SessionId)
FROM Ens.MessageHeader WHERE MessageBodyID = 98765

Keep in mind that the URL for the Visual Trace could change in future versions, so you're doing this at your own risk.