How to search message details in LIVE based on MRN
Hello Experts ,
Could you help to search message details based on MRN in intersytems iris.
We have created 100+ interfaces and currenly in live (interystems cloud) . Now I try to search message details based on MRN using below query. it is working fine in DEV. but in prod it is taking ages.
SELECT Header.SessionId, Header.SourceConfigName ,Body.RawContent
FROM Ens.MessageHeader AS Header
JOIN EnsLib_HL7.Message AS Body ON Header.MessageBodyId = Body.ID
where Body.TimeCreated BETWEEN '2023-03-15 13:10:22.993' AND '2023-03-15 13:10:25.993'
AND Body.RawContent LIKE '%40103262%'
could you please provide me any idea .
thanks you
Comments
Using the message viewer you can add criteria and search by
.png)
Prod will have much more messages than Dev, you need to add something in your query that is using an indexed field, if you want to search by MRN.
If you have the Enslib HL7 SearchTable enabled on the business host you are looking at then the below query can help.
SELECT RawContent
FROM EnsLib_HL7.Message
WHERE ID IN (SELECT
DocId
FROM EnsLib_HL7.SearchTable
WHERE PropId = 4 AND PropValue = 'MRN'
)
ORDER BY TimeCreated Desc