ReportingDb { @VisibleForTesting static boolean requiresSummary(@NotNull String sampleId, @NotNull LimsStudy study) { LimsCoreCohort coreCohort = LimsCoreCohort.fromSampleId(sampleId); if (study == LimsStudy.WIDE) { return true; } else { return study == LimsStudy.CORE && coreCohort != LimsCoreCohort.CORELR02 && coreCohort != LimsCoreCohort.CORERI02; } } private  ReportingDb(); static void addAnalysedReportToReportingDb(@NotNull String reportingDbTsv, @NotNull AnalysedPatientReport report); static void addQCFailReportToReportingDb(@NotNull String reportingDbTsv, @NotNull QCFailReport report);  }
@Test public void canDetermineWhetherSummaryIsRequired() { String sampleId1 = "WIDE01000001T"; assertTrue(ReportingDb.requiresSummary(sampleId1, LimsStudy.fromSampleId(sampleId1))); String sampleId2 = "CPCT01000001T"; assertFalse(ReportingDb.requiresSummary(sampleId2, LimsStudy.fromSampleId(sampleId2))); String sampleId3 = "CORE01000001T"; assertTrue(ReportingDb.requiresSummary(sampleId3, LimsStudy.fromSampleId(sampleId3))); String sampleId4 = "CORELR020000T"; assertFalse(ReportingDb.requiresSummary(sampleId4, LimsStudy.fromSampleId(sampleId4))); String sampleId5 = "CORELR110000T"; assertTrue(ReportingDb.requiresSummary(sampleId5, LimsStudy.fromSampleId(sampleId5))); }