PRPAIN201309UVParser { public static List<II> buildAssigningAuthorityInclusionFilterList(PRPAIN201309UV02 message) { List<II> list = new ArrayList<>(); PRPAMT201307UV02ParameterList parameterList = parseHL7ParameterListFrom201309Message(message); List<PRPAMT201307UV02DataSource> dataSourceList; if (parameterList != null) { dataSourceList = parameterList.getDataSource(); for (PRPAMT201307UV02DataSource dataSource : dataSourceList) { for (II dataSourceValue : dataSource.getValue()) { list.add(dataSourceValue); } } } return list; }  static PRPAMT201307UV02ParameterList parseHL7ParameterListFrom201309Message(PRPAIN201309UV02 message); static PRPAMT201307UV02PatientIdentifier parseHL7PatientPersonFrom201309Message(PRPAIN201309UV02 message); static List<II> buildAssigningAuthorityInclusionFilterList(PRPAIN201309UV02 message); static JAXBElement<PRPAMT201307UV02QueryByParameter> extractQueryId(PRPAIN201309UV02 message);  }
@Test public void testBuildAAInclusionFilterList() { PRPAIN201309UVParser parser = new PRPAIN201309UVParser(); List<II> list; list = parser.buildAssigningAuthorityInclusionFilterList(createMessage()); assertEquals(list.get(0).getAssigningAuthorityName(), "CONNECT"); assertEquals(list.get(0).getExtension(), "1.16.17.19"); }
@Test public void testBuildAAInclusionFilterListWhenParameterListNull() { PRPAIN201309UV02 message = new PRPAIN201309UV02(); PRPAIN201309UV02QUQIMT021001UV01ControlActProcess controlActProcess = new PRPAIN201309UV02QUQIMT021001UV01ControlActProcess(); PRPAMT201307UV02QueryByParameter parameter = new PRPAMT201307UV02QueryByParameter(); PRPAMT201307UV02ParameterList parameterList = null; parameter.setTypeId(createII()); parameter.setParameterList(parameterList); javax.xml.namespace.QName xmlqname = new javax.xml.namespace.QName("urn:hl7-org:v3", "parameter"); JAXBElement<PRPAMT201307UV02QueryByParameter> queryByParameter = new JAXBElement<>(xmlqname, PRPAMT201307UV02QueryByParameter.class, parameter); controlActProcess.setQueryByParameter(queryByParameter); message.setControlActProcess(controlActProcess); PRPAIN201309UVParser parser = new PRPAIN201309UVParser(); List<II> list; list = parser.buildAssigningAuthorityInclusionFilterList(message); assertTrue(list.isEmpty()); }