-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlabname_tests_03_pivot_results.yml
121 lines (120 loc) · 3.47 KB
/
labname_tests_03_pivot_results.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
version: 2
models:
- name: labname_03_pivot_results
description: Map test results to each pathogen column
tests:
- at_least_one_test_result_is_present
- only_one_test_result_is_present
- model_has_more_than_x_rows:
n_rows: 0
columns:
columns:
- name: date_testing
tests:
- not_null
- dbt_utils.expression_is_true:
name: labname_03_future_date
expression: "<= current_date"
- name: sex
tests:
- not_null:
config:
severity: error
error_if: ">1000"
warn_if: ">100"
- accepted_values:
values: ["M", "F"]
- name: location
tests:
- not_null
- name: state
tests:
- accepted_uf_names
- not_null:
name: labname_03_state_not_null
config:
severity: error
error_if: ">1000"
warn_if: ">100"
- name: age
tests:
- dbt_utils.accepted_range:
min_value: 0
max_value: 200
config:
severity: error
error_if: ">1000"
warn_if: ">100"
- not_null:
name: labname_03_age_not_null
config:
severity: error
error_if: ">1000"
warn_if: ">100"
- name: result
quote: true
tests:
- accepted_values:
values: [0, 1]
- not_null
- name: test_kit
tests:
- not_null
- accepted_values:
values: [
'flua_antigen', 'flub_antigen',
'covid_antigen','vsr_antigen',
'para_antigen','adeno_antigen',
'flua_pcr','flub_pcr',
'covid_pcr','vsr_pcr',
'adeno_pcr','meta_pcr',
'boca_pcr','rino_pcr',
'para_pcr'
]
- name: sample_id
tests:
- not_null
- unique:
config:
severity: error
error_if: ">50000"
warn_if: ">10000"
- name: SC2_test_result
quote: true
tests: &test_pivot_test_result_columns
- not_null
- accepted_values:
values: [0, 1, -1]
- name: FLUA_test_result
quote: true
tests: *test_pivot_test_result_columns
- name: FLUB_test_result
quote: true
tests: *test_pivot_test_result_columns
- name: VSR_test_result
quote: true
tests: *test_pivot_test_result_columns
- name: RINO_test_result
quote: true
tests: *test_pivot_test_result_columns
- name: META_test_result
quote: true
tests: *test_pivot_test_result_columns
- name: PARA_test_result
quote: true
tests: *test_pivot_test_result_columns
- name: ADENO_test_result
quote: true
tests: *test_pivot_test_result_columns
- name: BOCA_test_result
quote: true
tests: *test_pivot_test_result_columns
- name: COVS_test_result
quote: true
tests: *test_pivot_test_result_columns
- name: ENTERO_test_result
quote: true
tests: *test_pivot_test_result_columns
- name: BAC_test_result
quote: true
tests: *test_pivot_test_result_columns