Skip to content

Commit

Permalink
Fix cerberus logic
Browse files Browse the repository at this point in the history
  • Loading branch information
avarsava committed Oct 4, 2024
1 parent a96f391 commit faa948a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,8 @@
import ca.on.oicr.gsi.shesmu.gsicommon.IUSUtils;
import ca.on.oicr.gsi.shesmu.plugin.Tuple;
import ca.on.oicr.ws.dto.SampleProvenanceDto;
import java.util.Collections;
import java.util.Optional;
import java.util.Set;
import java.util.TreeSet;
import java.util.*;
import java.util.regex.Pattern;
import java.util.stream.Collectors;

public class SampleCerberusFileProvenanceRecord
extends BaseCerberusFileProvenanceRecord<SampleProvenanceDto> {
Expand All @@ -28,10 +24,9 @@ public Optional<String> barcode_kit() {

@Override
public Set<String> batches() {
return limsAttr("batchIds")
.<Set<String>>map(
s -> COMMA.splitAsStream(s).collect(Collectors.toCollection(TreeSet::new)))
.orElse(Set.of());
List<String> potentialBatchIds = provenanceRecord.lims().getBatchIds();
if (potentialBatchIds == null || potentialBatchIds.isEmpty()) return new HashSet<>();
return new HashSet<>(potentialBatchIds);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,8 @@
import ca.on.oicr.gsi.shesmu.gsicommon.IUSUtils;
import ca.on.oicr.gsi.shesmu.plugin.Tuple;
import ca.on.oicr.ws.dto.SampleProvenanceDto;
import java.util.Collections;
import java.util.Optional;
import java.util.Set;
import java.util.TreeSet;
import java.util.*;
import java.util.regex.Pattern;
import java.util.stream.Collectors;

public class SampleCerberusFileProvenanceSkippedRecord
extends BaseCerberusFileProvenanceSkippedRecord<SampleProvenanceDto> {
Expand All @@ -28,10 +24,9 @@ public Optional<String> barcode_kit() {

@Override
public Set<String> batches() {
return limsAttr("batchIds")
.<Set<String>>map(
s -> COMMA.splitAsStream(s).collect(Collectors.toCollection(TreeSet::new)))
.orElse(Set.of());
List<String> potentialBatchIds = provenanceRecord.lims().getBatchIds();
if (potentialBatchIds == null || potentialBatchIds.isEmpty()) return new HashSet<>();
return new HashSet<>(potentialBatchIds);
}

@Override
Expand Down

0 comments on commit faa948a

Please sign in to comment.