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

Adds support for temporal covariate ref #14

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
10 changes: 10 additions & 0 deletions R/RunCharacterization.R
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,16 @@ runCharacterizationAnalyses <- function(
tablePrefix = tablePrefix
)
}

if (!is.null(result$timeRef)) {
insertAndromedaToDatabase(
connection = conn,
databaseSchema = "main",
tableName = "time_ref",
andromedaObject = result$timeRef,
tablePrefix = tablePrefix
)
}
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions inst/settings/resultsDataModelSpecification.csv
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,8 @@ cohort_details,cohort_definition_id,int,Y,N,N,N,The study cohort id
cohort_details,cohort_type,varchar(10),Y,N,N,N,The cohort type
cohort_details,target_cohort_id,int,Y,N,N,N,The target cohort id
cohort_details,outcome_cohort_id,int,Y,N,N,N,The outcome cohort id
time_ref,run_id,int,Y,Y,N,N,The run identifier
time_ref,database_id,varchar(100),Y,Y,N,N,The database identifier
time_ref,time_id,int,Yes,Yes,No,Yes,No,No,No
time_ref,start_day,int,Y,N,N,N,The start day
time_ref,end_day,int,Y,N,N,N,The end day
10 changes: 10 additions & 0 deletions inst/sql/sql_server/ResultTables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ CREATE TABLE @my_schema.@table_prefixcovariates (
run_id int NOT NULL,
database_id varchar(100) NOT NULL,
cohort_definition_id int NOT NULL,
time_id INT NULL,
covariate_id int NOT NULL,
sum_value int NOT NULL,
average_value float NOT NULL
Expand All @@ -109,6 +110,7 @@ CREATE TABLE @my_schema.@table_prefixcovariates_continuous (
run_id int NOT NULL,
database_id varchar(100) NOT NULL,
cohort_definition_id int NOT NULL,
time_id INT NULL,
covariate_id int NOT NULL,
count_value int NOT NULL,
min_value float,
Expand All @@ -121,3 +123,11 @@ CREATE TABLE @my_schema.@table_prefixcovariates_continuous (
p_75_value float,
p_90_value float
);

CREATE TABLE @my_schema.@table_prefixtime_ref (
run_id int NOT NULL,
database_id varchar(100) NOT NULL,
time_id INT NOT NULL,
start_day BIGINT NOT NULL,
end_day BIGINT NOT NULL
);