Learn R Programming

processcheckR (version 0.1.4)

filter_rules: Filter Using Declarative Rules

Description

This function can be used to filter event data using declaritive rules or constraint templates. It needs a log (object of class log or derivatives, e.g. grouped_log, eventlog, activitylog, etc.). and a set of rules. Rules can be made with the following templates:

  • Cardinality:

    • absent: Check if the specified activity is absent from a case,

    • contains: Check if the specified activity is present (contained) in a case,

    • contains_between: Check if the specified activity is present (contained) in a case between the minimum and maximum number of times,

    • contains_exactly: Check if the specified activity is present (contained) in a case for exactly n times.

  • Relation:

    • ends: Check if cases end with the specified activity,

    • starts: Check if cases start with the specified activity.

    • precedence: Check for precedence between two activities,

    • response: Check for response between two activities,

    • responded_existence: Check for responded existence between two activities,

    • succession: Check for succession between two activities.

  • Exclusiveness:

    • and: Check for co-existence of two activities,

    • xor: Check for exclusiveness of two activities.

Usage

filter_rules(log, ..., eventlog = deprecated())

# S3 method for log filter_rules(log, ..., eventlog = deprecated())

Value

A filtered log (of same type as input) that satisfied the specified rules.

Arguments

log

log: Object of class log or derivatives (grouped_log, eventlog, activitylog, etc.).

...

Name-rule pairs created by rule functions.

eventlog

[Deprecated]; please use log instead.

Methods (by class)

  • filter_rules(log): Filter a log using declaritive rules.

Details

The rules or constraint templates in this package are (partially) based on DecSerFlow (Declarative Service Flow Language). For more information, see the References below.

Grouped Logs

When applied to a grouped_log, the grouping variables are ignored but retained in the returned log.

References

van der Aalst, W. M. P., & Pesic, M. (2006). DecSerFlow: Towards a Truly Declarative Service Flow Language. In M. Bravetti, M. Núñez, & G. Zavattaro (Eds.), Proceedings of the 3rd International Workshop on Web Services and Formal Methods (Vol. 4184, pp. 1–23). Springer. tools:::Rd_expr_doi("10.1007/11841197_1")

See Also

check_rules

Examples

Run this code
library(bupaR)
library(eventdataR)

# Filter where Blood test precedes MRI SCAN and Registration is the start of the case.
patients %>%
 filter_rules(precedence("Blood test","MRI SCAN"),
              starts("Registration"))

Run the code above in your browser using DataLab