diff --git a/src/main/java/org/ohdsi/webapi/cohortcharacterization/domain/CohortCharacterizationEntity.java b/src/main/java/org/ohdsi/webapi/cohortcharacterization/domain/CohortCharacterizationEntity.java index c9aef23268..ccc193a5c8 100644 --- a/src/main/java/org/ohdsi/webapi/cohortcharacterization/domain/CohortCharacterizationEntity.java +++ b/src/main/java/org/ohdsi/webapi/cohortcharacterization/domain/CohortCharacterizationEntity.java @@ -191,4 +191,25 @@ public Set getTags() { public void setTags(Set tags) { this.tags = tags; } + + public void addCcParamEntity(CcParamEntity ccParamEntity) { + this.parameters.add(ccParamEntity); + ccParamEntity.setCohortCharacterization(this); + } + + public void removeCcParamEntity(CcParamEntity ccParamEntity) { + this.parameters.remove(ccParamEntity); + ccParamEntity.setCohortCharacterization(null); + } + + public void addCcStrataEntity(CcStrataEntity ccStrataEntity) { + this.stratas.add(ccStrataEntity); + ccStrataEntity.setCohortCharacterization(this); + } + + public void removeCcStrataEntity(CcStrataEntity ccStrataEntity) { + this.stratas.remove(ccStrataEntity); + ccStrataEntity.setCohortCharacterization(null); + } + } diff --git a/src/main/java/org/ohdsi/webapi/cohortdefinition/CohortDefinition.java b/src/main/java/org/ohdsi/webapi/cohortdefinition/CohortDefinition.java index 9c0a126f79..6c608e6cc3 100644 --- a/src/main/java/org/ohdsi/webapi/cohortdefinition/CohortDefinition.java +++ b/src/main/java/org/ohdsi/webapi/cohortdefinition/CohortDefinition.java @@ -210,4 +210,25 @@ public Set getTags() { public void setTags(Set tags) { this.tags = tags; } + + public void addCohortAnalysisGenerationInfo(CohortAnalysisGenerationInfo cohortAnalysisGenerationInfo) { + this.cohortAnalysisGenerationInfoList.add(cohortAnalysisGenerationInfo); + cohortAnalysisGenerationInfo.setCohortDefinition(this); + } + + public void removeCohortAnalysisGenerationInfo(CohortAnalysisGenerationInfo cohortAnalysisGenerationInfo) { + this.cohortAnalysisGenerationInfoList.remove(cohortAnalysisGenerationInfo); + cohortAnalysisGenerationInfo.setCohortDefinition(null); + } + + public void addCohortGenerationInfo(CohortGenerationInfo cohortGenerationInfo) { + this.generationInfoList.add(cohortGenerationInfo); + cohortGenerationInfo.setCohortDefinition(this); + } + + public void removeCohortGenerationInfo(CohortGenerationInfo cohortGenerationInfo) { + this.generationInfoList.remove(cohortGenerationInfo); + cohortGenerationInfo.setCohortDefinition(null); + } + } diff --git a/src/main/java/org/ohdsi/webapi/cohortdefinition/CohortGenerationInfo.java b/src/main/java/org/ohdsi/webapi/cohortdefinition/CohortGenerationInfo.java index f79d3fd1db..9faa334610 100644 --- a/src/main/java/org/ohdsi/webapi/cohortdefinition/CohortGenerationInfo.java +++ b/src/main/java/org/ohdsi/webapi/cohortdefinition/CohortGenerationInfo.java @@ -187,4 +187,13 @@ public void setCreatedBy(UserEntity createdBy) { public UserEntity getCreatedBy() { return createdBy; } + + public void setCohortDefinition(CohortDefinition cohortDefinition) { + this.cohortDefinition = cohortDefinition; + cohortDefinition.addCohortGenerationInfo(this); + } + public void removeCohortDefinition(CohortDefinition cohortDefinition) { + cohortDefinition.removeCohortGenerationInfo(this); + this.cohortDefinition = null; + } } diff --git a/src/main/java/org/ohdsi/webapi/cohortdefinition/CohortGenerationInfoId.java b/src/main/java/org/ohdsi/webapi/cohortdefinition/CohortGenerationInfoId.java index 6fecee108c..0fc4415c13 100644 --- a/src/main/java/org/ohdsi/webapi/cohortdefinition/CohortGenerationInfoId.java +++ b/src/main/java/org/ohdsi/webapi/cohortdefinition/CohortGenerationInfoId.java @@ -68,4 +68,6 @@ public int hashCode() { return cohortDefinitionId + sourceId; } + + } diff --git a/src/main/java/org/ohdsi/webapi/executionengine/entity/ExecutionEngineAnalysisStatus.java b/src/main/java/org/ohdsi/webapi/executionengine/entity/ExecutionEngineAnalysisStatus.java index 54cc9b0616..eb3de89b7c 100644 --- a/src/main/java/org/ohdsi/webapi/executionengine/entity/ExecutionEngineAnalysisStatus.java +++ b/src/main/java/org/ohdsi/webapi/executionengine/entity/ExecutionEngineAnalysisStatus.java @@ -76,4 +76,14 @@ public void setResultFiles(List resultFiles) { this.resultFiles = resultFiles; } + public void addAnalysisResultFile(AnalysisResultFile analysisResultFile) { + this.resultFiles.add(analysisResultFile); + analysisResultFile.setExecution(this); + } + + public void removeAnalysisResultFile(AnalysisResultFile analysisResultFile) { + this.resultFiles.remove(analysisResultFile); + analysisResultFile.setExecution(null); + } + } diff --git a/src/main/java/org/ohdsi/webapi/feanalysis/domain/FeAnalysisEntity.java b/src/main/java/org/ohdsi/webapi/feanalysis/domain/FeAnalysisEntity.java index 868303e1ef..fd2f4b3bb0 100644 --- a/src/main/java/org/ohdsi/webapi/feanalysis/domain/FeAnalysisEntity.java +++ b/src/main/java/org/ohdsi/webapi/feanalysis/domain/FeAnalysisEntity.java @@ -184,12 +184,10 @@ public void setLocked(final Boolean locked) { } public Set getCohortCharacterizations() { - return cohortCharacterizations; } public void setCohortCharacterizations(final Set cohortCharacterizations) { - this.cohortCharacterizations = cohortCharacterizations; } @@ -207,5 +205,16 @@ public void setStatType(final CcResultType statType) { this.statType = statType; } + + public void addCohortCharacterizationEntity(CohortCharacterizationEntity cohortCharacterizationEntity) { + this.cohortCharacterizations.add(cohortCharacterizationEntity); + cohortCharacterizationEntity.getFeatureAnalyses().add(this); + } + + public void removeCohortCharacterizationEntity(CohortCharacterizationEntity cohortCharacterizationEntity) { + this.cohortCharacterizations.remove(cohortCharacterizationEntity); + cohortCharacterizationEntity.getFeatureAnalyses().remove(this); + } + } diff --git a/src/main/java/org/ohdsi/webapi/feanalysis/domain/FeAnalysisWithCriteriaEntity.java b/src/main/java/org/ohdsi/webapi/feanalysis/domain/FeAnalysisWithCriteriaEntity.java index 65647a937d..9684595e1f 100644 --- a/src/main/java/org/ohdsi/webapi/feanalysis/domain/FeAnalysisWithCriteriaEntity.java +++ b/src/main/java/org/ohdsi/webapi/feanalysis/domain/FeAnalysisWithCriteriaEntity.java @@ -48,4 +48,15 @@ public List getConceptSets() { return Objects.nonNull(this.conceptSetEntity) ? this.conceptSetEntity.getConceptSets() : Collections.emptyList(); } + + public void addFeAnalysisCriteriaEntity(T feAnalysisCriteriaEntity) { + this.design.add(feAnalysisCriteriaEntity); + feAnalysisCriteriaEntity.setFeatureAnalysis(this); + } + + public void removeFeAnalysisCriteriaEntity(T feAnalysisCriteriaEntity) { + this.design.remove(feAnalysisCriteriaEntity); + feAnalysisCriteriaEntity.setFeatureAnalysis(null); + } + } diff --git a/src/main/java/org/ohdsi/webapi/feanalysis/domain/FeAnalysisWithDistributionCriteriaEntity.java b/src/main/java/org/ohdsi/webapi/feanalysis/domain/FeAnalysisWithDistributionCriteriaEntity.java index 4614a8d96f..90faad0ba9 100644 --- a/src/main/java/org/ohdsi/webapi/feanalysis/domain/FeAnalysisWithDistributionCriteriaEntity.java +++ b/src/main/java/org/ohdsi/webapi/feanalysis/domain/FeAnalysisWithDistributionCriteriaEntity.java @@ -1,5 +1,6 @@ package org.ohdsi.webapi.feanalysis.domain; + import javax.persistence.DiscriminatorValue; import javax.persistence.Entity; @@ -13,4 +14,5 @@ public FeAnalysisWithDistributionCriteriaEntity() { public FeAnalysisWithDistributionCriteriaEntity(FeAnalysisWithCriteriaEntity analysis) { super(analysis); } + } diff --git a/src/main/java/org/ohdsi/webapi/feanalysis/domain/FeAnalysisWithStringEntity.java b/src/main/java/org/ohdsi/webapi/feanalysis/domain/FeAnalysisWithStringEntity.java index cd93bcd0d3..b675a42236 100644 --- a/src/main/java/org/ohdsi/webapi/feanalysis/domain/FeAnalysisWithStringEntity.java +++ b/src/main/java/org/ohdsi/webapi/feanalysis/domain/FeAnalysisWithStringEntity.java @@ -5,6 +5,7 @@ import javax.persistence.Lob; import org.hibernate.annotations.Type; import org.ohdsi.analysis.cohortcharacterization.design.FeatureAnalysis; +import org.ohdsi.webapi.cohortcharacterization.domain.CohortCharacterizationEntity; @Entity @DiscriminatorValue("not null") @@ -31,4 +32,5 @@ public void setDesign(final String design) { this.design = design; } + } diff --git a/src/main/java/org/ohdsi/webapi/feasibility/FeasibilityStudy.java b/src/main/java/org/ohdsi/webapi/feasibility/FeasibilityStudy.java index 18a3be2db6..1d9dfb5626 100644 --- a/src/main/java/org/ohdsi/webapi/feasibility/FeasibilityStudy.java +++ b/src/main/java/org/ohdsi/webapi/feasibility/FeasibilityStudy.java @@ -216,4 +216,13 @@ public FeasibilityStudy setInclusionRules(List inclusionRules) { this.inclusionRules = inclusionRules; return this; } + + public void addStudyGenerationInfo(StudyGenerationInfo studyGenerationInfo) { + studyGenerationInfoList.add(studyGenerationInfo); + studyGenerationInfo.setFeasibilityStudy(this); + } + public void removeStudyGenerationInfo(StudyGenerationInfo studyGenerationInfo) { + studyGenerationInfoList.remove(studyGenerationInfo); + studyGenerationInfo.setFeasibilityStudy(null); + } } diff --git a/src/main/java/org/ohdsi/webapi/feasibility/StudyGenerationInfo.java b/src/main/java/org/ohdsi/webapi/feasibility/StudyGenerationInfo.java index 59f6560061..65742404b9 100644 --- a/src/main/java/org/ohdsi/webapi/feasibility/StudyGenerationInfo.java +++ b/src/main/java/org/ohdsi/webapi/feasibility/StudyGenerationInfo.java @@ -139,4 +139,8 @@ public FeasibilityStudy getStudy() { public Source getSource() { return source; } + + public void setFeasibilityStudy(FeasibilityStudy feasibilityStudy) { + this.study = feasibilityStudy; + } } diff --git a/src/main/java/org/ohdsi/webapi/ircalc/ExecutionInfo.java b/src/main/java/org/ohdsi/webapi/ircalc/ExecutionInfo.java index 252c31306d..7f6dcd9686 100644 --- a/src/main/java/org/ohdsi/webapi/ircalc/ExecutionInfo.java +++ b/src/main/java/org/ohdsi/webapi/ircalc/ExecutionInfo.java @@ -152,7 +152,13 @@ public IncidenceRateAnalysis getAnalysis() { return analysis; } + public void setAnalysis(IncidenceRateAnalysis incidenceRateAnalysis) { + this.analysis = incidenceRateAnalysis; + } + public Source getSource() { return source; } + + } diff --git a/src/main/java/org/ohdsi/webapi/ircalc/IncidenceRateAnalysis.java b/src/main/java/org/ohdsi/webapi/ircalc/IncidenceRateAnalysis.java index 218fcd146f..730914ae74 100644 --- a/src/main/java/org/ohdsi/webapi/ircalc/IncidenceRateAnalysis.java +++ b/src/main/java/org/ohdsi/webapi/ircalc/IncidenceRateAnalysis.java @@ -130,4 +130,13 @@ public Set getTags() { public void setTags(Set tags) { this.tags = tags; } + + public void addExecutionInfo(ExecutionInfo executionInfo){ + executionInfoList.add(executionInfo); + executionInfo.setAnalysis(this); + } + public void removeExecutionInfo(ExecutionInfo executionInfo){ + executionInfoList.remove(executionInfo); + } + } diff --git a/src/main/java/org/ohdsi/webapi/pathway/domain/PathwayAnalysisEntity.java b/src/main/java/org/ohdsi/webapi/pathway/domain/PathwayAnalysisEntity.java index 609f5123a5..7172cf6b20 100644 --- a/src/main/java/org/ohdsi/webapi/pathway/domain/PathwayAnalysisEntity.java +++ b/src/main/java/org/ohdsi/webapi/pathway/domain/PathwayAnalysisEntity.java @@ -185,4 +185,25 @@ public Set getTags() { public void setTags(Set tags) { this.tags = tags; } + + public void addPathwayEventCohort(PathwayEventCohort pathwayEventCohort) { + this.eventCohorts.add(pathwayEventCohort); + pathwayEventCohort.setPathwayAnalysis(this); + } + + public void removePathwayEventCohort(PathwayEventCohort pathwayEventCohort) { + this.eventCohorts.remove(pathwayEventCohort); + pathwayEventCohort.setPathwayAnalysis(null); + } + + public void addPathwayTargetCohort(PathwayTargetCohort pathwayTargetCohort) { + this.targetCohorts.add(pathwayTargetCohort); + pathwayTargetCohort.setPathwayAnalysis(this); + } + + public void removePathwayTargetCohort(PathwayTargetCohort pathwayTargetCohort) { + this.targetCohorts.remove(pathwayTargetCohort); + pathwayTargetCohort.setPathwayAnalysis(null); + } + } diff --git a/src/main/java/org/ohdsi/webapi/shiro/Entities/PermissionEntity.java b/src/main/java/org/ohdsi/webapi/shiro/Entities/PermissionEntity.java index f54160b6bf..8fd78e76a0 100644 --- a/src/main/java/org/ohdsi/webapi/shiro/Entities/PermissionEntity.java +++ b/src/main/java/org/ohdsi/webapi/shiro/Entities/PermissionEntity.java @@ -78,4 +78,15 @@ public Set getRolePermissions() { public void setRolePermissions(Set rolePermissions) { this.rolePermissions = rolePermissions; } + + public void addRolePermissionEntity(RolePermissionEntity rolePermissionEntity) { + this.rolePermissions.add(rolePermissionEntity); + rolePermissionEntity.setPermission(this); + } + + public void removeRolePermissionEntity(RolePermissionEntity rolePermissionEntity) { + this.rolePermissions.remove(rolePermissionEntity); + rolePermissionEntity.setPermission(null); + } + } diff --git a/src/main/java/org/ohdsi/webapi/shiro/Entities/RoleEntity.java b/src/main/java/org/ohdsi/webapi/shiro/Entities/RoleEntity.java index f958d4fd9a..73c8949536 100644 --- a/src/main/java/org/ohdsi/webapi/shiro/Entities/RoleEntity.java +++ b/src/main/java/org/ohdsi/webapi/shiro/Entities/RoleEntity.java @@ -89,4 +89,25 @@ public Boolean isSystemRole() { public void setSystemRole(Boolean system) { systemRole = system; } + + public void addRolePermissionEntity(RolePermissionEntity rolePermissionEntity) { + this.rolePermissions.add(rolePermissionEntity); + rolePermissionEntity.setRole(this); + } + + public void removeRolePermissionEntity(RolePermissionEntity rolePermissionEntity) { + this.rolePermissions.remove(rolePermissionEntity); + rolePermissionEntity.setRole(null); + } + + public void addUserRoleEntity(UserRoleEntity userRoleEntity) { + this.userRoles.add(userRoleEntity); + userRoleEntity.setRole(this); + } + + public void removeUserRoleEntity(UserRoleEntity userRoleEntity) { + this.userRoles.remove(userRoleEntity); + userRoleEntity.setRole(null); + } + } diff --git a/src/main/java/org/ohdsi/webapi/shiro/Entities/UserEntity.java b/src/main/java/org/ohdsi/webapi/shiro/Entities/UserEntity.java index d51f7f3bae..e6bb7c92ad 100644 --- a/src/main/java/org/ohdsi/webapi/shiro/Entities/UserEntity.java +++ b/src/main/java/org/ohdsi/webapi/shiro/Entities/UserEntity.java @@ -93,4 +93,15 @@ public UserOrigin getOrigin() { public void setOrigin(UserOrigin origin) { this.origin = origin; } + + public void addUserRoleEntity(UserRoleEntity userRoleEntity) { + this.userRoles.add(userRoleEntity); + userRoleEntity.setUser(this); + } + + public void removeUserRoleEntity(UserRoleEntity userRoleEntity) { + this.userRoles.remove(userRoleEntity); + userRoleEntity.setUser(null); + } + } diff --git a/src/main/java/org/ohdsi/webapi/source/Source.java b/src/main/java/org/ohdsi/webapi/source/Source.java index b098077f69..98f4488f5b 100644 --- a/src/main/java/org/ohdsi/webapi/source/Source.java +++ b/src/main/java/org/ohdsi/webapi/source/Source.java @@ -17,10 +17,7 @@ import com.odysseusinc.arachne.execution_engine_common.api.v1.dto.KerberosAuthMechanism; import java.io.Serializable; -import java.util.Collection; -import java.util.Date; -import java.util.List; -import java.util.Objects; +import java.util.*; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -287,4 +284,19 @@ public Integer getId() { return sourceId; } + public void addSourceDaimon(SourceDaimon sourceDaimon) { + if (this.daimons == null) { + this.daimons = new ArrayList<>(); + } + this.daimons.add(sourceDaimon); + sourceDaimon.setSource(this); + } + + public void removeSourceDaimon(SourceDaimon sourceDaimon) { + if (this.daimons!= null) { + this.daimons.remove(sourceDaimon); + sourceDaimon.setSource(null); + } + } + } diff --git a/src/main/java/org/ohdsi/webapi/user/importer/model/UserImportJob.java b/src/main/java/org/ohdsi/webapi/user/importer/model/UserImportJob.java index 80a12f4a3d..c62cd8e46c 100644 --- a/src/main/java/org/ohdsi/webapi/user/importer/model/UserImportJob.java +++ b/src/main/java/org/ohdsi/webapi/user/importer/model/UserImportJob.java @@ -94,4 +94,15 @@ public String getUserRoles() { public void setUserRoles(String userRoles) { this.userRoles = userRoles; } + + public void addRoleGroupEntity(RoleGroupEntity roleGroupEntity) { + this.roleGroupMapping.add(roleGroupEntity); + roleGroupEntity.setUserImportJob(this); + } + + public void removeRoleGroupEntity(RoleGroupEntity roleGroupEntity) { + this.roleGroupMapping.remove(roleGroupEntity); + roleGroupEntity.setUserImportJob(null); + } + }