-
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 provisional assessment stages to PIN value views (#641)
* Add pre-mailed and pre-certified stages to vw_pin_value * Filter out orphaned records from default.vw_pin_value * Update reporting.vw_pin_value_long to pull from default.vw_pin_value * Use legacy stage name for "board certified" in reporting.vw_pin_value_long * Add tests and docs for new vw_pin_value assessment stages * Fix sorting in dbt yaml files * Clean up docs for provisional assessment values * Add comment to pre_stage_filters macro explaining `cur = 'Y'` * Change pre-mailed assessment stage_num from 0 to 0.5 * Add comments to `clean_values` and `change_reasons` CTEs in default.vw_pin_value * Add docs and column definitions for provisional values in default.vw_pin_value * Fix column sort order in default.vw_pin_value
- Loading branch information
1 parent
ba9db30
commit 6a2a3f9
Showing
9 changed files
with
753 additions
and
135 deletions.
There are no files selected for viewing
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,21 @@ | ||
-- Macros to simplify the filter conditions that produce pre-mailed and | ||
-- pre-certified values. | ||
-- | ||
-- Note that the `cur = 'Y'` filter is not necessary in the | ||
-- default.vw_pin_value query that is the main consumer of these macros, since | ||
-- that query already filters rows where `cur = 'Y'`; however, we leave the | ||
-- filter in here so that it might make the macro more generally useful in | ||
-- other instances where we may not filter queries the same way | ||
{% macro pre_stage_filters(tablename, stage_name) %} | ||
{{ tablename }}.procname is null | ||
and {{ tablename }}.cur = 'Y' | ||
and not contains(stages.procnames, '{{ stage_name }}') | ||
{% endmacro %} | ||
|
||
{% macro pre_mailed_filters(tablename) %} | ||
{{- pre_stage_filters(tablename, "CCAOVALUE") -}} | ||
{% endmacro %} | ||
|
||
{% macro pre_certified_filters(tablename) %} | ||
{{- pre_stage_filters(tablename, "CCAOFINAL") -}} | ||
{% endmacro %} |
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
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,47 @@ | ||
{% macro test_pre_stage_filters() %} | ||
{% do test_pre_stage_filters_params() %} | ||
{% do test_pre_mailed_filters() %} | ||
{% do test_pre_certified_filters() %} | ||
{% endmacro %} | ||
|
||
{% macro expected_pre_mailed_filters() %} | ||
asmt.procname is null | ||
and asmt.cur = 'Y' | ||
and not contains(stages.procnames, 'CCAOVALUE') | ||
{% endmacro %} | ||
|
||
{% macro expected_pre_certified_filters() %} | ||
asmt.procname is null | ||
and asmt.cur = 'Y' | ||
and not contains(stages.procnames, 'CCAOFINAL') | ||
{% endmacro %} | ||
|
||
{% macro test_pre_stage_filters_params() %} | ||
{{ | ||
assert_equals( | ||
"test_pre_stage_filters_params", | ||
pre_stage_filters("asmt", "CCAOVALUE"), | ||
expected_pre_mailed_filters(), | ||
) | ||
}} | ||
{% endmacro %} | ||
|
||
{% macro test_pre_mailed_filters() %} | ||
{{ | ||
assert_equals( | ||
"test_pre_mailed_filters_params", | ||
pre_mailed_filters("asmt"), | ||
expected_pre_mailed_filters(), | ||
) | ||
}} | ||
{% endmacro %} | ||
|
||
{% macro test_pre_certified_filters() %} | ||
{{ | ||
assert_equals( | ||
"test_pre_certified_filters_params", | ||
pre_certified_filters("asmt"), | ||
expected_pre_certified_filters(), | ||
) | ||
}} | ||
{% endmacro %} |
Oops, something went wrong.