ConsentHelper { public boolean isPOUMatches(Set<String> selPOU, Set<ConsentShareForPurposeOfUseCode> conPOU) { boolean isContain = false; if ((null != selPOU && selPOU.size() > 0) && (null != conPOU && conPOU.size() > 0)) { for (ConsentShareForPurposeOfUseCode aPOU : conPOU) { String code = aPOU.getPurposeOfUseCode().getCode(); if (null != code && selPOU.contains(code)) { isContain = true; break; } } } 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 testIsPOUMatches(){ Set<String> selPOU = new HashSet<String>(); selPOU.add("TREAT"); Set<ConsentShareForPurposeOfUseCode> conPOU = new HashSet<ConsentShareForPurposeOfUseCode>(); PurposeOfUseCode pCode = new PurposeOfUseCode(); pCode.setCode("TREAT"); ConsentShareForPurposeOfUseCode cpCode = new ConsentShareForPurposeOfUseCode(pCode); conPOU.add(cpCode); boolean isPouMatch = cst.isPOUMatches(selPOU, conPOU); assertEquals(isPouMatch, true); }
@Test public void testIsPOUMatches_false(){ Set<String> selPOU = new HashSet<String>(); selPOU.add("TREAT"); Set<ConsentShareForPurposeOfUseCode> conPOU = new HashSet<ConsentShareForPurposeOfUseCode>(); PurposeOfUseCode pCode = new PurposeOfUseCode(); pCode.setCode("ETREAT"); ConsentShareForPurposeOfUseCode cpCode = new ConsentShareForPurposeOfUseCode(pCode); conPOU.add(cpCode); boolean isPouMatch = cst.isPOUMatches(selPOU, conPOU); assertEquals(isPouMatch, false); }
@Test public void testIsPOUMatches_multrue(){ Set<String> selPOU = new HashSet<String>(); selPOU.add("TREAT"); selPOU.add("ETREAT"); Set<ConsentShareForPurposeOfUseCode> conPOU = new HashSet<ConsentShareForPurposeOfUseCode>(); PurposeOfUseCode pCode = new PurposeOfUseCode(); pCode.setCode("ETREAT"); ConsentShareForPurposeOfUseCode cpCode = new ConsentShareForPurposeOfUseCode(pCode); conPOU.add(cpCode); boolean isPouMatch = cst.isPOUMatches(selPOU, conPOU); assertEquals(isPouMatch, true); }
@Test public void testIsPOUMatches_mulpcodetrue(){ Set<String> selPOU = new HashSet<String>(); selPOU.add("CLINTRCH"); selPOU.add("HLEGAL"); Set<ConsentShareForPurposeOfUseCode> conPOU = new HashSet<ConsentShareForPurposeOfUseCode>(); PurposeOfUseCode pCode = new PurposeOfUseCode(); pCode.setCode("ETREAT"); ConsentShareForPurposeOfUseCode cpCode = new ConsentShareForPurposeOfUseCode(pCode); conPOU.add(cpCode); PurposeOfUseCode pCode2 = new PurposeOfUseCode(); pCode.setCode("HLEGAL"); ConsentShareForPurposeOfUseCode cpCode2 = new ConsentShareForPurposeOfUseCode(pCode2); conPOU.add(cpCode2); boolean isPouMatch = cst.isPOUMatches(selPOU, conPOU); assertEquals(isPouMatch, true); }
@Test public void testIsPOUMatches_mulpcodefalse(){ Set<String> selPOU = new HashSet<String>(); selPOU.add("CLINTRCH"); selPOU.add("HLEGAL"); Set<ConsentShareForPurposeOfUseCode> conPOU = new HashSet<ConsentShareForPurposeOfUseCode>(); PurposeOfUseCode pCode = new PurposeOfUseCode(); pCode.setCode("ETREAT"); ConsentShareForPurposeOfUseCode cpCode = new ConsentShareForPurposeOfUseCode(pCode); conPOU.add(cpCode); PurposeOfUseCode pCode2 = new PurposeOfUseCode(); pCode.setCode("HMARKT"); ConsentShareForPurposeOfUseCode cpCode2 = new ConsentShareForPurposeOfUseCode(pCode2); conPOU.add(cpCode2); boolean isPouMatch = cst.isPOUMatches(selPOU, conPOU); assertEquals(isPouMatch, false); }