HL7PRPA201306Transforms { public static PRPAIN201306UV02 createPRPA201306(PRPAMT201301UV02Patient patient, String senderOID, String receiverAAID, String receiverOID, String localDeviceId, PRPAIN201305UV02 query) { PRPAIN201306UV02 result = new PRPAIN201306UV02(); LOG.trace("Create the 201306 message header fields"); result.setITSVersion(HL7Constants.ITS_VERSION); result.setId(idGenerator.generateHL7MessageId(receiverOID)); result.setCreationTime(HL7DataTransformHelper.creationTimeFactory()); result.setInteractionId( HL7DataTransformHelper.IIFactory(HL7Constants.INTERACTION_ID_ROOT, "PRPA_IN201306UV02")); result.setProcessingCode(HL7DataTransformHelper.CSFactory("P")); result.setProcessingModeCode(HL7DataTransformHelper.CSFactory("R")); result.setAcceptAckCode(HL7DataTransformHelper.CSFactory("AL")); result.getAcknowledgement().add(createAck(query)); LOG.trace("Create the Receiver"); result.getReceiver().add(HL7ReceiverTransforms.createMCCIMT000300UV01Receiver(receiverOID)); LOG.trace("Create the Sender"); result.setSender(HL7SenderTransforms.createMCCIMT000300UV01Sender(senderOID)); LOG.trace("Create the ControlActProcess"); result.setControlActProcess( createQUQIMT021001UV01ControlActProcess(patient, localDeviceId, query, receiverAAID, receiverOID)); return result; }  static PRPAIN201306UV02 createPRPA201306(PRPAMT201301UV02Patient patient, String senderOID,
        String receiverAAID, String receiverOID, String localDeviceId, PRPAIN201305UV02 query); PRPAIN201306UV02 createPRPA201306ForPatientNotFound(PRPAIN201305UV02 oRequest); PRPAIN201306UV02 createPRPA201306ForErrors(PRPAIN201305UV02 oRequest, String sErrorCode); PRPAIN201306UV02 createPRPA201306ForErrors(PRPAIN201305UV02 oRequest, String sErrorCode, String sErrorText); static PRPAIN201306UV02MFMIMT700711UV01ControlActProcess createQUQIMT021001UV01ControlActProcess(
        PRPAMT201301UV02Patient patient, String localDeviceId, PRPAIN201305UV02 query, String aaId, String orgId); static PRPAIN201306UV02MFMIMT700711UV01ControlActProcess createQUQIMT021001UV01ControlActProcessWithNoRegistrationEvent(
        PRPAIN201305UV02 query); static MFMIMT700711UV01QueryAck createQueryAck(PRPAIN201305UV02 query); static PRPAIN201306UV02MFMIMT700711UV01Subject2 createSubject2(PRPAMT201301UV02Patient patient,
        PRPAIN201305UV02 query, String patId, String orgId);  }
@Test public void createPRPA201306() { String senderOID = "1.1"; String receiverAAID = "2.2"; String receiverOID = "2.2"; String localDeviceId = "1.1"; PRPAMT201301UV02Patient patient = createPRPAMT201301UV02Patient(); HL7PRPA201306Transforms transforms = new HL7PRPA201306Transforms(); PRPAIN201306UV02 result = transforms.createPRPA201306(patient, senderOID, receiverAAID, receiverOID, localDeviceId, createPRPAIN201305UV02()); assertEquals(result.getAcknowledgement().get(0).getTypeId().getExtension(), "1.16.17.19"); assertEquals(result.getReceiver().get(0).getDevice().getId().get(0).getRoot(), "2.2"); assertEquals(result.getSender().getDevice().getId().get(0).getRoot(), "1.1"); assertEquals(result.getControlActProcess().getSubject().get(0).getRegistrationEvent().getSubject1() .getPatient().getProviderOrganization().getValue().getId().get(0).getRoot(), "1.1"); }