This function can be used to check several rules on event data. It needs an event log and a rule. Rules can be made with the following functions: absent(), and(), contains(), contains_between(), contains_exactly(), ends(), precedence(), response(), responded_existence(), starts(), succession(), xor().
check_rules(eventlog, ...)
eventlog | Eventlog object |
---|---|
... | Name-rule pairs. |
An annotated event log, where - for every rule - a new column indicates whether the rule holds or not. The name of each rule becomes the name of the column.
library(eventdataR) # check whether MRI Scan is preceded by Blood test, and the case starts with Registration check_rules(patients, rule1 = precedence("Blood test","MRI SCAN"), rule2 = starts("Registration"))#> Log of 5442 events consisting of: #> 7 traces #> 500 cases #> 2721 instances of 7 activities #> 7 resources #> Events occurred from 2017-01-02 11:41:53 until 2018-05-05 07:16:02 #> #> Variables were mapped as follows: #> Case identifier: patient #> Activity identifier: handling #> Resource identifier: employee #> Activity instance identifier: handling_id #> Timestamp: time #> Lifecycle transition: registration_type #> #> # A tibble: 5,442 x 9 #> handling patient employee handling_id registration_ty~ time #> <fct> <chr> <fct> <chr> <fct> <dttm> #> 1 Registr~ 1 r1 1 start 2017-01-02 11:41:53 #> 2 Registr~ 2 r1 2 start 2017-01-02 11:41:53 #> 3 Triage ~ 1 r2 501 start 2017-01-02 12:40:20 #> 4 Registr~ 1 r1 1 complete 2017-01-02 12:40:20 #> 5 Registr~ 2 r1 2 complete 2017-01-02 15:16:38 #> 6 Triage ~ 2 r2 502 start 2017-01-02 22:32:25 #> 7 Triage ~ 1 r2 501 complete 2017-01-02 22:32:25 #> 8 Triage ~ 2 r2 502 complete 2017-01-03 12:34:01 #> 9 Registr~ 4 r1 4 start 2017-01-04 01:34:04 #> 10 Registr~ 3 r1 3 start 2017-01-04 01:34:05 #> # ... with 5,432 more rows, and 3 more variables: .order <int>, rule1 <lgl>, #> # rule2 <lgl>