Skip to content

Commit

Permalink
chore: use dbt macro cast over raw ANSI cast
Browse files Browse the repository at this point in the history
 - using this as a convention going forward
   - only applying on changes for this PR
  • Loading branch information
lawrenceadams committed Oct 1, 2024
1 parent 5c5cfd3 commit 16fb0a9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions models/intermediate/int__person.sql
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ SELECT
WHEN upper(p.ethnicity) = 'NONHISPANIC' THEN 38003564
ELSE 0
END AS ethnicity_concept_id
, cast(NULL AS INTEGER) AS location_id
, cast(NULL AS INTEGER) AS provider_id
, cast(NULL AS INTEGER) AS care_site_id
, {{ dbt.cast("NULL", api.Column.translate_type("integer")) }} AS location_id
, {{ dbt.cast("NULL", api.Column.translate_type("integer")) }} AS provider_id
, {{ dbt.cast("NULL", api.Column.translate_type("integer")) }} AS care_site_id
, p.patient_id AS person_source_value
, p.patient_gender AS gender_source_value
, 0 AS gender_source_concept_id
Expand Down
4 changes: 2 additions & 2 deletions models/omop/visit_detail.sql
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ SELECT
, av.visit_end_date AS visit_detail_end_datetime
, 32827 AS visit_detail_type_concept_id
, pr.provider_id
, cast(NULL AS INTEGER) AS care_site_id
, {{ dbt.cast("NULL", api.Column.translate_type("integer")) }} AS care_site_id
, 0 AS admitted_from_concept_id
, 0 AS discharged_to_concept_id
, lag(av.visit_occurrence_id)
Expand All @@ -34,7 +34,7 @@ SELECT
, 0 AS visit_detail_source_concept_id
, NULL AS admitted_from_source_value
, NULL AS discharged_to_source_value
, cast(NULL AS INTEGER) AS parent_visit_detail_id
, {{ dbt.cast("NULL", api.Column.translate_type("integer")) }} AS parent_visit_detail_id
, av.visit_occurrence_id
FROM {{ ref( 'int__all_visits') }} AS av
INNER JOIN {{ ref( 'person') }} AS p
Expand Down
2 changes: 1 addition & 1 deletion models/omop/visit_occurrence.sql
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ SELECT
, av.visit_end_date AS visit_end_datetime
, 32827 AS visit_type_concept_id
, pr.provider_id
, cast(NULL AS INTEGER) AS care_site_id
, {{ dbt.cast("NULL", api.Column.translate_type("integer")) }} AS care_site_id
, av.encounter_id AS visit_source_value
, 0 AS visit_source_concept_id
, 0 AS admitted_from_concept_id
Expand Down

0 comments on commit 16fb0a9

Please sign in to comment.