-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
389 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
Jira ticket or GitHub issue: | ||
|
||
- [ ] Includes a change file | ||
- [ ] Updated tests (or n/a) | ||
- [ ] Updated documentation (or n/a) | ||
- [ ] Discussed with CGI (or n/a; see release procedure on wiki for applicability) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/main/java/ca/on/oicr/gsi/dimsum/util/reporting/ReportFormat.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package ca.on.oicr.gsi.dimsum.util.reporting; | ||
|
||
import org.springframework.http.MediaType; | ||
|
||
public enum ReportFormat { | ||
// @formatter:off | ||
EXCEL(new MediaType("application", "vnd.ms-excel"), "xlsx"), | ||
CSV(new MediaType("text", "csv"), "csv"), | ||
TSV(new MediaType("text", "tab-separated-values"), "tsv"); | ||
// @formatter:on | ||
|
||
private final MediaType mediaType; | ||
private final String extension; | ||
|
||
private ReportFormat(MediaType mediaType, String extension) { | ||
this.mediaType = mediaType; | ||
this.extension = extension; | ||
} | ||
|
||
public MediaType getMediaType() { | ||
return mediaType; | ||
} | ||
|
||
public String getExtension() { | ||
return extension; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/main/java/ca/on/oicr/gsi/dimsum/util/reporting/reports/DareInputSheet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package ca.on.oicr.gsi.dimsum.util.reporting.reports; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.Set; | ||
import ca.on.oicr.gsi.dimsum.controller.BadRequestException; | ||
import ca.on.oicr.gsi.dimsum.service.CaseService; | ||
import ca.on.oicr.gsi.dimsum.util.reporting.Column; | ||
import ca.on.oicr.gsi.dimsum.util.reporting.Report; | ||
import ca.on.oicr.gsi.dimsum.util.reporting.ReportSection; | ||
import ca.on.oicr.gsi.dimsum.util.reporting.ReportSection.TableReportSection; | ||
import ca.on.oicr.gsi.dimsum.util.reporting.reports.shared.CaseSampleRowData; | ||
|
||
public class DareInputSheet extends Report { | ||
|
||
private static final ReportSection<CaseSampleRowData> mainSection = | ||
new TableReportSection<CaseSampleRowData>("Full-Depth Sequencing", Arrays.asList( | ||
Column.forString("Library", x -> x.getSample().getName()), | ||
Column.forString("Run", x -> x.getSample().getRun().getName()))) { | ||
|
||
@Override | ||
public List<CaseSampleRowData> getData(CaseService caseService, | ||
Map<String, String> parameters) { | ||
Set<String> caseIds = getParameterStringSet(parameters, "caseIds"); | ||
if (caseIds == null) { | ||
throw new BadRequestException("caseIds parameter missing"); | ||
} | ||
return CaseSampleRowData.listByCaseIds(caseService, caseIds); | ||
} | ||
|
||
}; | ||
|
||
public static final DareInputSheet INSTANCE = new DareInputSheet(); | ||
|
||
private DareInputSheet() { | ||
super("Dare Input Sheet", mainSection); | ||
} | ||
|
||
} |
Oops, something went wrong.