-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add audit for impact PNC view and delivery relationship and organize …
…folders
- Loading branch information
Maria Lorena Rodriguez Viruel
authored and
Maria Lorena Rodriguez Viruel
committed
Nov 17, 2023
1 parent
51b86ae
commit a9bc309
Showing
2 changed files
with
46 additions
and
6 deletions.
There are no files selected for viewing
14 changes: 8 additions & 6 deletions
14
...impact/PNC/impact_pncview_visit_audit.sql → ...s/impact_pncview_visit_delivery_audit.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
38
models/brac/impact/PNC/audits/impact_pncview_visit_pnc_audit.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
) }} |