Skip to content

Commit

Permalink
more fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
wuall826 committed Jan 23, 2024
1 parent dbb117f commit d2c296b
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ protected Function<Case, Stream<Sample>> getFilteredSamples(MetricCategory reque
throw new IllegalStateException("This gate does not apply to samples");
}

public static class Helpers {
private static class Helpers {
public static String TOP_UP_REASON = "Top-up Required";
public static Predicate<Sample> pendingQc = Helpers::isPendingQc;
public static Predicate<Sample> pendingDataReview = Helpers::isPendingDataReview;
Expand All @@ -351,7 +351,7 @@ public static class Helpers {
kase -> kase.getReceipts().stream().anyMatch(passed)
&& kase.getReceipts().stream().noneMatch(pendingQc);

public static boolean isPassed(Sample sample) {
private static boolean isPassed(Sample sample) {
return isTrue(sample.getQcPassed())
&& (sample.getRun() == null || isTrue(sample.getDataReviewPassed()));
}
Expand All @@ -360,20 +360,20 @@ private static boolean isTrue(Boolean value) {
return Boolean.TRUE.equals(value);
}

public static boolean isPendingQc(Sample sample) {
private static boolean isPendingQc(Sample sample) {
return sample.getQcPassed() == null && !isTopUpRequired(sample);
}

private static boolean isPendingReceiptQc(Case kase) {
return kase.getReceipts().stream().anyMatch(pendingQc);
}

public static boolean isPendingDataReview(Sample sample) {
private static boolean isPendingDataReview(Sample sample) {
return sample.getQcUser() != null && sample.getRun() != null
&& sample.getDataReviewPassed() == null;
}

public static boolean isTopUpRequired(Sample sample) {
private static boolean isTopUpRequired(Sample sample) {
return TOP_UP_REASON.equals(sample.getQcReason());
}

Expand Down

0 comments on commit d2c296b

Please sign in to comment.