/** * @see org.openmrs.hl7.HL7Service#saveHL7InError(org.openmrs.hl7.HL7InError) */ @Override public HL7InError saveHL7InError(HL7InError hl7InError) throws APIException { if (hl7InError.getDateCreated() == null) { hl7InError.setDateCreated(new Date()); } return dao.saveHL7InError(hl7InError); }
/** * Convenience constructor to build queue from a previously erred queue entry * * @param hl7InError erred entry from which queue entry will be constructed */ public HL7InQueue(HL7InError hl7InError) { setHL7Source(hl7InError.getHL7Source()); setHL7SourceKey(hl7InError.getHL7SourceKey()); setHL7Data(hl7InError.getHL7Data()); }
/** * @see org.openmrs.OpenmrsObject#getId() * @since 1.5 */ @Override public Integer getId() { return getHL7InErrorId(); }
/** * Convenience method to respond to fatal errors by moving the queue entry into an error bin * prior to aborting */ private void setFatalError(HL7InQueue hl7InQueue, String error, Throwable cause) { HL7InError hl7InError = new HL7InError(hl7InQueue); hl7InError.setError(error); if (cause == null) { hl7InError.setErrorDetails(""); } else { log.error("Fatal error", cause); hl7InError.setErrorDetails(ExceptionUtils.getStackTrace(cause)); } Context.getHL7Service().saveHL7InError(hl7InError); Context.getHL7Service().purgeHL7InQueue(hl7InQueue); log.info(error, cause); }
Assert.assertTrue(error.getErrorDetails().contains("In alternate oru r01 parser"));