Sidebar

How can I get additional information about my erred messages?

0 votes
342 views
asked Jul 24, 2014 by mike-r-7535 (13,830 points)
edited Jul 24, 2014 by mike-r-7535
I have a handful erred messages that were unable to process for a specific patient.  Not only that, the actual CCD is base64 encoded in the source node, so it is hard to view the content.  Is there a way to export or log the patient information for each of these messages so I can analyze these patient records?

1 Answer

0 votes
 
Best answer

On the Errors tab, a search will look at each of those messages.  So, if you create a custom search, you can gather the information you want from the source message, and even write the information to a file.  This is particularly helpful when receiving CCDs via a webservice call, since these are base64 encoded, and then the information is buried in the xml.  Here is an example of how you can extract this information.

var msgString = qie.base64Decode(source.getNode('/Request/Part[2]/Content').trim()).replaceAll("soapenv:", "").replaceAll("wsa:", "").replaceAll("query:", "").replaceAll("rim:", "").replaceAll("ihe:", "").replaceAll("lcm:", "").replaceAll("xop:", "").replaceAll("retrieve:", "");

var msg = qie.parseXMLString(msgString);
var medRec = msg.getNode('/ClinicalDocument/recordTarget/patientRole/id/@extension[contains(../@assigningAuthorityName,"Locally-assigned Medical Record Number")]');
var patientInfo = medRec + ' ' + msg.getNode('/ClinicalDocument/recordTarget/patientRole/patient/name/family') + ', ' + msg.getNode('/ClinicalDocument/recordTarget/patientRole/patient/name/given');
var siteString = msg.getNode('/ClinicalDocument/recordTarget/patientRole/id/@assigningAuthorityName[contains(../@assigningAuthorityName,"Locally-assigned Medical Record Number")]');
 
var logger = org.apache.log4j.Logger.getLogger("Patient EMRID not found");
logger.warn(patientInfo + ' ' + siteString);
The last two lines of the script write the information to the qie.log file.  Search for "Patient EMRID not found" in the logs to find all the entries.
 
This same approach could also work for searching the Messages tab, but you should be aware this tends to be CPU intensive and can take some time.
 
It is also worth noting that a custom search script is not within the context of a message, so the message object and the messageCache is not accessible.  Everything must be calculated off of the source object.

 

answered Jul 24, 2014 by mike-r-7535 (13,830 points)
edited Jul 24, 2014 by mike-r-7535
...