diff --git a/DESCRIPTION b/DESCRIPTION index f3e7c1b..9a77f9e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -9,7 +9,7 @@ Authors@R: c( person("Chris", "Knoll", , "knoll@ohdsi.org", role = c("aut")) ) Maintainer: Jenna Reps -Description: Various characterizations of target and outcome cohorts. +Description: Various characterizations of target and outcome cohorts for data mapped to the OMOP CDM. License: Apache License 2.0 URL: https://ohdsi.github.io/Characterization, https://github.com/OHDSI/Characterization BugReports: https://github.com/OHDSI/Characterization/issues diff --git a/NEWS.md b/NEWS.md index ebfe858..1663cfb 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +Characterization 2.1.1 +====================== +- fixed result database column type for mean_exposure_time + Characterization 2.1.0 ====================== - risk factors and case series now restrict to first outcome only. diff --git a/inst/sql/postgresql/migrations/Migration_2-v2_1_1_mean_exposure_time_type.sql b/inst/sql/postgresql/migrations/Migration_2-v2_1_1_mean_exposure_time_type.sql new file mode 100644 index 0000000..dc75050 --- /dev/null +++ b/inst/sql/postgresql/migrations/Migration_2-v2_1_1_mean_exposure_time_type.sql @@ -0,0 +1,8 @@ +-- Database migrations for verion 2.1.1 + +{DEFAULT @package_version = package_version} +{DEFAULT @migration = migration} +{DEFAULT @table_prefix = ''} + +-- Change the column type of mean_exposure_time +ALTER TABLE @database_schema.@table_prefixcohort_counts ALTER COLUMN mean_exposure_time TYPE float; diff --git a/inst/sql/sql_server/migrations/Migration_2-v2_1_1_mean_exposure_time_type.sql b/inst/sql/sql_server/migrations/Migration_2-v2_1_1_mean_exposure_time_type.sql new file mode 100644 index 0000000..ef9f3f0 --- /dev/null +++ b/inst/sql/sql_server/migrations/Migration_2-v2_1_1_mean_exposure_time_type.sql @@ -0,0 +1,9 @@ +-- Database migrations for verion 2.1.1 + +{DEFAULT @package_version = package_version} +{DEFAULT @migration = migration} +{DEFAULT @table_prefix = ''} + +-- Change the column type of mean_exposure_time +ALTER TABLE @database_schema.@table_prefixcohort_counts ALTER COLUMN mean_exposure_time float; + diff --git a/inst/sql/sqlite/migrations/Migration_2-v2_1_1_mean_exposure_time_type.sql b/inst/sql/sqlite/migrations/Migration_2-v2_1_1_mean_exposure_time_type.sql new file mode 100644 index 0000000..1cbab76 --- /dev/null +++ b/inst/sql/sqlite/migrations/Migration_2-v2_1_1_mean_exposure_time_type.sql @@ -0,0 +1,39 @@ +-- Database migrations for verion 2.1.1 + +{DEFAULT @package_version = package_version} +{DEFAULT @migration = migration} +{DEFAULT @table_prefix = ''} + +-- Change the column type of mean_exposure_time +ALTER TABLE @database_schema.@table_prefixcohort_counts RENAME TO _cohort_counts_old; + +CREATE TABLE @database_schema.@table_prefixcohort_counts ( + database_id varchar(100) NOT NULL, + cohort_type varchar(10), + target_cohort_id int, + outcome_cohort_id int, + risk_window_start int, + risk_window_end int, + start_anchor varchar(15), + end_anchor varchar(15), + min_prior_observation int, + outcome_washout_days int, + row_count int NOT NULL, + person_count int NOT NULL, + min_exposure_time int, + mean_exposure_time float, + max_exposure_time int +); + +INSERT INTO @database_schema.@table_prefixcohort_counts + (database_id, cohort_type, target_cohort_id, outcome_cohort_id, + risk_window_start, risk_window_end, start_anchor, end_anchor, + min_prior_observation, outcome_washout_days,row_count, person_count, + min_exposure_time, mean_exposure_time, max_exposure_time) +SELECT database_id, cohort_type, target_cohort_id, outcome_cohort_id, + risk_window_start, risk_window_end, start_anchor, end_anchor, + min_prior_observation, outcome_washout_days,row_count, person_count, + min_exposure_time, mean_exposure_time, max_exposure_time +FROM _cohort_counts_old; + +DROP TABLE _cohort_counts_old; diff --git a/man/Characterization-package.Rd b/man/Characterization-package.Rd index 7c65079..298e879 100644 --- a/man/Characterization-package.Rd +++ b/man/Characterization-package.Rd @@ -6,7 +6,7 @@ \alias{Characterization-package} \title{Characterization: Characterizations of Cohorts} \description{ -Various characterizations of target and outcome cohorts. +Various characterizations of target and outcome cohorts for data mapped to the OMOP CDM. } \seealso{ Useful links: