Skip to content

Commit

Permalink
Merge pull request #26 from tuva-health/testing-ci
Browse files Browse the repository at this point in the history
updates to data type casting to resolve try cast errors
  • Loading branch information
tuvaforrest authored Feb 15, 2024
2 parents 166d49f + 67698f8 commit f3d7a07
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions models/stage/elation_stage__lab_result.sql
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ select
, cast(null as {{ dbt.type_string() }} ) as normalized_component
, result.accession_status as status
, result.value as result
, result.resulted_date as result_date
, result.collected_date as collection_date
, cast(result.resulted_date as date) as result_date
, cast(result.collected_date as date) as collection_date
, result.units as source_units
, cast(null as {{ dbt.type_string() }} ) as normalized_units
, result.reference_min as source_reference_range_low
Expand Down
4 changes: 2 additions & 2 deletions models/stage/elation_stage__medication_fill.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ select
, fill.id as source_id
, fill.patient_id
, null as encounter_id
, last_fill_date as dispensing_date
, written_date as prescribing_date
, cast(last_fill_date as date) as dispensing_date
, cast(written_date as date) as prescribing_date
, 'rxnorm' as source_code_type
, rxnorm.rxnorm_code as source_code
, medication_name as source_description
Expand Down
6 changes: 3 additions & 3 deletions models/stage/elation_stage__patient_problem.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ select distinct
, prob.patient_id
, null as encounter_id
, null as claim_id
, prob.creation_time as recorded_date
, prob.start_date as onset_date
, prob.resolved_date
, cast(prob.creation_time as date) as recorded_date
, cast(prob.start_date as date) as onset_date
, cast(prob.resolved_date as date) as resolved_date
, case lower(prob.status)
when 'active' then 'active'
when 'resolved' then 'resolved'
Expand Down
2 changes: 1 addition & 1 deletion models/stage/elation_stage__procedure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ select
, note.patient_id
, note.id as encounter_id
, null as claim_id
, item.creation_time as procedure_date
, cast(item.creation_time as date) as procedure_date
, 'hcpcs' as source_code_type
, item.cpt as source_code
, null as source_description
Expand Down
1 change: 1 addition & 0 deletions models/stage/elation_stage__visit_note_encounter.sql
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ select
, null as died_flag
, physician_user_id as attending_provider_id
, null as facility_npi
, 'icd-10-cm' as primary_diagnosis_code_type
, icd10.icd_10_cm as primary_diagnosis_code
, icd10.description as primary_diagnosis_description
, null as ms_drg_code
Expand Down
2 changes: 1 addition & 1 deletion packages.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
packages:
- package: tuva-health/the_tuva_project
version: [">=0.5.0","<1.0.0"]
version: [">=0.7.0","<0.8.0"]
- package: dbt-labs/dbt_utils
version: 1.1.1

0 comments on commit f3d7a07

Please sign in to comment.