HL7AckTransforms { public static MCCIIN000002UV01 createAckFrom201306(PRPAIN201306UV02 request, String ackMsgText) { MCCIIN000002UV01 ack = new MCCIIN000002UV01(); II msgId = new II(); if (request != null) { if (request.getId() != null) { msgId = request.getId(); } String senderOID = getMCCIMT000300UV01RepresentedOrganizationRootOID(request.getReceiver()); String receiverOID = getMCCIMT000300UV01RepresentedOrganizationRootOID(request.getSender()); ack = HL7AckTransforms.createAckMessage(null, msgId, ACK_TYPE_CODE_ACCEPT, ackMsgText, senderOID, receiverOID); } return ack; } HL7AckTransforms();   HL7AckTransforms(HL7MessageIdGenerator idGenerator); static MCCIIN000002UV01 createAckFrom201305(PRPAIN201305UV02 request, String ackMsgText); static MCCIIN000002UV01 createAckErrorFrom201305(PRPAIN201305UV02 request, String ackMsgText); static MCCIIN000002UV01 createAckFrom201306(PRPAIN201306UV02 request, String ackMsgText); static MCCIIN000002UV01 createAckErrorFrom201306(PRPAIN201306UV02 request, String ackMsgText); static MCCIIN000002UV01 createAckMessage(String localDeviceId, II origMsgId, String ackTypeCode,
            String msgText, String senderOID, String receiverOID); static MCCIMT000200UV01Acknowledgement createAcknowledgement(II msgId, String ackTypeCode, String msgText); static MCCIMT000200UV01TargetMessage createTargetMessage(II msgId); static MCCIMT000200UV01AcknowledgementDetail createAckDetail(String ackTypeCode, String msgText); static final String ACK_DETAIL_TYPE_CODE_ERROR; static final String ACK_DETAIL_TYPE_CODE_INFO; static final String ACK_TYPE_CODE_ACCEPT; static final String ACK_TYPE_CODE_ERROR; }
@Test public void createAckFrom201306WhenrequestNull() { PRPAIN201306UV02 request = null; String ackMsgText = null; HL7AckTransforms ackTransform = new HL7AckTransforms(idGenerator); assertNull(ackTransform.createAckFrom201306(request, ackMsgText).getAcceptAckCode()); }
@Test public void testCreateAckFrom201306WhenMessageIdNull() { PRPAIN201306UV02 request = createPRPAIN201306UV02(); String ackMsgText = null; HL7AckTransforms ackTransform = new HL7AckTransforms(idGenerator); assertNotNull(ackTransform.createAckFrom201306(request, ackMsgText).getId().getRoot()); }
@Test public void testCreateAckFrom201306() { PRPAIN201306UV02 request = createPRPAIN201306UV02(); setMessageId(request); String ackMsgText = "HL7 AckMessage"; HL7AckTransforms ackTransform = new HL7AckTransforms(idGenerator); MCCIIN000002UV01 ack = ackTransform.createAckFrom201306(request, ackMsgText); assertNotNull(ack.getAcknowledgement().get(0).getAcknowledgementDetail().get(0).getText()); assertEquals(ack.getSender().getDevice().getAsAgent().getValue().getRepresentedOrganization().getValue() .getId().get(0).getRoot(), "1.1"); assertEquals(ack.getReceiver().get(0).getDevice().getAsAgent().getValue().getRepresentedOrganization() .getValue().getId().get(0).getRoot(), "2.2"); }