-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path01-UDS_create_tables.sql
158 lines (151 loc) · 4.01 KB
/
01-UDS_create_tables.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
/* CREATE TABLES FOR UDS DATA. */
DROP TABLE IF EXISTS patient_age_race;
DROP TABLE IF EXISTS clinical_data;
DROP TABLE IF EXISTS cost;
DROP TABLE IF EXISTS payer_mix_fpl;
DROP TABLE IF EXISTS services;
DROP TABLE IF EXISTS sites;
CREATE TABLE patient_age_race (
hc_name VARCHAR(200),
city VARCHAR(50),
state VARCHAR(50),
year INT,
total_patients INT,
children FLOAT,
adults_18to64 FLOAT,
adults_over64 FLOAT,
race_ethno_minority FLOAT,
hisp_lat_ethno FLOAT,
black FLOAT,
asian FLOAT,
native_amer_alaska FLOAT,
native_hawaii_pacific FLOAT,
more_than_one_race FLOAT,
another_language FLOAT,
hc_type VARCHAR(25)
);
CREATE TABLE clinical_data (
hc_name VARCHAR(200),
city VARCHAR(50),
state VARCHAR(50),
year INT,
hypertension FLOAT,
diabetes FLOAT,
asthma FLOAT,
hiv FLOAT,
prenatal_patients INT,
prenatal_patients_delivered INT,
access_to_prenatal_care FLOAT,
low_birth_weight FLOAT,
cervical_cancer_screening FLOAT,
adolescent_weight_screening FLOAT,
adult_weight_screening FLOAT,
adult_tobacco_use_screening FLOAT,
colorectal_cancer_screening FLOAT,
childhood_immunization FLOAT,
depression_screening FLOAT,
dental_sealants FLOAT,
asthma_treatment FLOAT,
statin_therapy_cardio_disease FLOAT,
heart_attack_stroke_treatment FLOAT,
bp_control FLOAT,
uncontrolled_diabetes FLOAT,
hiv_linkage_to_care FLOAT,
breast_cancer_screening FLOAT,
depression_remission FLOAT,
hiv_screening FLOAT,
hc_type VARCHAR(25)
);
CREATE TABLE cost (
hc_name VARCHAR(200),
city VARCHAR(50),
state VARCHAR(50),
year INT,
svc_grant_exp INT,
total_cost INT,
total_cost_per_patient FLOAT,
hc_type VARCHAR(25)
);
CREATE TABLE payer_mix_fpl (
hc_name VARCHAR(200),
city VARCHAR(50),
state VARCHAR(50),
year INT,
patients_at_below_200_fpl FLOAT,
patients_at_below_100_fpl FLOAT,
uninsured FLOAT,
medicaid FLOAT,
medicare FLOAT,
other_payer FLOAT,
hc_type VARCHAR(25)
);
CREATE TABLE services (
hc_name VARCHAR(200),
city VARCHAR(50),
state VARCHAR(50),
year INT,
medical FLOAT,
dental FLOAT,
mental_health FLOAT,
substance_abuse FLOAT,
vision FLOAT,
enabling FLOAT,
hc_type VARCHAR(25)
);
CREATE TABLE sites (
hc_type VARCHAR(200),
hc_id VARCHAR(50),
bhcmis_id VARCHAR(50),
bphc_id VARCHAR(50),
site_name VARCHAR(200),
site_address VARCHAR(200),
site_city VARCHAR(50),
site_state VARCHAR(2),
site_zipcode VARCHAR(50),
site_phone VARCHAR(50),
site_website VARCHAR(200),
op_hrs_per_wk FLOAT,
site_setting_id INT,
site_setting_desc VARCHAR(200),
site_status_id INT,
hc_status_desc VARCHAR(50),
site_medicare_billing_num VARCHAR(50),
site_npi VARCHAR(50),
loc_type_id INT,
loc_type_desc VARCHAR(50),
site_type_id INT,
site_type_desc VARCHAR(50),
hc_operator_id INT,
hc_operator_desc VARCHAR(50),
site_op_sched_id INT,
site_op_sched_desc VARCHAR(50),
site_op_calendar_id INT,
site_op_calendar_desc VARCHAR(50),
site_added_date DATE,
hc_name VARCHAR(200),
hc_address VARCHAR(200),
hc_city VARCHAR(50),
hc_state VARCHAR(2),
hc_zipcode VARCHAR(50),
hc_org_type VARCHAR(200),
site_longitude FLOAT,
site_latitude FLOAT,
site_mex_border_100km VARCHAR(2),
site_mex_border_county VARCHAR(2),
site_state_county_fed_info_code VARCHAR(5),
site_county_full VARCHAR(200),
site_county VARCHAR(200),
site_county_type VARCHAR(50),
site_region_code VARCHAR(2),
site_region_name VARCHAR(9),
site_state_fips_code VARCHAR(2),
site_state_name VARCHAR(50),
site_fips_congress_dist_num VARCHAR(4),
site_congress_dist_num VARCHAR(2),
site_congress_dist_name VARCHAR(50),
site_congress_dist_code VARCHAR(5),
site_us_rep_name VARCHAR(50),
site_us_sen_name_1 VARCHAR(50),
site_us_sen_name_2 VARCHAR(50),
data_collection_date DATE
);