HL7PRPA201310Transforms { public static PRPAIN201310UV02 createPRPA201310(final String patientId, final String assigningAuthorityId, final String localDeviceId, final String senderOID, final String receiverOID, final JAXBElement<PRPAMT201307UV02QueryByParameter> queryParam) { final PRPAIN201310UV02 ret201310 = createTransmissionWrapper(localDeviceId); ret201310.setSender(HL7SenderTransforms.createMCCIMT000300UV01Sender(senderOID)); ret201310.getReceiver().add(HL7ReceiverTransforms.createMCCIMT000300UV01Receiver(receiverOID)); final PRPAMT201304UV02Patient patient201304 = createPRPAMT201304UVPatient(patientId, assigningAuthorityId); ret201310.setControlActProcess( createMFMIMT700711UV01ControlActProcess(patient201304, localDeviceId, queryParam)); return ret201310; }  static PRPAIN201310UV02 createFaultPRPA201310(); static PRPAIN201310UV02 createFaultPRPA201310(final String senderOID, final String receiverOID); static PRPAIN201310UV02 createPRPA201310(final String patientId, final String assigningAuthorityId,
            final String localDeviceId, final String senderOID, final String receiverOID,
            final JAXBElement<PRPAMT201307UV02QueryByParameter> queryParam);  }
@Test public void createPRPA201310() { PRPAIN201310UV02 result = new PRPAIN201310UV02(); String patientId = "D123401"; String assigningAuthorityId = "1.1"; String localDeviceId = "1.1"; String senderOID = "1.1"; String receiverOID = "2.2"; JAXBElement<PRPAMT201307UV02QueryByParameter> queryParam = createQueryByParameter(); HL7PRPA201310Transforms transforms = new HL7PRPA201310Transforms(); result = transforms.createPRPA201310(patientId, assigningAuthorityId, localDeviceId, senderOID, receiverOID, queryParam); assertEquals(result.getId().getRoot(), "1.1"); assertEquals(result.getSender().getDevice().getId().get(0).getRoot(), "1.1"); assertEquals(result.getReceiver().get(0).getDevice().getId().get(0).getRoot(), "2.2"); assertEquals(result.getControlActProcess().getQueryByParameter().getValue().getParameterList() .getPatientIdentifier().get(0).getValue().get(0).getExtension(), "D123401"); assertEquals(result.getControlActProcess().getSubject().get(0).getRegistrationEvent().getSubject1() .getPatient().getId().get(0).getRoot(), "1.1"); }
@Test public void createPRPA201310WhenPatIdandAAIDNull() { PRPAIN201310UV02 result = new PRPAIN201310UV02(); String patientId = null; String assigningAuthorityId = null; String localDeviceId = "1.1"; String senderOID = "1.1"; String receiverOID = "2.2"; JAXBElement<PRPAMT201307UV02QueryByParameter> queryParam = createQueryByParameter(); HL7PRPA201310Transforms transforms = new HL7PRPA201310Transforms(); result = transforms.createPRPA201310(patientId, assigningAuthorityId, localDeviceId, senderOID, receiverOID, queryParam); assertEquals(result.getId().getRoot(), "1.1"); assertEquals(result.getSender().getDevice().getId().get(0).getRoot(), "1.1"); assertEquals(result.getReceiver().get(0).getDevice().getId().get(0).getRoot(), "2.2"); assertEquals(result.getControlActProcess().getQueryByParameter().getValue().getParameterList() .getPatientIdentifier().get(0).getValue().get(0).getExtension(), "D123401"); assertNull(result.getControlActProcess().getSubject().get(0).getRegistrationEvent().getSubject1().getPatient() .getId().get(0).getRoot()); }