Function detecting violations of conditional activity presence (i.e. an activity/activities that should be present when (a) particular condition(s) hold(s))

detect_conditional_activity_presence(
  activitylog,
  condition,
  activities,
  details,
  filter_condition
)

Arguments

activitylog

The activity log

condition

Condition which serve as an antecedent (if the condition in condition holds, then the activit(y)(ies) in activities should be present.)

activities

Vector of activity/activities which serve as a consequent (if the condition(s) in condition_vector hold, then the activity/activities in activity_vector should be recorded)

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

Numeric vector containing the case identifiers of cases for which the specified conditional activity presence is violated

Examples

# \donttest{ data("hospital_actlog") detect_conditional_activity_presence(activitylog = hospital_actlog, condition = specialization == "TRAU", activities = "Clinical exam")
#> *** OUTPUT ***
#> The following statement was checked: if condition(s) ~specialization == "TRAU" hold(s), then activity/activities Clinical exam should be recorded
#> The condition(s) hold(s) for 2 cases. From these cases:
#> - the specified activity/activities is/are recorded for 2 case(s) (100%)
#> - the specified activity/activities is/are not recorded for 0 case(s) (0%)
# }