Addresses cdm proposal #69

This commit is contained in:
clairblacketer 2017-07-14 13:32:52 -04:00
parent 19150d2720
commit 9a93623f96
9 changed files with 21 additions and 264 deletions

View File

@ -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)
)
;

View File

@ -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

View File

@ -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

View File

@ -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
)
;

View File

@ -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);
/************************

View File

@ -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
)
;

View File

@ -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:

View File

@ -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);
/************************

View File

@ -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
)
;