From 645585925799a026967d72691660cad634abb384 Mon Sep 17 00:00:00 2001 From: brendagutman Date: Sun, 22 Feb 2026 15:11:28 -0600 Subject: [PATCH 1/4] Add aadsc test models --- .../macros/harmonization/clean_codes.sql | 15 + .../harmonization/generate_global_id.sql | 10 + .../macros/harmonization/get_columns.sql | 6 + .../macros/register_external_sources.sql | 4 + .../macros/register_external_sources_pg.sql | 30 ++ dbt_project/macros/run_sql.sql | 3 + .../include/aadsc/aadsc_test_condition.sql | 155 ++++++ .../include/aadsc/aadsc_test_participant.sql | 92 ++++ .../models/include/aadsc/aadsc_test_study.sql | 22 + ...dsc_src_chicoine_down_syndrome_extract.sql | 204 +++++++ dbt_project/models/include/docs/sources.yml | 506 ++++++++++++++++++ .../template_study/_template__models.yml | 0 .../template_study/_template__sources.yml | 0 dbt_project/packages.yml | 3 + .../include/aadsc/run_20260119_aadsc.sh | 10 + 15 files changed, 1060 insertions(+) create mode 100644 dbt_project/macros/harmonization/clean_codes.sql create mode 100644 dbt_project/macros/harmonization/generate_global_id.sql create mode 100644 dbt_project/macros/harmonization/get_columns.sql create mode 100644 dbt_project/macros/register_external_sources.sql create mode 100644 dbt_project/macros/register_external_sources_pg.sql create mode 100644 dbt_project/macros/run_sql.sql create mode 100644 dbt_project/models/include/aadsc/aadsc_test_condition.sql create mode 100644 dbt_project/models/include/aadsc/aadsc_test_participant.sql create mode 100644 dbt_project/models/include/aadsc/aadsc_test_study.sql create mode 100644 dbt_project/models/include/aadsc/participant/include_aadsc_src_chicoine_down_syndrome_extract.sql create mode 100644 dbt_project/models/include/docs/sources.yml delete mode 100644 dbt_project/models/include/template_study/_template__models.yml delete mode 100644 dbt_project/models/include/template_study/_template__sources.yml create mode 100644 dbt_project/packages.yml create mode 100755 dbt_project/run_commands/include/aadsc/run_20260119_aadsc.sh diff --git a/dbt_project/macros/harmonization/clean_codes.sql b/dbt_project/macros/harmonization/clean_codes.sql new file mode 100644 index 0000000..e74f760 --- /dev/null +++ b/dbt_project/macros/harmonization/clean_codes.sql @@ -0,0 +1,15 @@ +{%- macro clean_codes(column_name, expected_prefixes, sp_chars) -%} + {%- set ns = namespace(expr=column_name) -%} + {%- for prefix in expected_prefixes -%} + {%- set ns.expr = "replace(" ~ ns.expr ~ ", '" ~ prefix ~ "', '|" ~ prefix ~ "')" -%} + {%- endfor -%} + {%- set chars_to_remove = sp_chars | join('') -%} +( + select string_agg(distinct trim(code), '|' order by trim(code)) + from ( + select unnest(string_to_array(trim(both '|' + from translate({{ ns.expr }}, '{{ chars_to_remove }}', '')),'|')) as code + ) as split_codes + where code is not null and length(trim(code)) > 0 +) +{%- endmacro -%} diff --git a/dbt_project/macros/harmonization/generate_global_id.sql b/dbt_project/macros/harmonization/generate_global_id.sql new file mode 100644 index 0000000..9ec79d9 --- /dev/null +++ b/dbt_project/macros/harmonization/generate_global_id.sql @@ -0,0 +1,10 @@ +{%- macro generate_global_id(prefix='', descriptor=[], study_id='') -%} + {%- set formatted_columns = [] -%} + {%- for col in descriptor -%} + {%- do formatted_columns.append("'" ~ study_id ~ "'") -%} + {%- do formatted_columns.append("cast(coalesce(" ~ col ~ ", '') as text)") -%} + {%- endfor -%} +{{ + "'" ~ prefix ~ "' || '_' || md5(" ~ formatted_columns | join(" || '|' || ") ~ ")" +}} +{%- endmacro -%} \ No newline at end of file diff --git a/dbt_project/macros/harmonization/get_columns.sql b/dbt_project/macros/harmonization/get_columns.sql new file mode 100644 index 0000000..b0b21a8 --- /dev/null +++ b/dbt_project/macros/harmonization/get_columns.sql @@ -0,0 +1,6 @@ +{% macro get_columns(relation, exclude=[]) %} + {{ return(dbt_utils.get_filtered_columns_in_relation( + from=relation, + except=exclude + )) }} +{% endmacro %} diff --git a/dbt_project/macros/register_external_sources.sql b/dbt_project/macros/register_external_sources.sql new file mode 100644 index 0000000..cfb2d1d --- /dev/null +++ b/dbt_project/macros/register_external_sources.sql @@ -0,0 +1,4 @@ +{% macro register_external_sources(fq_tablename, csv_path) %} + {% do adapter.execute("CREATE SCHEMA IF NOT EXISTS " ~ fq_tablename ~ ";") %} + {% do adapter.execute("CREATE OR REPLACE VIEW " ~ fq_tablename ~ " AS SELECT * FROM read_csv_auto('" ~ csv_path ~ "');") %} +{% endmacro %} \ No newline at end of file diff --git a/dbt_project/macros/register_external_sources_pg.sql b/dbt_project/macros/register_external_sources_pg.sql new file mode 100644 index 0000000..4ab7609 --- /dev/null +++ b/dbt_project/macros/register_external_sources_pg.sql @@ -0,0 +1,30 @@ +{% macro register_external_sources_pg(tb_schema, tablename, columns, src_data_csv_path) %} + -- Validate inputs (optional but recommended) + {% if tb_schema is none or tablename is none or columns is none or src_data_csv_path is none %} + {{ log("Error: Missing required arguments in register_external_sources_pg macro.", warn=True) }} + {% do return('') %} + {% endif %} + + -- Build the CREATE TABLE statement + {% set create_table_query %} + CREATE SCHEMA IF NOT EXISTS {{ tb_schema }}; + + CREATE TABLE IF NOT EXISTS {{ tb_schema }}.{{ tablename }} ( + {% for column in columns %} + {{ column }}{% if not loop.last %},{% endif %} + {% endfor %} + ); + {% endset %} + + + + -- Combine both queries + {% set full_query %} + {{ create_table_query }} + {% endset %} + + + {{ log("Executing SQL: " ~ full_query, info=True) }} + {{ run_query(full_query) }} + +{% endmacro %} \ No newline at end of file diff --git a/dbt_project/macros/run_sql.sql b/dbt_project/macros/run_sql.sql new file mode 100644 index 0000000..2a6e7de --- /dev/null +++ b/dbt_project/macros/run_sql.sql @@ -0,0 +1,3 @@ +{% macro run_sql(sql) %} + {% do run_query(sql) %} +{% endmacro %} diff --git a/dbt_project/models/include/aadsc/aadsc_test_condition.sql b/dbt_project/models/include/aadsc/aadsc_test_condition.sql new file mode 100644 index 0000000..5181979 --- /dev/null +++ b/dbt_project/models/include/aadsc/aadsc_test_condition.sql @@ -0,0 +1,155 @@ +{{ config(materialized='table', schema='aadsc') }} + +{% set relation = ref('include_aadsc_src_chicoine_down_syndrome_extract') %} +{% set constant_columns = ['masked_id','age','sex','race','ethnicity','extraction_date'] %} +{% set condition_columns = get_columns(relation=relation, exclude=constant_columns) %} + + with + condition_display_lookup as ( + select + variable_name as condition, + description as display + from {{ ref('clinical_stg_dd') }} + ) + ,unpivot_df as ( + -- Convert from 'wide' to 'long' src data format. + -- Uses union all strategy as it is available across dbs. + -- Output schema: 'masked_id','age','sex','race','ethnicity','extraction_date','bmi','height','weight','condition','assertion'(1,bmi,height,or weight) + + {% for col in condition_columns %} + select + {{ constant_columns | join(', ') }}, + '{{ col }}' as condition, + cast({{ col }} as varchar) as assertion + from {{ ref('include_aadsc_src_chicoine_down_syndrome_extract') }} + where {{ col }} IS NOT NULL + {% if not loop.last %}union all{% endif %} + {% endfor %} + ) + ,mondo_annotations as ( + select + distinct + "condition_name" ::text as condition_name, + "mondo_codes_with_prefix" ::text as mondo_code, + "mondo_label" ::text as mondo_label + from {{ ref('annotations') }} as a + where "mondo_codes_with_prefix" is not null + or "mondo_label" is not null + ) + ,hpo_annotations as ( + select + distinct + "condition_name" ::text as condition_name, + "hpo_codes_with_prefix" ::text as hpo_code, + "hpo_label" ::text as hpo_label + from {{ ref('annotations') }} as a + where "hpo_codes_with_prefix" is not null + or "hpo_label" is not null + ) + ,other_annotations as ( + select + distinct + "condition_name" ::text as condition_name, + "icd9_codes_with_prefix", + "icd10_codes_with_prefix", + "icdO_codes_with_prefix", + "icd10cm_label", + "loinc_label", + "loinc_code" + from {{ ref('annotations') }} as a + where "icd9_codes_with_prefix" is not null + or "icd10_codes_with_prefix" is not null + or "icdO_codes_with_prefix" is not null + or "loinc_code" is not null + ) + + ,source as ( + select + 'AADSC' as "study_code", + clinical.condition::text as "condition_or_measure_source_text_code", -- Ex: gi_ibs_status + cdl.display::text as "condition_or_measure_source_text_display", -- Ex: Irritable bowel syndrome + case + when cdl.display = 'HP_0032551' then clinical.condition + else coalesce(cdl.display,clinical.condition,NULL) + end as "condition_or_measure_source_text", + clinical.masked_id::text as "participant_external_id", + case + when clinical.assertion = '1' + then 'Observed' + when clinical.assertion = '0' + then 'Not Observed' + when clinical.assertion is null + then null + else null -- NULL for bmi, height, weight + end as "condition_interpretation", + ha.hpo_label, + ha.hpo_code, + ma.mondo_label, + ma.mondo_code, + case + when ha.hpo_code is null and ma.mondo_code is null + then (select COALESCE("icd10cm_label","loinc_label",'') + from other_annotations + where condition_name = clinical.condition + order by "icd9_codes_with_prefix", "icd10_codes_with_prefix", "icdO_codes_with_prefix", "loinc_code" + limit 1)::text + else null + end as "other_label", + case + when ha.hpo_code is null and ma.mondo_code is null + then (select COALESCE("icd9_codes_with_prefix", "icd10_codes_with_prefix", "icdO_codes_with_prefix","loinc_code",'') + from other_annotations + where condition_name = clinical.condition + order by "icd9_codes_with_prefix", "icd10_codes_with_prefix", "icdO_codes_with_prefix", "loinc_code" + limit 1)::text + else null + end as "other_code", + case + when clinical.condition in ('bmi','height','weight') + then clinical.assertion + else null + end as "measure_value", + case + when clinical.condition = 'bmi' + then 'kg/m2' + when clinical.condition = 'height' + then 'in' + when clinical.condition = 'weight' + then 'lb' + else null + end as "measure_unit" + from unpivot_df as clinical + left join mondo_annotations as ma + on ma.condition_name = clinical.condition + left join hpo_annotations as ha + on ha.condition_name = clinical.condition + left join condition_display_lookup as cdl + on cdl.condition = clinical.condition + ) + + +select + source.study_code, --req + null::text as "participant_global_id", --req, created after the pipeline + source.participant_external_id, --req + null::text as "event_id", + null::text as "event_type", + null::integer as "age_at_condition_measure_observation", + source.condition_or_measure_source_text_display, + source.condition_or_measure_source_text_code, + source.condition_or_measure_source_text, + null::integer as "age_at_first_patient_engagement", + source.condition_interpretation, + null::text as "condition_status", + null::text as "condition_data_source", + source.hpo_label, + source.hpo_code, + source.mondo_label, + source.mondo_code, + null::text as "maxo_label", + null::text as "maxo_code", + source.other_label, + source.other_code, + source.measure_value as "measure_value", + source.measure_unit as "measure_unit" +from source \ No newline at end of file diff --git a/dbt_project/models/include/aadsc/aadsc_test_participant.sql b/dbt_project/models/include/aadsc/aadsc_test_participant.sql new file mode 100644 index 0000000..090ee2c --- /dev/null +++ b/dbt_project/models/include/aadsc/aadsc_test_participant.sql @@ -0,0 +1,92 @@ +{{ config(materialized='table', schema='aadsc') }} + + with + source as ( + select + 'AADSC' as "study_code", + clinical.masked_id::text as "participant_external_id", + 'Proband-only' as "family_type", + 'Proband' as "family_relationship", + case + when clinical.sex = 'Female' + then 'Female' + when clinical.sex = 'Male' + then 'Male' + when clinical.sex is null + then 'Unknown' + else null + end as "sex", + case + when clinical.race = 'Black/African American' + then 'Black or African American' + when clinical.race = 'Native Hawaiian' + then 'Native Hawaiian or Other Pacific Islander' + when clinical.race = 'Two or more races' + then 'More than one race' + when clinical.race = 'Other Pacific Islander' + then 'Native Hawaiian or Other Pacific Islander' + when clinical.race = 'XXNative Hawaiian/Other Pacific Islander' + then 'Native Hawaiian or Other Pacific Islander' + when clinical.race = 'American Indian or Alaskan Native' + then 'American Indian or Alaska Native' + when clinical.race = 'Unknown' + then 'Unknown' + when clinical.race = 'Asian' + then 'Asian' + when clinical.race = 'White' + then 'White' + when clinical.race is null + then 'Unknown' + else null + end as "race", + case + when clinical.ethnicity = 'Hispanic/Latino Origin' + then 'Hispanic or Latino' + when clinical.ethnicity = 'Not of Hispanic or Latino Origin' + then 'Not Hispanic or Latino' + when clinical.ethnicity = 'Patient Refused' + then 'Prefer not to answer' + when clinical.ethnicity = 'Unknown' + then 'Unknown' + when clinical.ethnicity is null + then 'Unknown' + else null + end as "ethnicity", + case + when clinical.ds_diagnosis = '1' + then 'T21' + else null + end as "down_syndrome_status", + case + when clinical.age = 'Age 90 or older' + then ROUND(90 * 365.25) + when CAST(clinical.age AS FLOAT) >= 0 AND CAST(clinical.age AS FLOAT) < 90 + then ROUND(CAST(clinical.age AS FLOAT) * 365.25) -- years to days conversion + when clinical.age is null + then null + else null + end as "age_at_last_vital_status" + from {{ ref('include_aadsc_src_chicoine_down_syndrome_extract') }} as clinical + ) + + select + source.study_code, --req + null::text as "participant_global_id", --req, created after the pipeline + source.participant_external_id, --req + null::text as "family_id", + source.family_type, --req + null::text as "father_id", + null::text as "mother_id", + null::text as "sibling_id", + null::text as "other_family_member_id", + source.family_relationship, --req + source.sex, --req + source.race, --req + source.ethnicity, --req + source.down_syndrome_status, --req + null::integer as "age_at_first_patient_engagement", --req + null::text as "first_patient_engagement_event", --req + null::text as "outcomes_vital_status", + source.age_at_last_vital_status::integer as "age_at_last_vital_status" + from source + \ No newline at end of file diff --git a/dbt_project/models/include/aadsc/aadsc_test_study.sql b/dbt_project/models/include/aadsc/aadsc_test_study.sql new file mode 100644 index 0000000..a84f75a --- /dev/null +++ b/dbt_project/models/include/aadsc/aadsc_test_study.sql @@ -0,0 +1,22 @@ +{{ config(materialized='table', schema='aadsc_data') }} + +{% set relation = ref('studies') %} +{% set exclude_columns = ['one','two','three','four'] %} +{% set study_columns = get_columns(relation=relation, exclude=constant_columns) %} + + + with + source as ( + select + {% for col in study_columns %} + "{{ col }}"::text AS "{{ col.lower().replace(" ", "_") }}" + {% if not loop.last %},{% endif %} + {% endfor %} + from {{ ref('studies') }} as s + WHERE "Study Code" = 'AADSC' + ) + +select +* +from source + \ No newline at end of file diff --git a/dbt_project/models/include/aadsc/participant/include_aadsc_src_chicoine_down_syndrome_extract.sql b/dbt_project/models/include/aadsc/participant/include_aadsc_src_chicoine_down_syndrome_extract.sql new file mode 100644 index 0000000..971a5a1 --- /dev/null +++ b/dbt_project/models/include/aadsc/participant/include_aadsc_src_chicoine_down_syndrome_extract.sql @@ -0,0 +1,204 @@ +{{ config(materialized='table') }} + + select + ROW_NUMBER() OVER () AS "include_index", + "MASKED_ID"::text as "masked_id", + "AGE"::text as "age", + "SEX"::text as "sex", + "RACE"::text as "race", + "ETHNICITY"::text as "ethnicity", + "EXTRACTION_DATE"::text as "extraction_date", + "BMI"::text as "bmi", + "HEIGHT"::text as "height", + "WEIGHT"::text as "weight", + "Abnormalities of gait and mobility"::text as "abnormalities_of_gait_and_mobility", + "Achalasia"::text as "achalasia", + "Acute bronchitis"::text as "acute_bronchitis", + "Acute kidney failure"::text as "acute_kidney_failure", + "acute myocardial infarction"::text as "acute_myocardial_infarction", + "Acute nasopharyngitis"::text as "acute_nasopharyngitis", + "Acute recurrent sinusitis"::text as "acute_recurrent_sinusitis", + "Acute sinusitis"::text as "acute_sinusitis", + "All malignant neoplamsm"::text as "all_malignant_neoplamsm", + "Allergic rhinitis"::text as "allergic_rhinitis", + "Appendicitis"::text as "appendicitis", + "Atherosclerotic heart disease of native coronary artery"::text as "atherosclerotic_heart_disease_of_native_coronary_artery", + "auto_alopecia_status"::text as "auto_alopecia_status", + "auto_arthropathy_status"::text as "auto_arthropathy_status", + "auto_atopic_status"::text as "auto_atopic_status", + "auto_celiac_status"::text as "auto_celiac_status", + "auto_dermatomyositis_status"::text as "auto_dermatomyositis_status", + "auto_graves_status"::text as "auto_graves_status", + "auto_hashimoto_status"::text as "auto_hashimoto_status", + "auto_hemol_anemia_status"::text as "auto_hemol_anemia_status", + "auto_herpetiformis_status"::text as "auto_herpetiformis_status", + "auto_hidradenitis_status"::text as "auto_hidradenitis_status", + "auto_kawasaki_status"::text as "auto_kawasaki_status", + "auto_menieres_status"::text as "auto_menieres_status", + "auto_myositis_status"::text as "auto_myositis_status", + "auto_narcolepsy_status"::text as "auto_narcolepsy_status", + "auto_neutropenia_status"::text as "auto_neutropenia_status", + "auto_other_specify"::text as "auto_other_specify", + "auto_planus_status"::text as "auto_planus_status", + "auto_psoriasis_status"::text as "auto_psoriasis_status", + "auto_psoriatic_arth_status"::text as "auto_psoriatic_arth_status", + "auto_rh_arthritis_status"::text as "auto_rh_arthritis_status", + "auto_rls_status"::text as "auto_rls_status", + "auto_sarcoidosis_status"::text as "auto_sarcoidosis_status", + "auto_sclerosus_status"::text as "auto_sclerosus_status", + "auto_sle_status"::text as "auto_sle_status", + "auto_t1_diabetes_status"::text as "auto_t1_diabetes_status", + "auto_thrombo_purpura_status"::text as "auto_thrombo_purpura_status", + "cardiac_asd_age"::text as "cardiac_asd_age", + "cardiac_cardiomyopathy_status"::text as "cardiac_cardiomyopathy_status", + "cardiac_conditions"::text as "cardiac_conditions", + "cardiac_congestive_status"::text as "cardiac_congestive_status", + "cardiac_hypertension_status"::text as "cardiac_hypertension_status", + "cardiac_mi_status"::text as "cardiac_mi_status", + "cardiac_other_chd_specify"::text as "cardiac_other_chd_specify", + "cardiac_other_specify"::text as "cardiac_other_specify", + "cardiac_pda_age"::text as "cardiac_pda_age", + "cardiac_pfo_age"::text as "cardiac_pfo_age", + "cardiac_tof_age"::text as "cardiac_tof_age", + "cardiac_vsd_age"::text as "cardiac_vsd_age", + "Cerebrovascular diseases"::text as "cerebrovascular_diseases", + "Cervical Myelopathy"::text as "cervical_myelopathy", + "Change in skin texture"::text as "change_in_skin_texture", + "cholesteatoma of external ear"::text as "cholesteatoma_of_external_ear", + "Chronic cough"::text as "chronic_cough", + "chronic ischemic heart diseases"::text as "chronic_ischemic_heart_diseases", + "Chronic kidney disease"::text as "chronic_kidney_disease", + "Chronic nasopharyngitis"::text as "chronic_nasopharyngitis", + "Constipation"::text as "constipation", + "develop_expressive_status"::text as "develop_expressive_status", + "develop_mixed_status"::text as "develop_mixed_status", + "Disorder of adrenal gland-unspecified"::text as "disorder_of_adrenal_gland_unspecified", + "Do not resuscitate status"::text as "do_not_resuscitate_status", + "ds_diagnosis"::text as "ds_diagnosis", + "Dysmenorrhea"::text as "dysmenorrhea", + "Dysphagia"::text as "dysphagia", + "endo_congen_diabetes_status"::text as "endo_congen_diabetes_status", + "endo_diabetes_conditions"::text as "endo_diabetes_conditions", + "endo_graves_status"::text as "endo_graves_status", + "endo_hyperthyroid_status"::text as "endo_hyperthyroid_status", + "endo_hypothyroid_status"::text as "endo_hypothyroid_status", + "endo_other_specify"::text as "endo_other_specify", + "endo_t1_diabetes_status"::text as "endo_t1_diabetes_status", + "endo_t2_diabetes_status"::text as "endo_t2_diabetes_status", + "endo_thyroid_other_specify"::text as "endo_thyroid_other_specify", + "endo_vitaminb_status"::text as "endo_vitaminb_status", + "endo_vitamind_status"::text as "endo_vitamind_status", + "ent_etd_status"::text as "ent_etd_status", + "ent_hearing_status"::text as "ent_hearing_status", + "ent_laryngo_status"::text as "ent_laryngo_status", + "ent_osa_status"::text as "ent_osa_status", + "ent_rhinitis_status"::text as "ent_rhinitis_status", + "Esophagitis"::text as "esophagitis", + "eye_amblyopia"::text as "eye_amblyopia", + "eye_astigmatism"::text as "eye_astigmatism", + "eye_blind"::text as "eye_blind", + "eye_cataracts"::text as "eye_cataracts", + "eye_glaucoma"::text as "eye_glaucoma", + "eye_hyperopia"::text as "eye_hyperopia", + "eye_keratoconus"::text as "eye_keratoconus", + "eye_myopia"::text as "eye_myopia", + "eye_nystagmus"::text as "eye_nystagmus", + "eye_ptosis"::text as "eye_ptosis", + "eye_retina"::text as "eye_retina", + "eye_strabismus"::text as "eye_strabismus", + "Fatty liver"::text as "fatty_liver", + "female_pcos_status"::text as "female_pcos_status", + "Follicular disorder"::text as "follicular_disorder", + "gi_celiac_status"::text as "gi_celiac_status", + "gi_diverticulitis_status"::text as "gi_diverticulitis_status", + "gi_esophageal_atresia_status"::text as "gi_esophageal_atresia_status", + "gi_gerd_status"::text as "gi_gerd_status", + "gi_hemorrhoids_status"::text as "gi_hemorrhoids_status", + "gi_hirschsprung_status"::text as "gi_hirschsprung_status", + "gi_ibs_status"::text as "gi_ibs_status", + "gi_other_specify"::text as "gi_other_specify", + "gi_peptic_ulcers_status"::text as "gi_peptic_ulcers_status", + "gi_pyloric_stenosis_status"::text as "gi_pyloric_stenosis_status", + "heme_amkl_status"::text as "heme_amkl_status", + "heme_aml_status"::text as "heme_aml_status", + "heme_b_all_status"::text as "heme_b_all_status", + "heme_leuk_rxn_status"::text as "heme_leuk_rxn_status", + "heme_other_cancer_status"::text as "heme_other_cancer_status", + "heme_other_specify"::text as "heme_other_specify", + "heme_tmd_status"::text as "heme_tmd_status", + "Hernia"::text as "hernia", + "Impacted cerumen"::text as "impacted_cerumen", + "infection_c_diff_status"::text as "infection_c_diff_status", + "infection_cellulitis_status"::text as "infection_cellulitis_status", + "infection_gout_status"::text as "infection_gout_status", + "infection_impetigo_status"::text as "infection_impetigo_status", + "infection_otitis_status"::text as "infection_otitis_status", + "infection_periodontitis_status"::text as "infection_periodontitis_status", + "infection_sinus_status"::text as "infection_sinus_status", + "infection_tb_status"::text as "infection_tb_status", + "infection_uti_status"::text as "infection_uti_status", + "infection_zoster_status"::text as "infection_zoster_status", + "lymph_anemia_status"::text as "lymph_anemia_status", + "male_cancer_status"::text as "male_cancer_status", + "male_hypospadias_status"::text as "male_hypospadias_status", + "male_phimosis_status"::text as "male_phimosis_status", + "male_testicles_status"::text as "male_testicles_status", + "Metrorrhagia"::text as "metrorrhagia", + "neuro_alz_status"::text as "neuro_alz_status", + "neuro_dementia_status"::text as "neuro_dementia_status", + "neuro_epilepsy_status"::text as "neuro_epilepsy_status", + "neuro_moya_status"::text as "neuro_moya_status", + "neuro_other_specify"::text as "neuro_other_specify", + "neuro_palsy_status"::text as "neuro_palsy_status", + "neuro_parkinson_status"::text as "neuro_parkinson_status", + "Nonalcoholic steatohepatitis"::text as "nonalcoholic_steatohepatitis", + "Onychomycosis"::text as "onychomycosis", + "orthostatic hypotension"::text as "orthostatic_hypotension", + "Overweight and Obesity"::text as "overweight_and_obesity", + "psych_add_adhd_status"::text as "psych_add_adhd_status", + "psych_anxiety_status"::text as "psych_anxiety_status", + "psych_autism_status"::text as "psych_autism_status", + "psych_bipolar_status"::text as "psych_bipolar_status", + "psych_depression_status"::text as "psych_depression_status", + "psych_ocd_status"::text as "psych_ocd_status", + "psych_odd_status"::text as "psych_odd_status", + "psych_other_specify"::text as "psych_other_specify", + "psych_panic_status"::text as "psych_panic_status", + "psych_ptsd_status"::text as "psych_ptsd_status", + "psych_schizophrenia_status"::text as "psych_schizophrenia_status", + "Psychiatric Disorders"::text as "psychiatric_disorders", + "pulm_asthma_status"::text as "pulm_asthma_status", + "pulm_other_specify"::text as "pulm_other_specify", + "pulm_pulm_hypertension_status"::text as "pulm_pulm_hypertension_status", + "skel_arthritis_status"::text as "skel_arthritis_status", + "skel_osteoarthritis_status"::text as "skel_osteoarthritis_status", + "skel_osteoporosis_status"::text as "skel_osteoporosis_status", + "skel_scoliosis_status"::text as "skel_scoliosis_status", + "skin_acne_age"::text as "skin_acne_age", + "skin_acne_status"::text as "skin_acne_status", + "skin_alopecia_age"::text as "skin_alopecia_age", + "skin_alopecia_status"::text as "skin_alopecia_status", + "skin_athlete_status"::text as "skin_athlete_status", + "skin_atopic_status"::text as "skin_atopic_status", + "skin_cellulitis_status"::text as "skin_cellulitis_status", + "skin_hidradenitis_status"::text as "skin_hidradenitis_status", + "skin_psoriasis_status"::text as "skin_psoriasis_status", + "skin_rosacea_status"::text as "skin_rosacea_status", + "skin_seborrheic_status"::text as "skin_seborrheic_status", + "Spondylosis"::text as "spondylosis", + "Tinea barbae and tinea capitis"::text as "tinea_barbae_and_tinea_capitis", + "Tinea Cruris"::text as "tinea_cruris", + "Unspecified blepharitis unspecified eye- unspecified eyelid"::text as "unspecified_blepharitis_unspecified_eye_unspecified_eyelid", + "Urinary incontinence"::text as "urinary_incontinence", + "Urinary retention"::text as "urinary_retention", + "urogen_agenesis_status"::text as "urogen_agenesis_status", + "urogen_hydroneph_status"::text as "urogen_hydroneph_status", + "urogen_kidney_dz_status"::text as "urogen_kidney_dz_status", + "urogen_kidney_status"::text as "urogen_kidney_status", + "urogen_other_specify"::text as "urogen_other_specify", + "urogen_reflux_status"::text as "urogen_reflux_status", + "vitamin B12 deficiency"::text as "vitamin_b12_deficiency", + "Vitamin D deficiency"::text as "vitamin_d_deficiency", + "Xerosis cutis"::text as "xerosis_cutis" + from {{ source('aadsc', 'chicoine_down_syndrome_extract') }} + \ No newline at end of file diff --git a/dbt_project/models/include/docs/sources.yml b/dbt_project/models/include/docs/sources.yml new file mode 100644 index 0000000..5116fac --- /dev/null +++ b/dbt_project/models/include/docs/sources.yml @@ -0,0 +1,506 @@ +sources: +- name: aadsc + schema: bg_dev_schema + tables: + - name: chicoine_down_syndrome_extract + description: Source table for chicoine_down_syndrome_extract. + columns: + - name: MASKED_ID + description: '{{ doc("chicoine_down_syndrome_extract_masked_id") }}' + - name: AGE + description: '{{ doc("chicoine_down_syndrome_extract_age") }}' + - name: SEX + description: '{{ doc("chicoine_down_syndrome_extract_sex") }}' + - name: RACE + description: '{{ doc("chicoine_down_syndrome_extract_race") }}' + - name: ETHNICITY + description: '{{ doc("chicoine_down_syndrome_extract_ethnicity") }}' + - name: EXTRACTION_DATE + description: '{{ doc("chicoine_down_syndrome_extract_extraction_date") }}' + - name: BMI + description: '{{ doc("chicoine_down_syndrome_extract_bmi") }}' + - name: HEIGHT + description: '{{ doc("chicoine_down_syndrome_extract_height") }}' + - name: WEIGHT + description: '{{ doc("chicoine_down_syndrome_extract_weight") }}' + - name: Abnormalities of gait and mobility + description: '{{ doc("chicoine_down_syndrome_extract_abnormalities_of_gai_99ce47da") + }}' + - name: Achalasia + description: '{{ doc("chicoine_down_syndrome_extract_achalasia") }}' + - name: Acute bronchitis + description: '{{ doc("chicoine_down_syndrome_extract_acute_bronchitis") }}' + - name: Acute kidney failure + description: '{{ doc("chicoine_down_syndrome_extract_acute_kidney_failure") + }}' + - name: acute myocardial infarction + description: '{{ doc("chicoine_down_syndrome_extract_acute_myocardial_infarction") + }}' + - name: Acute nasopharyngitis + description: '{{ doc("chicoine_down_syndrome_extract_acute_nasopharyngitis") + }}' + - name: Acute recurrent sinusitis + description: '{{ doc("chicoine_down_syndrome_extract_acute_recurrent_sinusitis") + }}' + - name: Acute sinusitis + description: '{{ doc("chicoine_down_syndrome_extract_acute_sinusitis") }}' + - name: All malignant neoplamsm + description: '{{ doc("chicoine_down_syndrome_extract_all_malignant_neoplamsm") + }}' + - name: Allergic rhinitis + description: '{{ doc("chicoine_down_syndrome_extract_allergic_rhinitis") }}' + - name: Appendicitis + description: '{{ doc("chicoine_down_syndrome_extract_appendicitis") }}' + - name: Atherosclerotic heart disease of native coronary artery + description: '{{ doc("chicoine_down_syndrome_extract_atherosclerotic_hear_881e1ef0") + }}' + - name: auto_alopecia_status + description: '{{ doc("chicoine_down_syndrome_extract_auto_alopecia_status") + }}' + - name: auto_arthropathy_status + description: '{{ doc("chicoine_down_syndrome_extract_auto_arthropathy_status") + }}' + - name: auto_atopic_status + description: '{{ doc("chicoine_down_syndrome_extract_auto_atopic_status") }}' + - name: auto_celiac_status + description: '{{ doc("chicoine_down_syndrome_extract_auto_celiac_status") }}' + - name: auto_dermatomyositis_status + description: '{{ doc("chicoine_down_syndrome_extract_auto_dermatomyositis_status") + }}' + - name: auto_graves_status + description: '{{ doc("chicoine_down_syndrome_extract_auto_graves_status") }}' + - name: auto_hashimoto_status + description: '{{ doc("chicoine_down_syndrome_extract_auto_hashimoto_status") + }}' + - name: auto_hemol_anemia_status + description: '{{ doc("chicoine_down_syndrome_extract_auto_hemol_anemia_status") + }}' + - name: auto_herpetiformis_status + description: '{{ doc("chicoine_down_syndrome_extract_auto_herpetiformis_status") + }}' + - name: auto_hidradenitis_status + description: '{{ doc("chicoine_down_syndrome_extract_auto_hidradenitis_status") + }}' + - name: auto_kawasaki_status + description: '{{ doc("chicoine_down_syndrome_extract_auto_kawasaki_status") + }}' + - name: auto_menieres_status + description: '{{ doc("chicoine_down_syndrome_extract_auto_menieres_status") + }}' + - name: auto_myositis_status + description: '{{ doc("chicoine_down_syndrome_extract_auto_myositis_status") + }}' + - name: auto_narcolepsy_status + description: '{{ doc("chicoine_down_syndrome_extract_auto_narcolepsy_status") + }}' + - name: auto_neutropenia_status + description: '{{ doc("chicoine_down_syndrome_extract_auto_neutropenia_status") + }}' + - name: auto_other_specify + description: '{{ doc("chicoine_down_syndrome_extract_auto_other_specify") }}' + - name: auto_planus_status + description: '{{ doc("chicoine_down_syndrome_extract_auto_planus_status") }}' + - name: auto_psoriasis_status + description: '{{ doc("chicoine_down_syndrome_extract_auto_psoriasis_status") + }}' + - name: auto_psoriatic_arth_status + description: '{{ doc("chicoine_down_syndrome_extract_auto_psoriatic_arth_status") + }}' + - name: auto_rh_arthritis_status + description: '{{ doc("chicoine_down_syndrome_extract_auto_rh_arthritis_status") + }}' + - name: auto_rls_status + description: '{{ doc("chicoine_down_syndrome_extract_auto_rls_status") }}' + - name: auto_sarcoidosis_status + description: '{{ doc("chicoine_down_syndrome_extract_auto_sarcoidosis_status") + }}' + - name: auto_sclerosus_status + description: '{{ doc("chicoine_down_syndrome_extract_auto_sclerosus_status") + }}' + - name: auto_sle_status + description: '{{ doc("chicoine_down_syndrome_extract_auto_sle_status") }}' + - name: auto_t1_diabetes_status + description: '{{ doc("chicoine_down_syndrome_extract_auto_t1_diabetes_status") + }}' + - name: auto_thrombo_purpura_status + description: '{{ doc("chicoine_down_syndrome_extract_auto_thrombo_purpura_status") + }}' + - name: cardiac_asd_age + description: '{{ doc("chicoine_down_syndrome_extract_cardiac_asd_age") }}' + - name: cardiac_cardiomyopathy_status + description: '{{ doc("chicoine_down_syndrome_extract_cardiac_cardiomyopathy_status") + }}' + - name: cardiac_conditions + description: '{{ doc("chicoine_down_syndrome_extract_cardiac_conditions") }}' + - name: cardiac_congestive_status + description: '{{ doc("chicoine_down_syndrome_extract_cardiac_congestive_status") + }}' + - name: cardiac_hypertension_status + description: '{{ doc("chicoine_down_syndrome_extract_cardiac_hypertension_status") + }}' + - name: cardiac_mi_status + description: '{{ doc("chicoine_down_syndrome_extract_cardiac_mi_status") }}' + - name: cardiac_other_chd_specify + description: '{{ doc("chicoine_down_syndrome_extract_cardiac_other_chd_specify") + }}' + - name: cardiac_other_specify + description: '{{ doc("chicoine_down_syndrome_extract_cardiac_other_specify") + }}' + - name: cardiac_pda_age + description: '{{ doc("chicoine_down_syndrome_extract_cardiac_pda_age") }}' + - name: cardiac_pfo_age + description: '{{ doc("chicoine_down_syndrome_extract_cardiac_pfo_age") }}' + - name: cardiac_tof_age + description: '{{ doc("chicoine_down_syndrome_extract_cardiac_tof_age") }}' + - name: cardiac_vsd_age + description: '{{ doc("chicoine_down_syndrome_extract_cardiac_vsd_age") }}' + - name: Cerebrovascular diseases + description: '{{ doc("chicoine_down_syndrome_extract_cerebrovascular_diseases") + }}' + - name: Cervical Myelopathy + description: '{{ doc("chicoine_down_syndrome_extract_cervical_myelopathy") }}' + - name: Change in skin texture + description: '{{ doc("chicoine_down_syndrome_extract_change_in_skin_texture") + }}' + - name: cholesteatoma of external ear + description: '{{ doc("chicoine_down_syndrome_extract_cholesteatoma_of_external_ear") + }}' + - name: Chronic cough + description: '{{ doc("chicoine_down_syndrome_extract_chronic_cough") }}' + - name: chronic ischemic heart diseases + description: '{{ doc("chicoine_down_syndrome_extract_chronic_ischemic_hea_2b530820") + }}' + - name: Chronic kidney disease + description: '{{ doc("chicoine_down_syndrome_extract_chronic_kidney_disease") + }}' + - name: Chronic nasopharyngitis + description: '{{ doc("chicoine_down_syndrome_extract_chronic_nasopharyngitis") + }}' + - name: Constipation + description: '{{ doc("chicoine_down_syndrome_extract_constipation") }}' + - name: develop_expressive_status + description: '{{ doc("chicoine_down_syndrome_extract_develop_expressive_status") + }}' + - name: develop_mixed_status + description: '{{ doc("chicoine_down_syndrome_extract_develop_mixed_status") + }}' + - name: Disorder of adrenal gland-unspecified + description: '{{ doc("chicoine_down_syndrome_extract_disorder_of_adrenal__1dd78479") + }}' + - name: Do not resuscitate status + description: '{{ doc("chicoine_down_syndrome_extract_do_not_resuscitate_status") + }}' + - name: ds_diagnosis + description: '{{ doc("chicoine_down_syndrome_extract_ds_diagnosis") }}' + - name: Dysmenorrhea + description: '{{ doc("chicoine_down_syndrome_extract_dysmenorrhea") }}' + - name: Dysphagia + description: '{{ doc("chicoine_down_syndrome_extract_dysphagia") }}' + - name: endo_congen_diabetes_status + description: '{{ doc("chicoine_down_syndrome_extract_endo_congen_diabetes_status") + }}' + - name: endo_diabetes_conditions + description: '{{ doc("chicoine_down_syndrome_extract_endo_diabetes_conditions") + }}' + - name: endo_graves_status + description: '{{ doc("chicoine_down_syndrome_extract_endo_graves_status") }}' + - name: endo_hyperthyroid_status + description: '{{ doc("chicoine_down_syndrome_extract_endo_hyperthyroid_status") + }}' + - name: endo_hypothyroid_status + description: '{{ doc("chicoine_down_syndrome_extract_endo_hypothyroid_status") + }}' + - name: endo_other_specify + description: '{{ doc("chicoine_down_syndrome_extract_endo_other_specify") }}' + - name: endo_t1_diabetes_status + description: '{{ doc("chicoine_down_syndrome_extract_endo_t1_diabetes_status") + }}' + - name: endo_t2_diabetes_status + description: '{{ doc("chicoine_down_syndrome_extract_endo_t2_diabetes_status") + }}' + - name: endo_thyroid_other_specify + description: '{{ doc("chicoine_down_syndrome_extract_endo_thyroid_other_specify") + }}' + - name: endo_vitaminb_status + description: '{{ doc("chicoine_down_syndrome_extract_endo_vitaminb_status") + }}' + - name: endo_vitamind_status + description: '{{ doc("chicoine_down_syndrome_extract_endo_vitamind_status") + }}' + - name: ent_etd_status + description: '{{ doc("chicoine_down_syndrome_extract_ent_etd_status") }}' + - name: ent_hearing_status + description: '{{ doc("chicoine_down_syndrome_extract_ent_hearing_status") }}' + - name: ent_laryngo_status + description: '{{ doc("chicoine_down_syndrome_extract_ent_laryngo_status") }}' + - name: ent_osa_status + description: '{{ doc("chicoine_down_syndrome_extract_ent_osa_status") }}' + - name: ent_rhinitis_status + description: '{{ doc("chicoine_down_syndrome_extract_ent_rhinitis_status") }}' + - name: Esophagitis + description: '{{ doc("chicoine_down_syndrome_extract_esophagitis") }}' + - name: eye_amblyopia + description: '{{ doc("chicoine_down_syndrome_extract_eye_amblyopia") }}' + - name: eye_astigmatism + description: '{{ doc("chicoine_down_syndrome_extract_eye_astigmatism") }}' + - name: eye_blind + description: '{{ doc("chicoine_down_syndrome_extract_eye_blind") }}' + - name: eye_cataracts + description: '{{ doc("chicoine_down_syndrome_extract_eye_cataracts") }}' + - name: eye_glaucoma + description: '{{ doc("chicoine_down_syndrome_extract_eye_glaucoma") }}' + - name: eye_hyperopia + description: '{{ doc("chicoine_down_syndrome_extract_eye_hyperopia") }}' + - name: eye_keratoconus + description: '{{ doc("chicoine_down_syndrome_extract_eye_keratoconus") }}' + - name: eye_myopia + description: '{{ doc("chicoine_down_syndrome_extract_eye_myopia") }}' + - name: eye_nystagmus + description: '{{ doc("chicoine_down_syndrome_extract_eye_nystagmus") }}' + - name: eye_ptosis + description: '{{ doc("chicoine_down_syndrome_extract_eye_ptosis") }}' + - name: eye_retina + description: '{{ doc("chicoine_down_syndrome_extract_eye_retina") }}' + - name: eye_strabismus + description: '{{ doc("chicoine_down_syndrome_extract_eye_strabismus") }}' + - name: Fatty liver + description: '{{ doc("chicoine_down_syndrome_extract_fatty_liver") }}' + - name: female_pcos_status + description: '{{ doc("chicoine_down_syndrome_extract_female_pcos_status") }}' + - name: Follicular disorder + description: '{{ doc("chicoine_down_syndrome_extract_follicular_disorder") }}' + - name: gi_celiac_status + description: '{{ doc("chicoine_down_syndrome_extract_gi_celiac_status") }}' + - name: gi_diverticulitis_status + description: '{{ doc("chicoine_down_syndrome_extract_gi_diverticulitis_status") + }}' + - name: gi_esophageal_atresia_status + description: '{{ doc("chicoine_down_syndrome_extract_gi_esophageal_atresia_status") + }}' + - name: gi_gerd_status + description: '{{ doc("chicoine_down_syndrome_extract_gi_gerd_status") }}' + - name: gi_hemorrhoids_status + description: '{{ doc("chicoine_down_syndrome_extract_gi_hemorrhoids_status") + }}' + - name: gi_hirschsprung_status + description: '{{ doc("chicoine_down_syndrome_extract_gi_hirschsprung_status") + }}' + - name: gi_ibs_status + description: '{{ doc("chicoine_down_syndrome_extract_gi_ibs_status") }}' + - name: gi_other_specify + description: '{{ doc("chicoine_down_syndrome_extract_gi_other_specify") }}' + - name: gi_peptic_ulcers_status + description: '{{ doc("chicoine_down_syndrome_extract_gi_peptic_ulcers_status") + }}' + - name: gi_pyloric_stenosis_status + description: '{{ doc("chicoine_down_syndrome_extract_gi_pyloric_stenosis_status") + }}' + - name: heme_amkl_status + description: '{{ doc("chicoine_down_syndrome_extract_heme_amkl_status") }}' + - name: heme_aml_status + description: '{{ doc("chicoine_down_syndrome_extract_heme_aml_status") }}' + - name: heme_b_all_status + description: '{{ doc("chicoine_down_syndrome_extract_heme_b_all_status") }}' + - name: heme_leuk_rxn_status + description: '{{ doc("chicoine_down_syndrome_extract_heme_leuk_rxn_status") + }}' + - name: heme_other_cancer_status + description: '{{ doc("chicoine_down_syndrome_extract_heme_other_cancer_status") + }}' + - name: heme_other_specify + description: '{{ doc("chicoine_down_syndrome_extract_heme_other_specify") }}' + - name: heme_tmd_status + description: '{{ doc("chicoine_down_syndrome_extract_heme_tmd_status") }}' + - name: Hernia + description: '{{ doc("chicoine_down_syndrome_extract_hernia") }}' + - name: Impacted cerumen + description: '{{ doc("chicoine_down_syndrome_extract_impacted_cerumen") }}' + - name: infection_c_diff_status + description: '{{ doc("chicoine_down_syndrome_extract_infection_c_diff_status") + }}' + - name: infection_cellulitis_status + description: '{{ doc("chicoine_down_syndrome_extract_infection_cellulitis_status") + }}' + - name: infection_gout_status + description: '{{ doc("chicoine_down_syndrome_extract_infection_gout_status") + }}' + - name: infection_impetigo_status + description: '{{ doc("chicoine_down_syndrome_extract_infection_impetigo_status") + }}' + - name: infection_otitis_status + description: '{{ doc("chicoine_down_syndrome_extract_infection_otitis_status") + }}' + - name: infection_periodontitis_status + description: '{{ doc("chicoine_down_syndrome_extract_infection_periodonti_f237152b") + }}' + - name: infection_sinus_status + description: '{{ doc("chicoine_down_syndrome_extract_infection_sinus_status") + }}' + - name: infection_tb_status + description: '{{ doc("chicoine_down_syndrome_extract_infection_tb_status") }}' + - name: infection_uti_status + description: '{{ doc("chicoine_down_syndrome_extract_infection_uti_status") + }}' + - name: infection_zoster_status + description: '{{ doc("chicoine_down_syndrome_extract_infection_zoster_status") + }}' + - name: lymph_anemia_status + description: '{{ doc("chicoine_down_syndrome_extract_lymph_anemia_status") }}' + - name: male_cancer_status + description: '{{ doc("chicoine_down_syndrome_extract_male_cancer_status") }}' + - name: male_hypospadias_status + description: '{{ doc("chicoine_down_syndrome_extract_male_hypospadias_status") + }}' + - name: male_phimosis_status + description: '{{ doc("chicoine_down_syndrome_extract_male_phimosis_status") + }}' + - name: male_testicles_status + description: '{{ doc("chicoine_down_syndrome_extract_male_testicles_status") + }}' + - name: Metrorrhagia + description: '{{ doc("chicoine_down_syndrome_extract_metrorrhagia") }}' + - name: neuro_alz_status + description: '{{ doc("chicoine_down_syndrome_extract_neuro_alz_status") }}' + - name: neuro_dementia_status + description: '{{ doc("chicoine_down_syndrome_extract_neuro_dementia_status") + }}' + - name: neuro_epilepsy_status + description: '{{ doc("chicoine_down_syndrome_extract_neuro_epilepsy_status") + }}' + - name: neuro_moya_status + description: '{{ doc("chicoine_down_syndrome_extract_neuro_moya_status") }}' + - name: neuro_other_specify + description: '{{ doc("chicoine_down_syndrome_extract_neuro_other_specify") }}' + - name: neuro_palsy_status + description: '{{ doc("chicoine_down_syndrome_extract_neuro_palsy_status") }}' + - name: neuro_parkinson_status + description: '{{ doc("chicoine_down_syndrome_extract_neuro_parkinson_status") + }}' + - name: Nonalcoholic steatohepatitis + description: '{{ doc("chicoine_down_syndrome_extract_nonalcoholic_steatohepatitis") + }}' + - name: Onychomycosis + description: '{{ doc("chicoine_down_syndrome_extract_onychomycosis") }}' + - name: orthostatic hypotension + description: '{{ doc("chicoine_down_syndrome_extract_orthostatic_hypotension") + }}' + - name: Overweight and Obesity + description: '{{ doc("chicoine_down_syndrome_extract_overweight_and_obesity") + }}' + - name: psych_add_adhd_status + description: '{{ doc("chicoine_down_syndrome_extract_psych_add_adhd_status") + }}' + - name: psych_anxiety_status + description: '{{ doc("chicoine_down_syndrome_extract_psych_anxiety_status") + }}' + - name: psych_autism_status + description: '{{ doc("chicoine_down_syndrome_extract_psych_autism_status") }}' + - name: psych_bipolar_status + description: '{{ doc("chicoine_down_syndrome_extract_psych_bipolar_status") + }}' + - name: psych_depression_status + description: '{{ doc("chicoine_down_syndrome_extract_psych_depression_status") + }}' + - name: psych_ocd_status + description: '{{ doc("chicoine_down_syndrome_extract_psych_ocd_status") }}' + - name: psych_odd_status + description: '{{ doc("chicoine_down_syndrome_extract_psych_odd_status") }}' + - name: psych_other_specify + description: '{{ doc("chicoine_down_syndrome_extract_psych_other_specify") }}' + - name: psych_panic_status + description: '{{ doc("chicoine_down_syndrome_extract_psych_panic_status") }}' + - name: psych_ptsd_status + description: '{{ doc("chicoine_down_syndrome_extract_psych_ptsd_status") }}' + - name: psych_schizophrenia_status + description: '{{ doc("chicoine_down_syndrome_extract_psych_schizophrenia_status") + }}' + - name: Psychiatric Disorders + description: '{{ doc("chicoine_down_syndrome_extract_psychiatric_disorders") + }}' + - name: pulm_asthma_status + description: '{{ doc("chicoine_down_syndrome_extract_pulm_asthma_status") }}' + - name: pulm_other_specify + description: '{{ doc("chicoine_down_syndrome_extract_pulm_other_specify") }}' + - name: pulm_pulm_hypertension_status + description: '{{ doc("chicoine_down_syndrome_extract_pulm_pulm_hypertension_status") + }}' + - name: skel_arthritis_status + description: '{{ doc("chicoine_down_syndrome_extract_skel_arthritis_status") + }}' + - name: skel_osteoarthritis_status + description: '{{ doc("chicoine_down_syndrome_extract_skel_osteoarthritis_status") + }}' + - name: skel_osteoporosis_status + description: '{{ doc("chicoine_down_syndrome_extract_skel_osteoporosis_status") + }}' + - name: skel_scoliosis_status + description: '{{ doc("chicoine_down_syndrome_extract_skel_scoliosis_status") + }}' + - name: skin_acne_age + description: '{{ doc("chicoine_down_syndrome_extract_skin_acne_age") }}' + - name: skin_acne_status + description: '{{ doc("chicoine_down_syndrome_extract_skin_acne_status") }}' + - name: skin_alopecia_age + description: '{{ doc("chicoine_down_syndrome_extract_skin_alopecia_age") }}' + - name: skin_alopecia_status + description: '{{ doc("chicoine_down_syndrome_extract_skin_alopecia_status") + }}' + - name: skin_athlete_status + description: '{{ doc("chicoine_down_syndrome_extract_skin_athlete_status") }}' + - name: skin_atopic_status + description: '{{ doc("chicoine_down_syndrome_extract_skin_atopic_status") }}' + - name: skin_cellulitis_status + description: '{{ doc("chicoine_down_syndrome_extract_skin_cellulitis_status") + }}' + - name: skin_hidradenitis_status + description: '{{ doc("chicoine_down_syndrome_extract_skin_hidradenitis_status") + }}' + - name: skin_psoriasis_status + description: '{{ doc("chicoine_down_syndrome_extract_skin_psoriasis_status") + }}' + - name: skin_rosacea_status + description: '{{ doc("chicoine_down_syndrome_extract_skin_rosacea_status") }}' + - name: skin_seborrheic_status + description: '{{ doc("chicoine_down_syndrome_extract_skin_seborrheic_status") + }}' + - name: Spondylosis + description: '{{ doc("chicoine_down_syndrome_extract_spondylosis") }}' + - name: Tinea barbae and tinea capitis + description: '{{ doc("chicoine_down_syndrome_extract_tinea_barbae_and_tin_785b718d") + }}' + - name: Tinea Cruris + description: '{{ doc("chicoine_down_syndrome_extract_tinea_cruris") }}' + - name: Unspecified blepharitis unspecified eye- unspecified eyelid + description: '{{ doc("chicoine_down_syndrome_extract_unspecified_blephari_a0d3cad2") + }}' + - name: Urinary incontinence + description: '{{ doc("chicoine_down_syndrome_extract_urinary_incontinence") + }}' + - name: Urinary retention + description: '{{ doc("chicoine_down_syndrome_extract_urinary_retention") }}' + - name: urogen_agenesis_status + description: '{{ doc("chicoine_down_syndrome_extract_urogen_agenesis_status") + }}' + - name: urogen_hydroneph_status + description: '{{ doc("chicoine_down_syndrome_extract_urogen_hydroneph_status") + }}' + - name: urogen_kidney_dz_status + description: '{{ doc("chicoine_down_syndrome_extract_urogen_kidney_dz_status") + }}' + - name: urogen_kidney_status + description: '{{ doc("chicoine_down_syndrome_extract_urogen_kidney_status") + }}' + - name: urogen_other_specify + description: '{{ doc("chicoine_down_syndrome_extract_urogen_other_specify") + }}' + - name: urogen_reflux_status + description: '{{ doc("chicoine_down_syndrome_extract_urogen_reflux_status") + }}' + - name: vitamin B12 deficiency + description: '{{ doc("chicoine_down_syndrome_extract_vitamin_b12_deficiency") + }}' + - name: Vitamin D deficiency + description: '{{ doc("chicoine_down_syndrome_extract_vitamin_d_deficiency") + }}' + - name: Xerosis cutis + description: '{{ doc("chicoine_down_syndrome_extract_xerosis_cutis") }}' diff --git a/dbt_project/models/include/template_study/_template__models.yml b/dbt_project/models/include/template_study/_template__models.yml deleted file mode 100644 index e69de29..0000000 diff --git a/dbt_project/models/include/template_study/_template__sources.yml b/dbt_project/models/include/template_study/_template__sources.yml deleted file mode 100644 index e69de29..0000000 diff --git a/dbt_project/packages.yml b/dbt_project/packages.yml new file mode 100644 index 0000000..ffb713d --- /dev/null +++ b/dbt_project/packages.yml @@ -0,0 +1,3 @@ +packages: + - package: dbt-labs/dbt_utils + version: 1.3.3 \ No newline at end of file diff --git a/dbt_project/run_commands/include/aadsc/run_20260119_aadsc.sh b/dbt_project/run_commands/include/aadsc/run_20260119_aadsc.sh new file mode 100755 index 0000000..5610b14 --- /dev/null +++ b/dbt_project/run_commands/include/aadsc/run_20260119_aadsc.sh @@ -0,0 +1,10 @@ +#!/bin/bash +dbt clean +dbt deps || { echo "Error: dbt deps failed. Exiting..."; exit 1; } +dbt seed #--full-refresh +# Source tables +dbt run --select include_aadsc_src_chicoine_down_syndrome_extract + +dbt run --select aadsc_test_participant +dbt run --select aadsc_test_condition +dbt run --select aadsc_test_study \ No newline at end of file From 9192dd060e324fb7234109ef3da789e5c1ffb2ae Mon Sep 17 00:00:00 2001 From: brendagutman Date: Sun, 22 Feb 2026 15:53:28 -0600 Subject: [PATCH 2/4] Move studies seed to lookup source --- .../models/include/aadsc/aadsc_test_study.sql | 6 +- .../include/docs/column_descriptions.md | 915 ++++++++++++++++++ dbt_project/models/include/docs/sources.yml | 68 ++ 3 files changed, 986 insertions(+), 3 deletions(-) create mode 100644 dbt_project/models/include/docs/column_descriptions.md diff --git a/dbt_project/models/include/aadsc/aadsc_test_study.sql b/dbt_project/models/include/aadsc/aadsc_test_study.sql index a84f75a..319e6fe 100644 --- a/dbt_project/models/include/aadsc/aadsc_test_study.sql +++ b/dbt_project/models/include/aadsc/aadsc_test_study.sql @@ -1,8 +1,8 @@ {{ config(materialized='table', schema='aadsc_data') }} -{% set relation = ref('studies') %} +{% set relation = source('lookups', 'studies') %} {% set exclude_columns = ['one','two','three','four'] %} -{% set study_columns = get_columns(relation=relation, exclude=constant_columns) %} +{% set study_columns = get_columns(relation=relation, exclude=exclude_columns) %} with @@ -12,7 +12,7 @@ "{{ col }}"::text AS "{{ col.lower().replace(" ", "_") }}" {% if not loop.last %},{% endif %} {% endfor %} - from {{ ref('studies') }} as s + from {{ source('lookups', 'studies') }} as s WHERE "Study Code" = 'AADSC' ) diff --git a/dbt_project/models/include/docs/column_descriptions.md b/dbt_project/models/include/docs/column_descriptions.md new file mode 100644 index 0000000..0f45159 --- /dev/null +++ b/dbt_project/models/include/docs/column_descriptions.md @@ -0,0 +1,915 @@ +{% docs chicoine_down_syndrome_extract_masked_id %} +MASKED_ID +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_age %} +AGE +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_sex %} +SEX +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_race %} +RACE +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_ethnicity %} +ETHNICITY +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_extraction_date %} +EXTRACTION_DATE +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_bmi %} +BMI +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_height %} +HEIGHT +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_weight %} +WEIGHT +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_abnormalities_of_gai_99ce47da %} +Abnormalities of gait and mobility +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_achalasia %} +Achalasia +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_acute_bronchitis %} +Acute bronchitis +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_acute_kidney_failure %} +Acute kidney failure +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_acute_myocardial_infarction %} +acute myocardial infarction +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_acute_nasopharyngitis %} +Acute nasopharyngitis +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_acute_recurrent_sinusitis %} +Acute recurrent sinusitis +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_acute_sinusitis %} +Acute sinusitis +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_all_malignant_neoplamsm %} +All malignant neoplamsm +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_allergic_rhinitis %} +Allergic rhinitis +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_appendicitis %} +Appendicitis +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_atherosclerotic_hear_881e1ef0 %} +Atherosclerotic heart disease of native coronary artery +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_auto_alopecia_status %} +auto_alopecia_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_auto_arthropathy_status %} +auto_arthropathy_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_auto_atopic_status %} +auto_atopic_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_auto_celiac_status %} +auto_celiac_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_auto_dermatomyositis_status %} +auto_dermatomyositis_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_auto_graves_status %} +auto_graves_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_auto_hashimoto_status %} +auto_hashimoto_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_auto_hemol_anemia_status %} +auto_hemol_anemia_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_auto_herpetiformis_status %} +auto_herpetiformis_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_auto_hidradenitis_status %} +auto_hidradenitis_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_auto_kawasaki_status %} +auto_kawasaki_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_auto_menieres_status %} +auto_menieres_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_auto_myositis_status %} +auto_myositis_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_auto_narcolepsy_status %} +auto_narcolepsy_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_auto_neutropenia_status %} +auto_neutropenia_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_auto_other_specify %} +auto_other_specify +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_auto_planus_status %} +auto_planus_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_auto_psoriasis_status %} +auto_psoriasis_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_auto_psoriatic_arth_status %} +auto_psoriatic_arth_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_auto_rh_arthritis_status %} +auto_rh_arthritis_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_auto_rls_status %} +auto_rls_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_auto_sarcoidosis_status %} +auto_sarcoidosis_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_auto_sclerosus_status %} +auto_sclerosus_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_auto_sle_status %} +auto_sle_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_auto_t1_diabetes_status %} +auto_t1_diabetes_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_auto_thrombo_purpura_status %} +auto_thrombo_purpura_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_cardiac_asd_age %} +cardiac_asd_age +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_cardiac_cardiomyopathy_status %} +cardiac_cardiomyopathy_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_cardiac_conditions %} +cardiac_conditions +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_cardiac_congestive_status %} +cardiac_congestive_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_cardiac_hypertension_status %} +cardiac_hypertension_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_cardiac_mi_status %} +cardiac_mi_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_cardiac_other_chd_specify %} +cardiac_other_chd_specify +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_cardiac_other_specify %} +cardiac_other_specify +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_cardiac_pda_age %} +cardiac_pda_age +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_cardiac_pfo_age %} +cardiac_pfo_age +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_cardiac_tof_age %} +cardiac_tof_age +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_cardiac_vsd_age %} +cardiac_vsd_age +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_cerebrovascular_diseases %} +Cerebrovascular diseases +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_cervical_myelopathy %} +Cervical Myelopathy +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_change_in_skin_texture %} +Change in skin texture +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_cholesteatoma_of_external_ear %} +cholesteatoma of external ear +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_chronic_cough %} +Chronic cough +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_chronic_ischemic_hea_2b530820 %} +chronic ischemic heart diseases +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_chronic_kidney_disease %} +Chronic kidney disease +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_chronic_nasopharyngitis %} +Chronic nasopharyngitis +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_constipation %} +Constipation +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_develop_expressive_status %} +develop_expressive_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_develop_mixed_status %} +develop_mixed_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_disorder_of_adrenal__1dd78479 %} +Disorder of adrenal gland-unspecified +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_do_not_resuscitate_status %} +Do not resuscitate status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_ds_diagnosis %} +ds_diagnosis +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_dysmenorrhea %} +Dysmenorrhea +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_dysphagia %} +Dysphagia +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_endo_congen_diabetes_status %} +endo_congen_diabetes_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_endo_diabetes_conditions %} +endo_diabetes_conditions +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_endo_graves_status %} +endo_graves_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_endo_hyperthyroid_status %} +endo_hyperthyroid_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_endo_hypothyroid_status %} +endo_hypothyroid_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_endo_other_specify %} +endo_other_specify +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_endo_t1_diabetes_status %} +endo_t1_diabetes_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_endo_t2_diabetes_status %} +endo_t2_diabetes_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_endo_thyroid_other_specify %} +endo_thyroid_other_specify +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_endo_vitaminb_status %} +endo_vitaminb_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_endo_vitamind_status %} +endo_vitamind_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_ent_etd_status %} +ent_etd_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_ent_hearing_status %} +ent_hearing_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_ent_laryngo_status %} +ent_laryngo_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_ent_osa_status %} +ent_osa_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_ent_rhinitis_status %} +ent_rhinitis_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_esophagitis %} +Esophagitis +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_eye_amblyopia %} +eye_amblyopia +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_eye_astigmatism %} +eye_astigmatism +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_eye_blind %} +eye_blind +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_eye_cataracts %} +eye_cataracts +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_eye_glaucoma %} +eye_glaucoma +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_eye_hyperopia %} +eye_hyperopia +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_eye_keratoconus %} +eye_keratoconus +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_eye_myopia %} +eye_myopia +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_eye_nystagmus %} +eye_nystagmus +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_eye_ptosis %} +eye_ptosis +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_eye_retina %} +eye_retina +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_eye_strabismus %} +eye_strabismus +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_fatty_liver %} +Fatty liver +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_female_pcos_status %} +female_pcos_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_follicular_disorder %} +Follicular disorder +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_gi_celiac_status %} +gi_celiac_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_gi_diverticulitis_status %} +gi_diverticulitis_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_gi_esophageal_atresia_status %} +gi_esophageal_atresia_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_gi_gerd_status %} +gi_gerd_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_gi_hemorrhoids_status %} +gi_hemorrhoids_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_gi_hirschsprung_status %} +gi_hirschsprung_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_gi_ibs_status %} +gi_ibs_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_gi_other_specify %} +gi_other_specify +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_gi_peptic_ulcers_status %} +gi_peptic_ulcers_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_gi_pyloric_stenosis_status %} +gi_pyloric_stenosis_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_heme_amkl_status %} +heme_amkl_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_heme_aml_status %} +heme_aml_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_heme_b_all_status %} +heme_b_all_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_heme_leuk_rxn_status %} +heme_leuk_rxn_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_heme_other_cancer_status %} +heme_other_cancer_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_heme_other_specify %} +heme_other_specify +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_heme_tmd_status %} +heme_tmd_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_hernia %} +Hernia +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_impacted_cerumen %} +Impacted cerumen +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_infection_c_diff_status %} +infection_c_diff_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_infection_cellulitis_status %} +infection_cellulitis_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_infection_gout_status %} +infection_gout_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_infection_impetigo_status %} +infection_impetigo_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_infection_otitis_status %} +infection_otitis_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_infection_periodonti_f237152b %} +infection_periodontitis_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_infection_sinus_status %} +infection_sinus_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_infection_tb_status %} +infection_tb_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_infection_uti_status %} +infection_uti_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_infection_zoster_status %} +infection_zoster_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_lymph_anemia_status %} +lymph_anemia_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_male_cancer_status %} +male_cancer_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_male_hypospadias_status %} +male_hypospadias_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_male_phimosis_status %} +male_phimosis_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_male_testicles_status %} +male_testicles_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_metrorrhagia %} +Metrorrhagia +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_neuro_alz_status %} +neuro_alz_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_neuro_dementia_status %} +neuro_dementia_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_neuro_epilepsy_status %} +neuro_epilepsy_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_neuro_moya_status %} +neuro_moya_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_neuro_other_specify %} +neuro_other_specify +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_neuro_palsy_status %} +neuro_palsy_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_neuro_parkinson_status %} +neuro_parkinson_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_nonalcoholic_steatohepatitis %} +Nonalcoholic steatohepatitis +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_onychomycosis %} +Onychomycosis +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_orthostatic_hypotension %} +orthostatic hypotension +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_overweight_and_obesity %} +Overweight and Obesity +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_psych_add_adhd_status %} +psych_add_adhd_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_psych_anxiety_status %} +psych_anxiety_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_psych_autism_status %} +psych_autism_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_psych_bipolar_status %} +psych_bipolar_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_psych_depression_status %} +psych_depression_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_psych_ocd_status %} +psych_ocd_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_psych_odd_status %} +psych_odd_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_psych_other_specify %} +psych_other_specify +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_psych_panic_status %} +psych_panic_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_psych_ptsd_status %} +psych_ptsd_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_psych_schizophrenia_status %} +psych_schizophrenia_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_psychiatric_disorders %} +Psychiatric Disorders +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_pulm_asthma_status %} +pulm_asthma_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_pulm_other_specify %} +pulm_other_specify +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_pulm_pulm_hypertension_status %} +pulm_pulm_hypertension_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_skel_arthritis_status %} +skel_arthritis_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_skel_osteoarthritis_status %} +skel_osteoarthritis_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_skel_osteoporosis_status %} +skel_osteoporosis_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_skel_scoliosis_status %} +skel_scoliosis_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_skin_acne_age %} +skin_acne_age +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_skin_acne_status %} +skin_acne_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_skin_alopecia_age %} +skin_alopecia_age +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_skin_alopecia_status %} +skin_alopecia_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_skin_athlete_status %} +skin_athlete_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_skin_atopic_status %} +skin_atopic_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_skin_cellulitis_status %} +skin_cellulitis_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_skin_hidradenitis_status %} +skin_hidradenitis_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_skin_psoriasis_status %} +skin_psoriasis_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_skin_rosacea_status %} +skin_rosacea_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_skin_seborrheic_status %} +skin_seborrheic_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_spondylosis %} +Spondylosis +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_tinea_barbae_and_tin_785b718d %} +Tinea barbae and tinea capitis +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_tinea_cruris %} +Tinea Cruris +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_unspecified_blephari_a0d3cad2 %} +Unspecified blepharitis unspecified eye- unspecified eyelid +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_urinary_incontinence %} +Urinary incontinence +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_urinary_retention %} +Urinary retention +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_urogen_agenesis_status %} +urogen_agenesis_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_urogen_hydroneph_status %} +urogen_hydroneph_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_urogen_kidney_dz_status %} +urogen_kidney_dz_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_urogen_kidney_status %} +urogen_kidney_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_urogen_other_specify %} +urogen_other_specify +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_urogen_reflux_status %} +urogen_reflux_status +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_vitamin_b12_deficiency %} +vitamin B12 deficiency +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_vitamin_d_deficiency %} +Vitamin D deficiency +{% enddocs %} + +{% docs chicoine_down_syndrome_extract_xerosis_cutis %} +Xerosis cutis +{% enddocs %} + +{% docs studies_study_code %} +Study Code +{% enddocs %} + +{% docs studies_study_title %} +Study Title +{% enddocs %} + +{% docs studies_program %} +Program +{% enddocs %} + +{% docs studies_study_description %} +Study Description +{% enddocs %} + +{% docs studies_principal_investigator_name %} +Principal Investigator Name +{% enddocs %} + +{% docs studies_study_contact_name %} +Study Contact Name +{% enddocs %} + +{% docs studies_study_contact_institution %} +Study Contact Institution +{% enddocs %} + +{% docs studies_study_contact_email %} +Study Contact Email +{% enddocs %} + +{% docs studies_vbr_email %} +VBR Email +{% enddocs %} + +{% docs studies_vbr_url %} +VBR URL +{% enddocs %} + +{% docs studies_vbr_readme %} +VBR Readme +{% enddocs %} + +{% docs studies_research_domain %} +Research Domain +{% enddocs %} + +{% docs studies_participant_lifespan_stage %} +Participant Lifespan Stage +{% enddocs %} + +{% docs studies_selection_criteria %} +Selection Criteria +{% enddocs %} + +{% docs studies_study_design %} +Study Design +{% enddocs %} + +{% docs studies_clinical_data_source_type %} +Clinical Data Source Type +{% enddocs %} + +{% docs studies_data_category %} +Data Category +{% enddocs %} + +{% docs studies_study_website %} +Study Website +{% enddocs %} + +{% docs studies_dbgap %} +dbGaP +{% enddocs %} + +{% docs studies_publication %} +Publication +{% enddocs %} + +{% docs studies_expected_number_of_participants %} +Expected Number of Participants +{% enddocs %} + +{% docs studies_guid_type %} +GUID Type +{% enddocs %} + +{% docs studies_guid_mapped %} +GUID Mapped +{% enddocs %} + +{% docs studies_acknowledgments %} +Acknowledgments +{% enddocs %} + +{% docs studies_citation_statement %} +Citation Statement +{% enddocs %} + +{% docs studies_doi %} +DOI +{% enddocs %} + +{% docs studies_doi_citation %} +DOI Citation +{% enddocs %} + +{% docs studies_one %} +one +{% enddocs %} + +{% docs studies_two %} +two +{% enddocs %} + +{% docs studies_three %} +three +{% enddocs %} + +{% docs studies_four %} +four +{% enddocs %} \ No newline at end of file diff --git a/dbt_project/models/include/docs/sources.yml b/dbt_project/models/include/docs/sources.yml index 5116fac..bd891dd 100644 --- a/dbt_project/models/include/docs/sources.yml +++ b/dbt_project/models/include/docs/sources.yml @@ -504,3 +504,71 @@ sources: }}' - name: Xerosis cutis description: '{{ doc("chicoine_down_syndrome_extract_xerosis_cutis") }}' +- name: lookups + schema: bg_dev_schema + tables: + - name: studies + description: Source table for studies. + columns: + - name: Study Code + description: '{{ doc("studies_study_code") }}' + - name: Study Title + description: '{{ doc("studies_study_title") }}' + - name: Program + description: '{{ doc("studies_program") }}' + - name: Study Description + description: '{{ doc("studies_study_description") }}' + - name: Principal Investigator Name + description: '{{ doc("studies_principal_investigator_name") }}' + - name: Study Contact Name + description: '{{ doc("studies_study_contact_name") }}' + - name: Study Contact Institution + description: '{{ doc("studies_study_contact_institution") }}' + - name: Study Contact Email + description: '{{ doc("studies_study_contact_email") }}' + - name: VBR Email + description: '{{ doc("studies_vbr_email") }}' + - name: VBR URL + description: '{{ doc("studies_vbr_url") }}' + - name: VBR Readme + description: '{{ doc("studies_vbr_readme") }}' + - name: Research Domain + description: '{{ doc("studies_research_domain") }}' + - name: Participant Lifespan Stage + description: '{{ doc("studies_participant_lifespan_stage") }}' + - name: Selection Criteria + description: '{{ doc("studies_selection_criteria") }}' + - name: Study Design + description: '{{ doc("studies_study_design") }}' + - name: Clinical Data Source Type + description: '{{ doc("studies_clinical_data_source_type") }}' + - name: Data Category + description: '{{ doc("studies_data_category") }}' + - name: Study Website + description: '{{ doc("studies_study_website") }}' + - name: dbGaP + description: '{{ doc("studies_dbgap") }}' + - name: Publication + description: '{{ doc("studies_publication") }}' + - name: Expected Number of Participants + description: '{{ doc("studies_expected_number_of_participants") }}' + - name: GUID Type + description: '{{ doc("studies_guid_type") }}' + - name: GUID Mapped + description: '{{ doc("studies_guid_mapped") }}' + - name: Acknowledgments + description: '{{ doc("studies_acknowledgments") }}' + - name: Citation Statement + description: '{{ doc("studies_citation_statement") }}' + - name: DOI + description: '{{ doc("studies_doi") }}' + - name: DOI Citation + description: '{{ doc("studies_doi_citation") }}' + - name: one + description: '{{ doc("studies_one") }}' + - name: two + description: '{{ doc("studies_two") }}' + - name: three + description: '{{ doc("studies_three") }}' + - name: four + description: '{{ doc("studies_four") }}' From 7c6d0bf308c82db29ea1dff840e49a598df569a8 Mon Sep 17 00:00:00 2001 From: brendagutman Date: Mon, 23 Feb 2026 09:09:20 -0600 Subject: [PATCH 3/4] Clean up macro --- dbt_project/macros/register_external_sources_pg.sql | 4 ---- 1 file changed, 4 deletions(-) diff --git a/dbt_project/macros/register_external_sources_pg.sql b/dbt_project/macros/register_external_sources_pg.sql index 4ab7609..b3d882e 100644 --- a/dbt_project/macros/register_external_sources_pg.sql +++ b/dbt_project/macros/register_external_sources_pg.sql @@ -1,11 +1,9 @@ {% macro register_external_sources_pg(tb_schema, tablename, columns, src_data_csv_path) %} - -- Validate inputs (optional but recommended) {% if tb_schema is none or tablename is none or columns is none or src_data_csv_path is none %} {{ log("Error: Missing required arguments in register_external_sources_pg macro.", warn=True) }} {% do return('') %} {% endif %} - -- Build the CREATE TABLE statement {% set create_table_query %} CREATE SCHEMA IF NOT EXISTS {{ tb_schema }}; @@ -17,8 +15,6 @@ {% endset %} - - -- Combine both queries {% set full_query %} {{ create_table_query }} {% endset %} From 1e2e1feae95bc46a844faed0ef9ed3a2e9a5c8dc Mon Sep 17 00:00:00 2001 From: brendagutman Date: Mon, 23 Feb 2026 09:29:34 -0600 Subject: [PATCH 4/4] Add studies to run commands --- dbt_project/run_commands/include/aadsc/run_20260119_aadsc.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dbt_project/run_commands/include/aadsc/run_20260119_aadsc.sh b/dbt_project/run_commands/include/aadsc/run_20260119_aadsc.sh index 5610b14..7d9f990 100755 --- a/dbt_project/run_commands/include/aadsc/run_20260119_aadsc.sh +++ b/dbt_project/run_commands/include/aadsc/run_20260119_aadsc.sh @@ -4,6 +4,8 @@ dbt deps || { echo "Error: dbt deps failed. Exiting..."; exit 1; } dbt seed #--full-refresh # Source tables dbt run --select include_aadsc_src_chicoine_down_syndrome_extract +dbt run --select studies + dbt run --select aadsc_test_participant dbt run --select aadsc_test_condition