/** * 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()); }
/** * Convenience constructor to build queue from a previously deleted queue entry * * @param hl7InArchive deleted entry from which queue entry will be constructed * @since 1.5 */ public HL7InQueue(HL7InArchive hl7InArchive) { setHL7Source(hl7InArchive.getHL7Source()); setHL7SourceKey(hl7InArchive.getHL7SourceKey()); setHL7Data(hl7InArchive.getHL7Data()); setMessageState(HL7Constants.HL7_STATUS_PENDING); }
/** * @see HL7Service#saveHL7InQueue(HL7InQueue) */ @Test public void saveHL7InQueue_shouldAddGeneratedUuidIfUuidIsNull() { HL7InQueue hl7 = new HL7InQueue(); hl7.setHL7Data("dummy data"); hl7.setHL7Source(new HL7Source(1)); hl7.setHL7SourceKey("a random key"); hl7.setMessageState(HL7Constants.HL7_STATUS_PROCESSING); Context.getHL7Service().saveHL7InQueue(hl7); Assert.assertNotNull(hl7.getUuid()); }
/** * Creates new {@link HL7InQueue} instance from itself * * @return new {@link HL7InQueue} instance */ public HL7InQueue toHL7InQueue() { HL7InQueue result = new HL7InQueue(); result.setHL7Source(getSource()); result.setHL7SourceKey(getSourceKey()); result.setHL7Data(getData()); if (getMessageState() != null) result.setMessageState(getMessageState()); else result.setMessageState(HL7Constants.HL7_STATUS_PENDING); return result; }
@Override public IncomingHl7Message1_8 newObject() { HL7InQueue msg = new HL7InQueue(); msg.setHL7Data("hl7Data"); msg.setHL7SourceKey("sourceKey"); msg.setHL7Source(Context.getHL7Service().getHL7SourceByName(RestTestConstants1_8.HL7_SOURCE_NAME)); Context.getHL7Service().saveHL7InQueue(msg); return new IncomingHl7Message1_8(msg); }