/** * Transform the next pending HL7 inbound queue entry. If there are no pending items in the * queue, this method simply returns quietly. * * @return true if a queue entry was processed, false if queue was empty */ public boolean processNextHL7InQueue() { boolean entryProcessed = false; HL7Service hl7Service = Context.getHL7Service(); HL7InQueue hl7InQueue = hl7Service.getNextHL7InQueue(); if (hl7InQueue != null) { processHL7InQueue(hl7InQueue); entryProcessed = true; } return entryProcessed; }
/** * Process the next form entry in the database and then remove the form entry from the database. */ @Override public void execute() { Context.openSession(); try { log.debug("Processing HL7 queue ... "); processor.processHL7InQueue(); } catch (HL7Exception e) { log.error("Error running hl7 in queue task", e); throw new APIException("Hl7inQueue.error.running", null, e); } finally { Context.closeSession(); } }