VerifyMode implements ResponseMode { protected PRPAMT201301UV02Patient extractPatient(PRPAIN201306UV02 response) { PRPAMT201301UV02Patient patient = null; if (response != null && response.getControlActProcess() != null && NullChecker.isNotNullish(response.getControlActProcess().getSubject()) && response.getControlActProcess().getSubject().get(0) != null && response.getControlActProcess().getSubject().get(0).getRegistrationEvent() != null && response.getControlActProcess().getSubject().get(0).getRegistrationEvent().getSubject1() != null && response.getControlActProcess().getSubject().get(0).getRegistrationEvent().getSubject1() .getPatient() != null) { PRPAMT201310UV02Patient remotePatient = response.getControlActProcess().getSubject().get(0) .getRegistrationEvent().getSubject1().getPatient(); patient = HL7PatientTransforms.createPRPAMT201301UVPatient(remotePatient); } return patient; } VerifyMode(); @Override PRPAIN201306UV02 processResponse(ResponseParams params); @Override PRPAIN201306UV02 processResponse(PRPAIN201306UV02 response, AssertionType assertion, II localPatientId); PRPAIN201306UV02 processResponse(PRPAIN201305UV02 requestMsg, PRPAIN201306UV02 response,
        AssertionType assertion, NhinTargetSystemType target);  }
@Test public void testExtractPatient() { JAXBElement<PRPAMT201301UV02Person> person = HL7PatientTransforms.create201301PatientPerson("Joe", "Smith", "M", null, null); PRPAMT201301UV02Patient patient = HL7PatientTransforms.create201301Patient(person, "1234", "1.1.1"); PRPAIN201305UV02 request = HL7PRPA201305Transforms.createPRPA201305(patient, "1.1", "2.2", "1.1.1"); PRPAIN201306UV02 response = HL7PRPA201306Transforms.createPRPA201306(patient, "2.2", "1.1.1", "1.1", "2.2.2", request); VerifyMode verifyMode = new VerifyMode(); PRPAMT201301UV02Patient patientResult = verifyMode.extractPatient(response); assertEquals("1234", patientResult.getId().get(0).getExtension()); }