ConsentHelper { public boolean isConsentTermOverlap(ConsentDto consentDto, Date conStartDate, Date conEndDate) { boolean isOverlap = false; Date selStartDate = consentDto.getConsentStart(); Date selEndDate = consentDto.getConsentEnd(); isOverlap = isDatesOverlap(selStartDate, selEndDate, conStartDate, conEndDate); return isOverlap; }  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 testIsConsentTermOverlap_samerange() throws ParseException { consentDto.setConsentStart((Date)dateFormat.parse("06/12/2013 00:00:00")); consentDto.setConsentEnd((Date)dateFormat.parse("07/18/2013 22:59:59")); boolean isOverlap = cst.isConsentTermOverlap(consentDto, conStartDate, conEndDate); assertEquals(isOverlap, true); }
@Test public void testIsConsentTermOverlap_same_start_date() throws ParseException { consentDto.setConsentStart((Date)dateFormat.parse("06/12/2013 00:00:00")); consentDto.setConsentEnd((Date)dateFormat.parse("07/18/2014 22:59:59")); boolean isOverlap = cst.isConsentTermOverlap(consentDto, conStartDate, conEndDate); assertEquals(isOverlap, true); }
@Test public void testIsConsentTermOverlap_same_start_date_ltend() throws ParseException { consentDto.setConsentStart((Date)dateFormat.parse("06/12/2013 00:00:00")); consentDto.setConsentEnd((Date)dateFormat.parse("07/14/2013 22:59:59")); boolean isOverlap = cst.isConsentTermOverlap(consentDto, conStartDate, conEndDate); assertEquals(isOverlap, true); }
@Test public void testIsConsentTermOverlap_same_start_date_enddate() throws ParseException { consentDto.setConsentStart((Date)dateFormat.parse("06/12/2013 00:00:00")); consentDto.setConsentEnd((Date)dateFormat.parse("06/12/2013 22:59:59")); boolean isOverlap = cst.isConsentTermOverlap(consentDto, conStartDate, conEndDate); assertEquals(isOverlap, true); }
@Test public void testIsConsentTermOverlap_start_date_enddate() throws ParseException { consentDto.setConsentStart((Date)dateFormat.parse("07/18/2013 23:59:59")); consentDto.setConsentEnd((Date)dateFormat.parse("07/19/2014 22:59:59")); boolean isOverlap = cst.isConsentTermOverlap(consentDto, conStartDate, conEndDate); assertEquals(isOverlap, false); }
@Test public void testIsConsentTermOverlap_same_end_date() throws ParseException { consentDto.setConsentStart((Date)dateFormat.parse("07/12/2013 00:00:00")); consentDto.setConsentEnd((Date)dateFormat.parse("07/18/2013 22:59:59")); boolean isOverlap = cst.isConsentTermOverlap(consentDto, conStartDate, conEndDate); assertEquals(isOverlap, true); }
@Test public void testIsConsentTermOverlap_false_selendLTconstart() throws ParseException { consentDto.setConsentStart((Date)dateFormat.parse("05/12/2012 00:00:00")); consentDto.setConsentEnd((Date)dateFormat.parse("06/11/2013 22:59:59")); boolean isOverlap = cst.isConsentTermOverlap(consentDto, conStartDate, conEndDate); assertEquals(isOverlap, false); }
@Test public void testIsConsentTermOverlap_true_selendGTconstart() throws ParseException { consentDto.setConsentStart((Date)dateFormat.parse("05/12/2012 00:00:00")); consentDto.setConsentEnd((Date)dateFormat.parse("06/13/2013 22:59:59")); boolean isOverlap = cst.isConsentTermOverlap(consentDto, conStartDate, conEndDate); assertEquals(isOverlap, true); }
@Test public void testIsConsentTermOverlap_true_selendGTEconstartAndconendGTEselstart() throws ParseException { consentDto.setConsentStart((Date)dateFormat.parse("06/12/2013 00:00:00")); consentDto.setConsentEnd((Date)dateFormat.parse("07/18/2013 22:59:59")); boolean isOverlap = cst.isConsentTermOverlap(consentDto, conStartDate, conEndDate); assertEquals(isOverlap, true); }
@Test public void testIsConsentTermOverlap_true_selendGTconstartAndconendGTselstart() throws ParseException { consentDto.setConsentStart((Date)dateFormat.parse("06/14/2013 00:00:00")); consentDto.setConsentEnd((Date)dateFormat.parse("07/17/2013 22:59:59")); boolean isOverlap = cst.isConsentTermOverlap(consentDto, conStartDate, conEndDate); assertEquals(isOverlap, true); }
@Test public void testIsConsentTermOverlap_false_conendLTselstart() throws ParseException { consentDto.setConsentStart((Date)dateFormat.parse("07/19/2013 00:00:00")); consentDto.setConsentEnd((Date)dateFormat.parse("11/18/2013 22:59:59")); boolean isOverlap = cst.isConsentTermOverlap(consentDto, conStartDate, conEndDate); assertEquals(isOverlap, false); }
@Test public void testIsConsentTermOverlap_true_conendGTselstart() throws ParseException { consentDto.setConsentStart((Date)dateFormat.parse("07/17/2013 00:00:00")); consentDto.setConsentEnd((Date)dateFormat.parse("11/18/2013 22:59:59")); boolean isOverlap = cst.isConsentTermOverlap(consentDto, conStartDate, conEndDate); assertEquals(isOverlap, true); }