Function detecting violations of the value range, i.e. values outside the range of tolerable values

detect_value_range_violations(activitylog, ..., details, filter_condition)

Arguments

activitylog

The activity log

...

Define domain range using domain_numeric, domain_categorical and/or domain_time for each column

details

Boolean indicating wheter details of the results need to be shown

filter_condition

Condition that is used to extract a subset of the activity log prior to the application of the function

Value

activitylog containing the rows of the original activity log for which the provided value range is violated

See also

Examples

# \donttest{ data("hospital_actlog") detect_value_range_violations(activitylog = hospital_actlog, triagecode = domain_numeric(from = 0, to = 5))
#> *** OUTPUT ***
#> The domain range for column triagecode is checked.
#> Values allowed between 0 and 5
#> The values fall within the specified domain range for 46 (86.79%) of the rows in the activity log and outside the domain range for 7 (13.21%) of these rows.
#>
#> The following rows fall outside the specified domain range for indicated column:
#> # A tibble: 7 x 8 #> column_checked patient_visit_nr activity originator start #> <chr> <dbl> <chr> <chr> <dttm> #> 1 triagecode 510 Clinica~ Doctor 7 2017-11-20 11:35:01 #> 2 triagecode 529 Treatme~ Doctor 1 2017-11-22 16:30:00 #> 3 triagecode 530 Triage Nurse 17 2017-11-22 18:00:00 #> 4 triagecode 531 Triage Nurse 17 2017-11-22 18:05:00 #> 5 triagecode 532 Treatme~ Nurse 17 2017-11-22 18:15:00 #> 6 triagecode 532 Treatme~ Doctor 7 2017-11-22 18:27:00 #> 7 triagecode 533 0 NA 2017-11-22 18:35:00 #> # ... with 3 more variables: complete <dttm>, triagecode <dbl>, #> # specialization <chr>
# }