diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index fd5301af..a5fafb66 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -38,6 +38,7 @@ Please follow these checks if any changes were made to any classes in the web, s Updates were made to the mocked incoming request data and/or mocked published request data: - [ ] [cmo-metadb test data](https://github.com/mskcc/cmo-metadb/tree/master/service/src/test/resources/data) - [ ] [cmo-metadb-common test data](https://github.com/mskcc/cmo-metadb-common/tree/master/src/test/resources/data) +- [ ] [cmo-metadb-label-generator test data](https://github.com/mskcc/cmo-metadb-label-generator/tree/master/src/test/resources/data) **Code checks:** - [ ] Endpoints were tested to ensure their integrity. diff --git a/model/src/main/java/org/mskcc/cmo/metadb/model/SampleMetadata.java b/model/src/main/java/org/mskcc/cmo/metadb/model/SampleMetadata.java index 3478bf81..3b2ccd54 100644 --- a/model/src/main/java/org/mskcc/cmo/metadb/model/SampleMetadata.java +++ b/model/src/main/java/org/mskcc/cmo/metadb/model/SampleMetadata.java @@ -25,7 +25,7 @@ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) @NodeEntity -public class SampleMetadata implements Serializable, Comparable { +public class SampleMetadata implements Serializable, Comparable, Cloneable { @Id @GeneratedValue @JsonIgnore private Long id; @@ -382,4 +382,9 @@ public int compareTo(SampleMetadata sampleMetadata) { public String toString() { return ToStringBuilder.reflectionToString(this); } + + @Override + public Object clone() throws CloneNotSupportedException { + return super.clone(); // return shallow copy + } } diff --git a/persistence/src/main/java/org/mskcc/cmo/metadb/persistence/neo4j/MetadbPatientRepository.java b/persistence/src/main/java/org/mskcc/cmo/metadb/persistence/neo4j/MetadbPatientRepository.java index 5885f0ee..c514dd9f 100644 --- a/persistence/src/main/java/org/mskcc/cmo/metadb/persistence/neo4j/MetadbPatientRepository.java +++ b/persistence/src/main/java/org/mskcc/cmo/metadb/persistence/neo4j/MetadbPatientRepository.java @@ -29,15 +29,19 @@ MetadbPatient findPatientByCmoPatientId( + "RETURN p.metaDbPatientId") UUID findPatientIdBySample(@Param("metaDbSampleId") UUID metaDbSampleId); - @Query("MATCH (p: Patient)<-[:IS_ALIAS]-(pa: PatientAlias {value: $oldCmoPatientId, namespace: 'cmoId'}) " - + "SET pa.value = $newCmoPatientId " + @Query("MATCH (p: Patient)<-[:IS_ALIAS]-(pa: PatientAlias {value: $oldCmoId, namespace: 'cmoId'}) " + + "SET pa.value = $newCmoId " + "RETURN p") - MetadbPatient updateCmoPatientIdInPatientNode(@Param("oldCmoPatientId") String oldCmoPatientId, - @Param("newCmoPatientId") String newCmoPatientId); + MetadbPatient updateCmoPatientIdInPatientNode(@Param("oldCmoId") String oldCmoId, + @Param("newCmoId") String newCmoId); @Query("MATCH (s: Sample)<-[:IS_ALIAS]-(sa: SampleAlias {value: $value, namespace: $namespace}) " + "MATCH (s)<-[:HAS_SAMPLE]-(p: Patient) " + "RETURN p") MetadbPatient findPatientByNamespaceValue( @Param("namespace") String namespace, @Param("value") String value); + + @Query("MATCH (p: Patient {metaDbPatientId: $patient.metaDbPatientId})" + + "<-[:IS_ALIAS]-(pa: PatientAlias) DETACH DELETE p, pa") + void deletePatientAndAliases(@Param("patient") MetadbPatient patient); } diff --git a/persistence/src/main/java/org/mskcc/cmo/metadb/persistence/neo4j/MetadbSampleRepository.java b/persistence/src/main/java/org/mskcc/cmo/metadb/persistence/neo4j/MetadbSampleRepository.java index bbe5eb71..3c0931be 100644 --- a/persistence/src/main/java/org/mskcc/cmo/metadb/persistence/neo4j/MetadbSampleRepository.java +++ b/persistence/src/main/java/org/mskcc/cmo/metadb/persistence/neo4j/MetadbSampleRepository.java @@ -84,4 +84,9 @@ List findAllSamplesByCategoryAndCmoPatientId( List findSampleMetadataHistoryByNamespaceValue( @Param("namespace") String namespace, @Param("value") String value); + @Query("MATCH (s: Sample {metaDbSampleId: $metaDbSampleId}) " + + "MATCH (p: Patient {metaDbPatientId: $metaDbPatientId}) " + + "CREATE (s)<-[:HAS_SAMPLE]-(p)") + void updateSamplePatientRelationship(@Param("metaDbSampleId") UUID metaDbSampleId, + @Param("metaDbPatientId") UUID metaDbPatientId); } diff --git a/pom.xml b/pom.xml index 7a02a477..3a6de9ab 100644 --- a/pom.xml +++ b/pom.xml @@ -51,7 +51,7 @@ 1.2.1.RELEASE com.github.mskcc - 1.2.1.RELEASE + 1.2.2.RELEASE v2.0 diff --git a/service/src/main/java/org/mskcc/cmo/metadb/service/MetadbPatientService.java b/service/src/main/java/org/mskcc/cmo/metadb/service/MetadbPatientService.java index ac62941c..a35eda7a 100644 --- a/service/src/main/java/org/mskcc/cmo/metadb/service/MetadbPatientService.java +++ b/service/src/main/java/org/mskcc/cmo/metadb/service/MetadbPatientService.java @@ -8,4 +8,5 @@ public interface MetadbPatientService { MetadbPatient getPatientByCmoPatientId(String cmoPatientId); UUID getPatientIdBySample(UUID metadbSampleId); MetadbPatient updateCmoPatientId(String oldCmoPatientId, String newCmoPatientId); + void deletePatient(MetadbPatient patient); } diff --git a/service/src/main/java/org/mskcc/cmo/metadb/service/MetadbSampleService.java b/service/src/main/java/org/mskcc/cmo/metadb/service/MetadbSampleService.java index 0fbc8d0e..10f6d159 100644 --- a/service/src/main/java/org/mskcc/cmo/metadb/service/MetadbSampleService.java +++ b/service/src/main/java/org/mskcc/cmo/metadb/service/MetadbSampleService.java @@ -27,4 +27,5 @@ List getPublishedMetadbSamplesByCmoPatientId(String cmoPa MetadbSample getClinicalSampleByDmpId(String dmpId) throws Exception; List getSamplesByCategoryAndCmoPatientId(String cmoPatientId, String sampleCategory) throws Exception; + void updateSamplePatientRelationship(UUID metaDbSampleId, UUID metaDbPatientId); } diff --git a/service/src/main/java/org/mskcc/cmo/metadb/service/impl/MessageHandlingServiceImpl.java b/service/src/main/java/org/mskcc/cmo/metadb/service/impl/MessageHandlingServiceImpl.java index 7eea05ac..7b6ed0a8 100644 --- a/service/src/main/java/org/mskcc/cmo/metadb/service/impl/MessageHandlingServiceImpl.java +++ b/service/src/main/java/org/mskcc/cmo/metadb/service/impl/MessageHandlingServiceImpl.java @@ -61,6 +61,9 @@ public class MessageHandlingServiceImpl implements MessageHandlingService { @Value("${metadb.correct_cmoptid_topic}") private String CORRECT_CMOPTID_TOPIC; + @Value("${request_reply.cmo_label_generator_topic}") + private String CMO_LABEL_GENERATOR_REQREPLY_TOPIC; + @Value("${num.new_request_handler_threads}") private int NUM_NEW_REQUEST_HANDLERS; @@ -117,31 +120,66 @@ public void run() { Map idCorrectionMap = correctCmoPatientIdQueue.poll(100, TimeUnit.MILLISECONDS); if (idCorrectionMap != null) { - String oldCmoPatientId = idCorrectionMap.get("oldId"); - String newCmoPatientId = idCorrectionMap.get("newId"); - - // get samples by old cmo patient id before updating the - // cmo patient id for the given patient alias/patient node - List samples = - sampleService.getSamplesByCmoPatientId(oldCmoPatientId); - MetadbPatient updatedPatient = patientService.updateCmoPatientId( - oldCmoPatientId, newCmoPatientId); - - for (MetadbSample sample: samples) { - SampleMetadata latestMetadata = sample.getLatestSampleMetadata(); - latestMetadata.setCmoPatientId(newCmoPatientId); + String oldCmoPtId = idCorrectionMap.get("oldId"); + String newCmoPtId = idCorrectionMap.get("newId"); + + List samplesByOldCmoPatient = + sampleService.getSamplesByCmoPatientId(oldCmoPtId); + List samplesByNewCmoPatient = + sampleService.getSamplesByCmoPatientId(newCmoPtId); + MetadbPatient patientByNewId = patientService.getPatientByCmoPatientId(newCmoPtId); + + // update the cmo patient id for each sample linked to the "old" patient + // and the metadata as well + for (MetadbSample sample : samplesByOldCmoPatient) { + SampleMetadata updatedMetadata = sample.getLatestSampleMetadata(); + updatedMetadata.setCmoPatientId(newCmoPtId); + + // research samples need a new label as well if (sample.getSampleCategory().equals("research")) { - LOG.info("Updating patient ID prefix embedded in CMO sample label " - + "for research sample: " + latestMetadata.getPrimaryId()); - String newCmoSampleLabel = latestMetadata.getCmoSampleName() - .replaceAll(oldCmoPatientId, newCmoPatientId); - latestMetadata.setCmoSampleName(newCmoSampleLabel); + LOG.info("Requesting new CMO sample label for sample: " + + updatedMetadata.getPrimaryId()); + Message reply = messagingGateway.request(CMO_LABEL_GENERATOR_REQREPLY_TOPIC, + mapper.writeValueAsString(updatedMetadata)); + String newCmoSampleLabel = new String(reply.getData(), + StandardCharsets.UTF_8); + updatedMetadata.setCmoSampleName(newCmoSampleLabel); + } + // now update sample with the target patient we want to swap to + sample.updateSampleMetadata(updatedMetadata); + + // update the sample-to-patient relationship if swapping to a different + // patient node. if still using the same node the samples are already linked + // to then there's no need to override the patient currently set for the sample + if (patientByNewId != null) { + sample.setPatient(patientByNewId); + sampleService.updateSamplePatientRelationship(sample.getMetaDbSampleId(), + patientByNewId.getMetaDbPatientId()); } - sample.setPatient(updatedPatient); - sample.updateSampleMetadata(latestMetadata); - LOG.info("Persisting update for sample to database"); sampleService.saveMetadbSample(sample); } + + // delete old patient node if we are swapping to an existing patient node + // otherwise simply update the existing patient node with the new cmo id + if (patientByNewId != null) { + LOG.info("Deleting Patient node (and its relationships) for old ID: " + + oldCmoPtId); + MetadbPatient patientByOldId = + patientService.getPatientByCmoPatientId(oldCmoPtId); + patientService.deletePatient(patientByOldId); + } else { + patientService.updateCmoPatientId(oldCmoPtId, newCmoPtId); + } + + // sanity check the counts before and after the swaps + Integer expectedCount = samplesByOldCmoPatient.size() + + samplesByNewCmoPatient.size(); + List samplesAfterSwap = + sampleService.getSamplesByCmoPatientId(newCmoPtId); + if (expectedCount != samplesAfterSwap.size()) { + LOG.error("Expected sample count after patient ID swap does not match actual" + + " count: " + expectedCount + " != " + samplesAfterSwap.size()); + } } if (interrupted && correctCmoPatientIdQueue.isEmpty()) { break; diff --git a/service/src/main/java/org/mskcc/cmo/metadb/service/impl/PatientServiceImpl.java b/service/src/main/java/org/mskcc/cmo/metadb/service/impl/PatientServiceImpl.java index 5d1e2518..68dbf0eb 100644 --- a/service/src/main/java/org/mskcc/cmo/metadb/service/impl/PatientServiceImpl.java +++ b/service/src/main/java/org/mskcc/cmo/metadb/service/impl/PatientServiceImpl.java @@ -1,6 +1,5 @@ package org.mskcc.cmo.metadb.service.impl; -import java.util.ArrayList; import java.util.List; import java.util.UUID; import org.mskcc.cmo.metadb.model.MetadbPatient; @@ -9,6 +8,7 @@ import org.mskcc.cmo.metadb.service.MetadbPatientService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; @Component public class PatientServiceImpl implements MetadbPatientService { @@ -17,6 +17,7 @@ public class PatientServiceImpl implements MetadbPatientService { private MetadbPatientRepository patientRepository; @Override + @Transactional(rollbackFor = {Exception.class}) public MetadbPatient savePatientMetadata(MetadbPatient patient) { MetadbPatient result = patientRepository.save(patient); patient.setMetaDbPatientId(result.getMetaDbPatientId()); @@ -39,6 +40,7 @@ public UUID getPatientIdBySample(UUID metadbSampleId) { } @Override + @Transactional(rollbackFor = {Exception.class}) public MetadbPatient updateCmoPatientId(String oldCmoPatientId, String newCmoPatientId) { if (getPatientByCmoPatientId(oldCmoPatientId) == null) { return null; @@ -46,4 +48,9 @@ public MetadbPatient updateCmoPatientId(String oldCmoPatientId, String newCmoPat return patientRepository.updateCmoPatientIdInPatientNode(oldCmoPatientId, newCmoPatientId); } + @Override + @Transactional(rollbackFor = {Exception.class}) + public void deletePatient(MetadbPatient patient) { + patientRepository.deletePatientAndAliases(patient); + } } diff --git a/service/src/main/java/org/mskcc/cmo/metadb/service/impl/SampleServiceImpl.java b/service/src/main/java/org/mskcc/cmo/metadb/service/impl/SampleServiceImpl.java index 09bd4eef..becc262a 100644 --- a/service/src/main/java/org/mskcc/cmo/metadb/service/impl/SampleServiceImpl.java +++ b/service/src/main/java/org/mskcc/cmo/metadb/service/impl/SampleServiceImpl.java @@ -3,9 +3,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import java.text.ParseException; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.UUID; import org.mskcc.cmo.common.MetadbJsonComparator; import org.mskcc.cmo.metadb.model.MetadbPatient; @@ -51,7 +49,7 @@ public MetadbSample saveMetadbSample(MetadbSample sample.setMetaDbSampleId(newSampleId); return sample; } else { - existingSample.addSampleMetadata(sample.getLatestSampleMetadata()); + existingSample.updateSampleMetadata(sample.getLatestSampleMetadata()); sampleRepository.save(existingSample); return existingSample; } @@ -203,4 +201,10 @@ public List getSamplesByCategoryAndCmoPatientId(String cmoPatientI } return samples; } + + @Override + @Transactional(rollbackFor = {Exception.class}) + public void updateSamplePatientRelationship(UUID metaDbSampleId, UUID metaDbPatientId) { + sampleRepository.updateSamplePatientRelationship(metaDbSampleId, metaDbPatientId); + } } diff --git a/service/src/test/java/org/mskcc/cmo/metadb/service/CorrectCmoPatientIdHandlerTest.java b/service/src/test/java/org/mskcc/cmo/metadb/service/CorrectCmoPatientIdHandlerTest.java new file mode 100644 index 00000000..6ce445d0 --- /dev/null +++ b/service/src/test/java/org/mskcc/cmo/metadb/service/CorrectCmoPatientIdHandlerTest.java @@ -0,0 +1,126 @@ +package org.mskcc.cmo.metadb.service; + +import java.util.List; +import org.assertj.core.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mskcc.cmo.metadb.model.MetadbPatient; +import org.mskcc.cmo.metadb.model.MetadbRequest; +import org.mskcc.cmo.metadb.model.MetadbSample; +import org.mskcc.cmo.metadb.model.SampleMetadata; +import org.mskcc.cmo.metadb.persistence.neo4j.MetadbPatientRepository; +import org.mskcc.cmo.metadb.persistence.neo4j.MetadbRequestRepository; +import org.mskcc.cmo.metadb.persistence.neo4j.MetadbSampleRepository; +import org.mskcc.cmo.metadb.service.util.RequestDataFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.data.neo4j.DataNeo4jTest; +import org.springframework.boot.test.context.TestConfiguration; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Import; +import org.testcontainers.containers.Neo4jContainer; +import org.testcontainers.junit.jupiter.Container; +import org.testcontainers.junit.jupiter.Testcontainers; + +/** + * + * @author ochoaa + */ +@Testcontainers +@DataNeo4jTest +@Import(MockDataUtils.class) +public class CorrectCmoPatientIdHandlerTest { + @Autowired + private MockDataUtils mockDataUtils; + + @Autowired + private MetadbRequestService requestService; + + @Autowired + private MetadbSampleService sampleService; + + @Autowired + private MetadbPatientService patientService; + + @Container + private static final Neo4jContainer databaseServer = new Neo4jContainer<>() + .withEnv("NEO4J_dbms_security_procedures_unrestricted", "apoc.*,algo.*"); + + @TestConfiguration + static class Config { + @Bean + public org.neo4j.ogm.config.Configuration configuration() { + return new org.neo4j.ogm.config.Configuration.Builder() + .uri(databaseServer.getBoltUrl()) + .credentials("neo4j", databaseServer.getAdminPassword()) + .build(); + } + } + + private final MetadbRequestRepository requestRepository; + private final MetadbSampleRepository sampleRepository; + private final MetadbPatientRepository patientRepository; + + /** + * Persists the Mock Request data to the test database. + * @throws Exception + */ + @Autowired + public CorrectCmoPatientIdHandlerTest(MetadbRequestRepository requestRepository, + MetadbSampleRepository sampleRepository, MetadbPatientRepository patientRepository) { + this.requestRepository = requestRepository; + this.sampleRepository = sampleRepository; + this.patientRepository = patientRepository; + } + + + /** + * Persists the Mock Request data to the test database. + * @throws Exception + */ + @Autowired + public void initializeMockDatabase() throws Exception { + // mock request id: MOCKREQUEST1_B + MockJsonTestData request1Data = mockDataUtils.mockedRequestJsonDataMap + .get("mockIncomingRequest1JsonDataWith2T2N"); + MetadbRequest request1 = RequestDataFactory.buildNewLimsRequestFromJson(request1Data.getJsonString()); + requestService.saveRequest(request1); + // mock request id: 145145_IM + MockJsonTestData request5Data = mockDataUtils.mockedRequestJsonDataMap + .get("mockIncomingRequest5JsonPtMultiSamples"); + MetadbRequest request5 = RequestDataFactory.buildNewLimsRequestFromJson(request5Data.getJsonString()); + requestService.saveRequest(request5); + } + + + /** + * Tests sample fetch before patient swap and after the patient id swap in the + * event that the patient already exists by the new id. + */ + @Test + public void testPatientIdSwapWithExistingPatient() throws Exception { + String oldCmoPatientId = "C-MP789JR"; + String newCmoPatientId = "C-1MP6YY"; + + + List samplesByNewCmoPatient = sampleService.getSamplesByCmoPatientId(newCmoPatientId); + System.out.println("Samples for new cmo patient id: " + samplesByNewCmoPatient.size()); + + String request1 = "MOCKREQUEST1_B"; + String sampleId1 = "MOCKREQUEST1_B_1"; + MetadbSample sample1 = sampleService.getResearchSampleByRequestAndIgoId(request1, sampleId1); + + MetadbPatient newPatient = patientService.getPatientByCmoPatientId(newCmoPatientId); + SampleMetadata newSample1Metadata = sample1.getLatestSampleMetadata(); + newSample1Metadata.setCmoPatientId(newCmoPatientId); + sample1.updateSampleMetadata(newSample1Metadata); + sample1.setPatient(newPatient); + sampleService.saveMetadbSample(sample1); + sampleService.updateSamplePatientRelationship(sample1.getMetaDbSampleId(), + newPatient.getMetaDbPatientId()); + + Integer expectedSampleCount = samplesByNewCmoPatient.size() + 1; + List samplesByNewCmoPatientAfterSwap = + sampleService.getSamplesByCmoPatientId(newCmoPatientId); + Assertions.assertThat(samplesByNewCmoPatientAfterSwap.size()) + .isEqualTo(expectedSampleCount); + } +} diff --git a/service/src/test/java/org/mskcc/cmo/metadb/service/MockDataUtils.java b/service/src/test/java/org/mskcc/cmo/metadb/service/MockDataUtils.java index 2d4cd47a..ba802874 100644 --- a/service/src/test/java/org/mskcc/cmo/metadb/service/MockDataUtils.java +++ b/service/src/test/java/org/mskcc/cmo/metadb/service/MockDataUtils.java @@ -125,26 +125,30 @@ public String getDmpPatientIdForCmoPatient(String cmoPatientId) { * @throws IOException */ @Autowired - public void mockedRequestJsonDataMap() throws IOException { + public void mockedRequestJsonDataMap() { this.mockedRequestJsonDataMap = new HashMap<>(); ClassPathResource jsonDataDetailsResource = new ClassPathResource(MOCKED_REQUEST_DATA_DETAILS_FILEPATH); - BufferedReader reader = new BufferedReader(new FileReader(jsonDataDetailsResource.getFile())); - List columns = new ArrayList<>(); - String line; - while ((line = reader.readLine()) != null) { - String[] data = line.split("\t"); - if (columns.isEmpty()) { - columns = Arrays.asList(data); - continue; + try { + BufferedReader reader = new BufferedReader(new FileReader(jsonDataDetailsResource.getFile())); + List columns = new ArrayList<>(); + String line; + while ((line = reader.readLine()) != null) { + String[] data = line.split("\t"); + if (columns.isEmpty()) { + columns = Arrays.asList(data); + continue; + } + String identifier = data[columns.indexOf("identifier")]; + String filepath = data[columns.indexOf("filepath")]; + String description = data[columns.indexOf("description")]; + mockedRequestJsonDataMap.put(identifier, + createMockJsonTestData(identifier, filepath, description)); } - String identifier = data[columns.indexOf("identifier")]; - String filepath = data[columns.indexOf("filepath")]; - String description = data[columns.indexOf("description")]; - mockedRequestJsonDataMap.put(identifier, - createMockJsonTestData(identifier, filepath, description)); + reader.close(); + } catch (IOException e) { + throw new RuntimeException("Error loading data from test file source", e); } - reader.close(); } private MockJsonTestData createMockJsonTestData(String identifier, String filepath, diff --git a/service/src/test/resources/data/incoming_requests/mocked_request6_cmopt_after_swap.json b/service/src/test/resources/data/incoming_requests/mocked_request6_cmopt_after_swap.json new file mode 100644 index 00000000..02fff804 --- /dev/null +++ b/service/src/test/resources/data/incoming_requests/mocked_request6_cmopt_after_swap.json @@ -0,0 +1,244 @@ +{ + "requestId": "REQUESTAFTERUPDATE_A", + "recipe": "GENESET101_BAITS", + "projectManagerName": "Bar, Foo", + "piEmail": "request1pi@mskcc.org", + "labHeadName": "Foo Bar", + "labHeadEmail": "request1pi@mskcc.org", + "investigatorName": "John Smith", + "investigatorEmail": "smithj@mskcc.org", + "dataAnalystName": "Poin Dexter", + "dataAnalystEmail": "dexterp@mskcc.org", + "otherContactEmails": "dexterp@mskcc.org", + "dataAccessEmails": "", + "qcAccessEmails": "", + "isCmoRequest": true, + "bicAnalysis": false, + "samples": [ + { + "cmoSampleName": "C-CMOPTY1-X001-d", + "sampleName": "XXX002_P3_12345_L1", + "cmoSampleClass": "Primary", + "oncoTreeCode": "CLL", + "collectionYear": "", + "tubeId": "", + "qcReports": [], + "libraries": [ + { + "barcodeId": "IDT29", + "barcodeIndex": "ATTGAGGA", + "libraryIgoId": "REQUESTAFTERUPDATE_A_1_1_1_1", + "libraryVolume": 35.0, + "libraryConcentrationNgul": 34.8, + "captureConcentrationNm": "11.49425287356322", + "captureInputNg": "400.0", + "captureName": "Pool-REQUESTAFTERUPDATE_A-Tube7_1", + "runs": [ + { + "runMode": "HiSeq High Output", + "runId": "RUNID_0123", + "flowCellId": "X5KL2KKAY", + "readLength": "", + "runDate": "2018-06-05", + "flowCellLanes": [ + 5 + ], + "fastqs": [ + "/FASTQ/Project_REQUESTAFTERUPDATE_A/Sample_XXX002_P3_12345_L1_IGO_REQUESTAFTERUPDATE_A_1/XXX002_P3_12345_L1_IGO_REQUESTAFTERUPDATE_A_1_S82_R1_001.fastq.gz", + "/FASTQ/Project_REQUESTAFTERUPDATE_A/Sample_XXX002_P3_12345_L1_IGO_REQUESTAFTERUPDATE_A_1/XXX002_P3_12345_L1_IGO_REQUESTAFTERUPDATE_A_1_S82_R2_001.fastq.gz" + ] + } + ] + } + ], + "cmoPatientId": "C-CMOPTY1", + "igoId": "REQUESTAFTERUPDATE_A_5", + "investigatorSampleId": "XXX002_P3_12345_L1", + "species": "Human", + "sex": "F", + "tumorOrNormal": "Tumor", + "preservation": "Frozen", + "specimenType": "PDX", + "sampleOrigin": "Tissue", + "tissueLocation": "", + "baitSet": "GENESET101_BAITS", + "cmoSampleIdFields": { + "naToExtract": "", + "normalizedPatientId": "MRN_REDACTED", + "recipe": "GENESET101_BAITS" + } + }, + { + "cmoSampleName": "C-CMOPTY1-N001-d", + "sampleName": "01-0012345a", + "cmoSampleClass": "Normal", + "oncoTreeCode": "CLL", + "collectionYear": "", + "tubeId": "", + "qcReports": [], + "libraries": [ + { + "barcodeId": "TNG41", + "barcodeIndex": "CGACTGGA", + "libraryIgoId": "REQUESTAFTERUPDATE_A_2_1_1_1", + "libraryVolume": 35.0, + "libraryConcentrationNgul": 33.5, + "captureConcentrationNm": "5.074626865671642", + "captureInputNg": "170.0", + "captureName": "Pool-REQUESTAFTERUPDATE_A-Tube7_1", + "runs": [ + { + "runMode": "HiSeq High Output", + "runId": "RUNID_0123", + "flowCellId": "X5KL2KKAY", + "readLength": "", + "runDate": "2018-06-05", + "flowCellLanes": [ + 5 + ], + "fastqs": [ + "/FASTQ/Project_REQUESTAFTERUPDATE_A/Sample_01-0012345a_IGO_REQUESTAFTERUPDATE_A_2/01-0012345a_IGO_REQUESTAFTERUPDATE_A_2_S83_R2_001.fastq.gz", + "/FASTQ/Project_REQUESTAFTERUPDATE_A/Sample_01-0012345a_IGO_REQUESTAFTERUPDATE_A_2/01-0012345a_IGO_REQUESTAFTERUPDATE_A_2_S83_R1_001.fastq.gz" + ] + } + ] + } + ], + "cmoPatientId": "C-CMOPTY1", + "igoId": "REQUESTAFTERUPDATE_A_6", + "investigatorSampleId": "01-0012345a", + "species": "Human", + "sex": "F", + "tumorOrNormal": "Normal", + "preservation": "Frozen", + "specimenType": "Blood", + "sampleOrigin": "Whole Blood", + "tissueLocation": "", + "baitSet": "GENESET101_BAITS", + "cmoSampleIdFields": { + "naToExtract": "", + "normalizedPatientId": "MRN_REDACTED", + "recipe": "GENESET101_BAITS" + } + }, + { + "cmoSampleName": "C-CMOPTX1-X001-d", + "sampleName": "XXX002_P1_12348a_R_43", + "cmoSampleClass": "Primary", + "oncoTreeCode": "COAD", + "collectionYear": "", + "tubeId": "", + "qcReports": [], + "libraries": [ + { + "barcodeId": "TNG53", + "barcodeIndex": "GCTCGGTA", + "libraryIgoId": "REQUESTAFTERUPDATE_A_3_1_1_1", + "libraryVolume": 35.0, + "libraryConcentrationNgul": 35.2, + "captureConcentrationNm": "11.363636363636363", + "captureInputNg": "400.0", + "captureName": "Pool-REQUESTAFTERUPDATE_A-Tube7_1", + "runs": [ + { + "runMode": "HiSeq High Output", + "runId": "RUNID_0123", + "flowCellId": "X5KL2KKAY", + "readLength": "", + "runDate": "2018-06-05", + "flowCellLanes": [ + 5 + ], + "fastqs": [ + "/FASTQ/Project_REQUESTAFTERUPDATE_A/Sample_XXX002_P1_12348a_R_43_IGO_REQUESTAFTERUPDATE_A_3/XXX002_P1_12348a_R_43_IGO_REQUESTAFTERUPDATE_A_3_S84_R1_001.fastq.gz", + "/FASTQ/Project_REQUESTAFTERUPDATE_A/Sample_XXX002_P1_12348a_R_43_IGO_REQUESTAFTERUPDATE_A_3/XXX002_P1_12348a_R_43_IGO_REQUESTAFTERUPDATE_A_3_S84_R2_001.fastq.gz" + ] + } + ] + } + ], + "cmoPatientId": "C-CMOPTX1", + "igoId": "REQUESTAFTERUPDATE_A_7", + "investigatorSampleId": "XXX002_P1_12348a_R_43", + "species": "Human", + "sex": "M", + "tumorOrNormal": "Tumor", + "preservation": "Frozen", + "specimenType": "PDX", + "sampleOrigin": "Tissue", + "tissueLocation": "", + "baitSet": "GENESET101_BAITS", + "cmoSampleIdFields": { + "naToExtract": "", + "normalizedPatientId": "MRN_REDACTED", + "recipe": "GENESET101_BAITS" + } + }, + { + "cmoSampleName": "C-CMOPTX1-N001-d", + "sampleName": "01-XXXXXXXa", + "cmoSampleClass": "Normal", + "oncoTreeCode": "COAD", + "collectionYear": "", + "tubeId": "", + "qcReports": [], + "libraries": [ + { + "barcodeId": "TNG65", + "barcodeIndex": "TGGAACAA", + "libraryIgoId": "REQUESTAFTERUPDATE_A_4_1_1_1", + "libraryVolume": 35.0, + "libraryConcentrationNgul": 34.1, + "captureConcentrationNm": "4.9853372434017595", + "captureInputNg": "170.0", + "captureName": "Pool-REQUESTAFTERUPDATE_A-Tube7_1", + "runs": [ + { + "runMode": "HiSeq High Output", + "runId": "RUNID_0123", + "flowCellId": "X5KL2KKAY", + "readLength": "", + "runDate": "2018-06-05", + "flowCellLanes": [ + 5 + ], + "fastqs": [ + "/FASTQ/Project_REQUESTAFTERUPDATE_A/Sample_01-XXXXXXXa_IGO_REQUESTAFTERUPDATE_A_4/01-XXXXXXXa_IGO_REQUESTAFTERUPDATE_A_4_S85_R1_001.fastq.gz", + "/FASTQ/Project_REQUESTAFTERUPDATE_A/Sample_01-XXXXXXXa_IGO_REQUESTAFTERUPDATE_A_4/01-XXXXXXXa_IGO_REQUESTAFTERUPDATE_A_4_S85_R2_001.fastq.gz" + ] + } + ] + } + ], + "cmoPatientId": "C-CMOPTX1", + "igoId": "REQUESTAFTERUPDATE_A_8", + "investigatorSampleId": "01-XXXXXXXa", + "species": "Human", + "sex": "M", + "tumorOrNormal": "Normal", + "preservation": "Frozen", + "specimenType": "Blood", + "sampleOrigin": "Whole Blood", + "tissueLocation": "", + "baitSet": "GENESET101_BAITS", + "cmoSampleIdFields": { + "naToExtract": "", + "normalizedPatientId": "MRN_REDACTED", + "recipe": "GENESET101_BAITS" + } + } + ], + "pooledNormals": [ + "/FASTQ/Project_POOLEDNORMALS/Sample_FFPEPOOLEDNORMAL_IGO_GENESET101_TAGCTTGA/FFPEPOOLEDNORMAL_IGO_GENESET101_TAGCTTGA_S23_R1_001.fastq.gz", + "/FASTQ/Project_POOLEDNORMALS/Sample_FFPEPOOLEDNORMAL_IGO_GENESET101_TAGCTTGA/FFPEPOOLEDNORMAL_IGO_GENESET101_TAGCTTGA_S23_R2_001.fastq.gz", + "/FASTQ/Project_POOLEDNORMALS/Sample_FROZENPOOLEDNORMAL_IGO_AMBIGUOUS_TTAGGCTG/FROZENPOOLEDNORMAL_IGO_AMBIGUOUS_TTAGGCTG_S86_R1_001.fastq.gz", + "/FASTQ/Project_POOLEDNORMALS/Sample_FROZENPOOLEDNORMAL_IGO_AMBIGUOUS_TTAGGCTG/FROZENPOOLEDNORMAL_IGO_AMBIGUOUS_TTAGGCTG_S86_R2_001.fastq.gz", + "/FASTQ/Project_POOLEDNORMALS/Sample_FROZENPOOLEDNORMAL_IGO_HEMESET_v1_TTAGGCTG/FROZENPOOLEDNORMAL_IGO_HEMESET_v1_TTAGGCTG_S147_R1_001.fastq.gz", + "/FASTQ/Project_POOLEDNORMALS/Sample_FROZENPOOLEDNORMAL_IGO_HEMESET_v1_TTAGGCTG/FROZENPOOLEDNORMAL_IGO_HEMESET_v1_TTAGGCTG_S147_R2_001.fastq.gz", + "/FASTQ/Project_POOLEDNORMALS/Sample_FROZENPOOLEDNORMAL_IGO_GENESET101_TTAGGCTG/FROZENPOOLEDNORMAL_IGO_GENESET101_TTAGGCTG_S196_R1_001.fastq.gz", + "/FASTQ/Project_POOLEDNORMALS/Sample_FROZENPOOLEDNORMAL_IGO_GENESET101_TTAGGCTG/FROZENPOOLEDNORMAL_IGO_GENESET101_TTAGGCTG_S196_R2_001.fastq.gz", + "/FASTQ/Project_POOLEDNORMALS/Sample_MOUSEPOOLEDNORMAL_IGO_AMBIGUOUS_GGCGTCAT/MOUSEPOOLEDNORMAL_IGO_AMBIGUOUS_GGCGTCAT_S61_R1_001.fastq.gz", + "/FASTQ/Project_POOLEDNORMALS/Sample_MOUSEPOOLEDNORMAL_IGO_AMBIGUOUS_GGCGTCAT/MOUSEPOOLEDNORMAL_IGO_AMBIGUOUS_GGCGTCAT_S61_R2_001.fastq.gz" + ], + "projectId": "REQUESTAFTERUPDATE" +} diff --git a/service/src/test/resources/data/incoming_requests/mocked_request6_cmopt_swap.json b/service/src/test/resources/data/incoming_requests/mocked_request6_cmopt_swap.json new file mode 100644 index 00000000..6604808b --- /dev/null +++ b/service/src/test/resources/data/incoming_requests/mocked_request6_cmopt_swap.json @@ -0,0 +1,244 @@ +{ + "requestId": "REQUESTBEFOREUPDATE_A", + "recipe": "GENESET101_BAITS", + "projectManagerName": "Bar, Foo", + "piEmail": "request1pi@mskcc.org", + "labHeadName": "Foo Bar", + "labHeadEmail": "request1pi@mskcc.org", + "investigatorName": "John Smith", + "investigatorEmail": "smithj@mskcc.org", + "dataAnalystName": "Poin Dexter", + "dataAnalystEmail": "dexterp@mskcc.org", + "otherContactEmails": "dexterp@mskcc.org", + "dataAccessEmails": "", + "qcAccessEmails": "", + "isCmoRequest": true, + "bicAnalysis": false, + "samples": [ + { + "cmoSampleName": "C-CMOPTA1-X001-d", + "sampleName": "XXX002_P3_12345_L1", + "cmoSampleClass": "Primary", + "oncoTreeCode": "CLL", + "collectionYear": "", + "tubeId": "", + "qcReports": [], + "libraries": [ + { + "barcodeId": "IDT29", + "barcodeIndex": "ATTGAGGA", + "libraryIgoId": "REQUESTBEFOREUPDATE_A_1_1_1_1", + "libraryVolume": 35.0, + "libraryConcentrationNgul": 34.8, + "captureConcentrationNm": "11.49425287356322", + "captureInputNg": "400.0", + "captureName": "Pool-REQUESTBEFOREUPDATE_A-Tube7_1", + "runs": [ + { + "runMode": "HiSeq High Output", + "runId": "RUNID_0123", + "flowCellId": "X5KL2KKAY", + "readLength": "", + "runDate": "2018-06-05", + "flowCellLanes": [ + 5 + ], + "fastqs": [ + "/FASTQ/Project_REQUESTBEFOREUPDATE_A/Sample_XXX002_P3_12345_L1_IGO_REQUESTBEFOREUPDATE_A_1/XXX002_P3_12345_L1_IGO_REQUESTBEFOREUPDATE_A_1_S82_R1_001.fastq.gz", + "/FASTQ/Project_REQUESTBEFOREUPDATE_A/Sample_XXX002_P3_12345_L1_IGO_REQUESTBEFOREUPDATE_A_1/XXX002_P3_12345_L1_IGO_REQUESTBEFOREUPDATE_A_1_S82_R2_001.fastq.gz" + ] + } + ] + } + ], + "cmoPatientId": "C-CMOPTA1", + "igoId": "REQUESTBEFOREUPDATE_A_1", + "investigatorSampleId": "XXX002_P3_12345_L1", + "species": "Human", + "sex": "F", + "tumorOrNormal": "Tumor", + "preservation": "Frozen", + "specimenType": "PDX", + "sampleOrigin": "Tissue", + "tissueLocation": "", + "baitSet": "GENESET101_BAITS", + "cmoSampleIdFields": { + "naToExtract": "", + "normalizedPatientId": "MRN_REDACTED", + "recipe": "GENESET101_BAITS" + } + }, + { + "cmoSampleName": "C-CMOPTA1-N001-d", + "sampleName": "01-0012345a", + "cmoSampleClass": "Normal", + "oncoTreeCode": "CLL", + "collectionYear": "", + "tubeId": "", + "qcReports": [], + "libraries": [ + { + "barcodeId": "TNG41", + "barcodeIndex": "CGACTGGA", + "libraryIgoId": "REQUESTBEFOREUPDATE_A_2_1_1_1", + "libraryVolume": 35.0, + "libraryConcentrationNgul": 33.5, + "captureConcentrationNm": "5.074626865671642", + "captureInputNg": "170.0", + "captureName": "Pool-REQUESTBEFOREUPDATE_A-Tube7_1", + "runs": [ + { + "runMode": "HiSeq High Output", + "runId": "RUNID_0123", + "flowCellId": "X5KL2KKAY", + "readLength": "", + "runDate": "2018-06-05", + "flowCellLanes": [ + 5 + ], + "fastqs": [ + "/FASTQ/Project_REQUESTBEFOREUPDATE_A/Sample_01-0012345a_IGO_REQUESTBEFOREUPDATE_A_2/01-0012345a_IGO_REQUESTBEFOREUPDATE_A_2_S83_R2_001.fastq.gz", + "/FASTQ/Project_REQUESTBEFOREUPDATE_A/Sample_01-0012345a_IGO_REQUESTBEFOREUPDATE_A_2/01-0012345a_IGO_REQUESTBEFOREUPDATE_A_2_S83_R1_001.fastq.gz" + ] + } + ] + } + ], + "cmoPatientId": "C-CMOPTA1", + "igoId": "REQUESTBEFOREUPDATE_A_2", + "investigatorSampleId": "01-0012345a", + "species": "Human", + "sex": "F", + "tumorOrNormal": "Normal", + "preservation": "Frozen", + "specimenType": "Blood", + "sampleOrigin": "Whole Blood", + "tissueLocation": "", + "baitSet": "GENESET101_BAITS", + "cmoSampleIdFields": { + "naToExtract": "", + "normalizedPatientId": "MRN_REDACTED", + "recipe": "GENESET101_BAITS" + } + }, + { + "cmoSampleName": "C-CMOPTB1-X001-d", + "sampleName": "XXX002_P1_12348a_R_43", + "cmoSampleClass": "Primary", + "oncoTreeCode": "COAD", + "collectionYear": "", + "tubeId": "", + "qcReports": [], + "libraries": [ + { + "barcodeId": "TNG53", + "barcodeIndex": "GCTCGGTA", + "libraryIgoId": "REQUESTBEFOREUPDATE_A_3_1_1_1", + "libraryVolume": 35.0, + "libraryConcentrationNgul": 35.2, + "captureConcentrationNm": "11.363636363636363", + "captureInputNg": "400.0", + "captureName": "Pool-REQUESTBEFOREUPDATE_A-Tube7_1", + "runs": [ + { + "runMode": "HiSeq High Output", + "runId": "RUNID_0123", + "flowCellId": "X5KL2KKAY", + "readLength": "", + "runDate": "2018-06-05", + "flowCellLanes": [ + 5 + ], + "fastqs": [ + "/FASTQ/Project_REQUESTBEFOREUPDATE_A/Sample_XXX002_P1_12348a_R_43_IGO_REQUESTBEFOREUPDATE_A_3/XXX002_P1_12348a_R_43_IGO_REQUESTBEFOREUPDATE_A_3_S84_R1_001.fastq.gz", + "/FASTQ/Project_REQUESTBEFOREUPDATE_A/Sample_XXX002_P1_12348a_R_43_IGO_REQUESTBEFOREUPDATE_A_3/XXX002_P1_12348a_R_43_IGO_REQUESTBEFOREUPDATE_A_3_S84_R2_001.fastq.gz" + ] + } + ] + } + ], + "cmoPatientId": "C-CMOPTB1", + "igoId": "REQUESTBEFOREUPDATE_A_3", + "investigatorSampleId": "XXX002_P1_12348a_R_43", + "species": "Human", + "sex": "M", + "tumorOrNormal": "Tumor", + "preservation": "Frozen", + "specimenType": "PDX", + "sampleOrigin": "Tissue", + "tissueLocation": "", + "baitSet": "GENESET101_BAITS", + "cmoSampleIdFields": { + "naToExtract": "", + "normalizedPatientId": "MRN_REDACTED", + "recipe": "GENESET101_BAITS" + } + }, + { + "cmoSampleName": "C-CMOPTB1-N001-d", + "sampleName": "01-XXXXXXXa", + "cmoSampleClass": "Normal", + "oncoTreeCode": "COAD", + "collectionYear": "", + "tubeId": "", + "qcReports": [], + "libraries": [ + { + "barcodeId": "TNG65", + "barcodeIndex": "TGGAACAA", + "libraryIgoId": "REQUESTBEFOREUPDATE_A_4_1_1_1", + "libraryVolume": 35.0, + "libraryConcentrationNgul": 34.1, + "captureConcentrationNm": "4.9853372434017595", + "captureInputNg": "170.0", + "captureName": "Pool-REQUESTBEFOREUPDATE_A-Tube7_1", + "runs": [ + { + "runMode": "HiSeq High Output", + "runId": "RUNID_0123", + "flowCellId": "X5KL2KKAY", + "readLength": "", + "runDate": "2018-06-05", + "flowCellLanes": [ + 5 + ], + "fastqs": [ + "/FASTQ/Project_REQUESTBEFOREUPDATE_A/Sample_01-XXXXXXXa_IGO_REQUESTBEFOREUPDATE_A_4/01-XXXXXXXa_IGO_REQUESTBEFOREUPDATE_A_4_S85_R1_001.fastq.gz", + "/FASTQ/Project_REQUESTBEFOREUPDATE_A/Sample_01-XXXXXXXa_IGO_REQUESTBEFOREUPDATE_A_4/01-XXXXXXXa_IGO_REQUESTBEFOREUPDATE_A_4_S85_R2_001.fastq.gz" + ] + } + ] + } + ], + "cmoPatientId": "C-CMOPTB1", + "igoId": "REQUESTBEFOREUPDATE_A_4", + "investigatorSampleId": "01-XXXXXXXa", + "species": "Human", + "sex": "M", + "tumorOrNormal": "Normal", + "preservation": "Frozen", + "specimenType": "Blood", + "sampleOrigin": "Whole Blood", + "tissueLocation": "", + "baitSet": "GENESET101_BAITS", + "cmoSampleIdFields": { + "naToExtract": "", + "normalizedPatientId": "MRN_REDACTED", + "recipe": "GENESET101_BAITS" + } + } + ], + "pooledNormals": [ + "/FASTQ/Project_POOLEDNORMALS/Sample_FFPEPOOLEDNORMAL_IGO_GENESET101_TAGCTTGA/FFPEPOOLEDNORMAL_IGO_GENESET101_TAGCTTGA_S23_R1_001.fastq.gz", + "/FASTQ/Project_POOLEDNORMALS/Sample_FFPEPOOLEDNORMAL_IGO_GENESET101_TAGCTTGA/FFPEPOOLEDNORMAL_IGO_GENESET101_TAGCTTGA_S23_R2_001.fastq.gz", + "/FASTQ/Project_POOLEDNORMALS/Sample_FROZENPOOLEDNORMAL_IGO_AMBIGUOUS_TTAGGCTG/FROZENPOOLEDNORMAL_IGO_AMBIGUOUS_TTAGGCTG_S86_R1_001.fastq.gz", + "/FASTQ/Project_POOLEDNORMALS/Sample_FROZENPOOLEDNORMAL_IGO_AMBIGUOUS_TTAGGCTG/FROZENPOOLEDNORMAL_IGO_AMBIGUOUS_TTAGGCTG_S86_R2_001.fastq.gz", + "/FASTQ/Project_POOLEDNORMALS/Sample_FROZENPOOLEDNORMAL_IGO_HEMESET_v1_TTAGGCTG/FROZENPOOLEDNORMAL_IGO_HEMESET_v1_TTAGGCTG_S147_R1_001.fastq.gz", + "/FASTQ/Project_POOLEDNORMALS/Sample_FROZENPOOLEDNORMAL_IGO_HEMESET_v1_TTAGGCTG/FROZENPOOLEDNORMAL_IGO_HEMESET_v1_TTAGGCTG_S147_R2_001.fastq.gz", + "/FASTQ/Project_POOLEDNORMALS/Sample_FROZENPOOLEDNORMAL_IGO_GENESET101_TTAGGCTG/FROZENPOOLEDNORMAL_IGO_GENESET101_TTAGGCTG_S196_R1_001.fastq.gz", + "/FASTQ/Project_POOLEDNORMALS/Sample_FROZENPOOLEDNORMAL_IGO_GENESET101_TTAGGCTG/FROZENPOOLEDNORMAL_IGO_GENESET101_TTAGGCTG_S196_R2_001.fastq.gz", + "/FASTQ/Project_POOLEDNORMALS/Sample_MOUSEPOOLEDNORMAL_IGO_AMBIGUOUS_GGCGTCAT/MOUSEPOOLEDNORMAL_IGO_AMBIGUOUS_GGCGTCAT_S61_R1_001.fastq.gz", + "/FASTQ/Project_POOLEDNORMALS/Sample_MOUSEPOOLEDNORMAL_IGO_AMBIGUOUS_GGCGTCAT/MOUSEPOOLEDNORMAL_IGO_AMBIGUOUS_GGCGTCAT_S61_R2_001.fastq.gz" + ], + "projectId": "REQUESTBEFOREUPDATE" +} diff --git a/service/src/test/resources/data/mocked_request_data_details.txt b/service/src/test/resources/data/mocked_request_data_details.txt index bd3e3cb6..a25b8203 100644 --- a/service/src/test/resources/data/mocked_request_data_details.txt +++ b/service/src/test/resources/data/mocked_request_data_details.txt @@ -14,3 +14,5 @@ mockPublishedRequest3JsonDataPooledNormals published_requests/outgoing_mocked_re mockPublishedRequest1JsonNullValues published_requests/outgoing_mocked_request1_null_values.json Mock published request with null values. mockPublishedRequest4JsonNullOrEmptyValues published_requests/outgoing_mocked_request4_null_or_empty_values.json Mock published request with null or empty values. mockUpdatedPublishedRequest1Metadata other_mocked_data/outgoing_mocked_request1_updated_metadata.json Mock published request metadata json with updates. +mockIncomingRequestPreCmoPatientSwap incoming_requests/mocked_request6_cmopt_swap.json Mock incoming request json for pre-CMO patient ID swap testing. +mockIncomingRequestPostCmoPatientSwap incoming_requests/mocked_request6_cmopt_after_swap.json Mock incoming request json for post-CMO patient ID swap testing. diff --git a/service/src/test/resources/data/published_requests/outgoing_mocked_request1_complete_tumor_normal.json b/service/src/test/resources/data/published_requests/outgoing_mocked_request1_complete_tumor_normal.json index 4fc5a122..bc2eda45 100644 --- a/service/src/test/resources/data/published_requests/outgoing_mocked_request1_complete_tumor_normal.json +++ b/service/src/test/resources/data/published_requests/outgoing_mocked_request1_complete_tumor_normal.json @@ -96,7 +96,7 @@ { "metaDbSampleId": "afe75123-8756-11eb-8f14-acde48001122", "metaDbPatientId": "6cc9f242-875a-11eb-ae91-acde48001122", - "cmoSampleName": "C-MP789JR-N001-d", + "cmoSampleName": "C-MP789JR-N002-d", "sampleName": "01-0012345a", "sampleType": "Normal", "oncotreeCode": "CLL", @@ -250,7 +250,7 @@ { "metaDbSampleId": "afe7519c-8756-11eb-ac58-acde48001122", "metaDbPatientId": "6cc9f745-875a-11eb-a134-acde48001122", - "cmoSampleName": "C-8DH24X-N001-d", + "cmoSampleName": "C-8DH24X-N002-d", "sampleName": "01-XXXXXXXa", "sampleType": "Normal", "oncotreeCode": "COAD", diff --git a/service/src/test/resources/data/published_requests/outgoing_mocked_request1_null_values.json b/service/src/test/resources/data/published_requests/outgoing_mocked_request1_null_values.json index a04bfc72..a1423e46 100644 --- a/service/src/test/resources/data/published_requests/outgoing_mocked_request1_null_values.json +++ b/service/src/test/resources/data/published_requests/outgoing_mocked_request1_null_values.json @@ -96,7 +96,7 @@ { "metaDbSampleId": "afe75123-8756-11eb-8f14-acde48001122", "metaDbPatientId": "6cc9f242-875a-11eb-ae91-acde48001122", - "cmoSampleName": "C-MP789JR-N001-d", + "cmoSampleName": "C-MP789JR-N002-d", "sampleName": "01-0012345a", "sampleType": "Normal", "oncotreeCode": "CLL", @@ -250,7 +250,7 @@ { "metaDbSampleId": "afe7519c-8756-11eb-ac58-acde48001122", "metaDbPatientId": "6cc9f745-875a-11eb-a134-acde48001122", - "cmoSampleName": "C-8DH24X-N001-d", + "cmoSampleName": "C-8DH24X-N002-d", "sampleName": "01-XXXXXXXa", "sampleType": "Normal", "oncotreeCode": "COAD", diff --git a/service/src/test/resources/data/published_requests/outgoing_mocked_request4_null_or_empty_values.json b/service/src/test/resources/data/published_requests/outgoing_mocked_request4_null_or_empty_values.json index bea226eb..4f300f92 100644 --- a/service/src/test/resources/data/published_requests/outgoing_mocked_request4_null_or_empty_values.json +++ b/service/src/test/resources/data/published_requests/outgoing_mocked_request4_null_or_empty_values.json @@ -83,7 +83,7 @@ } ], "additionalProperties": { - "isCmoSample": "true", + "isCmoSample": "", "igoRequestId": "MOCKREQUEST1_B" }, "cmoSampleIdFields": { @@ -95,7 +95,7 @@ { "metaDbSampleId": "afe75123-8756-11eb-8f14-acde48001122", "metaDbPatientId": "6cc9f242-875a-11eb-ae91-acde48001122", - "cmoSampleName": "C-MP789JR-N001-d", + "cmoSampleName": "C-MP789JR-N002-d", "sampleName": "01-0012345a", "sampleType": "Normal", "oncotreeCode": "CLL", @@ -160,7 +160,7 @@ } ], "additionalProperties": { - "isCmoSample": "true", + "isCmoSample": "null", "igoRequestId": "MOCKREQUEST1_B" }, "cmoSampleIdFields": { @@ -237,7 +237,7 @@ } ], "additionalProperties": { - "isCmoSample": "true", + "isCmoSample": null, "igoRequestId": "MOCKREQUEST1_B" }, "cmoSampleIdFields": { @@ -249,7 +249,7 @@ { "metaDbSampleId": "afe7519c-8756-11eb-ac58-acde48001122", "metaDbPatientId": "6cc9f745-875a-11eb-a134-acde48001122", - "cmoSampleName": "C-8DH24X-N001-d", + "cmoSampleName": "C-8DH24X-N002-d", "sampleName": "01-XXXXXXXa", "sampleType": "Normal", "oncotreeCode": "COAD", diff --git a/src/main/resources/application.properties.EXAMPLE b/src/main/resources/application.properties.EXAMPLE index 7cd0971a..1be7caf4 100644 --- a/src/main/resources/application.properties.EXAMPLE +++ b/src/main/resources/application.properties.EXAMPLE @@ -33,6 +33,7 @@ metadb.dmp_new_sample_topic= # request-reply topics request_reply.patient_samples_topic= request_reply.crdb_mapping_topic= +request_reply.cmo_label_generator_topic= # cmo patient id correction topics metadb.correct_cmoptid_topic=