diff --git a/models/intermediate/int__person.sql b/models/intermediate/int__person.sql index a17faef..f3cc436 100644 --- a/models/intermediate/int__person.sql +++ b/models/intermediate/int__person.sql @@ -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 diff --git a/models/omop/visit_detail.sql b/models/omop/visit_detail.sql index 1c97563..bf9d119 100644 --- a/models/omop/visit_detail.sql +++ b/models/omop/visit_detail.sql @@ -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) @@ -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 diff --git a/models/omop/visit_occurrence.sql b/models/omop/visit_occurrence.sql index 6b9b50a..dfe7615 100644 --- a/models/omop/visit_occurrence.sql +++ b/models/omop/visit_occurrence.sql @@ -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