I am trying to use MDHT tools to extract values from a CCD document via Mirth. I am doing this in the following way.
Downloaded Java runtime libraries and placed them in Mirth's custom-lib folder and wrote sample code to extract some patient values in Mirth's transformer & Deploy section.
Code in transformer.
// Load the CCD Document
var doc = org.openhealthtools.mdht.uml.cda.util.CDAUtil.load(new
java.io.ByteArrayInputStream(messageObject.getRawData().getBytes("UTF-8")));
// Get CCD Document Sections to be parsed
var docPatientRole = doc.getRecordTargets().get(0).getPatientRole();
var docPatient = docPatientRole.getPatient();
var docPatientName = docPatient.getNames().get(0);
// Map Patient Identity Fields to Mirth Channel Map Variables
channelMap.put('patientFirstName',
docPatientName.getGivens().get(0).getText());
channelMap.put('patientLastName',
docPatientName.getFamilies().get(0).getText());
channelMap.put('patientGenderCode',
docPatient.getAdministrativeGenderCode().getCode());
channelMap.put('patientDateOfBirth', docPatient.getBirthTime().getValue()); // YYYYMMDD
Can anyone help me with the code as I am new to JavaScript and also I am not aware of all the functions in the .jar
files so as to access all the other components in a CCD.
I am currently stuck at this point. I need to access all the sections/Components in a CCD. Can anyone please redirect me to any examples/tutorials (via Mirth) related to each section. I have already looked at some links guide/developers guide but all links are Dead and not working.
Any help is appreciated.