Skip to content

Commit 52ed1bb

Browse files
authored
feat: demo project version updated to v0.15.x (#58)
* feat: demo project updated to version V0.15.x * appointment and immunization seed added * datatype update * seed.yml file cleanup * seed.yml file cleanup
1 parent 831dafd commit 52ed1bb

8 files changed

Lines changed: 178 additions & 20 deletions

File tree

dbt_project.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,19 @@ clean-targets:
3131

3232
seeds:
3333
the_tuva_project_demo:
34+
appointment:
35+
+post-hook: "{{ the_tuva_project.load_seed('tuva-public-resources/versioned_tuva_synthetic_data/0.15.0','appointment.csv',headers=true) }}"
3436
eligibility:
35-
+post-hook: "{{ the_tuva_project.load_seed('tuva-public-resources/versioned_tuva_synthetic_data/0.14.0','eligibility.csv',headers=true) }}"
37+
+post-hook: "{{ the_tuva_project.load_seed('tuva-public-resources/versioned_tuva_synthetic_data/0.15.0','eligibility.csv',headers=true) }}"
38+
immunization:
39+
+post-hook: "{{ the_tuva_project.load_seed('tuva-public-resources/versioned_tuva_synthetic_data/0.15.0','immunization.csv',headers=true) }}"
3640
lab_result:
37-
+post-hook: "{{ the_tuva_project.load_seed('tuva-public-resources/versioned_tuva_synthetic_data/0.14.0','lab_result.csv',headers=true) }}"
41+
+post-hook: "{{ the_tuva_project.load_seed('tuva-public-resources/versioned_tuva_synthetic_data/0.15.0','lab_result.csv',headers=true) }}"
3842
medical_claim:
39-
+post-hook: "{{ the_tuva_project.load_seed('tuva-public-resources/versioned_tuva_synthetic_data/0.14.0','medical_claim.csv',headers=true) }}"
43+
+post-hook: "{{ the_tuva_project.load_seed('tuva-public-resources/versioned_tuva_synthetic_data/0.15.0','medical_claim.csv',headers=true) }}"
4044
observation:
41-
+post-hook: "{{ the_tuva_project.load_seed('tuva-public-resources/versioned_tuva_synthetic_data/0.14.0','observation.csv',headers=true) }}"
45+
+post-hook: "{{ the_tuva_project.load_seed('tuva-public-resources/versioned_tuva_synthetic_data/0.15.0','observation.csv',headers=true) }}"
4246
pharmacy_claim:
43-
+post-hook: "{{ the_tuva_project.load_seed('tuva-public-resources/versioned_tuva_synthetic_data/0.14.0','pharmacy_claim.csv',headers=true) }}"
47+
+post-hook: "{{ the_tuva_project.load_seed('tuva-public-resources/versioned_tuva_synthetic_data/0.15.0','pharmacy_claim.csv',headers=true) }}"
4448
provider_attribution:
45-
+post-hook: "{{ the_tuva_project.load_seed('tuva-public-resources/versioned_tuva_synthetic_data/0.14.0','provider_attribution.csv',headers=true) }}"
49+
+post-hook: "{{ the_tuva_project.load_seed('tuva-public-resources/versioned_tuva_synthetic_data/0.15.0','provider_attribution.csv',headers=true) }}"

models/patient.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
select {% if target.type == 'fabric' %} top 0 {% else %}{% endif %}
22
cast(null as {{ dbt.type_string() }} ) as person_id
33
, cast(null as {{ dbt.type_string() }} ) as patient_id
4+
, cast(null as {{ dbt.type_string() }} ) as name_suffix
45
, cast(null as {{ dbt.type_string() }} ) as first_name
6+
, cast(null as {{ dbt.type_string() }} ) as middle_name
57
, cast(null as {{ dbt.type_string() }} ) as last_name
68
, cast(null as {{ dbt.type_string() }} ) as sex
79
, cast(null as {{ dbt.type_string() }} ) as race
@@ -17,6 +19,8 @@ select {% if target.type == 'fabric' %} top 0 {% else %}{% endif %}
1719
, cast(null as {{ dbt.type_float() }} ) as latitude
1820
, cast(null as {{ dbt.type_float() }} ) as longitude
1921
, cast(null as {{ dbt.type_string() }} ) as phone
22+
, cast(null as {{ dbt.type_string() }} ) as email
23+
, cast(null as {{ dbt.type_string() }} ) as ethnicity
2024
, cast(null as {{ dbt.type_string() }} ) as data_source
2125
, cast(null as {{ dbt.type_string() }} ) as file_name
2226
, cast(null as {{ dbt.type_timestamp() }} ) as ingest_datetime

packages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
packages:
22
- package: tuva-health/the_tuva_project
3-
version: [">=0.14.0","<0.15.0"]
3+
version: [">=0.15.0","<0.16.0"]
44
- package: dbt-labs/dbt_utils
55
version: [ ">=0.9.2" ]

seeds/_seeds.yml

Lines changed: 159 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,83 @@
11
version: 2
22

33
seeds:
4+
- name: appointment
5+
config:
6+
schema: input_layer
7+
tags: tuva_demo
8+
column_types:
9+
appointment_id: |
10+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
11+
person_id: |
12+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
13+
patient_id: |
14+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
15+
encounter_id: |
16+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
17+
source_appointment_type_code: |
18+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
19+
source_appointment_type_description: |
20+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
21+
normalized_appointment_type_code: |
22+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
23+
normalized_appointment_type_description: |
24+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
25+
start_datetime: |
26+
{%- if target.type in ("postgres", "databricks", "athena") -%} timestamp
27+
{%- elif target.type == "fabric" -%} datetime2(6)
28+
{%- else -%} datetime {%- endif -%}
29+
end_datetime: |
30+
{%- if target.type in ("postgres", "databricks", "athena") -%} timestamp
31+
{%- elif target.type == "fabric" -%} datetime2(6)
32+
{%- else -%} datetime {%- endif -%}
33+
duration: integer
34+
location_id: |
35+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
36+
practitioner_id: |
37+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
38+
source_status: |
39+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
40+
normalized_status: |
41+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
42+
appointment_specialty: |
43+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
44+
reason: |
45+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
46+
source_reason_code_type: |
47+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
48+
source_reason_code: |
49+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
50+
source_reason_description: |
51+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
52+
normalized_reason_code_type: |
53+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
54+
normalized_reason_code: |
55+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
56+
normalized_reason_description: |
57+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
58+
cancellation_reason: |
59+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
60+
source_cancellation_reason_code_type: |
61+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
62+
source_cancellation_reason_code: |
63+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
64+
source_cancellation_reason_description: |
65+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
66+
normalized_cancellation_reason_code_type: |
67+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
68+
normalized_cancellation_reason_code: |
69+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
70+
normalized_cancellation_reason_description: |
71+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
72+
data_source: |
73+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
74+
file_name: |
75+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
76+
ingest_datetime: |
77+
{%- if target.type in ("postgres", "databricks", "athena") -%} timestamp
78+
{%- elif target.type == "fabric" -%} datetime2(6)
79+
{%- else -%} datetime {%- endif -%}
80+
481
- name: eligibility
582
config:
683
schema: input_layer
@@ -37,6 +114,10 @@ seeds:
37114
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
38115
group_name: |
39116
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
117+
name_suffix: |
118+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
119+
middle_name: |
120+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
40121
first_name: |
41122
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
42123
last_name: |
@@ -55,6 +136,10 @@ seeds:
55136
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
56137
phone: |
57138
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
139+
email: |
140+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
141+
ethnicity: |
142+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
58143
data_source: |
59144
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
60145
file_name: |
@@ -65,43 +150,108 @@ seeds:
65150
{%- elif target.type == "fabric" -%} datetime2(6)
66151
{%- else -%} datetime {%- endif -%}
67152
68-
- name: lab_result
153+
- name: immunization
69154
config:
70155
schema: input_layer
71156
tags: tuva_demo
72157
column_types:
73-
lab_result_id: |
158+
immunization_id: |
74159
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
75160
person_id: |
76161
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
77162
patient_id: |
78163
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
79164
encounter_id: |
80165
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
81-
accession_number: |
82-
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
83166
source_code_type: |
84167
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
85168
source_code: |
86169
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
87170
source_description: |
88171
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
89-
source_component: |
90-
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
91172
normalized_code_type: |
92173
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
93174
normalized_code: |
94175
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
95176
normalized_description: |
96177
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
97-
normalized_component: |
178+
status: |
179+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
180+
status_reason: |
181+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
182+
occurrence_date: date
183+
source_dose: |
184+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
185+
lot_number: |
186+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
187+
body_site: |
188+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
189+
route: |
190+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
191+
location_id: |
192+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
193+
practitioner_id: |
194+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
195+
data_source: |
196+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
197+
file_name: |
198+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
199+
ingest_datetime: |
200+
{%- if target.type in ("postgres", "databricks", "athena") -%} timestamp
201+
{%- elif target.type == "fabric" -%} datetime2(6)
202+
{%- else -%} datetime {%- endif -%}
203+
204+
- name: lab_result
205+
config:
206+
schema: input_layer
207+
tags: tuva_demo
208+
column_types:
209+
lab_result_id: |
210+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
211+
person_id: |
212+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
213+
patient_id: |
214+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
215+
encounter_id: |
216+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
217+
accession_number: |
218+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
219+
source_order_type: |
220+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
221+
source_order_code: |
222+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
223+
source_order_description: |
224+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
225+
source_component_type: |
226+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
227+
source_component_code: |
228+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
229+
source_component_description: |
230+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
231+
normalized_order_type: |
232+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
233+
normalized_order_code: |
234+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
235+
normalized_order_description: |
236+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
237+
normalized_component_type: |
238+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
239+
normalized_component_code: |
240+
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
241+
normalized_component_description: |
98242
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
99243
status: |
100244
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
101245
result: |
102246
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
103-
result_date: date
104-
collection_date: date
247+
result_datetime: |
248+
{%- if target.type in ("postgres", "databricks", "athena") -%} timestamp
249+
{%- elif target.type == "fabric" -%} datetime2(6)
250+
{%- else -%} datetime {%- endif -%}
251+
collection_datetime: |
252+
{%- if target.type in ("postgres", "databricks", "athena") -%} timestamp
253+
{%- elif target.type == "fabric" -%} datetime2(6)
254+
{%- else -%} datetime {%- endif -%}
105255
source_units: |
106256
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
107257
normalized_units: |
@@ -128,8 +278,6 @@ seeds:
128278
{%- if target.type in ("postgres", "databricks") -%} timestamp
129279
{%- elif target.type == "fabric" -%} datetime2(6)
130280
{%- else -%} datetime {%- endif -%}
131-
tuva_last_run: |
132-
{%- if target.type in ("bigquery", "databricks") -%} string {%- else -%} varchar(255) {%- endif -%}
133281
134282
- name: medical_claim
135283
config:

seeds/appointment.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
appointment_id,person_id,patient_id,encounter_id,source_appointment_type_code,source_appointment_type_description,normalized_appointment_type_code,normalized_appointment_type_description,start_datetime,end_datetime,duration,location_id,practitioner_id,source_status,normalized_status,appointment_specialty,reason,source_reason_code_type,source_reason_code,source_reason_description,normalized_reason_code_type,normalized_reason_code,normalized_reason_description,cancellation_reason,source_cancellation_reason_code_type,source_cancellation_reason_code,source_cancellation_reason_description,normalized_cancellation_reason_code_type,normalized_cancellation_reason_code,normalized_cancellation_reason_description,data_source,file_name,ingest_datetime

seeds/eligibility.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
person_id,member_id,subscriber_id,gender,race,birth_date,death_date,death_flag,enrollment_start_date,enrollment_end_date,payer,payer_type,plan,original_reason_entitlement_code,dual_status_code,medicare_status_code,group_id,group_name,first_name,last_name,social_security_number,subscriber_relation,address,city,state,zip_code,phone,data_source,file_name,file_date,ingest_datetime
1+
person_id,member_id,subscriber_id,gender,race,birth_date,death_date,death_flag,enrollment_start_date,enrollment_end_date,payer,payer_type,plan,original_reason_entitlement_code,dual_status_code,medicare_status_code,group_id,group_name,name_suffix,first_name,middle_name,last_name,social_security_number,subscriber_relation,address,city,state,zip_code,phone,email,ethnicity,data_source,file_name,file_date,ingest_datetime

seeds/immunization.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
immunization_id,person_id,patient_id,encounter_id,source_code_type,source_code,source_description,normalized_code_type,normalized_code,normalized_description,status,status_reason,occurrence_date,source_dose,normalized_dose,lot_number,body_site,route,location_id,practitioner_id,data_source,file_name,ingest_datetime

0 commit comments

Comments
 (0)