private String generateMDM_T02Message(IfPatientDocumentMessageVo event) throws HL7Exception { t02mapper.processedCount++; try { // IfOutOcsOrderVo orderVo= ocsIf.getOrder(order); Message msg = t02mapper.populateMDM_T02Message(event); if (msg != null) { String ret = parser.encode(msg); t02mapper.successCount++; t02mapper.lastSuccessDateTime = new DateTime(); t02mapper.lastSuccessMessage = ret; return ret; } } catch (Exception e) { t02mapper.errorCount++; t02mapper.lastFailedDateTime = new DateTime(); throw new HL7Exception("Exception occurred generating T02 Message for HL7App - " + event.getProviderSystem().getHl7Application() + " - " + e.getMessage(), e); } t02mapper.errorCount++; t02mapper.lastFailedDateTime = new DateTime(); throw new HL7Exception("A null message cannot be parsed!"); }