diff --git a/plugin-cerberus/src/main/java/ca/on/oicr/gsi/shesmu/cerberus/SampleCerberusFileProvenanceRecord.java b/plugin-cerberus/src/main/java/ca/on/oicr/gsi/shesmu/cerberus/SampleCerberusFileProvenanceRecord.java index 6dd80eefc..95a6f4fe5 100644 --- a/plugin-cerberus/src/main/java/ca/on/oicr/gsi/shesmu/cerberus/SampleCerberusFileProvenanceRecord.java +++ b/plugin-cerberus/src/main/java/ca/on/oicr/gsi/shesmu/cerberus/SampleCerberusFileProvenanceRecord.java @@ -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 { @@ -28,10 +24,9 @@ public Optional barcode_kit() { @Override public Set batches() { - return limsAttr("batchIds") - .>map( - s -> COMMA.splitAsStream(s).collect(Collectors.toCollection(TreeSet::new))) - .orElse(Set.of()); + List potentialBatchIds = provenanceRecord.lims().getBatchIds(); + if (potentialBatchIds == null || potentialBatchIds.isEmpty()) return new HashSet<>(); + return new HashSet<>(potentialBatchIds); } @Override diff --git a/plugin-cerberus/src/main/java/ca/on/oicr/gsi/shesmu/cerberus/SampleCerberusFileProvenanceSkippedRecord.java b/plugin-cerberus/src/main/java/ca/on/oicr/gsi/shesmu/cerberus/SampleCerberusFileProvenanceSkippedRecord.java index 0224ea6ac..d5fecf3b1 100644 --- a/plugin-cerberus/src/main/java/ca/on/oicr/gsi/shesmu/cerberus/SampleCerberusFileProvenanceSkippedRecord.java +++ b/plugin-cerberus/src/main/java/ca/on/oicr/gsi/shesmu/cerberus/SampleCerberusFileProvenanceSkippedRecord.java @@ -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 { @@ -28,10 +24,9 @@ public Optional barcode_kit() { @Override public Set batches() { - return limsAttr("batchIds") - .>map( - s -> COMMA.splitAsStream(s).collect(Collectors.toCollection(TreeSet::new))) - .orElse(Set.of()); + List potentialBatchIds = provenanceRecord.lims().getBatchIds(); + if (potentialBatchIds == null || potentialBatchIds.isEmpty()) return new HashSet<>(); + return new HashSet<>(potentialBatchIds); } @Override