diff --git a/src/main/java/org/mskcc/limsrest/service/SetOrCreateBankedBatch.java b/src/main/java/org/mskcc/limsrest/service/SetOrCreateBankedBatch.java index 986b0d40..daafec9d 100644 --- a/src/main/java/org/mskcc/limsrest/service/SetOrCreateBankedBatch.java +++ b/src/main/java/org/mskcc/limsrest/service/SetOrCreateBankedBatch.java @@ -223,6 +223,19 @@ private DataRecord processSingleSample(SetBankedSamples.BankedSampleRequest samp setFieldIfNotNull(bankedFields, "RunType", sampleRequest.getSequencingReadLength(), "NULL"); setFieldIfNotNull(bankedFields, "ServiceId", sampleRequest.getServiceId(), "NULL"); setFieldIfNotNull(bankedFields, "TubeBarcode", sampleRequest.getTubeId(), "NULL"); + String tubeId = sampleRequest.getTubeId(); + String sampleType = sampleRequest.getSampleType(); + String micronicBarcode = sampleRequest.getMicronicTubeBarcode(); + + if (tubeId != null && !"NULL".equals(tubeId) && sampleType != null) { + if ("Curls/Punches".equals(sampleType) || + "Buffy Coat".equals(sampleType) || + "Plasma".equals(sampleType)) { + if (micronicBarcode == null || "NULL".equals(micronicBarcode) || micronicBarcode.trim().isEmpty()) { + bankedFields.put("MicronicTubeBarcode", tubeId); + } + } + } setFieldIfNotNull(bankedFields, "PatientId", sampleRequest.getPatientId(), "NULL"); setFieldIfNotNull(bankedFields, "NormalizedPatientId", sampleRequest.getNormalizedPatientId(), "NULL"); setFieldIfNotNull(bankedFields, "CMOPatientId", sampleRequest.getCmoPatientId(), "NULL");