Function detecting missing related activity registration, i.e. detecting activities that should be registered for a case because another activity is registered for that case

detect_related_activities(
  activitylog,
  antecedent,
  consequent,
  details,
  filter_condition
)

Arguments

activitylog

The activity log

antecedent

Activity name of the activity that acts as a an antecedent (if antecedent occurs, then consequent should also occur)

consequent

Activity name of the activity that acts as a an consequent (if antecedent occurs, then consequent should also occur)

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 related activities are not present

Examples

# \donttest{ data("hospital_actlog") detect_related_activities(activitylog = hospital_actlog, antecedent = "Treatment evaluation", consequent = "Treatment")
#> *** OUTPUT ***
#> The following statement was checked: if Treatment evaluation is recorded for a case, then Treatment should also be recorded.
#> This statement holds for 5 (83.33%) of the cases in which Treatment evaluation was recorded and does not hold for 1 (16.67%) of the cases in which Treatment evaluation was recorded.
#> For the following cases, only Treatment evaluation is recorded:
#> [1] 529
# }