/** * @throws HL7Exception * @see HL7Service#processHL7InQueue(HL7InQueue) */ @Test public void processHL7InQueue_shouldCreateHL7InErrorAfterFailedParsing() throws HL7Exception { executeDataSet("org/openmrs/hl7/include/ORUTest-initialData.xml"); // sanity check, make sure there aren't any error items HL7Service hl7service = Context.getHL7Service(); Assert.assertEquals(0, hl7service.getAllHL7InErrors().size()); HL7InQueue queueItem = hl7service.getHL7InQueue(2); hl7service.processHL7InQueue(queueItem); Assert.assertEquals(1, hl7service.getAllHL7InErrors().size()); }
List<HL7InError> errors = hl7service.getAllHL7InErrors(); HL7InError error = errors.get(errors.size() - 1); // get the last error, the one made by this test presumably Assert.assertTrue(error.getErrorDetails().contains("In alternate oru r01 parser"));
Assert.assertEquals(0, service.getAllHL7InErrors().size()); Assert.assertEquals(0, service.getAllHL7InArchives().size()); Assert.assertEquals(0, service.getAllHL7InErrors().size()); Assert.assertEquals(0, service.getAllHL7InArchives().size()); Assert.assertEquals(0, service.getAllHL7InErrors().size()); Assert.assertEquals(1, service.getAllHL7InArchives().size());