This function can be used to filter event data using declaritive rules. 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().

filter_rules(eventlog, ...)

Arguments

eventlog

Eventlog object

...

rules

Value

A filtered event log.

Examples

library(eventdataR) # Filter where Blood test precedes MRI SCAN and Registration is the start of the case. filter_rules(patients, precedence("Blood test","MRI SCAN"), starts("Registration"))
#> Log of 2614 events consisting of: #> 5 traces #> 264 cases #> 1307 instances of 6 activities #> 6 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: 2,614 x 9 #> handling patient employee handling_id registration_ty~ time #> <fct> <chr> <fct> <chr> <fct> <dttm> #> 1 Registr~ 2 r1 2 start 2017-01-02 11:41:53 #> 2 Registr~ 2 r1 2 complete 2017-01-02 15:16:38 #> 3 Triage ~ 2 r2 502 start 2017-01-02 22:32:25 #> 4 Triage ~ 2 r2 502 complete 2017-01-03 12:34:01 #> 5 Registr~ 5 r1 5 start 2017-01-04 16:07:47 #> 6 Registr~ 5 r1 5 complete 2017-01-04 20:07:50 #> 7 Registr~ 8 r1 8 start 2017-01-05 04:56:11 #> 8 Registr~ 8 r1 8 complete 2017-01-05 07:58:17 #> 9 Triage ~ 5 r2 505 start 2017-01-05 21:27:44 #> 10 Triage ~ 5 r2 505 complete 2017-01-06 03:19:50 #> # ... with 2,604 more rows, and 3 more variables: .order <int>, #> # filtering_rule1 <lgl>, filtering_rule2 <lgl>