VerifyMode implements ResponseMode { protected String getSenderCommunityId(PRPAIN201306UV02 response) { String hcid = null; if (response != null && response.getSender() != null && response.getSender().getDevice() != null && response.getSender().getDevice().getAsAgent() != null && response.getSender().getDevice().getAsAgent().getValue() != null && response.getSender().getDevice().getAsAgent().getValue().getRepresentedOrganization() != null && response.getSender().getDevice().getAsAgent().getValue().getRepresentedOrganization() .getValue() != null && NullChecker.isNotNullish(response.getSender().getDevice().getAsAgent().getValue() .getRepresentedOrganization().getValue().getId()) && response.getSender().getDevice().getAsAgent().getValue().getRepresentedOrganization().getValue() .getId().get(0) != null && NullChecker.isNotNullish(response.getSender().getDevice().getAsAgent().getValue() .getRepresentedOrganization().getValue().getId().get(0).getRoot())) { hcid = response.getSender().getDevice().getAsAgent().getValue().getRepresentedOrganization().getValue() .getId().get(0).getRoot(); } return hcid; } 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 testGetSenderCommunityId() { 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(); String senderId = verifyMode.getSenderCommunityId(response); assertEquals("2.2", senderId); }