diff --git a/.circleci/config.yml b/.circleci/config.yml
index 0fe18591..b8e15575 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -4,7 +4,7 @@ jobs:
run_checkstyle:
working_directory: /tmp/repos/smile-server
machine:
- image: ubuntu-2004:202201-02
+ image: ubuntu-2004:2024.05.1
steps:
- checkout
- run:
diff --git a/model/pom.xml b/model/pom.xml
index d161feff..b277c46c 100644
--- a/model/pom.xml
+++ b/model/pom.xml
@@ -11,11 +11,6 @@
-
- org.springframework.boot
- spring-boot-starter-data-neo4j
- ${spring.boot.version}
-
org.neo4j
neo4j-ogm
diff --git a/model/src/main/java/org/mskcc/smile/model/PatientAlias.java b/model/src/main/java/org/mskcc/smile/model/PatientAlias.java
index bda4105a..d4ef87dd 100644
--- a/model/src/main/java/org/mskcc/smile/model/PatientAlias.java
+++ b/model/src/main/java/org/mskcc/smile/model/PatientAlias.java
@@ -1,5 +1,9 @@
package org.mskcc.smile.model;
+//import org.springframework.data.neo4j.core.schema.GeneratedValue;
+//import org.springframework.data.neo4j.core.schema.Id;
+//import org.springframework.data.neo4j.core.schema.Node;
+//import org.springframework.data.neo4j.core.schema.Relationship;
import com.fasterxml.jackson.annotation.JsonIgnore;
import java.io.Serializable;
import org.apache.commons.lang.builder.ToStringBuilder;
@@ -14,13 +18,15 @@
*/
@NodeEntity
+//@Node
public class PatientAlias implements Serializable {
@Id @GeneratedValue
private Long id;
private String value;
private String namespace;
@JsonIgnore
- @Relationship(type = "IS_ALIAS", direction = Relationship.OUTGOING)
+ //@Relationship(type = "IS_ALIAS", direction = Relationship.OUTGOING)
+ @Relationship(type = "IS_ALIAS", direction = Relationship.Direction.OUTGOING)
private SmilePatient smilePatient;
public PatientAlias() {}
diff --git a/model/src/main/java/org/mskcc/smile/model/RequestMetadata.java b/model/src/main/java/org/mskcc/smile/model/RequestMetadata.java
index 6c775387..02c9bc2e 100644
--- a/model/src/main/java/org/mskcc/smile/model/RequestMetadata.java
+++ b/model/src/main/java/org/mskcc/smile/model/RequestMetadata.java
@@ -1,5 +1,8 @@
package org.mskcc.smile.model;
+//import org.springframework.data.neo4j.core.schema.GeneratedValue;
+//import org.springframework.data.neo4j.core.schema.Id;
+//import org.springframework.data.neo4j.core.schema.Relationship;
import com.fasterxml.jackson.annotation.JsonIgnore;
import java.io.Serializable;
import org.apache.commons.lang.builder.ToStringBuilder;
@@ -14,7 +17,8 @@ public class RequestMetadata implements Serializable, Comparable, Cloneable {
@Id @GeneratedValue
@JsonIgnore
@@ -61,7 +66,8 @@ public class SampleMetadata implements Serializable, Comparable,
private Map cmoSampleIdFields;
@Convert(MapStringConverter.class)
private Map additionalProperties = new HashMap<>();
- @Relationship(type = "HAS_STATUS", direction = Relationship.OUTGOING)
+ //@Relationship(type = "HAS_STATUS", direction = Relationship.OUTGOING)
+ @Relationship(type = "HAS_STATUS", direction = Relationship.Direction.OUTGOING)
private Status status;
public SampleMetadata() {}
diff --git a/model/src/main/java/org/mskcc/smile/model/SmilePatient.java b/model/src/main/java/org/mskcc/smile/model/SmilePatient.java
index 177c9b53..0effadc7 100644
--- a/model/src/main/java/org/mskcc/smile/model/SmilePatient.java
+++ b/model/src/main/java/org/mskcc/smile/model/SmilePatient.java
@@ -12,6 +12,11 @@
import org.neo4j.ogm.annotation.typeconversion.Convert;
import org.neo4j.ogm.id.UuidStrategy;
import org.neo4j.ogm.typeconversion.UuidStringConverter;
+//import org.springframework.data.neo4j.core.schema.GeneratedValue;
+//import org.springframework.data.neo4j.core.schema.Id;
+//import org.springframework.data.neo4j.core.schema.Node;
+//import org.springframework.data.neo4j.core.schema.Relationship;
+//import org.springframework.data.neo4j.core.support.UUIDStringGenerator;
/**
*
@@ -19,13 +24,17 @@
*/
@NodeEntity(label = "Patient")
+//@Node("Patient")
public class SmilePatient implements Serializable {
@Id @GeneratedValue(strategy = UuidStrategy.class)
+ //@Id @GeneratedValue(UUIDStringGenerator.class)
@Convert(UuidStringConverter.class)
private UUID smilePatientId;
- @Relationship(type = "HAS_SAMPLE", direction = Relationship.OUTGOING)
+ //@Relationship(type = "HAS_SAMPLE", direction = Relationship.OUTGOING)
+ @Relationship(type = "HAS_SAMPLE", direction = Relationship.Direction.OUTGOING)
private List smileSampleList;
- @Relationship(type = "IS_ALIAS", direction = Relationship.INCOMING)
+ //@Relationship(type = "IS_ALIAS", direction = Relationship.INCOMING)
+ @Relationship(type = "IS_ALIAS", direction = Relationship.Direction.INCOMING)
private List patientAliases;
public SmilePatient() {}
diff --git a/model/src/main/java/org/mskcc/smile/model/SmileProject.java b/model/src/main/java/org/mskcc/smile/model/SmileProject.java
index ac0020b6..69aacca9 100644
--- a/model/src/main/java/org/mskcc/smile/model/SmileProject.java
+++ b/model/src/main/java/org/mskcc/smile/model/SmileProject.java
@@ -7,13 +7,20 @@
import org.neo4j.ogm.annotation.Id;
import org.neo4j.ogm.annotation.NodeEntity;
import org.neo4j.ogm.annotation.Relationship;
+//import org.springframework.data.neo4j.core.schema.GeneratedValue;
+//import org.springframework.data.neo4j.core.schema.Id;
+//import org.springframework.data.neo4j.core.schema.Node;
+//import org.springframework.data.neo4j.core.schema.Relationship;
+//import org.springframework.data.neo4j.core.support.UUIDStringGenerator;
@NodeEntity(label = "Project")
+//@Node("Project")
public class SmileProject implements Serializable {
@Id
private String igoProjectId;
private String namespace;
- @Relationship(type = "HAS_REQUEST", direction = Relationship.OUTGOING)
+ //@Relationship(type = "HAS_REQUEST", direction = Relationship.OUTGOING)
+ @Relationship(type = "HAS_REQUEST", direction = Relationship.Direction.OUTGOING)
private List requestList;
public SmileProject() {}
diff --git a/model/src/main/java/org/mskcc/smile/model/SmileRequest.java b/model/src/main/java/org/mskcc/smile/model/SmileRequest.java
index 45ed1f5b..0da2f9d8 100644
--- a/model/src/main/java/org/mskcc/smile/model/SmileRequest.java
+++ b/model/src/main/java/org/mskcc/smile/model/SmileRequest.java
@@ -20,12 +20,18 @@
import org.neo4j.ogm.annotation.typeconversion.Convert;
import org.neo4j.ogm.id.UuidStrategy;
import org.neo4j.ogm.typeconversion.UuidStringConverter;
+//import org.springframework.data.neo4j.core.schema.GeneratedValue;
+//import org.springframework.data.neo4j.core.schema.Id;
+//import org.springframework.data.neo4j.core.schema.Node;
+//import org.springframework.data.neo4j.core.schema.Relationship;
+//import org.springframework.data.neo4j.core.support.UUIDStringGenerator;
/**
*
* @author ochoaa
*/
@NodeEntity(label = "Request")
+//@Node("Request")
@JsonIgnoreProperties({"samples"})
@JsonInclude(JsonInclude.Include.NON_NULL)
public class SmileRequest implements Serializable {
@@ -33,14 +39,18 @@ public class SmileRequest implements Serializable {
private final ObjectMapper mapper = new ObjectMapper();
@Id @GeneratedValue(strategy = UuidStrategy.class)
+ //@Id @GeneratedValue(UUIDStringGenerator.class)
@Convert(UuidStringConverter.class)
private UUID smileRequestId;
- @Relationship(type = "HAS_SAMPLE", direction = Relationship.OUTGOING)
+ //@Relationship(type = "HAS_SAMPLE", direction = Relationship.OUTGOING)
+ @Relationship(type = "HAS_SAMPLE", direction = Relationship.Direction.OUTGOING)
private List smileSampleList;
- @Relationship(type = "HAS_REQUEST", direction = Relationship.INCOMING)
+ //@Relationship(type = "HAS_REQUEST", direction = Relationship.INCOMING)
+ @Relationship(type = "HAS_REQUEST", direction = Relationship.Direction.INCOMING)
private SmileProject smileProject;
@JsonIgnore
- @Relationship(type = "HAS_METADATA", direction = Relationship.OUTGOING)
+ //@Relationship(type = "HAS_METADATA", direction = Relationship.OUTGOING)
+ @Relationship(type = "HAS_METADATA", direction = Relationship.Direction.OUTGOING)
private List requestMetadataList;
@JsonIgnore
private String namespace;
diff --git a/model/src/main/java/org/mskcc/smile/model/SmileSample.java b/model/src/main/java/org/mskcc/smile/model/SmileSample.java
index ced5e37d..9d74523b 100644
--- a/model/src/main/java/org/mskcc/smile/model/SmileSample.java
+++ b/model/src/main/java/org/mskcc/smile/model/SmileSample.java
@@ -16,20 +16,31 @@
import org.neo4j.ogm.annotation.typeconversion.Convert;
import org.neo4j.ogm.id.UuidStrategy;
import org.neo4j.ogm.typeconversion.UuidStringConverter;
+//import org.springframework.data.neo4j.core.schema.GeneratedValue;
+//import org.springframework.data.neo4j.core.schema.Id;
+//import org.springframework.data.neo4j.core.schema.Node;
+//import org.springframework.data.neo4j.core.schema.Relationship;
+//import org.springframework.data.neo4j.core.support.UUIDStringGenerator;
@NodeEntity(label = "Sample")
+//@Node("Sample")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class SmileSample implements Serializable {
@Id @GeneratedValue(strategy = UuidStrategy.class)
+ //@Id @GeneratedValue(UUIDStringGenerator.class)
@Convert(UuidStringConverter.class)
private UUID smileSampleId;
- @Relationship(type = "IS_ALIAS", direction = Relationship.INCOMING)
+ //@Relationship(type = "IS_ALIAS", direction = Relationship.INCOMING)
+ @Relationship(type = "IS_ALIAS", direction = Relationship.Direction.INCOMING)
private List sampleAliases;
- @Relationship(type = "HAS_SAMPLE", direction = Relationship.INCOMING)
+ //@Relationship(type = "HAS_SAMPLE", direction = Relationship.INCOMING)
+ @Relationship(type = "HAS_SAMPLE", direction = Relationship.Direction.INCOMING)
private SmilePatient patient;
- @Relationship(type = "HAS_METADATA", direction = Relationship.OUTGOING)
+ //@Relationship(type = "HAS_METADATA", direction = Relationship.OUTGOING)
+ @Relationship(type = "HAS_METADATA", direction = Relationship.Direction.OUTGOING)
private List sampleMetadataList;
- @Relationship(type = "HAS_TEMPO", direction = Relationship.OUTGOING)
+ //@Relationship(type = "HAS_TEMPO", direction = Relationship.OUTGOING)
+ @Relationship(type = "HAS_TEMPO", direction = Relationship.Direction.OUTGOING)
private Tempo tempo;
private String sampleClass;
private String sampleCategory;
diff --git a/model/src/main/java/org/mskcc/smile/model/Status.java b/model/src/main/java/org/mskcc/smile/model/Status.java
index ff97202e..4c49e232 100644
--- a/model/src/main/java/org/mskcc/smile/model/Status.java
+++ b/model/src/main/java/org/mskcc/smile/model/Status.java
@@ -11,10 +11,14 @@
import org.neo4j.ogm.annotation.GeneratedValue;
import org.neo4j.ogm.annotation.Id;
import org.neo4j.ogm.annotation.NodeEntity;
+//import org.springframework.data.neo4j.core.schema.GeneratedValue;
+//import org.springframework.data.neo4j.core.schema.Id;
+//import org.springframework.data.neo4j.core.schema.Node;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
@NodeEntity(label = "Status")
+//@Node("Status")
public class Status implements Serializable {
@Id @GeneratedValue
diff --git a/model/src/main/java/org/mskcc/smile/model/internal/CrdbMappingModel.java b/model/src/main/java/org/mskcc/smile/model/internal/CrdbMappingModel.java
index 74c8dd58..067bd804 100644
--- a/model/src/main/java/org/mskcc/smile/model/internal/CrdbMappingModel.java
+++ b/model/src/main/java/org/mskcc/smile/model/internal/CrdbMappingModel.java
@@ -2,10 +2,10 @@
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Id;
import java.io.Serializable;
import java.util.ArrayList;
-import javax.persistence.Entity;
-import javax.persistence.Id;
import org.apache.commons.lang.builder.ToStringBuilder;
@Entity
diff --git a/model/src/main/java/org/mskcc/smile/model/tempo/Cohort.java b/model/src/main/java/org/mskcc/smile/model/tempo/Cohort.java
index 55c78263..324fc2b2 100644
--- a/model/src/main/java/org/mskcc/smile/model/tempo/Cohort.java
+++ b/model/src/main/java/org/mskcc/smile/model/tempo/Cohort.java
@@ -24,9 +24,11 @@ public class Cohort implements Serializable {
@Id @GeneratedValue
private Long id;
private String cohortId;
- @Relationship(type = "HAS_COHORT_COMPLETE", direction = Relationship.OUTGOING)
+ //@Relationship(type = "HAS_COHORT_COMPLETE", direction = Relationship.OUTGOING)
+ @Relationship(type = "HAS_COHORT_COMPLETE", direction = Relationship.Direction.OUTGOING)
private List cohortCompleteList;
- @Relationship(type = "HAS_COHORT_SAMPLE", direction = Relationship.OUTGOING)
+ //@Relationship(type = "HAS_COHORT_SAMPLE", direction = Relationship.OUTGOING)
+ @Relationship(type = "HAS_COHORT_SAMPLE", direction = Relationship.Direction.OUTGOING)
private List cohortSamples;
public Cohort() {}
diff --git a/model/src/main/java/org/mskcc/smile/model/tempo/Tempo.java b/model/src/main/java/org/mskcc/smile/model/tempo/Tempo.java
index 197c3d5d..6b1eec80 100644
--- a/model/src/main/java/org/mskcc/smile/model/tempo/Tempo.java
+++ b/model/src/main/java/org/mskcc/smile/model/tempo/Tempo.java
@@ -28,13 +28,17 @@ public class Tempo implements Serializable {
private Boolean billed;
private String billedBy;
private String costCenter;
- @Relationship(type = "HAS_EVENT", direction = Relationship.OUTGOING)
+ //@Relationship(type = "HAS_EVENT", direction = Relationship.OUTGOING)
+ @Relationship(type = "HAS_EVENT", direction = Relationship.Direction.OUTGOING)
private List bamCompleteEvents;
- @Relationship(type = "HAS_EVENT", direction = Relationship.OUTGOING)
+ //@Relationship(type = "HAS_EVENT", direction = Relationship.OUTGOING)
+ @Relationship(type = "HAS_EVENT", direction = Relationship.Direction.OUTGOING)
private List qcCompleteEvents;
- @Relationship(type = "HAS_EVENT", direction = Relationship.OUTGOING)
+ //@Relationship(type = "HAS_EVENT", direction = Relationship.OUTGOING)
+ @Relationship(type = "HAS_EVENT", direction = Relationship.Direction.OUTGOING)
private List mafCompleteEvents;
- @Relationship(type = "HAS_TEMPO", direction = Relationship.INCOMING)
+ //@Relationship(type = "HAS_TEMPO", direction = Relationship.INCOMING)
+ @Relationship(type = "HAS_TEMPO", direction = Relationship.Direction.INCOMING)
private SmileSample sample;
public Tempo() {}
diff --git a/persistence/src/main/java/org/mskcc/smile/persistence/neo4j/CohortCompleteRepository.java b/persistence/src/main/java/org/mskcc/smile/persistence/neo4j/CohortCompleteRepository.java
index e5f14a89..db581f26 100644
--- a/persistence/src/main/java/org/mskcc/smile/persistence/neo4j/CohortCompleteRepository.java
+++ b/persistence/src/main/java/org/mskcc/smile/persistence/neo4j/CohortCompleteRepository.java
@@ -1,5 +1,6 @@
package org.mskcc.smile.persistence.neo4j;
+//import org.springframework.data.neo4j.repository.query.Query;
import java.util.List;
import org.mskcc.smile.model.tempo.Cohort;
import org.mskcc.smile.model.tempo.CohortComplete;
diff --git a/persistence/src/main/java/org/mskcc/smile/persistence/neo4j/SmilePatientRepository.java b/persistence/src/main/java/org/mskcc/smile/persistence/neo4j/SmilePatientRepository.java
index c9e430c2..ca0b6c4b 100644
--- a/persistence/src/main/java/org/mskcc/smile/persistence/neo4j/SmilePatientRepository.java
+++ b/persistence/src/main/java/org/mskcc/smile/persistence/neo4j/SmilePatientRepository.java
@@ -1,5 +1,6 @@
package org.mskcc.smile.persistence.neo4j;
+//import org.springframework.data.neo4j.repository.query.Query;
import java.util.List;
import java.util.UUID;
import org.mskcc.smile.model.PatientAlias;
diff --git a/persistence/src/main/java/org/mskcc/smile/persistence/neo4j/SmileRequestRepository.java b/persistence/src/main/java/org/mskcc/smile/persistence/neo4j/SmileRequestRepository.java
index cef94d3e..0d7410de 100644
--- a/persistence/src/main/java/org/mskcc/smile/persistence/neo4j/SmileRequestRepository.java
+++ b/persistence/src/main/java/org/mskcc/smile/persistence/neo4j/SmileRequestRepository.java
@@ -1,5 +1,6 @@
package org.mskcc.smile.persistence.neo4j;
+//import org.springframework.data.neo4j.repository.query.Query;
import java.util.List;
import org.mskcc.smile.model.RequestMetadata;
import org.mskcc.smile.model.SmileRequest;
diff --git a/persistence/src/main/java/org/mskcc/smile/persistence/neo4j/SmileSampleRepository.java b/persistence/src/main/java/org/mskcc/smile/persistence/neo4j/SmileSampleRepository.java
index 5706e516..f49d9789 100644
--- a/persistence/src/main/java/org/mskcc/smile/persistence/neo4j/SmileSampleRepository.java
+++ b/persistence/src/main/java/org/mskcc/smile/persistence/neo4j/SmileSampleRepository.java
@@ -1,5 +1,6 @@
package org.mskcc.smile.persistence.neo4j;
+//import org.springframework.data.neo4j.repository.query.Query;
import java.util.List;
import java.util.UUID;
import org.mskcc.smile.model.SampleAlias;
@@ -121,9 +122,10 @@ void createSampleRequestRelationship(@Param("smileSampleId") UUID smileSampleId,
@Param("smileRequestId") UUID smileRequestId);
@Query("MATCH (sm: SampleMetadata)-[:HAS_STATUS]->(st: Status) "
- + "WHERE ID(sm) = $smId "
- + "RETURN st")
- Status findStatusForSampleMetadataById(@Param("smId") Long smId);
+ + "WHERE sm.primaryId = $primaryId AND sm.importDate = $importDate "
+ + "RETURN st LIMIT 1")
+ Status findStatusForSampleMetadataById(@Param("primaryId") String primaryId,
+ @Param("importDate") String importDate);
@Query("MATCH (s: Sample {smileSampleId: $smileSampleId}) "
+ "SET s.revisable = $revisable "
diff --git a/persistence/src/main/java/org/mskcc/smile/persistence/neo4j/TempoRepository.java b/persistence/src/main/java/org/mskcc/smile/persistence/neo4j/TempoRepository.java
index d45a77a3..ea77e21d 100644
--- a/persistence/src/main/java/org/mskcc/smile/persistence/neo4j/TempoRepository.java
+++ b/persistence/src/main/java/org/mskcc/smile/persistence/neo4j/TempoRepository.java
@@ -1,5 +1,6 @@
package org.mskcc.smile.persistence.neo4j;
+//import org.springframework.data.neo4j.repository.query.Query;
import java.util.List;
import java.util.UUID;
import org.mskcc.smile.model.tempo.BamComplete;
diff --git a/pom.xml b/pom.xml
index 63672b6f..3e997914 100644
--- a/pom.xml
+++ b/pom.xml
@@ -19,7 +19,7 @@
org.springframework.boot
spring-boot-starter-parent
- 2.3.3.RELEASE
+ 3.3.0
@@ -37,21 +37,21 @@
- 1.8
- 1.8
- 5.2.6.RELEASE
- 2.3.3.RELEASE
- 2.11.2
- 3.2.14
- 5.3.2
- 4.4.9
- 1.17.0
+ 21
+ 3.11.0
+ 5.3.5.RELEASE
+ 3.3.0
+ 2.17.2
+ 4.0.11
+ 5.9.1
+ 5.24.0
+ 1.20.1
com.github.mskcc
- 1.4.1.RELEASE
+ java-v21-beta-2
com.github.mskcc
- 1.4.1.RELEASE
+ java-v21-beta-2
v2.3
@@ -76,14 +76,14 @@
${spring.boot.version}
-
+
-
+
com.h2database
h2
-
+
org.neo4j.driver
neo4j-java-driver
@@ -128,6 +128,28 @@
spring-boot-starter-data-jpa
${spring.boot.version}
+
+
+ org.neo4j
+ neo4j-ogm-spring-boot-starter
+ 1.1.0
+
+
+
+ jakarta.persistence
+ jakarta.persistence-api
+
+
+
+
+
@@ -166,11 +188,12 @@
org.apache.maven.plugins
maven-compiler-plugin
- 3.6.1
+ ${maven.compiler.version}
-
- ${maven.compiler.version}
+
+ ${java.version}
-Xlint:deprecation
+ -parameters
diff --git a/server/pom.xml b/server/pom.xml
index f2731121..e8c8f418 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -28,7 +28,13 @@
web
${project.version}
-
+
+ org.springdoc
+ springdoc-openapi-starter-common
+ 2.6.0
+ jar
+
+
smile_server
diff --git a/server/src/main/java/org/mskcc/smile/SmileApp.java b/server/src/main/java/org/mskcc/smile/SmileApp.java
index bfb827fa..03d6055e 100644
--- a/server/src/main/java/org/mskcc/smile/SmileApp.java
+++ b/server/src/main/java/org/mskcc/smile/SmileApp.java
@@ -9,6 +9,7 @@
import org.mskcc.smile.service.RequestReplyHandlingService;
import org.mskcc.smile.service.ResearchMessageHandlingService;
import org.mskcc.smile.service.TempoMessageHandlingService;
+import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
@@ -19,13 +20,6 @@
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.data.neo4j.repository.config.EnableNeo4jRepositories;
import org.springframework.stereotype.Controller;
-import springfox.documentation.builders.ApiInfoBuilder;
-import springfox.documentation.builders.PathSelectors;
-import springfox.documentation.builders.RequestHandlerSelectors;
-import springfox.documentation.service.ApiInfo;
-import springfox.documentation.spi.DocumentationType;
-import springfox.documentation.spring.web.plugins.Docket;
-import springfox.documentation.swagger2.annotations.EnableSwagger2;
@EntityScan(basePackages = "org.mskcc.smile.model")
@EnableNeo4jRepositories(basePackages = "org.mskcc.smile.persistence.neo4j")
@@ -34,7 +28,7 @@
"org.mskcc.smile.commons.*", "org.mskcc.smile.*"})
@Controller
@EnableCaching
-@EnableSwagger2
+//@Import(SmileConfiguration.class)
public class SmileApp implements CommandLineRunner {
private static final Log LOG = LogFactory.getLog(SmileApp.class);
@@ -43,10 +37,10 @@ public class SmileApp implements CommandLineRunner {
@Autowired
private ResearchMessageHandlingService researchMessageHandlingService;
-
+
@Autowired
private ClinicalMessageHandlingService clinicalMessageHandlingService;
-
+
@Autowired
private CorrectCmoPatientHandlingService correctCmoPatientHandlingService;
@@ -60,23 +54,15 @@ public class SmileApp implements CommandLineRunner {
final CountDownLatch smileAppClose = new CountDownLatch(1);
/**
- * Docket bean for Swagger configuration.
- * @return Docket
+ * Migration from springfox-swagger to springdoc-openapi.
+ * @return
*/
@Bean
- public Docket api() {
- return new Docket(DocumentationType.SWAGGER_2)
- .useDefaultResponseMessages(true)
- .apiInfo(apiInfo())
- .select()
- .apis(RequestHandlerSelectors.any())
- .paths(PathSelectors.any())
- .build();
- }
-
- private ApiInfo apiInfo() {
- return new ApiInfoBuilder()
- .title("CMO SMILE REST API")
+ public GroupedOpenApi api() {
+ return GroupedOpenApi.builder()
+ .group("smile rest api")
+ .packagesToScan("org.mskcc.smile.web")
+ .pathsToMatch("/**")
.build();
}
diff --git a/server/src/main/java/org/mskcc/smile/SmileConfiguration.java b/server/src/main/java/org/mskcc/smile/SmileConfiguration.java
new file mode 100644
index 00000000..1c9c9493
--- /dev/null
+++ b/server/src/main/java/org/mskcc/smile/SmileConfiguration.java
@@ -0,0 +1,74 @@
+package org.mskcc.smile;
+
+////import org.springframework.data.neo4j.transaction.Neo4jTransactionManager;
+//import org.neo4j.driver.internal.SessionFactory;
+//import org.springframework.beans.factory.annotation.Value;
+//import org.springframework.context.annotation.Bean;
+//import org.springframework.context.annotation.Configuration;
+//import org.springframework.data.neo4j.core.DatabaseSelection;
+//import org.springframework.data.neo4j.core.DatabaseSelectionProvider;
+//import org.springframework.data.neo4j.core.ReactiveDatabaseSelectionProvider;
+//import org.springframework.data.neo4j.core.transaction.ReactiveNeo4jTransactionManager;
+//import org.springframework.data.neo4j.repository.config.EnableNeo4jRepositories;
+//import org.springframework.data.neo4j.repository.config.ReactiveNeo4jRepositoryConfigurationExtension;
+//import org.springframework.transaction.ReactiveTransactionManager;
+import org.neo4j.ogm.session.SessionFactory;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.data.neo4j.repository.config.EnableNeo4jRepositories;
+
+/**
+ *
+ * @author laptop
+ */
+@Configuration
+@EnableNeo4jRepositories(basePackages = "org.mskcc.smile.persistence.neo4j")
+public class SmileConfiguration {
+ @Value("${spring.neo4j.authentication.username}")
+ private String username;
+
+ @Value("${spring.neo4j.authentication.password}")
+ private String password;
+
+ @Value("${spring.neo4j.uri}")
+ private String uri;
+
+ @Bean
+ public SessionFactory sessionFactory() {
+ // with domain entity base package(s)
+ return new SessionFactory(configuration(), "org.mskcc.smile.persistence");
+ }
+
+ /**
+ * OGM db configuration.
+ * @return
+ */
+ @Bean
+ public org.neo4j.ogm.config.Configuration configuration() {
+ return new org.neo4j.ogm.config.Configuration.Builder()
+ .uri(uri)
+ .credentials(username, password)
+ .build();
+ }
+
+ // see: https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.4.0-M2-Release-Notes#neo4j-1
+ // @Bean(ReactiveNeo4jRepositoryConfigurationExtension.DEFAULT_TRANSACTION_MANAGER_BEAN_NAME)
+ // public ReactiveTransactionManager reactiveTransactionManager(
+ // Driver driver,
+ // ReactiveDatabaseSelectionProvider databaseNameProvider) {
+ // return new ReactiveNeo4jTransactionManager(driver, databaseNameProvider);
+ // }
+ //
+ // @Bean
+ // DatabaseSelectionProvider databaseSelectionProvider() {
+ // return () -> {
+ // return DatabaseSelection.byName(database);
+ // };
+ // }
+
+ // @Bean
+ // public Neo4jTransactionManager transactionManager() {
+ // return new Neo4jTransactionManager(sessionFactory());
+ // }
+}
diff --git a/service/src/main/java/org/mskcc/smile/service/impl/RequestServiceImpl.java b/service/src/main/java/org/mskcc/smile/service/impl/RequestServiceImpl.java
index badb7270..88e45a80 100644
--- a/service/src/main/java/org/mskcc/smile/service/impl/RequestServiceImpl.java
+++ b/service/src/main/java/org/mskcc/smile/service/impl/RequestServiceImpl.java
@@ -1,19 +1,15 @@
package org.mskcc.smile.service.impl;
import com.fasterxml.jackson.databind.ObjectMapper;
-import com.google.common.base.Strings;
-import java.io.IOException;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
-import java.util.Calendar;
import java.util.Date;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
+import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.mskcc.smile.commons.JsonComparator;
@@ -209,10 +205,10 @@ public List getRequestSamplesWithUpdates(SmileRequest request) thro
@Override
public List getRequestsByDate(String startDate, String endDate) throws Exception {
- if (Strings.isNullOrEmpty(startDate)) {
+ if (StringUtils.isBlank(startDate)) {
throw new RuntimeException("Start date " + startDate + " cannot be null or empty");
}
- if (Strings.isNullOrEmpty(endDate)) {
+ if (StringUtils.isBlank(endDate)) {
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
LocalDateTime now = LocalDateTime.now();
endDate = dtf.format(now);
diff --git a/service/src/main/java/org/mskcc/smile/service/impl/SampleServiceImpl.java b/service/src/main/java/org/mskcc/smile/service/impl/SampleServiceImpl.java
index 7b008163..7f8cfcf2 100644
--- a/service/src/main/java/org/mskcc/smile/service/impl/SampleServiceImpl.java
+++ b/service/src/main/java/org/mskcc/smile/service/impl/SampleServiceImpl.java
@@ -1,13 +1,12 @@
package org.mskcc.smile.service.impl;
import com.fasterxml.jackson.databind.ObjectMapper;
-import com.google.common.base.Strings;
-import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.mskcc.smile.commons.JsonComparator;
@@ -461,7 +460,7 @@ public void updateSamplePatientRelationship(UUID smileSampleId, UUID smilePatien
@Override
public List getSamplesByDate(String importDate) {
- if (Strings.isNullOrEmpty(importDate)) {
+ if (StringUtils.isBlank(importDate)) {
throw new RuntimeException("Start date " + importDate + " cannot be null or empty");
}
// return latest sample metadata for each sample uuid returned
@@ -472,7 +471,8 @@ public List getSamplesByDate(String importDate) {
List sampleIdsList = new ArrayList<>();
for (UUID smileSampleId : sampleIds) {
SampleMetadata sm = sampleRepository.findLatestSampleMetadataBySmileId(smileSampleId);
- sm.setStatus(sampleRepository.findStatusForSampleMetadataById(sm.getId()));
+ sm.setStatus(sampleRepository.findStatusForSampleMetadataById(sm.getPrimaryId(),
+ sm.getImportDate()));
sampleIdsList.add(new SmileSampleIdMapping(smileSampleId, sm));
}
return sampleIdsList;
@@ -510,7 +510,8 @@ public List getSamplesByCohortId(String cohortId) throws Exception
private List getSampleMetadataWithStatus(List smList) {
for (SampleMetadata sm : smList) {
- sm.setStatus(sampleRepository.findStatusForSampleMetadataById(sm.getId()));
+ sm.setStatus(sampleRepository.findStatusForSampleMetadataById(sm.getPrimaryId(),
+ sm.getImportDate()));
}
return smList;
}
diff --git a/service/src/main/java/org/mskcc/smile/service/impl/TempoMessageHandlingServiceImpl.java b/service/src/main/java/org/mskcc/smile/service/impl/TempoMessageHandlingServiceImpl.java
index cfb14122..50cf232b 100644
--- a/service/src/main/java/org/mskcc/smile/service/impl/TempoMessageHandlingServiceImpl.java
+++ b/service/src/main/java/org/mskcc/smile/service/impl/TempoMessageHandlingServiceImpl.java
@@ -137,6 +137,7 @@ public void run() {
} catch (Exception e) {
LOG.error("Error during handling of BAM complete event", e);
}
+ bamCompleteHandlerShutdownLatch.countDown();
}
}
}
@@ -183,6 +184,7 @@ public void run() {
} catch (Exception e) {
LOG.error("Error during handling of BAM complete event", e);
}
+ qcCompleteHandlerShutdownLatch.countDown();
}
}
}
@@ -240,6 +242,7 @@ public void run() {
} catch (Exception e) {
LOG.error("Error during handling of MAF complete event", e);
}
+ mafCompleteHandlerShutdownLatch.countDown();
}
}
}
@@ -292,6 +295,7 @@ public void run() {
} catch (Exception e) {
LOG.error("Error during handling of Cohort complete event", e);
}
+ cohortCompleteHandlerShutdownLatch.countDown();
}
}
}
@@ -338,6 +342,7 @@ public void run() {
} catch (Exception e) {
LOG.error("Error during handling of sample billing data", e);
}
+ sampleBillingHandlerShutdownLatch.countDown();
}
}
}
@@ -501,7 +506,6 @@ public void onMessage(Message msg, Object message) {
LOG.error("Exception occurred during processing of NATS message data");
return;
}
- System.out.println("Extracted message contents =\n\n" + bamCompleteJson + "\n\n");
Map bamCompleteMap =
(Map) NatsMsgUtil.convertObjectFromString(
bamCompleteJson, new TypeReference