ConsentHelper { public boolean isProviderComboMatch(Consent consent, ConsentDto consentDto) { boolean isContain = false; Set<String> selToDiscloseNpi = getDtoProviderToDiscloseToNpi(consentDto); Set<String> conToDiscloseNpi = getProviderToDiscloseToNpi(consent); Set<String> selToDiscloseNpiCopy = new HashSet<String>(selToDiscloseNpi); Set<String> conToDiscloseNpiCopy = new HashSet<String>(conToDiscloseNpi); selToDiscloseNpiCopy.retainAll(conToDiscloseNpiCopy); if (null != selToDiscloseNpiCopy && selToDiscloseNpiCopy.size() > 0) { Set<String> selIsMadeToNpi = getDtoProviderIsMadeToNpi(consentDto); Set<String> conIsMadeToNpi = getProviderIsMadeToNpi(consent); Set<String> selIsMadeToNpiCopy = new HashSet<String>(selIsMadeToNpi); Set<String> conIsMadeToNpiCopy = new HashSet<String>(conIsMadeToNpi); selIsMadeToNpiCopy.retainAll(conIsMadeToNpiCopy); if (null != selIsMadeToNpiCopy && selIsMadeToNpiCopy.size() > 0) { isContain = true; } } return isContain; }  Date setDateAsEndOfDay(Date consentEnd); boolean isConsentTermOverlap(ConsentDto consentDto,
			Date conStartDate, Date conEndDate); Set<SpecificMedicalInfoDto> getDoNotShareClinicalConceptCodes(
			HashSet<String> icd9); boolean isPOUMatches(Set<String> selPOU,
			Set<ConsentShareForPurposeOfUseCode> conPOU); boolean isProviderComboMatch(Consent consent, ConsentDto consentDto);  }
@Test public void testIsProviderCombomatch_samecombo(){ Consent consent = new Consent(); setConsentProvidersMatchData(consent); setDtoProvidersMatchData(consentDto); boolean isProviderComboMatch = cst.isProviderComboMatch(consent, consentDto); assertEquals(isProviderComboMatch, true); }
@Test public void testIsProviderCombomatch_selsamePermittedToAndToDisclose(){ Consent consent = new Consent(); setConsentProvidersMatchData(consent); setDtoProvidersMatchData(consentDto); consentDto.setProvidersDisclosureIsMadeTo(consentDto.getProvidersPermittedToDisclose()); boolean isProviderComboMatch = cst.isProviderComboMatch(consent, consentDto); assertEquals(isProviderComboMatch, false); }
@Test public void testIsProviderCombomatch_selsameToDiscloseAndPermittedTo(){ Consent consent = new Consent(); setConsentProvidersMatchData(consent); setDtoProvidersMatchData(consentDto); consentDto.setProvidersPermittedToDisclose(consentDto.getProvidersDisclosureIsMadeTo()); boolean isProviderComboMatch = cst.isProviderComboMatch(consent, consentDto); assertEquals(isProviderComboMatch, false); }
@Test public void testIsProviderCombomatch_onematch(){ Consent consent = new Consent(); setConsentProvidersMatchData(consent); Set<String> selIsMadeToNpi = new HashSet<String>(); selIsMadeToNpi.add("1083949036"); Set<String> selIsMadeToOrgNpi = new HashSet<String>(); selIsMadeToOrgNpi.add("1174858088"); selIsMadeToNpi.addAll(selIsMadeToOrgNpi); consentDto.setProvidersPermittedToDisclose(selIsMadeToNpi); Set<String> selToDiscloseNpi = new HashSet<String>(); selToDiscloseNpi.add("1346575297"); Set<String> selToDiscloseOrgNpi = new HashSet<String>(); selToDiscloseOrgNpi.add("1902131865"); selToDiscloseNpi.addAll(selToDiscloseOrgNpi); consentDto.setProvidersDisclosureIsMadeTo(selToDiscloseNpi); boolean isProviderComboMatch = cst.isProviderComboMatch(consent, consentDto); assertEquals(isProviderComboMatch, true); }
@Test public void testIsProviderCombomatch_onematch2(){ Consent consent = new Consent(); setConsentProvidersMatchData(consent); Set<String> selIsMadeToNpi = new HashSet<String>(); selIsMadeToNpi.add("1174858088"); Set<String> selIsMadeToOrgNpi = new HashSet<String>(); selIsMadeToOrgNpi.add("1902131865"); selIsMadeToNpi.addAll(selIsMadeToOrgNpi); consentDto.setProvidersPermittedToDisclose(selIsMadeToNpi); Set<String> selToDiscloseNpi = new HashSet<String>(); selToDiscloseNpi.add("1902131865"); Set<String> selToDiscloseOrgNpi = new HashSet<String>(); selToDiscloseOrgNpi.add("1346575297"); selToDiscloseNpi.addAll(selToDiscloseOrgNpi); consentDto.setProvidersDisclosureIsMadeTo(selToDiscloseNpi); boolean isProviderComboMatch = cst.isProviderComboMatch(consent, consentDto); assertEquals(isProviderComboMatch, true); }
@Test public void testIsProviderCombomatch_alldifferent(){ Consent consent = new Consent(); setConsentProvidersMatchData(consent); Set<String> selIsMadeToNpi = new HashSet<String>(); selIsMadeToNpi.add("12312314"); Set<String> selIsMadeToOrgNpi = new HashSet<String>(); selIsMadeToOrgNpi.add("5757556756"); selIsMadeToNpi.addAll(selIsMadeToOrgNpi); consentDto.setProvidersPermittedToDisclose(selIsMadeToNpi); Set<String> selToDiscloseNpi = new HashSet<String>(); selToDiscloseNpi.add("76967886"); Set<String> selToDiscloseOrgNpi = new HashSet<String>(); selToDiscloseOrgNpi.add("23432423"); selToDiscloseNpi.addAll(selToDiscloseOrgNpi); consentDto.setProvidersDisclosureIsMadeTo(selToDiscloseNpi); boolean isProviderComboMatch = cst.isProviderComboMatch(consent, consentDto); assertEquals(isProviderComboMatch, false); }
@Test public void testIsProviderCombomatch_difftodisclose(){ Consent consent = new Consent(); setConsentProvidersMatchData(consent); Set<String> selIsMadeToNpi = new HashSet<String>(); selIsMadeToNpi.add("1083949036"); Set<String> selIsMadeToOrgNpi = new HashSet<String>(); selIsMadeToOrgNpi.add("1902131865"); selIsMadeToNpi.addAll(selIsMadeToOrgNpi); Set<String> selToDiscloseNpi = new HashSet<String>(); selToDiscloseNpi.add("76967886"); Set<String> selToDiscloseOrgNpi = new HashSet<String>(); selToDiscloseOrgNpi.add("23432423"); selToDiscloseNpi.addAll(selToDiscloseOrgNpi); consentDto.setProvidersDisclosureIsMadeTo(selToDiscloseNpi); boolean isProviderComboMatch = cst.isProviderComboMatch(consent, consentDto); assertEquals(isProviderComboMatch, false); }
@Test public void testIsProviderCombomatch_alldiffpermittedto(){ Consent consent = new Consent(); setConsentProvidersMatchData(consent); Set<String> selIsMadeToNpi = new HashSet<String>(); selIsMadeToNpi.add("12312314"); Set<String> selIsMadeToOrgNpi = new HashSet<String>(); selIsMadeToOrgNpi.add("5757556756"); selIsMadeToNpi.addAll(selIsMadeToOrgNpi); consentDto.setProvidersPermittedToDisclose(selIsMadeToNpi); Set<String> selToDiscloseNpi = new HashSet<String>(); selToDiscloseNpi.add("1346575297"); Set<String> selToDiscloseOrgNpi = new HashSet<String>(); selToDiscloseOrgNpi.add("1174858088"); selToDiscloseNpi.addAll(selToDiscloseOrgNpi); consentDto.setProvidersDisclosureIsMadeTo(selToDiscloseNpi); boolean isProviderComboMatch = cst.isProviderComboMatch(consent, consentDto); assertEquals(isProviderComboMatch, false); }