From 9a93623f96795533b515c2cd76193f461e67eb52 Mon Sep 17 00:00:00 2001 From: clairblacketer Date: Fri, 14 Jul 2017 13:32:52 -0400 Subject: [PATCH] Addresses cdm proposal #69 --- Impala/OMOP_CDM_ddl_Impala.sql | 81 +----------------- Impala/OMOP_Parquet_v5.2.sql | 23 ----- Oracle/OMOP CDM constraints - Oracle.sql | 4 +- Oracle/OMOP CDM ddl - Oracle.sql | 84 +------------------ .../OMOP CDM constraints - PostgreSQL.sql | 2 + PostgreSQL/OMOP CDM ddl - PostgreSQL.sql | 83 +----------------- README.md | 3 + .../OMOP CDM constraints - SQL Server.sql | 1 + Sql Server/OMOP CDM ddl - SQL Server.sql | 4 +- 9 files changed, 21 insertions(+), 264 deletions(-) diff --git a/Impala/OMOP_CDM_ddl_Impala.sql b/Impala/OMOP_CDM_ddl_Impala.sql index c01a171..2d6bbeb 100644 --- a/Impala/OMOP_CDM_ddl_Impala.sql +++ b/Impala/OMOP_CDM_ddl_Impala.sql @@ -587,83 +587,6 @@ CREATE TABLE payer_plan_period ( ; -/* The individual cost tables are being phased out and will disappear soon - -CREATE TABLE visit_cost ( - visit_cost_id INTEGER, - visit_occurrence_id INTEGER, - currency_concept_id INTEGER, - paid_copay DECIMAL(19,4), -- NUMERIC - paid_coinsurance DECIMAL(19,4), -- NUMERIC - paid_toward_deductible DECIMAL(19,4), -- NUMERIC - paid_by_payer DECIMAL(19,4), -- NUMERIC - paid_by_coordination_benefits DECIMAL(19,4), -- NUMERIC - total_out_of_pocket DECIMAL(19,4), -- NUMERIC - total_paid DECIMAL(19,4), -- NUMERIC - payer_plan_period_id INTEGER -) -; - - - -CREATE TABLE procedure_cost ( - procedure_cost_id INTEGER, - procedure_occurrence_id INTEGER, - currency_concept_id INTEGER, - paid_copay DECIMAL(19,4), -- NUMERIC - paid_coinsurance DECIMAL(19,4), -- NUMERIC - paid_toward_deductible DECIMAL(19,4), -- NUMERIC - paid_by_payer DECIMAL(19,4), -- NUMERIC - paid_by_coordination_benefits DECIMAL(19,4), -- NUMERIC - total_out_of_pocket DECIMAL(19,4), -- NUMERIC - total_paid DECIMAL(19,4), -- NUMERIC - revenue_code_concept_id INTEGER, - payer_plan_period_id INTEGER, - revenue_code_source_value VARCHAR(50) -) -; - - - -CREATE TABLE drug_cost ( - drug_cost_id INTEGER, - drug_exposure_id INTEGER, - currency_concept_id INTEGER, - paid_copay DECIMAL(19,4), -- NUMERIC - paid_coinsurance DECIMAL(19,4), -- NUMERIC - paid_toward_deductible DECIMAL(19,4), -- NUMERIC - paid_by_payer DECIMAL(19,4), -- NUMERIC - paid_by_coordination_benefits DECIMAL(19,4), -- NUMERIC - total_out_of_pocket DECIMAL(19,4), -- NUMERIC - total_paid DECIMAL(19,4), -- NUMERIC - ingredient_cost DECIMAL(19,4), -- NUMERIC - dispensing_fee DECIMAL(19,4), -- NUMERIC - average_wholesale_price DECIMAL(19,4), -- NUMERIC - payer_plan_period_id INTEGER -) -; - - - - - -CREATE TABLE device_cost ( - device_cost_id INTEGER, - device_exposure_id INTEGER, - currency_concept_id INTEGER, - paid_copay DECIMAL(19,4), -- NUMERIC - paid_coinsurance DECIMAL(19,4), -- NUMERIC - paid_toward_deductible DECIMAL(19,4), -- NUMERIC - paid_by_payer DECIMAL(19,4), -- NUMERIC - paid_by_coordination_benefits DECIMAL(19,4), -- NUMERIC - total_out_of_pocket DECIMAL(19,4), -- NUMERIC - total_paid DECIMAL(19,4), -- NUMERIC - payer_plan_period_id INTEGER -) -; -*/ - - CREATE TABLE cost ( cost_id INTEGER, cost_event_id INTEGER, @@ -684,7 +607,9 @@ CREATE TABLE cost ( payer_plan_period_id INTEGER, amount_allowed DECIMAL(19,4), -- NUMERIC revenue_code_concept_id INTEGER, - reveue_code_source_value VARCHAR(50) + reveue_code_source_value VARCHAR(50), + drg_concept_id INTEGER, + drg_source_value VARCHAR(3) ) ; diff --git a/Impala/OMOP_Parquet_v5.2.sql b/Impala/OMOP_Parquet_v5.2.sql index 7afd312..60ff974 100644 --- a/Impala/OMOP_Parquet_v5.2.sql +++ b/Impala/OMOP_Parquet_v5.2.sql @@ -405,29 +405,6 @@ SELECT FROM omop_cdm.payer_plan_period; -/* The individual cost tables are being phased out and will disappear soon - -CREATE TABLE omop_cdm_parquet.visit_cost -STORED AS PARQUET -AS -SELECT * from omop_cdm.visit_cost; - -CREATE TABLE omop_cdm_parquet.procedure_cost -STORED AS PARQUET -AS -SELECT * from omop_cdm.procedure_cost; - -CREATE TABLE omop_cdm_parquet.drug_cost -STORED AS PARQUET -AS -SELECT * from omop_cdm.drug_cost; - -CREATE TABLE omop_cdm_parquet.device_cost -STORED AS PARQUET -AS -SELECT * from omop_cdm.device_cost; -*/ - CREATE TABLE omop_cdm_parquet.cost STORED AS PARQUET AS diff --git a/Oracle/OMOP CDM constraints - Oracle.sql b/Oracle/OMOP CDM constraints - Oracle.sql index a1e3207..f093106 100644 --- a/Oracle/OMOP CDM constraints - Oracle.sql +++ b/Oracle/OMOP CDM constraints - Oracle.sql @@ -464,7 +464,7 @@ ALTER TABLE provider ADD CONSTRAINT fpk_provider_specialty_s FOREIGN KEY (specia ALTER TABLE provider ADD CONSTRAINT fpk_provider_gender_s FOREIGN KEY (gender_source_concept_id) REFERENCES concept (concept_id); - +ALTER TABLE cost ADD CONSTRAINT fpk_drg_concept FOREIGN KEY (drg_concept_id) REFERENCES concept (concept_id); /************************ @@ -480,6 +480,8 @@ ALTER TABLE cost ADD CONSTRAINT fpk_visit_cost_currency FOREIGN KEY (currency_co ALTER TABLE cost ADD CONSTRAINT fpk_visit_cost_period FOREIGN KEY (payer_plan_period_id) REFERENCES payer_plan_period (payer_plan_period_id); + + /************************ Standardized derived elements diff --git a/Oracle/OMOP CDM ddl - Oracle.sql b/Oracle/OMOP CDM ddl - Oracle.sql index 5f7a4f1..14147fc 100644 --- a/Oracle/OMOP CDM ddl - Oracle.sql +++ b/Oracle/OMOP CDM ddl - Oracle.sql @@ -568,86 +568,6 @@ CREATE TABLE payer_plan_period ; --- The individual cost tables are phased out and will be removed -/* -CREATE TABLE visit_cost - ( - visit_cost_id INTEGER NOT NULL , - visit_occurrence_id INTEGER NOT NULL , - currency_concept_id INTEGER NULL , - paid_copay FLOAT NULL , - paid_coinsurance FLOAT NULL , - paid_toward_deductible FLOAT NULL , - paid_by_payer FLOAT NULL , - paid_by_coordination_benefits FLOAT NULL , - total_out_of_pocket FLOAT NULL , - total_paid FLOAT NULL , - payer_plan_period_id INTEGER NULL - ) -; - - - -CREATE TABLE procedure_cost - ( - procedure_cost_id INTEGER NOT NULL , - procedure_occurrence_id INTEGER NOT NULL , - currency_concept_id INTEGER NULL , - paid_copay FLOAT NULL , - paid_coinsurance FLOAT NULL , - paid_toward_deductible FLOAT NULL , - paid_by_payer FLOAT NULL , - paid_by_coordination_benefits FLOAT NULL , - total_out_of_pocket FLOAT NULL , - total_paid FLOAT NULL , - revenue_code_concept_id INTEGER NULL , - payer_plan_period_id INTEGER NULL , - revenue_code_source_value VARCHAR(50) NULL - ) -; - - - -CREATE TABLE drug_cost - ( - drug_cost_id INTEGER NOT NULL , - drug_exposure_id INTEGER NOT NULL , - currency_concept_id INTEGER NULL , - paid_copay FLOAT NULL , - paid_coinsurance FLOAT NULL , - paid_toward_deductible FLOAT NULL , - paid_by_payer FLOAT NULL , - paid_by_coordination_benefits FLOAT NULL , - total_out_of_pocket FLOAT NULL , - total_paid FLOAT NULL , - ingredient_cost FLOAT NULL , - dispensing_fee FLOAT NULL , - average_wholesale_price FLOAT NULL , - payer_plan_period_id INTEGER NULL - ) -; - - - - - -CREATE TABLE device_cost - ( - device_cost_id INTEGER NOT NULL , - device_exposure_id INTEGER NOT NULL , - currency_concept_id INTEGER NULL , - paid_copay FLOAT NULL , - paid_coinsurance FLOAT NULL , - paid_toward_deductible FLOAT NULL , - paid_by_payer FLOAT NULL , - paid_by_coordination_benefits FLOAT NULL , - total_out_of_pocket FLOAT NULL , - total_paid FLOAT NULL , - payer_plan_period_id INTEGER NULL - ) -; -*/ - CREATE TABLE cost ( @@ -670,7 +590,9 @@ CREATE TABLE cost payer_plan_period_id INTEGER NULL , amount_allowed FLOAT NULL , revenue_code_concept_id INTEGER NULL , - reveue_code_source_value VARCHAR2(50) NULL + reveue_code_source_value VARCHAR2(50) NULL , + drg_concept_id INTEGER NULL, + drg_source_value VARCHAR(3) NULL ) ; diff --git a/PostgreSQL/OMOP CDM constraints - PostgreSQL.sql b/PostgreSQL/OMOP CDM constraints - PostgreSQL.sql index 429c111..e72c7e6 100644 --- a/PostgreSQL/OMOP CDM constraints - PostgreSQL.sql +++ b/PostgreSQL/OMOP CDM constraints - PostgreSQL.sql @@ -478,6 +478,8 @@ ALTER TABLE cost ADD CONSTRAINT fpk_visit_cost_currency FOREIGN KEY (currency_co ALTER TABLE cost ADD CONSTRAINT fpk_visit_cost_period FOREIGN KEY (payer_plan_period_id) REFERENCES payer_plan_period (payer_plan_period_id); +ALTER TABLE cost ADD CONSTRAINT fpk_drg_concept FOREIGN KEY (drg_concept_id) REFERENCES concept (concept_id); + /************************ diff --git a/PostgreSQL/OMOP CDM ddl - PostgreSQL.sql b/PostgreSQL/OMOP CDM ddl - PostgreSQL.sql index af5e54e..07ada4d 100644 --- a/PostgreSQL/OMOP CDM ddl - PostgreSQL.sql +++ b/PostgreSQL/OMOP CDM ddl - PostgreSQL.sql @@ -568,85 +568,6 @@ CREATE TABLE payer_plan_period ; -/* The individual cost tables are being phased out and will disappear soon - -CREATE TABLE visit_cost - ( - visit_cost_id INTEGER NOT NULL , - visit_occurrence_id INTEGER NOT NULL , - currency_concept_id INTEGER NULL , - paid_copay NUMERIC NULL , - paid_coinsurance NUMERIC NULL , - paid_toward_deductible NUMERIC NULL , - paid_by_payer NUMERIC NULL , - paid_by_coordination_benefits NUMERIC NULL , - total_out_of_pocket NUMERIC NULL , - total_paid NUMERIC NULL , - payer_plan_period_id INTEGER NULL - ) -; - - - -CREATE TABLE procedure_cost - ( - procedure_cost_id INTEGER NOT NULL , - procedure_occurrence_id INTEGER NOT NULL , - currency_concept_id INTEGER NULL , - paid_copay NUMERIC NULL , - paid_coinsurance NUMERIC NULL , - paid_toward_deductible NUMERIC NULL , - paid_by_payer NUMERIC NULL , - paid_by_coordination_benefits NUMERIC NULL , - total_out_of_pocket NUMERIC NULL , - total_paid NUMERIC NULL , - revenue_code_concept_id INTEGER NULL , - payer_plan_period_id INTEGER NULL , - revenue_code_source_value VARCHAR(50) NULL - ) -; - - - -CREATE TABLE drug_cost - ( - drug_cost_id INTEGER NOT NULL , - drug_exposure_id INTEGER NOT NULL , - currency_concept_id INTEGER NULL , - paid_copay NUMERIC NULL , - paid_coinsurance NUMERIC NULL , - paid_toward_deductible NUMERIC NULL , - paid_by_payer NUMERIC NULL , - paid_by_coordination_benefits NUMERIC NULL , - total_out_of_pocket NUMERIC NULL , - total_paid NUMERIC NULL , - ingredient_cost NUMERIC NULL , - dispensing_fee NUMERIC NULL , - average_wholesale_price NUMERIC NULL , - payer_plan_period_id INTEGER NULL - ) -; - - - - - -CREATE TABLE device_cost - ( - device_cost_id INTEGER NOT NULL , - device_exposure_id INTEGER NOT NULL , - currency_concept_id INTEGER NULL , - paid_copay NUMERIC NULL , - paid_coinsurance NUMERIC NULL , - paid_toward_deductible NUMERIC NULL , - paid_by_payer NUMERIC NULL , - paid_by_coordination_benefits NUMERIC NULL , - total_out_of_pocket NUMERIC NULL , - total_paid NUMERIC NULL , - payer_plan_period_id INTEGER NULL - ) -; -*/ CREATE TABLE cost @@ -670,7 +591,9 @@ CREATE TABLE cost payer_plan_period_id INTEGER NULL , amount_allowed NUMERIC NULL , revenue_code_concept_id INTEGER NULL , - reveue_code_source_value VARCHAR(50) NULL + reveue_code_source_value VARCHAR(50) NULL , + drg_concept_id INTEGER NULL, + drg_source_value VARCHAR(3) NULL ) ; diff --git a/README.md b/README.md index 2bd8ef3..fbf1f96 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,9 @@ This version is based on the CDM working group proposals: * [#84](https://github.com/OHDSI/CommonDataModel/issues/84) Adds the following fields to CONDITION_OCCURRENCE: * CONDITION_STATUS_CONCEPT_ID * CONDITION_STATUS_SOURCE_VALUE +* [#69](https://github.com/OHDSI/CommonDataModel/issues/69) Adds the following fields to COST: + * DRG_CONCEPT_ID + * DRG_SOURCE_VALUE and is **backwards compatibile with v5.0.1**. The proposed and accepted changes include adding a datetime field to every table that had a date column and adding field DENOMINATOR_VALUE to the DRUG_STRENGTH table. These were the new columns added: diff --git a/Sql Server/OMOP CDM constraints - SQL Server.sql b/Sql Server/OMOP CDM constraints - SQL Server.sql index 4ee15d2..82ca1af 100644 --- a/Sql Server/OMOP CDM constraints - SQL Server.sql +++ b/Sql Server/OMOP CDM constraints - SQL Server.sql @@ -478,6 +478,7 @@ ALTER TABLE cost ADD CONSTRAINT fpk_visit_cost_currency FOREIGN KEY (currency_co ALTER TABLE cost ADD CONSTRAINT fpk_visit_cost_period FOREIGN KEY (payer_plan_period_id) REFERENCES payer_plan_period (payer_plan_period_id); +ALTER TABLE cost ADD CONSTRAINT fpk_drg_concept FOREIGN KEY (drg_concept_id) REFERENCES concept (concept_id); /************************ diff --git a/Sql Server/OMOP CDM ddl - SQL Server.sql b/Sql Server/OMOP CDM ddl - SQL Server.sql index 20e2f1d..e9d8fb2 100644 --- a/Sql Server/OMOP CDM ddl - SQL Server.sql +++ b/Sql Server/OMOP CDM ddl - SQL Server.sql @@ -589,7 +589,9 @@ CREATE TABLE cost payer_plan_period_id INTEGER NULL , amount_allowed FLOAT NULL , revenue_code_concept_id INTEGER NULL , - reveue_code_source_value VARCHAR(50) NULL + reveue_code_source_value VARCHAR(50) NULL, + drg_concept_id INTEGER NULL, + drg_source_value VARCHAR(3) NULL ) ;