Skip to content

Commit

Permalink
reverse deletions
Browse files Browse the repository at this point in the history
  • Loading branch information
Maria Lorena Rodriguez Viruel authored and Maria Lorena Rodriguez Viruel committed Oct 20, 2023
1 parent 9531756 commit 82b612a
Show file tree
Hide file tree
Showing 3 changed files with 254 additions and 0 deletions.
74 changes: 74 additions & 0 deletions models/brac/brac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
version: 2

models:
- name: brac_hmis
columns:
- name: uuid
tests:
- not_null
- unique
- relationships:
to: ref('contactview_chp')
field: uuid
- name: households_registered
tests:
- not_null
- name: num_of_hh_visited
tests:
- not_null
- name: num_of_hh_bed_nets
tests:
- not_null
- name: num_of_hh_latrines
tests:
- not_null
- name: num_of_hh_safe_water
tests:
- not_null
- name: num_of_comm_members
tests:
- not_null
- name: num_of_health_forum
tests:
- not_null
- name: num_pregnant_care
tests:
- not_null
- name: num_pregnant_identified
tests:
- not_null
- name: num_facility_deliveries
tests:
- not_null
- name: num_home_deliveries
tests:
- not_null
- name: brac_kpis
columns:
- name: chp_uuid
tests:
- not_null
- relationships:
to: ref('contactview_chp')
field: uuid
- name: count_all_assessments
tests:
- not_null
- name: u5_malaria_treatment
tests:
- not_null
- name: u5_diarrhea_treatment
tests:
- not_null
- name: u5_pneumonia_treatment
tests:
- not_null
- name: u1_malaria_treatment
tests:
- not_null
- name: u1_diarrhea_treatment
tests:
- not_null
- name: u1_pneumonia_treatment
tests:
- not_null
80 changes: 80 additions & 0 deletions models/brac/contact_views/contact_views.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,52 @@ models:
- name: patient_id
tests:
- not_null
- name: contactview_person_fields
columns:
- name: uuid
tests:
- not_null
- unique
- relationships:
to: ref('contactview_metadata')
field: uuid
tests:
- dbt_utils.fewer_rows_than:
compare_model: ref('contactview_metadata')
- name: contactview_chw
columns:
- name: uuid
tests:
- not_null
- unique
- relationships:
to: ref('contactview_person_fields')
field: uuid
tests:
- dbt_utils.fewer_rows_than:
compare_model: ref('contactview_metadata')
- dbt_utils.fewer_rows_than:
compare_model: ref('contactview_person_fields')
- name: contactview_chp
columns:
- name: uuid
tests:
- not_null
- unique
- relationships:
to: ref('contactview_chw')
field: uuid
- name: branch_uuid
tests:
- not_null
- name: supervisor_uuid
tests:
- not_null
tests:
- dbt_utils.fewer_rows_than:
compare_model: ref('contactview_metadata')
- dbt_utils.fewer_rows_than:
compare_model: ref('contactview_person_fields')
- name: contactview_muted
columns:
- name: contact_uuid
Expand Down Expand Up @@ -52,6 +98,23 @@ models:
tests:
- dbt_utils.fewer_rows_than:
compare_model: ref('contactview_metadata')
- name: contactview_hierarchy
columns:
- name: branch_uuid
tests:
- not_null
- relationships:
to: ref('contactview_branch')
field: uuid
- name: chw_uuid
tests:
- not_null
- relationships:
to: ref('contactview_chp')
field: uuid
- name: chw_area_uuid
tests:
- not_null
- name: contactview_branch
columns:
- name: uuid
Expand All @@ -61,3 +124,20 @@ models:
- relationships:
to: ref('contactview_hospital')
field: uuid
- name: contactview_clinic
columns:
- name: uuid
tests:
- not_null
- relationships:
to: ref('contactview_metadata')
field: uuid
- name: chw_uuid
tests:
- not_null
- relationships:
to: ref('contactview_chw')
field: uuid
tests:
- dbt_utils.fewer_rows_than:
compare_model: ref('contactview_metadata')
100 changes: 100 additions & 0 deletions models/brac/useviews/useviews.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,29 @@
version: 2

models:
- name: useview_visit
columns:
- name: uuid
tests:
- not_null
- unique
- relationships:
to: ref('couchdb')
field: doc ->> '_id'
- name: form
tests:
- not_null
- name: source_id
tests:
- not_null
- name: visit_type
tests:
- not_null
- accepted_values:
values: [anc, pnc, imm, iccm]
- name: danger_signs
tests:
- not_null
- name: useview_pregnancy
columns:
- name: uuid
Expand All @@ -13,6 +36,27 @@ models:
- name: chw
tests:
- not_null
- name: useview_pregnancy_visit
columns:
- name: xmlforms_uuid
tests:
- not_null
- unique
- relationships:
to: ref('couchdb')
field: doc ->> '_id'
- name: useview_postnatal_care
columns:
- name: uuid
tests:
- not_null
- unique
- relationships:
to: ref('couchdb')
field: doc ->> '_id'
- name: form
tests:
- not_null
- name: useview_place_record
columns:
- name: place_id
Expand All @@ -21,6 +65,49 @@ models:
- relationships:
to: ref('couchdb')
field: doc#>>'{fields,place_id}'
- name: useview_patient_record
columns:
- name: patient_id
tests:
- not_null
- relationships:
to: ref('couchdb')
field: doc#>>'{fields,patient_id}'
- name: useview_household_survey
columns:
- name: uuid
tests:
- not_null
- relationships:
to: ref('couchdb')
field: doc ->> '_id'
- name: useview_health_forum
columns:
- name: xmlforms_uuid
tests:
- not_null
- relationships:
to: ref('couchdb')
field: doc ->> '_id'
- name: useview_family_survey
columns:
- name: uuid
tests:
- not_null
- relationships:
to: ref('couchdb')
field: doc ->> '_id'
- name: useview_assessment
columns:
- name: uuid
tests:
- not_null
- relationships:
to: ref('couchdb')
field: doc ->> '_id'
- name: form
tests:
- not_null
- name: formview_fp_patient_record
columns:
- name: uuid
Expand All @@ -41,3 +128,16 @@ models:
'fp_follow_up_prospective',
'fp_follow_up_short_term',
]
- name: useview_assessment_follow_up
columns:
- name: uuid
tests:
- not_null
- relationships:
to: ref('couchdb')
field: doc ->> '_id'
- name: form
tests:
- not_null
- accepted_values:
values: ['assessment_follow_up']

0 comments on commit 82b612a

Please sign in to comment.