Skip to content

Commit

Permalink
validate qcFailed so cannot be null
Browse files Browse the repository at this point in the history
  • Loading branch information
grapigeau committed Nov 15, 2024
1 parent 0ed35c7 commit f3866a2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ public String getId() {
return id;
}

public Boolean isSupplemental() {
public boolean isSupplemental() {
return supplemental;
}

public Boolean qcFailed() {
public boolean isQcFailed() {
return qcFailed;
}

Expand All @@ -42,7 +42,7 @@ public static class Builder {

private String id;
private boolean supplemental;
private boolean qcFailed;
private Boolean qcFailed;

public ShesmuSample build() {
return new ShesmuSample(this);
Expand All @@ -59,7 +59,7 @@ public Builder supplemental(boolean supplemental) {
return this;
}

public Builder qcFailed(boolean qcFailed) {
public Builder qcFailed(Boolean qcFailed) {
this.qcFailed = qcFailed;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@ private static void assertShesmuDetailedCaseEqual(ShesmuDetailedCase one,
private static void assertShesmuSampleEqual(ShesmuSample one, ShesmuSample two) {
assertEquals(one.getId(), two.getId());
assertEquals(one.isSupplemental(), two.isSupplemental());
assertEquals(one.isQcFailed(), two.isQcFailed());
}

private static void assertShesmuTestEqual(ShesmuSequencing one, ShesmuSequencing two) {
Expand Down Expand Up @@ -862,6 +863,7 @@ private static ShesmuDetailedCase makeShesmuDetailedCase() {
limsIds.add(new ShesmuSample.Builder()
.id("ID1")
.supplemental(false)
.qcFailed(false)
.build());
sequencing.add(new ShesmuSequencing.Builder()
.test("Some Test")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,10 @@ private ShesmuSequencing makeShesmuSequencing(List<Sample> samples, MetricCatego

private boolean getQcFailed(Sample sample) {
Run run = sample.getRun();
return (!(sample.getDataReviewPassed() == null || sample.getDataReviewPassed())
|| !(sample.getQcPassed() == null || sample.getQcPassed())
|| !(run.getDataReviewPassed() == null || run.getDataReviewPassed())
|| !(run.getQcPassed() == null || run.getQcPassed()));
return ((sample.getDataReviewPassed() == false)
|| (sample.getQcPassed() == false)
|| (run.getDataReviewPassed() == false)
|| (run.getQcPassed() == false));
}

private Set<String> getLimsIusIdsForShesmu(Case kase) {
Expand Down
2 changes: 1 addition & 1 deletion changes/add_qc_failed_field.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Field qcFailed on shesmu detailed cases
Field qcFailed on sequencing items in shesmu detailed cases

0 comments on commit f3866a2

Please sign in to comment.