CFReportWriter implements ReportWriter { @Override public void writeAnalysedPatientReport(@NotNull AnalysedPatientReport report, @NotNull String outputFilePath) throws IOException { ReportChapter[] chapters = new ReportChapter[] { new SummaryChapter(report), new TherapyDetailsChapterOnLabel(report), new TherapyDetailsChapterOffLabel(report), new GenomicAlterationsChapter(report), new TumorCharacteristicsChapter(report), new CircosChapter(report), new ExplanationChapter(), new DetailsAndDisclaimerChapter(report) }; writeReport(report, chapters, outputFilePath); } @VisibleForTesting  CFReportWriter(final boolean writeToFile); @NotNull static CFReportWriter createProductionReportWriter(); @Override void writeAnalysedPatientReport(@NotNull AnalysedPatientReport report, @NotNull String outputFilePath); @Override void writeQCFailReport(@NotNull QCFailReport report, @NotNull String outputFilePath);  }
@Test public void canGeneratePatientReportForCOLO829() throws IOException { AnalysedPatientReport colo829Report = ExampleAnalysisTestFactory.buildCOLO829("PNT00012345T", false, COLO_COMMENT_STRING); CFReportWriter writer = new CFReportWriter(WRITE_TO_PDF); writer.writeAnalysedPatientReport(colo829Report, testReportFilePath(colo829Report)); }
@Test public void canGeneratePatientReportForCOLO829Corrected() throws IOException { AnalysedPatientReport colo829Report = ExampleAnalysisTestFactory.buildCOLO829("PNT00012345T", true, COLO_COMMENT_STRING_CORRECTED); CFReportWriter writer = new CFReportWriter(WRITE_TO_PDF); writer.writeAnalysedPatientReport(colo829Report, testReportFilePath(colo829Report)); }
@Test public void canGeneratePatientReportForCOLO829WithGermline() throws IOException { AnalysedPatientReport colo829Report = ExampleAnalysisTestFactory.buildWithCOLO829Data("PNT00012345T_GERMLINE", false, COLO_COMMENT_STRING, QsFormNumber.FOR_080.display(), true, 1D, true, true); CFReportWriter writer = new CFReportWriter(WRITE_TO_PDF); writer.writeAnalysedPatientReport(colo829Report, testReportFilePath(colo829Report)); }
@Test public void canGeneratePatientReportForCOLO829BelowDetectionThreshold() throws IOException { AnalysedPatientReport colo829Report = ExampleAnalysisTestFactory.buildWithCOLO829Data("PNT00012345T_NO_TUMOR", false, COLO_COMMENT_STRING, QsFormNumber.FOR_209.display(), false, 0.23, false, false); CFReportWriter writer = new CFReportWriter(WRITE_TO_PDF); writer.writeAnalysedPatientReport(colo829Report, testReportFilePath(colo829Report)); }
@Test public void canGeneratePatientReportForCOLO829InsufficientTCP() throws IOException { AnalysedPatientReport colo829Report = ExampleAnalysisTestFactory.buildWithCOLO829Data("PNT00012345T_INSUFFICIENT_TUMOR", false, COLO_COMMENT_STRING, QsFormNumber.FOR_209.display(), true, 0.19, false, false); CFReportWriter writer = new CFReportWriter(WRITE_TO_PDF); writer.writeAnalysedPatientReport(colo829Report, testReportFilePath(colo829Report)); }
@Test public void canGeneratePatientReportForCPCTSample() throws IOException { AnalysedPatientReport patientReport = ExampleAnalysisTestFactory.buildAnalysisWithAllTablesFilledInAndReliablePurity("CPCT01_FULL", FULL_TABLES_COMMENT_STRING); CFReportWriter writer = new CFReportWriter(WRITE_TO_PDF); writer.writeAnalysedPatientReport(patientReport, testReportFilePath(patientReport)); }
@Test public void canGeneratePatientReportForCORESample() throws IOException { AnalysedPatientReport patientReport = ExampleAnalysisTestFactory.buildAnalysisWithAllTablesFilledInAndReliablePurity("CORE01_FULL", null); CFReportWriter writer = new CFReportWriter(WRITE_TO_PDF); writer.writeAnalysedPatientReport(patientReport, testReportFilePath(patientReport)); }
@Test public void canGeneratePatientReportForWIDESample() throws IOException { AnalysedPatientReport patientReport = ExampleAnalysisTestFactory.buildAnalysisWithAllTablesFilledInAndReliablePurity("WIDE01_FULL", FULL_TABLES_COMMENT_STRING); CFReportWriter writer = new CFReportWriter(WRITE_TO_PDF); writer.writeAnalysedPatientReport(patientReport, testReportFilePath(patientReport)); }
@Test public void canGeneratePatientReportForBelowDetectionSample() throws IOException { AnalysedPatientReport patientReport = ExampleAnalysisTestFactory.buildAnalysisWithAllTablesFilledIn("CPCT01_NO_TUMOR", FULL_TABLES_COMMENT_STRING, false, 1D); CFReportWriter writer = new CFReportWriter(WRITE_TO_PDF); writer.writeAnalysedPatientReport(patientReport, testReportFilePath(patientReport)); }
@Test public void canGeneratePatientReportForInsufficientTCPSample() throws IOException { AnalysedPatientReport patientReport = ExampleAnalysisTestFactory.buildAnalysisWithAllTablesFilledIn("CPCT01_INSUFFICIENT_TUMOR", FULL_TABLES_COMMENT_STRING, true, 0.19); CFReportWriter writer = new CFReportWriter(WRITE_TO_PDF); writer.writeAnalysedPatientReport(patientReport, testReportFilePath(patientReport)); }