Skip to content

Commit

Permalink
Add audit for impact PNC view and delivery relationship and organize …
Browse files Browse the repository at this point in the history
…folders
  • Loading branch information
Maria Lorena Rodriguez Viruel authored and Maria Lorena Rodriguez Viruel committed Nov 17, 2023
1 parent 51b86ae commit a9bc309
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
{# in dbt Develop #}


{% set old_useview_postnatal_care %}
{% set old_pncview_actual_enrollments %}
select
uuid,
delivery_id as uuid,
patient_id,
form
from dbt.useview_postnatal_care
facility_delivery,
delivery_date
from dbt.pncview_actual_enrollments
{% endset %}


{% set new_impact_pncview_visit %}
select
uuid,
patient_id,
form
facility_delivery,
delivery_date
from {{ ref("impact_pncview_visit") }}
{% endset %}


{{ audit_helper.compare_queries(
a_query=old_useview_postnatal_care,
a_query=old_pncview_actual_enrollments,
b_query=new_impact_pncview_visit,
primary_key="uuid"
) }}
38 changes: 38 additions & 0 deletions models/brac/impact/PNC/audits/impact_pncview_visit_pnc_audit.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{# in dbt Develop #}


{% set old_useview_postnatal_care %}
select
uuid,
patient_id,
form,
reported_by,
reported_by_parent,
reported::DATE AS pnc_visit_date,
follow_up_count AS pnc_visit_number,
reported,
baby_danger_signs <> '' AS visit_with_danger_sign
from dbt.useview_postnatal_care
{% endset %}


{% set new_impact_pncview_visit %}
select
uuid,
patient_id,
form,
reported_by,
reported_by_parent,
pnc_visit_date,
pnc_visit_number,
reported,
visit_with_danger_sign
from {{ ref("impact_pncview_visit") }}
{% endset %}


{{ audit_helper.compare_queries(
a_query=old_useview_postnatal_care,
b_query=new_impact_pncview_visit,
primary_key="uuid"
) }}

0 comments on commit a9bc309

Please sign in to comment.