Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v1.1.0 prep #184

Merged
merged 2 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: Strategus
Type: Package
Title: Coordinate and Execute OHDSI HADES Modules
Version: 1.1.0
Date: 2024-11-12
Date: 2024-11-26
Authors@R: c(
person("Anthony", "Sena", email = "[email protected]", role = c("aut", "cre")),
person("Martijn", "Schuemie", email = "[email protected]", role = c("aut")),
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Strategus 1.1.0
===============
- Inject cohort schema and table into `createCohortBasedCovariateSettings` (#181)
- Provide hook to optimize cohort SQL construction (#179)
- Fixes broken links in R6 class documentation (#183)

Strategus 1.0.0
===============

Expand Down
7 changes: 3 additions & 4 deletions R/Module-PatientLevelPrediction.R
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,9 @@ PatientLevelPredictionModule <- R6::R6Class(
}
),
private = list(
.setCovariateSchemaTable = function(
modelDesignList,
cohortDatabaseSchema,
cohortTable) {
.setCovariateSchemaTable = function(modelDesignList,
cohortDatabaseSchema,
cohortTable) {
if (inherits(modelDesignList, "modelDesign")) {
modelDesignList <- list(modelDesignList)
}
Expand Down
16 changes: 8 additions & 8 deletions R/Settings.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ addModuleSpecifications <- function(analysisSpecifications, moduleSpecifications
#' Add Characterization module specifications to analysis specifications
#'
#' @template analysisSpecifications
#' @param moduleSpecifications Created by the \href{../../docs/reference/CharacterizationModule.html#method-CharacterizationModule-createModuleSpecifications}{\code{CharacterizationModule$createModuleSpecifications()}} function.
#' @param moduleSpecifications Created by the \href{../reference/CharacterizationModule.html#method-CharacterizationModule-createModuleSpecifications}{\code{CharacterizationModule$createModuleSpecifications()}} function.
#'
#' @return
#' Returns the `analysisSpecifications` object with the module specifications added.
Expand All @@ -81,7 +81,7 @@ addCharacterizationModuleSpecifications <- function(analysisSpecifications, modu
#' Add Cohort Diagnostics module specifications to analysis specifications
#'
#' @template analysisSpecifications
#' @param moduleSpecifications Created by the \href{../../docs/reference/CohortDiagnosticsModule.html#method-CohortDiagnosticsModule-createModuleSpecifications}{\code{CohortDiagnosticsModule$createModuleSpecifications()}} function.
#' @param moduleSpecifications Created by the \href{../reference/CohortDiagnosticsModule.html#method-CohortDiagnosticsModule-createModuleSpecifications}{\code{CohortDiagnosticsModule$createModuleSpecifications()}} function.
#'
#' @return
#' Returns the `analysisSpecifications` object with the module specifications added.
Expand All @@ -100,7 +100,7 @@ addCohortDiagnosticsModuleSpecifications <- function(analysisSpecifications, mod
#' Add Cohort Generator module specifications to analysis specifications
#'
#' @template analysisSpecifications
#' @param moduleSpecifications Created by the \href{../../docs/reference/CohortGeneratorModule.html#method-CohortGeneratorModule-createModuleSpecifications}{\code{CohortGeneratorModule$createModuleSpecifications()}} function.
#' @param moduleSpecifications Created by the \href{../reference/CohortGeneratorModule.html#method-CohortGeneratorModule-createModuleSpecifications}{\code{CohortGeneratorModule$createModuleSpecifications()}} function.
#'
#' @return
#' Returns the `analysisSpecifications` object with the module specifications added.
Expand All @@ -119,7 +119,7 @@ addCohortGeneratorModuleSpecifications <- function(analysisSpecifications, modul
#' Add Cohort Incidence module specifications to analysis specifications
#'
#' @template analysisSpecifications
#' @param moduleSpecifications Created by the \href{../../docs/reference/CohortIncidenceModule.html#method-CohortIncidenceModule-createModuleSpecifications}{\code{CohortIncidenceModule$createModuleSpecifications()}} function.
#' @param moduleSpecifications Created by the \href{../reference/CohortIncidenceModule.html#method-CohortIncidenceModule-createModuleSpecifications}{\code{CohortIncidenceModule$createModuleSpecifications()}} function.
#'
#' @return
#' Returns the `analysisSpecifications` object with the module specifications added.
Expand All @@ -138,7 +138,7 @@ addCohortIncidenceModuleSpecifications <- function(analysisSpecifications, modul
#' Add Cohort Method module specifications to analysis specifications
#'
#' @template analysisSpecifications
#' @param moduleSpecifications Created by the \href{../../docs/reference/CohortMethodModule.html#method-CohortMethodModule-createModuleSpecifications}{\code{CohortMethodModule$createModuleSpecifications()}} function.
#' @param moduleSpecifications Created by the \href{../reference/CohortMethodModule.html#method-CohortMethodModule-createModuleSpecifications}{\code{CohortMethodModule$createModuleSpecifications()}} function.
#'
#' @return
#' Returns the `analysisSpecifications` object with the module specifications added.
Expand All @@ -157,7 +157,7 @@ addCohortMethodeModuleSpecifications <- function(analysisSpecifications, moduleS
#' Add Evidence Synthesis module specifications to analysis specifications
#'
#' @template analysisSpecifications
#' @param moduleSpecifications Created by the \href{../../docs/reference/EvidenceSynthesisModule.html#method-EvidenceSynthesisModule-createModuleSpecifications}{\code{EvidenceSynthesisModule$createModuleSpecifications()}} function.
#' @param moduleSpecifications Created by the \href{../reference/EvidenceSynthesisModule.html#method-EvidenceSynthesisModule-createModuleSpecifications}{\code{EvidenceSynthesisModule$createModuleSpecifications()}} function.
#'
#' @return
#' Returns the `analysisSpecifications` object with the module specifications added.
Expand All @@ -176,7 +176,7 @@ addEvidenceSynthesisModuleSpecifications <- function(analysisSpecifications, mod
#' Add Patient Level Prediction module specifications to analysis specifications
#'
#' @template analysisSpecifications
#' @param moduleSpecifications Created by the \href{../../docs/reference/PatientLevelPredictionModule.html#method-PatientLevelPredictionModule-createModuleSpecifications}{\code{PatientLevelPredictionModule$createModuleSpecifications()}} function.
#' @param moduleSpecifications Created by the \href{../reference/PatientLevelPredictionModule.html#method-PatientLevelPredictionModule-createModuleSpecifications}{\code{PatientLevelPredictionModule$createModuleSpecifications()}} function.
#'
#' @return
#' Returns the `analysisSpecifications` object with the module specifications added.
Expand All @@ -195,7 +195,7 @@ addPatientLevelPredictionModuleSpecifications <- function(analysisSpecifications
#' Add Self Controlled Case Series Module module specifications to analysis specifications
#'
#' @template analysisSpecifications
#' @param moduleSpecifications Created by the \href{../../docs/reference/SelfControlledCaseSeriesModule.html#method-SelfControlledCaseSeriesModule-createModuleSpecifications}{\code{SelfControlledCaseSeriesModule$createModuleSpecifications()}} function.
#' @param moduleSpecifications Created by the \href{../reference/SelfControlledCaseSeriesModule.html#method-SelfControlledCaseSeriesModule-createModuleSpecifications}{\code{SelfControlledCaseSeriesModule$createModuleSpecifications()}} function.
#'
#' @return
#' Returns the `analysisSpecifications` object with the module specifications added.
Expand Down
6 changes: 2 additions & 4 deletions R/StrategusModule.R
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,8 @@ StrategusModule <- R6::R6Class(
if (inherits(s, "covariateSettings") && "fun" %in% names(attributes(s))) {
if (attr(s, "fun") == "getDbCohortBasedCovariatesData") {
# Set the covariateCohortDatabaseSchema & covariateCohortTable values
s$covariateCohortDatabaseSchema = executionSettings$workDatabaseSchema
s$covariateCohortTable = executionSettings$cohortTableNames$cohortTable
s$covariateCohortDatabaseSchema <- executionSettings$workDatabaseSchema
s$covariateCohortTable <- executionSettings$cohortTableNames$cohortTable
}
}
return(s)
Expand Down Expand Up @@ -379,5 +379,3 @@ StrategusModule <- R6::R6Class(
# Call the helper function on the input list
return(replaceHelper(moduleSettings))
}


Binary file modified extras/Strategus.pdf
Binary file not shown.
4 changes: 2 additions & 2 deletions extras/rdms/schema_meta.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1067,10 +1067,10 @@
<table name="plp_model_designs" comments="PatientLevelPredictionModule: Model designs">
<column name="model_design_id" comments="a unique identifier for the model design settings"/>
<column name="target_id" comments="the identifier for the target cohort id">
<foreignKey table="cg_cohort_definition" column="cohort_definition_id"/>
<foreignKey table="plp_cohorts" column="cohort_definition_id"/>
</column>
<column name="outcome_id" comments="the identifier for the outcome cohort id">
<foreignKey table="cg_cohort_definition" column="cohort_definition_id"/>
<foreignKey table="plp_cohorts" column="cohort_definition_id"/>
</column>
<column name="tar_id" comments="the identifier for the time at risk setting"/>
<column name="plp_data_setting_id" comments="the identifier for the plp data setting"/>
Expand Down
Binary file modified inst/doc/CreatingAnalysisSpecification.pdf
Binary file not shown.
Binary file modified inst/doc/ExecuteStrategus.pdf
Binary file not shown.
Binary file modified inst/doc/IntroductionToStrategus.pdf
Binary file not shown.
Binary file modified inst/doc/WorkingWithResults.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion man/addCharacterizationModuleSpecifications.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/addCohortDiagnosticsModuleSpecifications.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/addCohortGeneratorModuleSpecifications.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/addCohortIncidenceModuleSpecifications.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/addCohortMethodeModuleSpecifications.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/addEvidenceSynthesisModuleSpecifications.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/addPatientLevelPredictionModuleSpecifications.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/addSelfControlledCaseSeriesModuleSpecifications.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tests/testthat/test-Settings.R
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,8 @@ test_that("Test internal function for modifying covariate settings", {

testReplacedModuleSettings <- .replaceCovariateSettings(moduleSettings, executionSettings)
# For visual inspection
#ParallelLogger::saveSettingsToJson(moduleSettings, "before_unit_test.json")
#ParallelLogger::saveSettingsToJson(testReplacedModuleSettings, "after_unit_test.json")
# ParallelLogger::saveSettingsToJson(moduleSettings, "before_unit_test.json")
# ParallelLogger::saveSettingsToJson(testReplacedModuleSettings, "after_unit_test.json")
expect_equal(testReplacedModuleSettings$analysis$something[[1]]$covariateCohortDatabaseSchema, NULL)
expect_equal(testReplacedModuleSettings$analysis$something[[1]]$covariateCohortTable, NULL)
expect_equal(testReplacedModuleSettings$analysis$something[[2]]$covariateCohortDatabaseSchema, workDatabaseSchema)
Expand Down
Loading