Function detecting violations in activity order. Having additional or less activity types than those specified in activity_order is no violation, but the activity types present should occur in the specified order, and only once.

detect_activity_order_violations(
  activitylog,
  activity_order,
  timestamp,
  details,
  filter_condition
)

# S3 method for activitylog
detect_activity_order_violations(
  activitylog,
  activity_order,
  timestamp = c("both", "start", "complete"),
  details = TRUE,
  filter_condition = NULL
)

Arguments

activitylog

The activity log

activity_order

Vector expressing the activity order that needs to be checked (using activity names)

timestamp

Type of timestamp that needs to be taken into account in the analysis (either "start", "complete" or "both)

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

tbl_df providing an overview of detected activity orders which violate the specified activity order

Methods (by class)

  • activitylog: Detect activity order_violations in activity log.

Examples

# \donttest{ data("hospital_actlog") detect_activity_order_violations(activitylog = hospital_actlog, activity_order = c( "Registration", "Triage", "Clinical exam", "Treatment", "Treatment evaluation"))
#> Warning: Some activity instances within the same case overlap. Use detect_overlaps to investigate further.
#> Warning: Not all specified activities occur in each case. Use detect_incomplete_cases to investigate further.
#> Selected timestamp parameter value: both #>
#> *** OUTPUT ***
#> It was checked whether the activity order Registration - Triage - Clinical exam - Treatment - Treatment evaluation is respected.
#> This activity order is respected for 18 (81.82%) of the cases and not for4 (18.18%) of the cases.
#> For cases for which the aformentioned activity order is not respected, the following order is detected (ordered by decreasing frequeny of occurrence):
#> # A tibble: 4 x 3 #> activity_list n case_ids #> <chr> <int> <chr> #> 1 Registration - Registration - Registration 1 518 #> 2 Registration - Registration - Triage - Clinical exam - Treatme~ 1 535 #> 3 Registration - Triage - Clinical exam - Clinical exam 1 512 #> 4 Triage - Registration 1 521
# }