Skip to content

Commit

Permalink
Merge pull request #197 from National-COVID-Cohort-Collaborative/LL-T…
Browse files Browse the repository at this point in the history
…NX-Update

TNX v3.2 Update
  • Loading branch information
LoraLingrey-TriNetX authored Mar 17, 2021
2 parents f479638 + 1b3b1cb commit 4fd5fde
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion PhenotypeScripts/N3C_phenotype_trinetx.sql
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ CREATE TABLE IF NOT EXISTS data_a.n3c_control_map (
SELECT CURRENT_TIMESTAMP as date_time, 'UPDATING PHENO VERSION TABLE' as log_entry;
TRUNCATE TABLE :TNX_SCHEMA.n3c_pheno_version;
INSERT INTO :TNX_SCHEMA.n3c_pheno_version
SELECT '3.1';
SELECT '3.2';

---------------------------------------------------------------------------------------------------------
-- 3. Clear out existing tables
Expand Down Expand Up @@ -421,6 +421,9 @@ DELETE FROM data_a.n3c_control_map WHERE control_patient_id NOT IN (SELECT patie
-- Remove if case no longer meets phenotype criteria
DELETE FROM data_a.n3c_control_map WHERE case_patient_id NOT IN (SELECT patient_id FROM :TNX_SCHEMA.n3c_case_cohort);

-- Remove if control patient ID is null
DELETE FROM data_a.n3c_control_map WHERE control_patient_id IS NULL;

---------------------------------------------------------------------------------------------------------
-- 8. Create Additional Control Tables
---------------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit 4fd5fde

Please sign in to comment.