Skip to content

Commit

Permalink
Removed annotation tables from schema creation
Browse files Browse the repository at this point in the history
  • Loading branch information
azimov committed Feb 15, 2024
1 parent d867c15 commit 98d663b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 41 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Description: CohortDiagnostics is an R utility package for the development and e
definitions across one or more data sources, facilitating reproducible research.
Depends:
DatabaseConnector (>= 5.0.0),
FeatureExtraction (>= 3.2.0),
FeatureExtraction (>= 3.4.0),
R (>= 4.1.0)
Imports:
Andromeda (>= 0.6.0),
Expand Down
6 changes: 5 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ Changes:

1. Added function to make deployment to posit connect servers easier

2 Added ability to use CohortGenerator sample functionality to executeDiagnostics which speeds up execution for very
2. Added ability to use CohortGenerator sample functionality to executeDiagnostics which speeds up execution for very
large cohort definitions

3. Requires use of FeatureExtraction 3.4.0 to support new API

4. Removed annotation tables from result schema script

CohortDiagnostics 3.2.5
=======================
Bug Fixes:
Expand Down
2 changes: 1 addition & 1 deletion R/CohortCharacterizationDiagnostics.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ getCohortCharacteristics <- function(connectionDetails = NULL,
cohortDatabaseSchema = cohortDatabaseSchema,
cdmVersion = cdmVersion,
cohortTable = cohortTable,
cohortId = cohortIds,
cohortIds = cohortIds,
covariateSettings = covariateSettings,
aggregated = TRUE
)
Expand Down
38 changes: 0 additions & 38 deletions inst/sql/sql_server/CreateResultsDataModel.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{DEFAULT @annotation = annotation}
{DEFAULT @annotation_link = annotation_link}
{DEFAULT @annotation_attributes = annotation_attributes}
{DEFAULT @cohort = cohort}
{DEFAULT @cohort_count = cohort_count}
{DEFAULT @cohort_inclusion = cohort_inclusion}
Expand Down Expand Up @@ -35,9 +32,6 @@
{DEFAULT @subset_definition = subset_definition}

-- Drop old tables if exist
DROP TABLE IF EXISTS @results_schema.@annotation;
DROP TABLE IF EXISTS @results_schema.@annotation_link;
DROP TABLE IF EXISTS @results_schema.@annotation_attributes;
DROP TABLE IF EXISTS @results_schema.@cohort;
DROP TABLE IF EXISTS @results_schema.@cohort_count;
DROP TABLE IF EXISTS @results_schema.@cohort_inclusion;
Expand Down Expand Up @@ -70,38 +64,6 @@ DROP TABLE IF EXISTS @results_schema.@visit_context;
DROP TABLE IF EXISTS @results_schema.@vocabulary;

-- Create tables
--Table annotation
--HINT DISTRIBUTE ON RANDOM
CREATE TABLE @results_schema.@annotation (
annotation_id BIGINT NOT NULL,
created_by VARCHAR NOT NULL,
created_on BIGINT NOT NULL,
modified_last_on BIGINT,
deleted_on BIGINT,
annotation VARCHAR NOT NULL,
PRIMARY KEY(annotation_id)
);

--Table annotation_link
--HINT DISTRIBUTE ON RANDOM
CREATE TABLE @results_schema.@annotation_link (
annotation_id BIGINT NOT NULL DEFAULT 0,
diagnostics_id VARCHAR NOT NULL,
cohort_id BIGINT NOT NULL,
database_id VARCHAR NOT NULL,
PRIMARY KEY(annotation_id, diagnostics_id, cohort_id, database_id)
);

--Table annotation_attributes
--HINT DISTRIBUTE ON RANDOM
CREATE TABLE @results_schema.@annotation_attributes (
annotation_id BIGINT NOT NULL DEFAULT 0,
created_by VARCHAR NOT NULL,
annotation_attributes VARCHAR NOT NULL,
created_on BIGINT NOT NULL,
PRIMARY KEY(annotation_id, created_by)
);

--Table cohort
--HINT DISTRIBUTE ON RANDOM
CREATE TABLE @results_schema.@cohort (
Expand Down

0 comments on commit 98d663b

Please sign in to comment.