2018-08-31 01:00:34 +00:00
/*
Copyright 2018-08 Observational Health Data Sciences and Informatics
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
OMOP CDM v6.0 DDL
bigquery script to create OMOP common data model version 6.0
last revised: 27-Aug-2018
Authors: Patrick Ryan, Christian Reich, Clair Blacketer
*/
2018-03-19 21:03:02 +00:00
#standardsql
2018-01-03 19:56:42 +00:00
create table concept (
2018-09-24 16:55:05 +00:00
concept_id INT64 not null ,
concept_name STRING not null ,
domain_id STRING not null ,
vocabulary_id STRING not null ,
2018-08-31 01:00:34 +00:00
concept_class_id STRING not null ,
standard_concept STRING null ,
2018-09-24 16:55:05 +00:00
concept_code STRING not null ,
valid_start_date date not null ,
valid_end_date date not null ,
invalid_reason STRING null
2018-01-03 19:56:42 +00:00
)
;
create table vocabulary (
2018-08-31 01:00:34 +00:00
vocabulary_id STRING not null,
2018-09-24 16:55:05 +00:00
vocabulary_name STRING not null,
vocabulary_reference STRING not null,
2018-10-02 13:17:30 +00:00
vocabulary_version STRING null,
2018-09-24 16:55:05 +00:00
vocabulary_concept_id INT64 not null
2018-01-03 19:56:42 +00:00
)
;
create table domain (
2018-08-31 01:00:34 +00:00
domain_id STRING not null,
2018-09-24 16:55:05 +00:00
domain_name STRING not null,
domain_concept_id INT64 not null
2018-01-03 19:56:42 +00:00
)
;
create table concept_class (
2018-08-31 01:00:34 +00:00
concept_class_id STRING not null,
2018-09-24 16:55:05 +00:00
concept_class_name STRING not null,
concept_class_concept_id INT64 not null
2018-01-03 19:56:42 +00:00
)
;
create table concept_relationship (
2018-09-24 16:55:05 +00:00
concept_id_1 INT64 not null,
concept_id_2 INT64 not null,
relationship_id STRING not null,
valid_start_date date not null,
valid_end_date date not null,
invalid_reason STRING null
2018-01-03 19:56:42 +00:00
)
;
create table relationship (
2018-09-24 16:55:05 +00:00
relationship_id STRING not null,
relationship_name STRING not null,
is_hierarchical STRING not null,
defines_ancestry STRING not null,
2018-08-31 01:00:34 +00:00
reverse_relationship_id STRING not null,
2018-09-24 16:55:05 +00:00
relationship_concept_id INT64 not null
2018-01-03 19:56:42 +00:00
)
;
create table concept_synonym (
2018-09-24 16:55:05 +00:00
concept_id INT64 not null,
concept_synonym_name STRING not null,
language_concept_id INT64 not null
2018-01-03 19:56:42 +00:00
)
;
create table concept_ancestor (
2018-09-24 16:55:05 +00:00
ancestor_concept_id INT64 not null,
descendant_concept_id INT64 not null,
2018-03-19 20:39:52 +00:00
min_levels_of_separation INT64 not null,
max_levels_of_separation INT64 not null
2018-01-03 19:56:42 +00:00
)
;
create table source_to_concept_map (
2018-09-24 16:55:05 +00:00
source_code STRING not null,
source_concept_id INT64 not null,
2018-08-31 01:00:34 +00:00
source_vocabulary_id STRING not null,
2018-09-24 16:55:05 +00:00
source_code_description STRING null,
target_concept_id INT64 not null,
2018-08-31 01:00:34 +00:00
target_vocabulary_id STRING not null,
2018-09-24 16:55:05 +00:00
valid_start_date date not null,
valid_end_date date not null,
invalid_reason STRING null
2018-01-03 19:56:42 +00:00
)
;
create table drug_strength (
2018-09-24 16:55:05 +00:00
drug_concept_id INT64 not null,
ingredient_concept_id INT64 not null,
amount_value FLOAT64 null,
amount_unit_concept_id INT64 null,
numerator_value FLOAT64 null,
2018-08-31 01:00:34 +00:00
numerator_unit_concept_id INT64 null,
2018-09-24 16:55:05 +00:00
denominator_value FLOAT64 null,
2018-08-31 01:00:34 +00:00
denominator_unit_concept_id INT64 null,
2018-09-24 16:55:05 +00:00
box_size INT64 null,
valid_start_date date not null,
valid_end_date date not null,
invalid_reason STRING null
2018-01-03 19:56:42 +00:00
)
;
create table cdm_source
(
2018-09-24 16:55:05 +00:00
cdm_source_name STRING not null ,
cdm_source_abbreviation STRING null ,
cdm_holder STRING null ,
source_description STRING null ,
source_documentation_reference STRING null ,
cdm_etl_reference STRING null ,
source_release_date date null ,
cdm_release_date date null ,
cdm_version STRING null ,
vocabulary_version STRING null
2018-01-03 19:56:42 +00:00
)
;
create table metadata
(
2018-03-19 20:39:52 +00:00
metadata_concept_id INT64 not null ,
metadata_type_concept_id INT64 not null ,
2018-09-24 16:55:05 +00:00
name STRING not null ,
value_as_string STRING null ,
2018-08-31 01:00:34 +00:00
value_as_concept_id INT64 null ,
2018-09-24 16:55:05 +00:00
metadata_date date null ,
metadata_datetime DATETIME null
2018-01-03 19:56:42 +00:00
)
;
2018-09-24 16:55:05 +00:00
insert into metadata (metadata_concept_id, metadata_type_concept_id, name, value_as_string, value_as_concept_id, metadata_date, measurement_datetime) --Added cdm version record
values (0, 0, 'CDM Version', '6.0', 0, NULL, NULL)
2018-08-31 01:00:34 +00:00
;
2018-01-03 19:56:42 +00:00
--HINT DISTRIBUTE_ON_KEY(person_id)
create table person
(
2018-09-24 16:55:05 +00:00
person_id INT64 not null , --INT64s added
gender_concept_id INT64 not null ,
year_of_birth INT64 not null ,
month_of_birth INT64 null,
day_of_birth INT64 null,
birth_datetime DATETIME null,
2018-10-25 19:29:52 +00:00
death_datetime DATETIME null,
2018-09-24 16:55:05 +00:00
race_concept_id INT64 not null,
ethnicity_concept_id INT64 not null,
location_id INT64 null,
provider_id INT64 null,
care_site_id INT64 null,
person_source_value STRING null,
gender_source_value STRING null,
2018-10-02 19:42:21 +00:00
gender_source_concept_id INT64 not null,
2018-09-24 16:55:05 +00:00
race_source_value STRING null,
2018-10-02 19:42:21 +00:00
race_source_concept_id INT64 not null,
2018-09-24 16:55:05 +00:00
ethnicity_source_value STRING null,
2018-10-02 19:42:21 +00:00
ethnicity_source_concept_id INT64 not null
2018-01-03 19:56:42 +00:00
)
;
--HINT DISTRIBUTE_ON_KEY(person_id)
create table observation_period
(
2018-09-24 16:55:05 +00:00
observation_period_id INT64 not null ,
person_id INT64 not null ,
observation_period_start_date date not null ,
observation_period_end_date date not null ,
period_type_concept_id INT64 not null
2018-01-03 19:56:42 +00:00
)
;
--HINT DISTRIBUTE_ON_KEY(person_id)
create table specimen
(
2018-09-24 16:55:05 +00:00
specimen_id INT64 not null ,
person_id INT64 not null ,
specimen_concept_id INT64 not null ,
specimen_type_concept_id INT64 not null ,
specimen_date date null ,
specimen_datetime DATETIME not null ,
quantity FLOAT64 null ,
unit_concept_id INT64 null ,
2018-10-02 19:42:21 +00:00
anatomic_site_concept_id INT64 not null ,
disease_status_concept_id INT64 not null ,
2018-09-24 16:55:05 +00:00
specimen_source_id STRING null ,
specimen_source_value STRING null ,
unit_source_value STRING null ,
anatomic_site_source_value STRING null ,
disease_status_source_value STRING null
2018-01-03 19:56:42 +00:00
)
;
--HINT DISTRIBUTE_ON_KEY(person_id)
create table visit_occurrence
(
2018-09-24 16:55:05 +00:00
visit_occurrence_id INT64 not null ,
person_id INT64 not null ,
visit_concept_id INT64 not null ,
visit_start_date date null ,
visit_start_datetime DATETIME not null ,
visit_end_date date null ,
visit_end_datetime DATETIME not null ,
2018-03-19 20:39:52 +00:00
visit_type_concept_id INT64 not null ,
2018-09-24 16:55:05 +00:00
provider_id INT64 null,
care_site_id INT64 null,
visit_source_value STRING null,
2018-10-02 19:42:21 +00:00
visit_source_concept_id INT64 not null ,
admitted_from_concept_id INT64 not NULL , /*Changed from admitting_source_* */
2018-09-24 16:55:05 +00:00
admitted_from_source_value STRING NULL ,
discharge_to_source_value STRING null ,
2018-10-02 19:42:21 +00:00
discharge_to_concept_id INT64 not null ,
2018-09-24 16:55:05 +00:00
preceding_visit_occurrence_id INT64 null
2018-01-03 19:56:42 +00:00
)
;
--HINT DISTRIBUTE_ON_KEY(person_id)
create table visit_detail
(
2018-08-31 01:00:34 +00:00
visit_detail_id INT64 not null ,
person_id INT64 not null ,
2018-09-24 16:55:05 +00:00
visit_detail_concept_id INT64 not null ,
visit_detail_start_date date null ,
2018-08-31 01:00:34 +00:00
visit_detail_start_datetime DATETIME not null ,
2018-09-24 16:55:05 +00:00
visit_detail_end_date date null ,
visit_detail_end_datetime DATETIME not null ,
visit_detail_type_concept_id INT64 not null ,
provider_id INT64 null ,
care_site_id INT64 null ,
2018-10-02 19:42:21 +00:00
discharge_to_concept_id INT64 not null ,
admitted_from_concept_id INT64 not NULL , /*Changed from admitting_source_* */
2018-09-24 16:55:05 +00:00
admitted_from_source_value STRING NULL ,
visit_detail_source_value STRING null ,
2018-10-02 19:42:21 +00:00
visit_detail_source_concept_id INT64 not null ,
2018-09-24 16:55:05 +00:00
discharge_to_source_value STRING null ,
2018-08-31 01:00:34 +00:00
preceding_visit_detail_id INT64 null ,
visit_detail_parent_id INT64 null ,
visit_occurrence_id INT64 not null
2018-01-03 19:56:42 +00:00
)
;
--HINT DISTRIBUTE_ON_KEY(person_id)
create table procedure_occurrence
(
2018-09-24 16:55:05 +00:00
procedure_occurrence_id INT64 not null ,
person_id INT64 not null ,
procedure_concept_id INT64 not null ,
procedure_date date null ,
procedure_datetime DATETIME not null ,
2018-03-19 20:39:52 +00:00
procedure_type_concept_id INT64 not null ,
2018-10-02 19:42:21 +00:00
modifier_concept_id INT64 not null ,
2018-09-24 16:55:05 +00:00
quantity INT64 null ,
provider_id INT64 null ,
visit_occurrence_id INT64 null ,
visit_detail_id INT64 null ,
procedure_source_value STRING null ,
2018-10-02 19:42:21 +00:00
procedure_source_concept_id INT64 not null ,
2018-09-24 16:55:05 +00:00
modifier_source_value STRING null
2018-01-03 19:56:42 +00:00
)
;
--HINT DISTRIBUTE_ON_KEY(person_id)
create table drug_exposure
(
2018-09-24 16:55:05 +00:00
drug_exposure_id INT64 not null ,
person_id INT64 not null ,
drug_concept_id INT64 not null ,
drug_exposure_start_date date null ,
drug_exposure_start_datetime DATETIME not null ,
drug_exposure_end_date date null ,
drug_exposure_end_datetime DATETIME not null ,
verbatim_end_date date null ,
drug_type_concept_id INT64 not null ,
stop_reason STRING null ,
refills INT64 null ,
quantity FLOAT64 null ,
days_supply INT64 null ,
sig STRING null ,
2018-10-02 19:42:21 +00:00
route_concept_id INT64 not null ,
2018-09-24 16:55:05 +00:00
lot_number STRING null ,
provider_id INT64 null ,
visit_occurrence_id INT64 null ,
visit_detail_id INT64 null ,
drug_source_value STRING null ,
2018-10-02 19:42:21 +00:00
drug_source_concept_id INT64 not null ,
2018-09-24 16:55:05 +00:00
route_source_value STRING null ,
dose_unit_source_value STRING null
2018-01-03 19:56:42 +00:00
)
;
--HINT DISTRIBUTE_ON_KEY(person_id)
create table device_exposure
(
2018-09-24 16:55:05 +00:00
device_exposure_id INT64 not null ,
person_id INT64 not null ,
device_concept_id INT64 not null ,
device_exposure_start_date date null ,
device_exposure_start_datetime DATETIME not null ,
device_exposure_end_date date null ,
device_exposure_end_datetime DATETIME null ,
device_type_concept_id INT64 not null ,
unique_device_id STRING null ,
quantity INT64 null ,
provider_id INT64 null ,
visit_occurrence_id INT64 null ,
visit_detail_id INT64 null ,
device_source_value STRING null ,
2018-10-02 19:42:21 +00:00
device_source_concept_id INT64 not null
2018-01-03 19:56:42 +00:00
)
;
--HINT DISTRIBUTE_ON_KEY(person_id)
create table condition_occurrence
(
2018-03-19 20:39:52 +00:00
condition_occurrence_id INT64 not null ,
2018-09-24 16:55:05 +00:00
person_id INT64 not null ,
2018-03-19 20:39:52 +00:00
condition_concept_id INT64 not null ,
2018-09-24 16:55:05 +00:00
condition_start_date date null ,
condition_start_datetime DATETIME not null ,
condition_end_date date null ,
2018-08-31 01:00:34 +00:00
condition_end_datetime DATETIME null ,
2018-09-24 16:55:05 +00:00
condition_type_concept_id INT64 not null ,
2018-10-02 19:42:21 +00:00
condition_status_concept_id INT64 not null ,
2018-09-24 16:55:05 +00:00
stop_reason STRING null ,
provider_id INT64 null ,
visit_occurrence_id INT64 null ,
visit_detail_id INT64 null ,
condition_source_value STRING null ,
2018-10-02 19:42:21 +00:00
condition_source_concept_id INT64 not null ,
2018-09-24 16:55:05 +00:00
condition_status_source_value STRING null
2018-01-03 19:56:42 +00:00
)
;
--HINT DISTRIBUTE_ON_KEY(person_id)
create table measurement
(
2018-09-24 16:55:05 +00:00
measurement_id INT64 not null ,
person_id INT64 not null ,
2018-03-19 20:39:52 +00:00
measurement_concept_id INT64 not null ,
2018-09-24 16:55:05 +00:00
measurement_date date null ,
2018-08-31 01:00:34 +00:00
measurement_datetime DATETIME not null ,
2018-09-24 16:55:05 +00:00
measurement_time STRING null,
measurement_type_concept_id INT64 not null ,
operator_concept_id INT64 null ,
value_as_number FLOAT64 null ,
value_as_concept_id INT64 null ,
unit_concept_id INT64 null ,
range_low FLOAT64 null ,
range_high FLOAT64 null ,
provider_id INT64 null ,
visit_occurrence_id INT64 null ,
visit_detail_id INT64 null ,
measurement_source_value STRING null ,
2018-10-02 19:42:21 +00:00
measurement_source_concept_id INT64 not null ,
2018-09-24 16:55:05 +00:00
unit_source_value STRING null ,
value_source_value STRING null
2018-01-03 19:56:42 +00:00
)
;
--HINT DISTRIBUTE_ON_KEY(person_id)
create table note
(
2018-09-24 16:55:05 +00:00
note_id INT64 not null ,
person_id INT64 not null ,
note_event_id INT64 null ,
2018-10-02 19:42:21 +00:00
note_event_field_concept_id INT64 not NULL ,
2018-09-24 16:55:05 +00:00
note_date date null ,
note_datetime DATETIME not null ,
note_type_concept_id INT64 not null ,
note_class_concept_id INT64 not null ,
note_title STRING null ,
note_text STRING null ,
encoding_concept_id INT64 not null ,
language_concept_id INT64 not null ,
provider_id INT64 null ,
visit_occurrence_id INT64 null ,
visit_detail_id INT64 null ,
note_source_value STRING null
2018-01-03 19:56:42 +00:00
)
;
create table note_nlp
(
2018-09-24 16:55:05 +00:00
note_nlp_id INT64 not null ,
note_id INT64 not null ,
2018-10-02 19:42:21 +00:00
section_concept_id INT64 not null ,
2018-09-24 16:55:05 +00:00
snippet STRING null ,
"offset" STRING null ,
lexical_variant STRING not null ,
2018-10-02 19:42:21 +00:00
note_nlp_concept_id INT64 not null ,
2018-09-24 16:55:05 +00:00
nlp_system STRING null ,
nlp_date date not null ,
nlp_datetime DATETIME null ,
term_exists STRING null ,
term_temporal STRING null ,
term_modifiers STRING null ,
2018-10-02 19:42:21 +00:00
note_nlp_source_concept_id INT64 not null
2018-01-03 19:56:42 +00:00
)
;
--HINT DISTRIBUTE_ON_KEY(person_id)
create table observation
(
2018-09-24 16:55:05 +00:00
observation_id INT64 not null ,
person_id INT64 not null ,
observation_concept_id INT64 not null ,
observation_date date null ,
observation_datetime DATETIME not null ,
2018-08-31 01:00:34 +00:00
observation_type_concept_id INT64 not null ,
2018-09-24 16:55:05 +00:00
value_as_number FLOAT64 null ,
value_as_string STRING null ,
value_as_concept_id INT64 null ,
qualifier_concept_id INT64 null ,
unit_concept_id INT64 null ,
provider_id INT64 null ,
visit_occurrence_id INT64 null ,
visit_detail_id INT64 null ,
observation_source_value STRING null ,
2018-10-02 19:42:21 +00:00
observation_source_concept_id INT64 not null ,
2018-09-24 16:55:05 +00:00
unit_source_value STRING null ,
qualifier_source_value STRING null ,
observation_event_id INT64 null ,
2018-10-02 19:42:21 +00:00
obs_event_field_concept_id INT64 not NULL ,
2018-09-24 16:55:05 +00:00
value_as_datetime DATETIME null
2018-08-31 01:00:34 +00:00
)
;
2018-09-24 16:55:05 +00:00
create table survey_conduct
2018-08-31 01:00:34 +00:00
(
2018-09-24 16:55:05 +00:00
survey_conduct_id INT64 not null ,
person_id INT64 not null ,
survey_concept_id INT64 not null ,
survey_start_date date null ,
survey_start_datetime DATETIME null ,
survey_end_date date null ,
survey_end_datetime DATETIME not null ,
provider_id INT64 null ,
2018-10-02 19:42:21 +00:00
assisted_concept_id INT64 not null ,
respondent_type_concept_id INT64 not null ,
timing_concept_id INT64 not null ,
collection_method_concept_id INT64 not null ,
2018-09-24 16:55:05 +00:00
assisted_source_value STRING null ,
respondent_type_source_value STRING null ,
timing_source_value STRING null ,
collection_method_source_value STRING null ,
survey_source_value STRING null ,
2018-10-02 19:42:21 +00:00
survey_source_concept_id INT64 not null ,
2018-09-24 16:55:05 +00:00
survey_source_identifier STRING null ,
2018-10-02 19:42:21 +00:00
validated_survey_concept_id INT64 not null ,
2018-09-24 16:55:05 +00:00
validated_survey_source_value STRING null ,
survey_version_number STRING null ,
visit_occurrence_id INT64 null ,
2018-08-31 01:00:34 +00:00
visit_detail_id INT64 null ,
2018-09-24 16:55:05 +00:00
response_visit_occurrence_id INT64 null
2018-01-03 19:56:42 +00:00
)
;
create table fact_relationship
(
2018-09-24 16:55:05 +00:00
domain_concept_id_1 INT64 not null ,
fact_id_1 INT64 not null ,
domain_concept_id_2 INT64 not null ,
fact_id_2 INT64 not null ,
2018-03-19 20:39:52 +00:00
relationship_concept_id INT64 not null
2018-01-03 19:56:42 +00:00
)
;
create table location
(
2018-09-24 16:55:05 +00:00
location_id INT64 not null ,
2018-08-31 01:00:34 +00:00
address_1 STRING null ,
address_2 STRING null ,
2018-09-24 16:55:05 +00:00
city STRING null ,
state STRING null ,
zip STRING null ,
county STRING null ,
country STRING null ,
location_source_value STRING null ,
latitude FLOAT64 null ,
longitude FLOAT64 null
2018-08-31 01:00:34 +00:00
)
;
2018-09-24 16:55:05 +00:00
2018-08-31 01:00:34 +00:00
create table location_history
(
2018-09-24 16:55:05 +00:00
location_history_id INT64 not null ,
location_id INT64 not null ,
2018-10-02 19:42:21 +00:00
relationship_type_concept_id INT64 not null , --Recent addition based on github discussion
2018-09-24 16:55:05 +00:00
domain_id STRING not null ,
entity_id INT64 not null ,
start_date date not null ,
end_date date null
2018-01-03 19:56:42 +00:00
)
;
create table care_site
(
2018-09-24 16:55:05 +00:00
care_site_id INT64 not null ,
care_site_name STRING null ,
2018-10-02 19:56:21 +00:00
place_of_service_concept_id INT64 not null ,
2018-09-24 16:55:05 +00:00
location_id INT64 null ,
care_site_source_value STRING null ,
place_of_service_source_value STRING null
2018-01-03 19:56:42 +00:00
)
;
create table provider
(
2018-09-24 16:55:05 +00:00
provider_id INT64 not null ,
provider_name STRING null ,
npi STRING null ,
dea STRING null ,
2018-10-02 19:42:21 +00:00
specialty_concept_id INT64 not null ,
2018-09-24 16:55:05 +00:00
care_site_id INT64 null ,
year_of_birth INT64 null ,
2018-10-02 19:42:21 +00:00
gender_concept_id INT64 not null ,
2018-09-24 16:55:05 +00:00
provider_source_value STRING null ,
specialty_source_value STRING null ,
2018-10-02 19:42:21 +00:00
specialty_source_concept_id INT64 not null ,
2018-09-24 16:55:05 +00:00
gender_source_value STRING null ,
2018-10-02 19:42:21 +00:00
gender_source_concept_id INT64 not null
2018-01-03 19:56:42 +00:00
)
;
--HINT DISTRIBUTE_ON_KEY(person_id)
create table payer_plan_period
(
2018-09-24 16:55:05 +00:00
payer_plan_period_id INT64 not null ,
person_id INT64 not null ,
contract_person_id INT64 null ,
payer_plan_period_start_date date not null ,
payer_plan_period_end_date date not null ,
2018-10-02 19:42:21 +00:00
payer_concept_id INT64 not null ,
plan_concept_id INT64 not null ,
contract_concept_id INT64 not null ,
sponsor_concept_id INT64 not null ,
stop_reason_concept_id INT64 not null ,
2018-09-24 16:55:05 +00:00
payer_source_value STRING null ,
2018-10-02 19:42:21 +00:00
payer_source_concept_id INT64 not null ,
2018-09-24 16:55:05 +00:00
plan_source_value STRING null ,
2018-10-02 19:42:21 +00:00
plan_source_concept_id INT64 not null ,
2018-09-24 16:55:05 +00:00
contract_source_value STRING null ,
2018-10-02 19:42:21 +00:00
contract_source_concept_id INT64 not null ,
2018-09-24 16:55:05 +00:00
sponsor_source_value STRING null ,
2018-10-02 19:42:21 +00:00
sponsor_source_concept_id INT64 not null ,
2018-09-24 16:55:05 +00:00
family_source_value STRING null ,
stop_reason_source_value STRING null ,
2018-10-02 19:42:21 +00:00
stop_reason_source_concept_id INT64 not null
2018-01-03 19:56:42 +00:00
)
;
create table cost
(
2018-09-24 16:55:05 +00:00
cost_id INT64 not null ,
person_id INT64 not null,
cost_event_id INT64 not null ,
cost_event_field_concept_id INT64 NOT NULL ,
cost_concept_id INT64 not null ,
cost_type_concept_id INT64 not null ,
2018-10-02 19:42:21 +00:00
currency_concept_id INT64 not null ,
2018-09-24 16:55:05 +00:00
cost FLOAT64 null ,
incurred_date date not null ,
billed_date date null ,
paid_date date null ,
2018-10-02 19:42:21 +00:00
revenue_code_concept_id INT64 not null ,
drg_concept_id INT64 not null ,
2018-09-24 16:55:05 +00:00
cost_source_value STRING null ,
2018-10-02 19:42:21 +00:00
cost_source_concept_id INT64 not null ,
2018-09-24 16:55:05 +00:00
revenue_code_source_value STRING null ,
drg_source_value STRING null ,
payer_plan_period_id INT64 null
2018-01-03 19:56:42 +00:00
)
;
--HINT DISTRIBUTE_ON_KEY(person_id)
create table drug_era
(
2018-10-02 13:17:30 +00:00
drug_era_id INT64 not null ,
person_id INT64 not null ,
drug_concept_id INT64 not null ,
drug_era_start_datetime datetime not null ,
drug_era_end_datetime datetime not null ,
drug_exposure_count INT64 null ,
gap_days INT64 null
2018-01-03 19:56:42 +00:00
)
;
--HINT DISTRIBUTE_ON_KEY(person_id)
create table dose_era
(
2018-10-02 13:17:30 +00:00
dose_era_id INT64 not null ,
person_id INT64 not null ,
drug_concept_id INT64 not null ,
unit_concept_id INT64 not null ,
dose_value FLOAT64 not null ,
dose_era_start_datetime datetime not null ,
dose_era_end_datetime datetime not null
2018-01-03 19:56:42 +00:00
)
;
--HINT DISTRIBUTE_ON_KEY(person_id)
create table condition_era
(
2018-10-02 13:17:30 +00:00
condition_era_id INT64 not null ,
person_id INT64 not null ,
condition_concept_id INT64 not null ,
condition_era_start_datetime datetime not null ,
condition_era_end_datetime datetime not null ,
condition_occurrence_count INT64 null
2018-01-03 19:56:42 +00:00
)
;