Skip to content

Commit

Permalink
[ATL-11] Added saving of the covariates checkbox state
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg-odysseus authored and alex-odysseus committed Nov 15, 2024
1 parent 8170bd5 commit 787e805
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ public CohortGenerationInfo(CohortDefinition definition, Integer sourceId)
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "created_by_id")
private UserEntity createdBy;
@Column(name = "is_choose_covariates")
private boolean isChooseCovariates;

public CohortGenerationInfoId getId() {
return id;
Expand Down Expand Up @@ -187,4 +189,12 @@ public void setCreatedBy(UserEntity createdBy) {
public UserEntity getCreatedBy() {
return createdBy;
}

public boolean isChooseCovariates() {
return isChooseCovariates;
}

public void setChooseCovariates(boolean chooseCovariates) {
isChooseCovariates = chooseCovariates;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public CohortGenerationInfoDTO convert(CohortGenerationInfo info) {
dto.setStartTime(info.getStartTime());
dto.setStatus(info.getStatus());
dto.setIsValid(info.isIsValid());
dto.setChooseCovariates(info.isChooseCovariates());

return dto;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public class CohortGenerationInfoDTO {

private UserDTO createdBy;

private boolean isChooseCovariates;

public CohortGenerationInfoId getId() {
return id;
}
Expand Down Expand Up @@ -124,4 +126,12 @@ public UserDTO getCreatedBy() {
public void setCreatedBy(UserDTO createdBy) {
this.createdBy = createdBy;
}

public boolean isChooseCovariates() {
return isChooseCovariates;
}

public void setChooseCovariates(boolean chooseCovariates) {
isChooseCovariates = chooseCovariates;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import org.ohdsi.webapi.job.GeneratesNotification;
import org.ohdsi.webapi.job.JobExecutionResource;
import org.ohdsi.webapi.shiro.Entities.UserEntity;
import org.ohdsi.webapi.shiro.Entities.UserRepository;
import org.ohdsi.webapi.source.Source;
import org.ohdsi.webapi.source.SourceService;
import org.ohdsi.webapi.util.SessionUtils;
Expand All @@ -38,10 +37,10 @@
import static org.ohdsi.webapi.Constants.Params.COHORT_DEFINITION_ID;
import static org.ohdsi.webapi.Constants.Params.GENERATE_STATS;
import static org.ohdsi.webapi.Constants.Params.JOB_NAME;
import static org.ohdsi.webapi.Constants.Params.RETAIN_COHORT_COVARIATES;
import static org.ohdsi.webapi.Constants.Params.SESSION_ID;
import static org.ohdsi.webapi.Constants.Params.SOURCE_ID;
import static org.ohdsi.webapi.Constants.Params.TARGET_DATABASE_SCHEMA;
import static org.ohdsi.webapi.Constants.Params.RETAIN_COHORT_COVARIATES;

@Component
@DependsOn("flyway")
Expand Down Expand Up @@ -79,6 +78,7 @@ public JobExecutionResource generateCohortViaJob(UserEntity userEntity, CohortDe
.orElse(new CohortGenerationInfo(cohortDefinition, source.getSourceId()));

info.setCreatedBy(userEntity);
info.setChooseCovariates(retainCohortCovariates);

cohortDefinition.getGenerationInfoList().add(info);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE ${ohdsiSchema}.cohort_generation_info ADD is_choose_covariates BOOLEAN NOT NULL DEFAULT FALSE;

0 comments on commit 787e805

Please sign in to comment.