PRPAIN201306UV02Parser { public static List<II> getPatientIds(PRPAIN201306UV02 response) { List<II> oIIs = null; if (response != null && response.getControlActProcess() != null && response.getControlActProcess().getSubject() != null) { oIIs = new ArrayList<>(); for (PRPAIN201306UV02MFMIMT700711UV01Subject1 subject : response.getControlActProcess().getSubject()) { if (subject.getRegistrationEvent() != null && subject.getRegistrationEvent().getSubject1() != null && subject.getRegistrationEvent().getSubject1().getPatient() != null && subject.getRegistrationEvent().getSubject1().getPatient().getId() != null) { oIIs.addAll(subject.getRegistrationEvent().getSubject1().getPatient().getId()); } } } else { LOG.error("PatientId doesn't exist in the received PRPAIN201306UV02 message"); } return oIIs; }  static String getQueryId(PRPAIN201306UV02 response); static List<II> getPatientIds(PRPAIN201306UV02 response); static String getSenderHcid(PRPAIN201306UV02 response); static String getReceiverHCID(PRPAIN201306UV02 response);  }
@Test public void testPatientId() { List<II> pids = PRPAIN201306UV02Parser.getPatientIds(TestPatientDiscoveryMessageHelper. createPRPAIN201306UV02Response("Gallow", "Younger", "M", "01-12-2967", "1.1", "D12345", "2.2", "abd3453dcd24wkkks545")); assertEquals("Response patientIds size mismatch", pids.size(), 1); assertEquals("Response patientId extension mismatch", pids.get(0).getExtension(), "D12345"); assertEquals("Response patientId root mismatch", pids.get(0).getRoot(), "1.1"); }