diff --git a/adjust_logs.html b/adjust_logs.html index 043968e..45def7a 100644 --- a/adjust_logs.html +++ b/adjust_logs.html @@ -13,15 +13,15 @@ bupaR Docs | Adjust Logs - + - - - - + + + + @@ -704,23 +704,23 @@

Using eventlog()/activitylog()

## Lifecycle transition: lifecycle ## ## # A tibble: 34,724 × 18 -## case_id activity lifec…¹ resou…² timestamp amount article dismi…³ -## <chr> <fct> <fct> <fct> <dttm> <chr> <dbl> <chr> -## 1 A1 Create Fi… comple… 561 2006-07-24 00:00:00 35.0 157 NIL -## 2 A1 Send Fine comple… <NA> 2006-12-05 00:00:00 <NA> NA <NA> -## 3 A100 Create Fi… comple… 561 2006-08-02 00:00:00 35.0 157 NIL -## 4 A100 Send Fine comple… <NA> 2006-12-12 00:00:00 <NA> NA <NA> -## 5 A100 Insert Fi… comple… <NA> 2007-01-15 00:00:00 <NA> NA <NA> -## 6 A100 Add penal… comple… <NA> 2007-03-16 00:00:00 71.5 NA <NA> -## 7 A100 Send for … comple… <NA> 2009-03-30 00:00:00 <NA> NA <NA> -## 8 A10000 Create Fi… comple… 561 2007-03-09 00:00:00 36.0 157 NIL -## 9 A10000 Send Fine comple… <NA> 2007-07-17 00:00:00 <NA> NA <NA> -## 10 A10000 Insert Fi… comple… <NA> 2007-08-02 00:00:00 <NA> NA <NA> -## # … with 34,714 more rows, 10 more variables: expense <chr>, lastsent <chr>, +## case_id activity lifecycle resource timestamp amount article +## <chr> <fct> <fct> <fct> <dttm> <chr> <dbl> +## 1 A1 Create Fine complete 561 2006-07-24 00:00:00 35.0 157 +## 2 A1 Send Fine complete <NA> 2006-12-05 00:00:00 <NA> NA +## 3 A100 Create Fine complete 561 2006-08-02 00:00:00 35.0 157 +## 4 A100 Send Fine complete <NA> 2006-12-12 00:00:00 <NA> NA +## 5 A100 Insert Fine No… complete <NA> 2007-01-15 00:00:00 <NA> NA +## 6 A100 Add penalty complete <NA> 2007-03-16 00:00:00 71.5 NA +## 7 A100 Send for Credi… complete <NA> 2009-03-30 00:00:00 <NA> NA +## 8 A10000 Create Fine complete 561 2007-03-09 00:00:00 36.0 157 +## 9 A10000 Send Fine complete <NA> 2007-07-17 00:00:00 <NA> NA +## 10 A10000 Insert Fine No… complete <NA> 2007-08-02 00:00:00 <NA> NA +## # ℹ 34,714 more rows +## # ℹ 11 more variables: dismissal <chr>, expense <chr>, lastsent <chr>, ## # matricola <dbl>, notificationtype <chr>, paymentamount <dbl>, points <dbl>, ## # totalpaymentamount <chr>, vehicleclass <chr>, activity_instance_id <chr>, -## # .order <int>, and abbreviated variable names ¹​lifecycle, ²​resource, -## # ³​dismissal +## # .order <int>

Using set_-functions

@@ -745,23 +745,23 @@

Using set_-functions

## Lifecycle transition: lifecycle ## ## # A tibble: 34,724 × 18 -## case_id activity lifec…¹ resou…² timestamp amount article dismi…³ -## <chr> <fct> <fct> <fct> <dttm> <chr> <dbl> <chr> -## 1 A1 Create Fi… comple… 561 2006-07-24 00:00:00 35.0 157 NIL -## 2 A1 Send Fine comple… <NA> 2006-12-05 00:00:00 <NA> NA <NA> -## 3 A100 Create Fi… comple… 561 2006-08-02 00:00:00 35.0 157 NIL -## 4 A100 Send Fine comple… <NA> 2006-12-12 00:00:00 <NA> NA <NA> -## 5 A100 Insert Fi… comple… <NA> 2007-01-15 00:00:00 <NA> NA <NA> -## 6 A100 Add penal… comple… <NA> 2007-03-16 00:00:00 71.5 NA <NA> -## 7 A100 Send for … comple… <NA> 2009-03-30 00:00:00 <NA> NA <NA> -## 8 A10000 Create Fi… comple… 561 2007-03-09 00:00:00 36.0 157 NIL -## 9 A10000 Send Fine comple… <NA> 2007-07-17 00:00:00 <NA> NA <NA> -## 10 A10000 Insert Fi… comple… <NA> 2007-08-02 00:00:00 <NA> NA <NA> -## # … with 34,714 more rows, 10 more variables: expense <chr>, lastsent <chr>, +## case_id activity lifecycle resource timestamp amount article +## <chr> <fct> <fct> <fct> <dttm> <chr> <dbl> +## 1 A1 Create Fine complete 561 2006-07-24 00:00:00 35.0 157 +## 2 A1 Send Fine complete <NA> 2006-12-05 00:00:00 <NA> NA +## 3 A100 Create Fine complete 561 2006-08-02 00:00:00 35.0 157 +## 4 A100 Send Fine complete <NA> 2006-12-12 00:00:00 <NA> NA +## 5 A100 Insert Fine No… complete <NA> 2007-01-15 00:00:00 <NA> NA +## 6 A100 Add penalty complete <NA> 2007-03-16 00:00:00 71.5 NA +## 7 A100 Send for Credi… complete <NA> 2009-03-30 00:00:00 <NA> NA +## 8 A10000 Create Fine complete 561 2007-03-09 00:00:00 36.0 157 +## 9 A10000 Send Fine complete <NA> 2007-07-17 00:00:00 <NA> NA +## 10 A10000 Insert Fine No… complete <NA> 2007-08-02 00:00:00 <NA> NA +## # ℹ 34,714 more rows +## # ℹ 11 more variables: dismissal <chr>, expense <chr>, lastsent <chr>, ## # matricola <dbl>, notificationtype <chr>, paymentamount <dbl>, points <dbl>, ## # totalpaymentamount <chr>, vehicleclass <chr>, activity_instance_id <chr>, -## # .order <int>, and abbreviated variable names ¹​lifecycle, ²​resource, -## # ³​dismissal +## # .order <int>

Using existing mapping

@@ -800,23 +800,23 @@

Using existing mapping

## Lifecycle transition: lifecycle ## ## # A tibble: 34,724 × 18 -## case_id activity lifec…¹ resou…² timestamp amount article dismi…³ -## <chr> <fct> <fct> <fct> <dttm> <chr> <dbl> <chr> -## 1 A1 Create Fi… comple… 561 2006-07-24 00:00:00 35.0 157 NIL -## 2 A1 Send Fine comple… <NA> 2006-12-05 00:00:00 <NA> NA <NA> -## 3 A100 Create Fi… comple… 561 2006-08-02 00:00:00 35.0 157 NIL -## 4 A100 Send Fine comple… <NA> 2006-12-12 00:00:00 <NA> NA <NA> -## 5 A100 Insert Fi… comple… <NA> 2007-01-15 00:00:00 <NA> NA <NA> -## 6 A100 Add penal… comple… <NA> 2007-03-16 00:00:00 71.5 NA <NA> -## 7 A100 Send for … comple… <NA> 2009-03-30 00:00:00 <NA> NA <NA> -## 8 A10000 Create Fi… comple… 561 2007-03-09 00:00:00 36.0 157 NIL -## 9 A10000 Send Fine comple… <NA> 2007-07-17 00:00:00 <NA> NA <NA> -## 10 A10000 Insert Fi… comple… <NA> 2007-08-02 00:00:00 <NA> NA <NA> -## # … with 34,714 more rows, 10 more variables: expense <chr>, lastsent <chr>, +## case_id activity lifecycle resource timestamp amount article +## <chr> <fct> <fct> <fct> <dttm> <chr> <dbl> +## 1 A1 Create Fine complete 561 2006-07-24 00:00:00 35.0 157 +## 2 A1 Send Fine complete <NA> 2006-12-05 00:00:00 <NA> NA +## 3 A100 Create Fine complete 561 2006-08-02 00:00:00 35.0 157 +## 4 A100 Send Fine complete <NA> 2006-12-12 00:00:00 <NA> NA +## 5 A100 Insert Fine No… complete <NA> 2007-01-15 00:00:00 <NA> NA +## 6 A100 Add penalty complete <NA> 2007-03-16 00:00:00 71.5 NA +## 7 A100 Send for Credi… complete <NA> 2009-03-30 00:00:00 <NA> NA +## 8 A10000 Create Fine complete 561 2007-03-09 00:00:00 36.0 157 +## 9 A10000 Send Fine complete <NA> 2007-07-17 00:00:00 <NA> NA +## 10 A10000 Insert Fine No… complete <NA> 2007-08-02 00:00:00 <NA> NA +## # ℹ 34,714 more rows +## # ℹ 11 more variables: dismissal <chr>, expense <chr>, lastsent <chr>, ## # matricola <dbl>, notificationtype <chr>, paymentamount <dbl>, points <dbl>, ## # totalpaymentamount <chr>, vehicleclass <chr>, activity_instance_id <chr>, -## # .order <int>, and abbreviated variable names ¹​lifecycle, ²​resource, -## # ³​dismissal +## # .order <int>

Read more:

diff --git a/advanced_maps.html b/advanced_maps.html index dbcd680..cf808a9 100644 --- a/advanced_maps.html +++ b/advanced_maps.html @@ -13,22 +13,22 @@ bupaR Docs | Advanced Maps - + - - - - + + + + - + - + +
+

Adding secondary information

@@ -676,8 +676,8 @@

Adding secondary information

patients %>%
     process_map(type = frequency("relative_case"),
                 sec = frequency("absolute"))
-
- +
+

Both primary and secondary layers can be differentiated between nodes and edges.

patients %>%
@@ -685,8 +685,8 @@ 

Adding secondary information

type_edges = performance(units = "hours"), sec_nodes = frequency("absolute"), sec_edges = performance(FUN = max, units = "hours"))
-
- +
+

Customizing colors

@@ -708,8 +708,8 @@

Customizing colors

patients %>%
     process_map(type_nodes = frequency("relative_case", color_scale = "PuBu"),
                 type_edges = performance(mean, color_edges = "dodgerblue4"))
-
- +
+

Customizing the layout

diff --git a/analyze.html b/analyze.html index 38a2369..6950050 100644 --- a/analyze.html +++ b/analyze.html @@ -13,17 +13,18 @@ Analyze process data - + - - - + + + - - + + +
- -
-
-
+
+
Performance
-
+ +
-
-
-
-
+
+
Organisational
-
+ +
-
-
-
-
+
+
Multi-dimensional
-
+ -
+
diff --git a/animate_maps.html b/animate_maps.html index 530c460..6f0cc7e 100644 --- a/animate_maps.html +++ b/animate_maps.html @@ -13,19 +13,19 @@ bupaR Docs | Animate Process Maps - + - - - - + + + + - + @@ -672,29 +672,29 @@

Animate Process Maps

eventdataR package.

A basic animation with static color and token size:

animate_process(patients)
-
- +
+

Default token color, size, or image can be changed as follows:

animate_process(patients, mapping = token_aes(size = token_scale(12), shape = "rect"))
-
- +
+
animate_process(patients, mapping = token_aes(color = token_scale("red")))
-
- +
+

The example animation on the top of this site:

animate_process(patients, mode = "relative", jitter = 10, legend = "color",
   mapping = token_aes(color = token_scale("employee", 
     scale = "ordinal", 
     range = RColorBrewer::brewer.pal(7, "Paired"))))
-
- +
+

Tokens can also be assigned images, for example:

animate_process(patients,
    mapping = token_aes(shape = "image",
     size = token_scale(10),
     image = token_scale("https://upload.wikimedia.org/wikipedia/en/5/5f/Pacman.gif")))
-
- +
+

Use external data

It is possible to use a secondary data frame to determine the @@ -730,8 +730,8 @@

Use external data

mapping = token_aes(color = token_scale(lactic, scale = "linear", range = c("#fff5eb","#7f2704"))))
-
- +
+

processanimateR animation can be also used interactively as part of a (Shiny) web-application. Here, an example application that expects attributes are of an appropriate data type and automatically @@ -996,8 +996,8 @@

User defined bins

, domain = my_flags$value , range = rev(RColorBrewer::brewer.pal(5,"Spectral")) )))
-
- +
+

The colors can be adjusted by the range argument. In this case the scale is reversed with rev() to go from blue to red. See Ordinal scales mapping = token_aes(color = token_scale("employee", scale = "ordinal", range = RColorBrewer::brewer.pal(8, "Paired"))))

-
- +
+

Linear scales

@@ -1039,8 +1039,8 @@

Time scales

mapping = token_aes(color = token_scale("time", scale = "time", range = c("blue","red"))))
-
- +
+

Source: https://bupaverse.github.io/processanimateR/


diff --git a/augment.html b/augment.html index e2ea482..951ab73 100644 --- a/augment.html +++ b/augment.html @@ -13,15 +13,15 @@ bupaR Docs | Augment logs - + - - - - + + + + @@ -671,7 +671,7 @@

Augment logs

## 8 A1327 9 ## 9 A13617 9 ## 10 A13984 9 -## # … with 9,990 more rows +## # ℹ 9,990 more rows

Feeding the resulting table back to traffic_fines with augment() makes the trace length metric available as a case attribute for further analysis.

@@ -740,16 +740,16 @@

Select variables

patients %>% 
     processing_time(level = "activity", units = "hours")
## # A tibble: 7 × 11
-##   handling       min   q1    mean  median q3    max   st_dev   iqr total relat…¹
-##   <fct>          <drt> <drt> <drt> <drtn> <drt> <drt>  <dbl> <dbl> <drt>   <dbl>
-## 1 Registration   0.82…  2.0…  2.7…  2.71…  3.4…  5.6…  0.954 1.33  1376…  0.184 
-## 2 Triage and As… 5.86… 11.3… 13.1… 13.34… 15.0… 18.8…  2.76  3.68  6552…  0.184 
-## 3 Discuss Resul… 1.33…  2.3…  2.7…  2.77…  3.2…  4.5…  0.628 0.906 1374…  0.182 
-## 4 Check-out      0.66…  1.6…  2.0…  2.07…  2.4…  3.8…  0.620 0.860 1014…  0.181 
-## 5 X-Ray          2.29…  3.8…  4.8…  4.79…  5.6…  8.1…  1.28  1.76  1264…  0.0959
-## 6 Blood test     3.08…  4.7…  5.5…  5.46…  6.2…  8.1…  1.06  1.51  1311…  0.0871
-## 7 MRI SCAN       2.48…  3.6…  4.1…  4.09…  4.6…  5.9…  0.735 1.09   979…  0.0867
-## # … with abbreviated variable name ¹​relative_frequency
+## handling min q1 mean median q3 max st_dev iqr total +## <fct> <drtn> <drt> <drt> <drtn> <drt> <drt> <dbl> <dbl> <drt> +## 1 Registration 0.828… 2.0… 2.7… 2.71… 3.4… 5.6… 0.954 1.33 1376… +## 2 Triage and Assessment 5.868… 11.3… 13.1… 13.34… 15.0… 18.8… 2.76 3.68 6552… +## 3 Discuss Results 1.333… 2.3… 2.7… 2.77… 3.2… 4.5… 0.628 0.906 1374… +## 4 Check-out 0.667… 1.6… 2.0… 2.07… 2.4… 3.8… 0.620 0.860 1014… +## 5 X-Ray 2.294… 3.8… 4.8… 4.79… 5.6… 8.1… 1.28 1.76 1264… +## 6 Blood test 3.089… 4.7… 5.5… 5.46… 6.2… 8.1… 1.06 1.51 1311… +## 7 MRI SCAN 2.489… 3.6… 4.1… 4.09… 4.6… 5.9… 0.735 1.09 979… +## # ℹ 1 more variable: relative_frequency <dbl>

Calling augment without any further arguments will add all columns, from min until relative_frequency to the data.

diff --git a/case_filters.html b/case_filters.html index 6caaa47..35ee786 100644 --- a/case_filters.html +++ b/case_filters.html @@ -13,22 +13,22 @@ bupaR Docs | Filter case - + - - - - + + + + - + - + +
+

Endpoints Condition

@@ -1082,19 +1076,20 @@

Endpoints Condition

## Lifecycle transition: registration_type ## ## # A tibble: 5,388 × 7 -## handling patient employee handling_id regist…¹ time .order -## <fct> <chr> <fct> <chr> <fct> <dttm> <int> -## 1 Registration 1 r1 1 start 2017-01-02 11:41:53 1 -## 2 Registration 2 r1 2 start 2017-01-02 11:41:53 2 -## 3 Registration 3 r1 3 start 2017-01-04 01:34:05 3 -## 4 Registration 4 r1 4 start 2017-01-04 01:34:04 4 -## 5 Registration 5 r1 5 start 2017-01-04 16:07:47 5 -## 6 Registration 6 r1 6 start 2017-01-04 16:07:47 6 -## 7 Registration 7 r1 7 start 2017-01-05 04:56:11 7 -## 8 Registration 8 r1 8 start 2017-01-05 04:56:11 8 -## 9 Registration 9 r1 9 start 2017-01-06 05:58:54 9 -## 10 Registration 10 r1 10 start 2017-01-06 05:58:54 10 -## # … with 5,378 more rows, and abbreviated variable name ¹​registration_type +## handling patient employee handling_id registration_type time +## <fct> <chr> <fct> <chr> <fct> <dttm> +## 1 Registrat… 1 r1 1 start 2017-01-02 11:41:53 +## 2 Registrat… 2 r1 2 start 2017-01-02 11:41:53 +## 3 Registrat… 3 r1 3 start 2017-01-04 01:34:05 +## 4 Registrat… 4 r1 4 start 2017-01-04 01:34:04 +## 5 Registrat… 5 r1 5 start 2017-01-04 16:07:47 +## 6 Registrat… 6 r1 6 start 2017-01-04 16:07:47 +## 7 Registrat… 7 r1 7 start 2017-01-05 04:56:11 +## 8 Registrat… 8 r1 8 start 2017-01-05 04:56:11 +## 9 Registrat… 9 r1 9 start 2017-01-06 05:58:54 +## 10 Registrat… 10 r1 10 start 2017-01-06 05:58:54 +## # ℹ 5,378 more rows +## # ℹ 1 more variable: .order <int>

Naturally, both conditions can use any of the available variables. The following selects all cases that started between midnight and 6am. Note that no condition is applied on the end activity instance using the @@ -1134,23 +1129,23 @@

Flow Time

## Lifecycle transition: lifecycle ## ## # A tibble: 6,303 × 18 -## case_id activity lifec…¹ resou…² timestamp amount article dismi…³ -## <chr> <fct> <fct> <fct> <dttm> <chr> <dbl> <chr> -## 1 A10005 Create Fi… comple… 537 2007-03-20 00:00:00 36.0 157 NIL -## 2 A10005 Payment comple… <NA> 2007-03-21 00:00:00 <NA> NA <NA> -## 3 A10007 Create Fi… comple… 537 2007-03-20 00:00:00 36.0 157 NIL -## 4 A10007 Payment comple… <NA> 2007-03-23 00:00:00 <NA> NA <NA> -## 5 A10022 Create Fi… comple… 537 2007-03-22 00:00:00 22.0 7 NIL -## 6 A10022 Payment comple… <NA> 2007-03-28 00:00:00 <NA> NA <NA> -## 7 A10024 Create Fi… comple… 537 2007-03-22 00:00:00 36.0 157 NIL -## 8 A10024 Payment comple… <NA> 2007-03-26 00:00:00 <NA> NA <NA> -## 9 A10029 Create Fi… comple… 537 2007-03-22 00:00:00 36.0 157 NIL -## 10 A10029 Payment comple… <NA> 2007-04-10 00:00:00 <NA> NA <NA> -## # … with 6,293 more rows, 10 more variables: expense <chr>, lastsent <chr>, +## case_id activity lifecycle resource timestamp amount article +## <chr> <fct> <fct> <fct> <dttm> <chr> <dbl> +## 1 A10005 Create Fine complete 537 2007-03-20 00:00:00 36.0 157 +## 2 A10005 Payment complete <NA> 2007-03-21 00:00:00 <NA> NA +## 3 A10007 Create Fine complete 537 2007-03-20 00:00:00 36.0 157 +## 4 A10007 Payment complete <NA> 2007-03-23 00:00:00 <NA> NA +## 5 A10022 Create Fine complete 537 2007-03-22 00:00:00 22.0 7 +## 6 A10022 Payment complete <NA> 2007-03-28 00:00:00 <NA> NA +## 7 A10024 Create Fine complete 537 2007-03-22 00:00:00 36.0 157 +## 8 A10024 Payment complete <NA> 2007-03-26 00:00:00 <NA> NA +## 9 A10029 Create Fine complete 537 2007-03-22 00:00:00 36.0 157 +## 10 A10029 Payment complete <NA> 2007-04-10 00:00:00 <NA> NA +## # ℹ 6,293 more rows +## # ℹ 11 more variables: dismissal <chr>, expense <chr>, lastsent <chr>, ## # matricola <dbl>, notificationtype <chr>, paymentamount <dbl>, points <dbl>, ## # totalpaymentamount <chr>, vehicleclass <chr>, activity_instance_id <chr>, -## # .order <int>, and abbreviated variable names ¹​lifecycle, ²​resource, -## # ³​dismissal +## # .order <int>

The interval can be defined as half-open using NA for the first or second element. Below select cases where payment is followed after 4 weeks.

@@ -1172,23 +1167,23 @@

Flow Time

## Lifecycle transition: lifecycle ## ## # A tibble: 646 × 18 -## case_id activity lifec…¹ resou…² timestamp amount article dismi…³ -## <chr> <fct> <fct> <fct> <dttm> <chr> <dbl> <chr> -## 1 A10059 Create Fi… comple… 541 2007-03-08 00:00:00 36.0 157 NIL -## 2 A10059 Payment comple… <NA> 2007-04-18 00:00:00 <NA> NA <NA> -## 3 A1006 Create Fi… comple… 550 2006-08-08 00:00:00 21.0 7 NIL -## 4 A1006 Payment comple… <NA> 2006-09-12 00:00:00 <NA> NA <NA> -## 5 A10157 Create Fi… comple… 558 2007-03-06 00:00:00 36.0 157 NIL -## 6 A10157 Payment comple… <NA> 2007-04-13 00:00:00 <NA> NA <NA> -## 7 A10221 Create Fi… comple… 559 2007-03-09 00:00:00 36.0 157 NIL -## 8 A10221 Payment comple… <NA> 2007-04-19 00:00:00 <NA> NA <NA> -## 9 A10283 Create Fi… comple… 559 2007-03-18 00:00:00 36.0 157 NIL -## 10 A10283 Payment comple… <NA> 2007-05-17 00:00:00 <NA> NA <NA> -## # … with 636 more rows, 10 more variables: expense <chr>, lastsent <chr>, +## case_id activity lifecycle resource timestamp amount article +## <chr> <fct> <fct> <fct> <dttm> <chr> <dbl> +## 1 A10059 Create Fine complete 541 2007-03-08 00:00:00 36.0 157 +## 2 A10059 Payment complete <NA> 2007-04-18 00:00:00 <NA> NA +## 3 A1006 Create Fine complete 550 2006-08-08 00:00:00 21.0 7 +## 4 A1006 Payment complete <NA> 2006-09-12 00:00:00 <NA> NA +## 5 A10157 Create Fine complete 558 2007-03-06 00:00:00 36.0 157 +## 6 A10157 Payment complete <NA> 2007-04-13 00:00:00 <NA> NA +## 7 A10221 Create Fine complete 559 2007-03-09 00:00:00 36.0 157 +## 8 A10221 Payment complete <NA> 2007-04-19 00:00:00 <NA> NA +## 9 A10283 Create Fine complete 559 2007-03-18 00:00:00 36.0 157 +## 10 A10283 Payment complete <NA> 2007-05-17 00:00:00 <NA> NA +## # ℹ 636 more rows +## # ℹ 11 more variables: dismissal <chr>, expense <chr>, lastsent <chr>, ## # matricola <dbl>, notificationtype <chr>, paymentamount <dbl>, points <dbl>, ## # totalpaymentamount <chr>, vehicleclass <chr>, activity_instance_id <chr>, -## # .order <int>, and abbreviated variable names ¹​lifecycle, ²​resource, -## # ³​dismissal +## # .order <int>

Note that we can also use reverse = TRUE. However, this will also include cases where Create Fine is not followed by Payment at all. Therefore, the @@ -1211,23 +1206,23 @@

Flow Time

## Lifecycle transition: lifecycle ## ## # A tibble: 28,421 × 18 -## case_id activity lifec…¹ resou…² timestamp amount article dismi…³ -## <chr> <fct> <fct> <fct> <dttm> <chr> <dbl> <chr> -## 1 A1 Create Fi… comple… 561 2006-07-24 00:00:00 35.0 157 NIL -## 2 A1 Send Fine comple… <NA> 2006-12-05 00:00:00 <NA> NA <NA> -## 3 A100 Create Fi… comple… 561 2006-08-02 00:00:00 35.0 157 NIL -## 4 A100 Send Fine comple… <NA> 2006-12-12 00:00:00 <NA> NA <NA> -## 5 A100 Insert Fi… comple… <NA> 2007-01-15 00:00:00 <NA> NA <NA> -## 6 A100 Add penal… comple… <NA> 2007-03-16 00:00:00 71.5 NA <NA> -## 7 A100 Send for … comple… <NA> 2009-03-30 00:00:00 <NA> NA <NA> -## 8 A10000 Create Fi… comple… 561 2007-03-09 00:00:00 36.0 157 NIL -## 9 A10000 Send Fine comple… <NA> 2007-07-17 00:00:00 <NA> NA <NA> -## 10 A10000 Insert Fi… comple… <NA> 2007-08-02 00:00:00 <NA> NA <NA> -## # … with 28,411 more rows, 10 more variables: expense <chr>, lastsent <chr>, +## case_id activity lifecycle resource timestamp amount article +## <chr> <fct> <fct> <fct> <dttm> <chr> <dbl> +## 1 A1 Create Fine complete 561 2006-07-24 00:00:00 35.0 157 +## 2 A1 Send Fine complete <NA> 2006-12-05 00:00:00 <NA> NA +## 3 A100 Create Fine complete 561 2006-08-02 00:00:00 35.0 157 +## 4 A100 Send Fine complete <NA> 2006-12-12 00:00:00 <NA> NA +## 5 A100 Insert Fine No… complete <NA> 2007-01-15 00:00:00 <NA> NA +## 6 A100 Add penalty complete <NA> 2007-03-16 00:00:00 71.5 NA +## 7 A100 Send for Credi… complete <NA> 2009-03-30 00:00:00 <NA> NA +## 8 A10000 Create Fine complete 561 2007-03-09 00:00:00 36.0 157 +## 9 A10000 Send Fine complete <NA> 2007-07-17 00:00:00 <NA> NA +## 10 A10000 Insert Fine No… complete <NA> 2007-08-02 00:00:00 <NA> NA +## # ℹ 28,411 more rows +## # ℹ 11 more variables: dismissal <chr>, expense <chr>, lastsent <chr>, ## # matricola <dbl>, notificationtype <chr>, paymentamount <dbl>, points <dbl>, ## # totalpaymentamount <chr>, vehicleclass <chr>, activity_instance_id <chr>, -## # .order <int>, and abbreviated variable names ¹​lifecycle, ²​resource, -## # ³​dismissal +## # .order <int>

Idle Time

@@ -1323,16 +1318,16 @@

Infrequent Flows

href="https://bupaverse.github.io/docs/frequency_maps.html">process map below.

traffic_fines %>% process_map()
-
- +
+

In this map, we can observe several unique directly follows relations, as well as flows occurring only 2 or 3 times. Using the filter, we can remove the cases that lead to these flows as follows:

traffic_fines %>%
     filter_infrequent_flows(min_n = 5) %>%
     process_map()
-
- +
+

We can immediately observe less very infrequent flows in the process map.

It is important to note that filter_infrequent_flows() @@ -1378,12 +1373,11 @@

Precedence

precedence_type = "directly_follows") %>% traces()
## # A tibble: 3 × 3
-##   trace                                                          absol…¹ relat…²
-##   <chr>                                                            <int>   <dbl>
-## 1 Registration,Triage and Assessment,Blood test,MRI SCAN,Discus…     234 0.987  
-## 2 Registration,Triage and Assessment,Blood test,MRI SCAN,Discus…       2 0.00844
-## 3 Registration,Triage and Assessment,Blood test                        1 0.00422
-## # … with abbreviated variable names ¹​absolute_frequency, ²​relative_frequency
+## trace absolute_frequency relative_frequency +## <chr> <int> <dbl> +## 1 Registration,Triage and Assessment,Bloo… 234 0.987 +## 2 Registration,Triage and Assessment,Bloo… 2 0.00844 +## 3 Registration,Triage and Assessment,Bloo… 1 0.00422

The following selects cases where Triage and Assessment is eventually followed by both Blood test and X-Ray, which never happens.

@@ -1405,15 +1399,14 @@

Precedence

filter_method = "one_of") %>% traces()
## # A tibble: 6 × 3
-##   trace                                                          absol…¹ relat…²
-##   <chr>                                                            <int>   <dbl>
-## 1 Registration,Triage and Assessment,X-Ray,Discuss Results,Chec…     258 0.518  
-## 2 Registration,Triage and Assessment,Blood test,MRI SCAN,Discus…     234 0.470  
-## 3 Registration,Triage and Assessment,Blood test,MRI SCAN,Discus…       2 0.00402
-## 4 Registration,Triage and Assessment,X-Ray                             2 0.00402
-## 5 Registration,Triage and Assessment,X-Ray,Discuss Results             1 0.00201
-## 6 Registration,Triage and Assessment,Blood test                        1 0.00201
-## # … with abbreviated variable names ¹​absolute_frequency, ²​relative_frequency
+## trace absolute_frequency relative_frequency +## <chr> <int> <dbl> +## 1 Registration,Triage and Assessment,X-Ra… 258 0.518 +## 2 Registration,Triage and Assessment,Bloo… 234 0.470 +## 3 Registration,Triage and Assessment,Bloo… 2 0.00402 +## 4 Registration,Triage and Assessment,X-Ray 2 0.00402 +## 5 Registration,Triage and Assessment,X-Ra… 1 0.00201 +## 6 Registration,Triage and Assessment,Bloo… 1 0.00201

This final example only retains cases where Triage and Assessment is not followed by any of the three consequent activities. The result is 2 incomplete cases where the last activity was @@ -1450,7 +1443,7 @@

Precedence Condition

precedence_type = "eventually_follows")
## EMPTY EVENT LOG
 ## # A tibble: 0 × 20
-## # … with 20 variables: case_id <chr>, activity <fct>, lifecycle <fct>,
+## # ℹ 20 variables: case_id <chr>, activity <fct>, lifecycle <fct>,
 ## #   resource <fct>, timestamp <dttm>, amount <chr>, article <dbl>,
 ## #   dismissal <chr>, expense <chr>, lastsent <chr>, matricola <dbl>,
 ## #   notificationtype <chr>, paymentamount <dbl>, points <dbl>,
@@ -1710,52 +1703,49 @@ 

Interval-based

filter_trace_frequency(interval = c(10,50)) %>% traces()
## # A tibble: 5 × 3
-##   trace                                                          absol…¹ relat…²
-##   <chr>                                                            <int>   <dbl>
-## 1 ER Registration,ER Triage,ER Sepsis Triage                          35   0.333
-## 2 ER Registration,ER Triage,ER Sepsis Triage,Leucocytes,CRP           24   0.229
-## 3 ER Registration,ER Triage,ER Sepsis Triage,CRP,Leucocytes           22   0.210
-## 4 ER Registration,ER Triage,ER Sepsis Triage,CRP,LacticAcid,Leu…      13   0.124
-## 5 ER Registration,ER Triage,ER Sepsis Triage,Leucocytes,CRP,Lac…      11   0.105
-## # … with abbreviated variable names ¹​absolute_frequency, ²​relative_frequency
+## trace absolute_frequency relative_frequency +## <chr> <int> <dbl> +## 1 ER Registration,ER Triage,ER Sepsis Tri… 35 0.333 +## 2 ER Registration,ER Triage,ER Sepsis Tri… 24 0.229 +## 3 ER Registration,ER Triage,ER Sepsis Tri… 22 0.210 +## 4 ER Registration,ER Triage,ER Sepsis Tri… 13 0.124 +## 5 ER Registration,ER Triage,ER Sepsis Tri… 11 0.105

Also here you can use half-open intervals.

sepsis %>%
     filter_trace_frequency(interval = c(5,NA)) %>%
     traces()
## # A tibble: 11 × 3
-##    trace                                                         absol…¹ relat…²
-##    <chr>                                                           <int>   <dbl>
-##  1 ER Registration,ER Triage,ER Sepsis Triage                         35  0.248 
-##  2 ER Registration,ER Triage,ER Sepsis Triage,Leucocytes,CRP          24  0.170 
-##  3 ER Registration,ER Triage,ER Sepsis Triage,CRP,Leucocytes          22  0.156 
-##  4 ER Registration,ER Triage,ER Sepsis Triage,CRP,LacticAcid,Le…      13  0.0922
-##  5 ER Registration,ER Triage,ER Sepsis Triage,Leucocytes,CRP,La…      11  0.0780
-##  6 ER Registration,ER Triage,ER Sepsis Triage,Leucocytes,CRP,La…       9  0.0638
-##  7 ER Registration,ER Triage,ER Sepsis Triage,Leucocytes,Lactic…       7  0.0496
-##  8 ER Registration,ER Triage,ER Sepsis Triage,Leucocytes,CRP,Ad…       5  0.0355
-##  9 ER Registration,ER Triage,ER Sepsis Triage,LacticAcid,Leucoc…       5  0.0355
-## 10 ER Registration,ER Triage,ER Sepsis Triage,CRP,Leucocytes,La…       5  0.0355
-## 11 ER Registration,ER Triage,CRP,Leucocytes,ER Sepsis Triage           5  0.0355
-## # … with abbreviated variable names ¹​absolute_frequency, ²​relative_frequency
+## trace absolute_frequency relative_frequency +## <chr> <int> <dbl> +## 1 ER Registration,ER Triage,ER Sepsis Tr… 35 0.248 +## 2 ER Registration,ER Triage,ER Sepsis Tr… 24 0.170 +## 3 ER Registration,ER Triage,ER Sepsis Tr… 22 0.156 +## 4 ER Registration,ER Triage,ER Sepsis Tr… 13 0.0922 +## 5 ER Registration,ER Triage,ER Sepsis Tr… 11 0.0780 +## 6 ER Registration,ER Triage,ER Sepsis Tr… 9 0.0638 +## 7 ER Registration,ER Triage,ER Sepsis Tr… 7 0.0496 +## 8 ER Registration,ER Triage,ER Sepsis Tr… 5 0.0355 +## 9 ER Registration,ER Triage,ER Sepsis Tr… 5 0.0355 +## 10 ER Registration,ER Triage,ER Sepsis Tr… 5 0.0355 +## 11 ER Registration,ER Triage,CRP,Leucocyt… 5 0.0355

And use reverse = TRUE.

sepsis %>%
     filter_trace_frequency(interval = c(5,NA), reverse = TRUE) %>%
     traces()
## # A tibble: 835 × 3
-##    trace                                                         absol…¹ relat…²
-##    <chr>                                                           <int>   <dbl>
-##  1 ER Registration,ER Triage,ER Sepsis Triage,CRP,LacticAcid,Le…       4 0.00440
-##  2 ER Registration,ER Triage,ER Sepsis Triage,LacticAcid,Leucoc…       4 0.00440
-##  3 ER Registration,ER Triage,ER Sepsis Triage,IV Liquid,CRP,Leu…       4 0.00440
-##  4 ER Registration,ER Triage,ER Sepsis Triage,CRP,Leucocytes,Ad…       4 0.00440
-##  5 ER Registration,ER Triage,Leucocytes,CRP,ER Sepsis Triage           4 0.00440
-##  6 ER Registration,ER Triage,ER Sepsis Triage,Leucocytes,CRP,La…       4 0.00440
-##  7 ER Registration,ER Triage,ER Sepsis Triage,Leucocytes,Lactic…       4 0.00440
-##  8 ER Registration,ER Triage,ER Sepsis Triage,IV Liquid,Leucocy…       3 0.00330
-##  9 ER Registration,ER Triage,LacticAcid,Leucocytes,CRP,ER Sepsi…       3 0.00330
-## 10 ER Registration,ER Triage,CRP,LacticAcid,Leucocytes,ER Sepsi…       3 0.00330
-## # … with 825 more rows, and abbreviated variable names ¹​absolute_frequency,
-## #   ²​relative_frequency
+## trace absolute_frequency relative_frequency +## <chr> <int> <dbl> +## 1 ER Registration,ER Triage,ER Sepsis Tr… 4 0.00440 +## 2 ER Registration,ER Triage,ER Sepsis Tr… 4 0.00440 +## 3 ER Registration,ER Triage,ER Sepsis Tr… 4 0.00440 +## 4 ER Registration,ER Triage,ER Sepsis Tr… 4 0.00440 +## 5 ER Registration,ER Triage,Leucocytes,C… 4 0.00440 +## 6 ER Registration,ER Triage,ER Sepsis Tr… 4 0.00440 +## 7 ER Registration,ER Triage,ER Sepsis Tr… 4 0.00440 +## 8 ER Registration,ER Triage,ER Sepsis Tr… 3 0.00330 +## 9 ER Registration,ER Triage,LacticAcid,L… 3 0.00330 +## 10 ER Registration,ER Triage,CRP,LacticAc… 3 0.00330 +## # ℹ 825 more rows
@@ -1770,40 +1760,38 @@

Percentage-based

filter_trace_frequency(percentage = 0.8) %>% traces()
## # A tibble: 846 × 3
-##    trace                                                         absol…¹ relat…²
-##    <chr>                                                           <int>   <dbl>
-##  1 ER Registration,ER Triage,ER Sepsis Triage                         35 0.0333 
-##  2 ER Registration,ER Triage,ER Sepsis Triage,Leucocytes,CRP          24 0.0229 
-##  3 ER Registration,ER Triage,ER Sepsis Triage,CRP,Leucocytes          22 0.0210 
-##  4 ER Registration,ER Triage,ER Sepsis Triage,CRP,LacticAcid,Le…      13 0.0124 
-##  5 ER Registration,ER Triage,ER Sepsis Triage,Leucocytes,CRP,La…      11 0.0105 
-##  6 ER Registration,ER Triage,ER Sepsis Triage,Leucocytes,CRP,La…       9 0.00857
-##  7 ER Registration,ER Triage,ER Sepsis Triage,Leucocytes,Lactic…       7 0.00667
-##  8 ER Registration,ER Triage,ER Sepsis Triage,Leucocytes,CRP,Ad…       5 0.00476
-##  9 ER Registration,ER Triage,ER Sepsis Triage,LacticAcid,Leucoc…       5 0.00476
-## 10 ER Registration,ER Triage,ER Sepsis Triage,CRP,Leucocytes,La…       5 0.00476
-## # … with 836 more rows, and abbreviated variable names ¹​absolute_frequency,
-## #   ²​relative_frequency
+## trace absolute_frequency relative_frequency +## <chr> <int> <dbl> +## 1 ER Registration,ER Triage,ER Sepsis Tr… 35 0.0333 +## 2 ER Registration,ER Triage,ER Sepsis Tr… 24 0.0229 +## 3 ER Registration,ER Triage,ER Sepsis Tr… 22 0.0210 +## 4 ER Registration,ER Triage,ER Sepsis Tr… 13 0.0124 +## 5 ER Registration,ER Triage,ER Sepsis Tr… 11 0.0105 +## 6 ER Registration,ER Triage,ER Sepsis Tr… 9 0.00857 +## 7 ER Registration,ER Triage,ER Sepsis Tr… 7 0.00667 +## 8 ER Registration,ER Triage,ER Sepsis Tr… 5 0.00476 +## 9 ER Registration,ER Triage,ER Sepsis Tr… 5 0.00476 +## 10 ER Registration,ER Triage,ER Sepsis Tr… 5 0.00476 +## # ℹ 836 more rows

You can again set reverse = TRUE if you instead want 80% of the cases with the lowest frequency.

sepsis %>%
     filter_trace_frequency(percentage = 0.2, reverse = TRUE) %>%
     traces()
## # A tibble: 784 × 3
-##    trace                                                         absol…¹ relat…²
-##    <chr>                                                           <int>   <dbl>
-##  1 ER Registration,ER Triage,ER Sepsis Triage,LacticAcid,Leucoc…       1 0.00128
-##  2 ER Registration,ER Triage,ER Sepsis Triage,IV Antibiotics,Le…       1 0.00128
-##  3 ER Registration,ER Triage,ER Sepsis Triage,CRP,Leucocytes,IV…       1 0.00128
-##  4 ER Registration,ER Triage,ER Sepsis Triage,LacticAcid,Leucoc…       1 0.00128
-##  5 ER Registration,IV Liquid,ER Triage,Leucocytes,CRP,LacticAci…       1 0.00128
-##  6 ER Registration,ER Triage,ER Sepsis Triage,CRP,LacticAcid,Le…       1 0.00128
-##  7 ER Registration,ER Triage,ER Sepsis Triage,Leucocytes,CRP,La…       1 0.00128
-##  8 ER Registration,ER Triage,CRP,LacticAcid,Leucocytes,ER Sepsi…       1 0.00128
-##  9 ER Registration,ER Triage,ER Sepsis Triage,Leucocytes,CRP,La…       1 0.00128
-## 10 ER Registration,ER Triage,Leucocytes,CRP,LacticAcid,ER Sepsi…       1 0.00128
-## # … with 774 more rows, and abbreviated variable names ¹​absolute_frequency,
-## #   ²​relative_frequency
+## trace absolute_frequency relative_frequency +## <chr> <int> <dbl> +## 1 ER Registration,ER Triage,ER Sepsis Tr… 1 0.00128 +## 2 ER Registration,ER Triage,ER Sepsis Tr… 1 0.00128 +## 3 ER Registration,ER Triage,ER Sepsis Tr… 1 0.00128 +## 4 ER Registration,ER Triage,ER Sepsis Tr… 1 0.00128 +## 5 ER Registration,IV Liquid,ER Triage,Le… 1 0.00128 +## 6 ER Registration,ER Triage,ER Sepsis Tr… 1 0.00128 +## 7 ER Registration,ER Triage,ER Sepsis Tr… 1 0.00128 +## 8 ER Registration,ER Triage,CRP,LacticAc… 1 0.00128 +## 9 ER Registration,ER Triage,ER Sepsis Tr… 1 0.00128 +## 10 ER Registration,ER Triage,Leucocytes,C… 1 0.00128 +## # ℹ 774 more rows

Note that the obtained percentage of cases will not always be exactly the specified percentage, as there can be ties. For example, in the sepsis data set, 784 of the 1050 cases (75%) follow a @@ -1838,60 +1826,57 @@

Interval-based

filter_trace_length(interval = c(10,50)) %>% traces()
## # A tibble: 703 × 3
-##    trace                                                         absol…¹ relat…²
-##    <chr>                                                           <int>   <dbl>
-##  1 ER Registration,ER Triage,ER Sepsis Triage,LacticAcid,Leucoc…       4 0.00540
-##  2 ER Registration,ER Triage,ER Sepsis Triage,Leucocytes,CRP,La…       4 0.00540
-##  3 ER Registration,ER Triage,ER Sepsis Triage,Leucocytes,Lactic…       4 0.00540
-##  4 ER Registration,ER Triage,ER Sepsis Triage,IV Liquid,IV Anti…       3 0.00405
-##  5 ER Registration,ER Triage,ER Sepsis Triage,Leucocytes,CRP,La…       3 0.00405
-##  6 ER Registration,ER Triage,ER Sepsis Triage,CRP,LacticAcid,Le…       3 0.00405
-##  7 ER Registration,ER Triage,ER Sepsis Triage,IV Liquid,Leucocy…       3 0.00405
-##  8 ER Registration,ER Triage,ER Sepsis Triage,LacticAcid,Leucoc…       2 0.00270
-##  9 ER Registration,ER Triage,ER Sepsis Triage,LacticAcid,CRP,Le…       2 0.00270
-## 10 ER Registration,ER Triage,ER Sepsis Triage,Leucocytes,CRP,La…       2 0.00270
-## # … with 693 more rows, and abbreviated variable names ¹​absolute_frequency,
-## #   ²​relative_frequency
+## trace absolute_frequency relative_frequency +## <chr> <int> <dbl> +## 1 ER Registration,ER Triage,ER Sepsis Tr… 4 0.00540 +## 2 ER Registration,ER Triage,ER Sepsis Tr… 4 0.00540 +## 3 ER Registration,ER Triage,ER Sepsis Tr… 4 0.00540 +## 4 ER Registration,ER Triage,ER Sepsis Tr… 3 0.00405 +## 5 ER Registration,ER Triage,ER Sepsis Tr… 3 0.00405 +## 6 ER Registration,ER Triage,ER Sepsis Tr… 3 0.00405 +## 7 ER Registration,ER Triage,ER Sepsis Tr… 3 0.00405 +## 8 ER Registration,ER Triage,ER Sepsis Tr… 2 0.00270 +## 9 ER Registration,ER Triage,ER Sepsis Tr… 2 0.00270 +## 10 ER Registration,ER Triage,ER Sepsis Tr… 2 0.00270 +## # ℹ 693 more rows

Also here you can use half-open intervals.

sepsis %>%
     filter_trace_length(interval = c(10,NA)) %>%
     traces()
## # A tibble: 715 × 3
-##    trace                                                         absol…¹ relat…²
-##    <chr>                                                           <int>   <dbl>
-##  1 ER Registration,ER Triage,ER Sepsis Triage,LacticAcid,Leucoc…       4 0.00531
-##  2 ER Registration,ER Triage,ER Sepsis Triage,Leucocytes,CRP,La…       4 0.00531
-##  3 ER Registration,ER Triage,ER Sepsis Triage,Leucocytes,Lactic…       4 0.00531
-##  4 ER Registration,ER Triage,ER Sepsis Triage,IV Liquid,IV Anti…       3 0.00398
-##  5 ER Registration,ER Triage,ER Sepsis Triage,Leucocytes,CRP,La…       3 0.00398
-##  6 ER Registration,ER Triage,ER Sepsis Triage,CRP,LacticAcid,Le…       3 0.00398
-##  7 ER Registration,ER Triage,ER Sepsis Triage,IV Liquid,Leucocy…       3 0.00398
-##  8 ER Registration,ER Triage,ER Sepsis Triage,LacticAcid,Leucoc…       2 0.00266
-##  9 ER Registration,ER Triage,ER Sepsis Triage,LacticAcid,CRP,Le…       2 0.00266
-## 10 ER Registration,ER Triage,ER Sepsis Triage,Leucocytes,CRP,La…       2 0.00266
-## # … with 705 more rows, and abbreviated variable names ¹​absolute_frequency,
-## #   ²​relative_frequency
+## trace absolute_frequency relative_frequency +## <chr> <int> <dbl> +## 1 ER Registration,ER Triage,ER Sepsis Tr… 4 0.00531 +## 2 ER Registration,ER Triage,ER Sepsis Tr… 4 0.00531 +## 3 ER Registration,ER Triage,ER Sepsis Tr… 4 0.00531 +## 4 ER Registration,ER Triage,ER Sepsis Tr… 3 0.00398 +## 5 ER Registration,ER Triage,ER Sepsis Tr… 3 0.00398 +## 6 ER Registration,ER Triage,ER Sepsis Tr… 3 0.00398 +## 7 ER Registration,ER Triage,ER Sepsis Tr… 3 0.00398 +## 8 ER Registration,ER Triage,ER Sepsis Tr… 2 0.00266 +## 9 ER Registration,ER Triage,ER Sepsis Tr… 2 0.00266 +## 10 ER Registration,ER Triage,ER Sepsis Tr… 2 0.00266 +## # ℹ 705 more rows

And use reverse = TRUE.

sepsis %>%
     filter_trace_length(interval = c(10,NA), reverse = TRUE) %>%
     traces()
## # A tibble: 131 × 3
-##    trace                                                         absol…¹ relat…²
-##    <chr>                                                           <int>   <dbl>
-##  1 ER Registration,ER Triage,ER Sepsis Triage                         35  0.118 
-##  2 ER Registration,ER Triage,ER Sepsis Triage,Leucocytes,CRP          24  0.0808
-##  3 ER Registration,ER Triage,ER Sepsis Triage,CRP,Leucocytes          22  0.0741
-##  4 ER Registration,ER Triage,ER Sepsis Triage,CRP,LacticAcid,Le…      13  0.0438
-##  5 ER Registration,ER Triage,ER Sepsis Triage,Leucocytes,CRP,La…      11  0.0370
-##  6 ER Registration,ER Triage,ER Sepsis Triage,Leucocytes,CRP,La…       9  0.0303
-##  7 ER Registration,ER Triage,ER Sepsis Triage,Leucocytes,Lactic…       7  0.0236
-##  8 ER Registration,ER Triage,ER Sepsis Triage,Leucocytes,CRP,Ad…       5  0.0168
-##  9 ER Registration,ER Triage,ER Sepsis Triage,LacticAcid,Leucoc…       5  0.0168
-## 10 ER Registration,ER Triage,ER Sepsis Triage,CRP,Leucocytes,La…       5  0.0168
-## # … with 121 more rows, and abbreviated variable names ¹​absolute_frequency,
-## #   ²​relative_frequency
+## trace absolute_frequency relative_frequency +## <chr> <int> <dbl> +## 1 ER Registration,ER Triage,ER Sepsis Tr… 35 0.118 +## 2 ER Registration,ER Triage,ER Sepsis Tr… 24 0.0808 +## 3 ER Registration,ER Triage,ER Sepsis Tr… 22 0.0741 +## 4 ER Registration,ER Triage,ER Sepsis Tr… 13 0.0438 +## 5 ER Registration,ER Triage,ER Sepsis Tr… 11 0.0370 +## 6 ER Registration,ER Triage,ER Sepsis Tr… 9 0.0303 +## 7 ER Registration,ER Triage,ER Sepsis Tr… 7 0.0236 +## 8 ER Registration,ER Triage,ER Sepsis Tr… 5 0.0168 +## 9 ER Registration,ER Triage,ER Sepsis Tr… 5 0.0168 +## 10 ER Registration,ER Triage,ER Sepsis Tr… 5 0.0168 +## # ℹ 121 more rows
@@ -1908,20 +1893,19 @@

Percentage-based

filter_trace_length(percentage = 0.5) %>% traces()
## # A tibble: 514 × 3
-##    trace                                                         absol…¹ relat…²
-##    <chr>                                                           <int>   <dbl>
-##  1 ER Registration,ER Triage,ER Sepsis Triage,LacticAcid,Leucoc…       2 0.00381
-##  2 ER Registration,ER Triage,ER Sepsis Triage,IV Liquid,IV Anti…       2 0.00381
-##  3 ER Registration,ER Triage,ER Sepsis Triage,Leucocytes,CRP,La…       2 0.00381
-##  4 ER Registration,ER Triage,ER Sepsis Triage,Leucocytes,CRP,La…       2 0.00381
-##  5 ER Registration,ER Triage,ER Sepsis Triage,LacticAcid,Leucoc…       2 0.00381
-##  6 ER Registration,ER Triage,ER Sepsis Triage,CRP,Leucocytes,La…       2 0.00381
-##  7 ER Registration,ER Triage,ER Sepsis Triage,Leucocytes,CRP,La…       2 0.00381
-##  8 ER Registration,ER Triage,ER Sepsis Triage,IV Liquid,Leucocy…       2 0.00381
-##  9 ER Registration,ER Triage,ER Sepsis Triage,CRP,LacticAcid,Le…       2 0.00381
-## 10 ER Registration,ER Triage,ER Sepsis Triage,IV Liquid,CRP,Lac…       2 0.00381
-## # … with 504 more rows, and abbreviated variable names ¹​absolute_frequency,
-## #   ²​relative_frequency
+## trace absolute_frequency relative_frequency +## <chr> <int> <dbl> +## 1 ER Registration,ER Triage,ER Sepsis Tr… 2 0.00381 +## 2 ER Registration,ER Triage,ER Sepsis Tr… 2 0.00381 +## 3 ER Registration,ER Triage,ER Sepsis Tr… 2 0.00381 +## 4 ER Registration,ER Triage,ER Sepsis Tr… 2 0.00381 +## 5 ER Registration,ER Triage,ER Sepsis Tr… 2 0.00381 +## 6 ER Registration,ER Triage,ER Sepsis Tr… 2 0.00381 +## 7 ER Registration,ER Triage,ER Sepsis Tr… 2 0.00381 +## 8 ER Registration,ER Triage,ER Sepsis Tr… 2 0.00381 +## 9 ER Registration,ER Triage,ER Sepsis Tr… 2 0.00381 +## 10 ER Registration,ER Triage,ER Sepsis Tr… 2 0.00381 +## # ℹ 504 more rows

You can again set reverse = TRUE if you instead want 50% of the cases with the lowest frequency.

Percentage-based
     filter_trace_length(percentage = 0.5, reverse = TRUE) %>%
     traces()
## # A tibble: 337 × 3
-##    trace                                                         absol…¹ relat…²
-##    <chr>                                                           <int>   <dbl>
-##  1 ER Registration,ER Triage,ER Sepsis Triage                         35 0.0667 
-##  2 ER Registration,ER Triage,ER Sepsis Triage,Leucocytes,CRP          24 0.0457 
-##  3 ER Registration,ER Triage,ER Sepsis Triage,CRP,Leucocytes          22 0.0419 
-##  4 ER Registration,ER Triage,ER Sepsis Triage,CRP,LacticAcid,Le…      13 0.0248 
-##  5 ER Registration,ER Triage,ER Sepsis Triage,Leucocytes,CRP,La…      11 0.0210 
-##  6 ER Registration,ER Triage,ER Sepsis Triage,Leucocytes,CRP,La…       9 0.0171 
-##  7 ER Registration,ER Triage,ER Sepsis Triage,Leucocytes,Lactic…       7 0.0133 
-##  8 ER Registration,ER Triage,ER Sepsis Triage,Leucocytes,CRP,Ad…       5 0.00952
-##  9 ER Registration,ER Triage,ER Sepsis Triage,LacticAcid,Leucoc…       5 0.00952
-## 10 ER Registration,ER Triage,ER Sepsis Triage,CRP,Leucocytes,La…       5 0.00952
-## # … with 327 more rows, and abbreviated variable names ¹​absolute_frequency,
-## #   ²​relative_frequency
+## trace absolute_frequency relative_frequency +## <chr> <int> <dbl> +## 1 ER Registration,ER Triage,ER Sepsis Tr… 35 0.0667 +## 2 ER Registration,ER Triage,ER Sepsis Tr… 24 0.0457 +## 3 ER Registration,ER Triage,ER Sepsis Tr… 22 0.0419 +## 4 ER Registration,ER Triage,ER Sepsis Tr… 13 0.0248 +## 5 ER Registration,ER Triage,ER Sepsis Tr… 11 0.0210 +## 6 ER Registration,ER Triage,ER Sepsis Tr… 9 0.0171 +## 7 ER Registration,ER Triage,ER Sepsis Tr… 7 0.0133 +## 8 ER Registration,ER Triage,ER Sepsis Tr… 5 0.00952 +## 9 ER Registration,ER Triage,ER Sepsis Tr… 5 0.00952 +## 10 ER Registration,ER Triage,ER Sepsis Tr… 5 0.00952 +## # ℹ 327 more rows

Note that the obtained percentage of cases will not always be exactly the specified percentage, as there can be ties.

diff --git a/case_filters_files/figure-html/unnamed-chunk-20-1.png b/case_filters_files/figure-html/unnamed-chunk-20-1.png index 27cfc2b..0f350cc 100644 Binary files a/case_filters_files/figure-html/unnamed-chunk-20-1.png and b/case_filters_files/figure-html/unnamed-chunk-20-1.png differ diff --git a/collapse.html b/collapse.html index 4fc51b3..11ac204 100644 --- a/collapse.html +++ b/collapse.html @@ -13,19 +13,19 @@ bupaR Docs | Collapse Activities - + - - - + + + - + - + +
+

Let’s say we want to combine the activities Blood test, MRI SCAN and X-Ray scan into a single Examination activity. This can be done as follows:

patients %>%
     act_collapse(Examination = c("Blood test","MRI SCAN","X-Ray")) %>%
     process_map()
-
- +
+

Read more:

diff --git a/control_flow_analysis.html b/control_flow_analysis.html index 598d0fa..101e6d8 100644 --- a/control_flow_analysis.html +++ b/control_flow_analysis.html @@ -13,15 +13,15 @@ Control-Flow Analysis - + - - - - + + + + @@ -647,23 +647,26 @@

Control-Flow Analysis

-
library(bupaR)
-
-

Variance

-
-

Activity Presence

+

+
+
+

Control-flow analysis

+
+

Metrics

+
+

Activity Presence

Activity presence shows in what percentage of cases an activity is present. It has no level-argument.

-
patients %>% activity_presence() %>%
-    plot
-

+
patients %>% activity_presence() %>%
+    plot
+

-
-

Activity Frequency

+
+

Activity Frequency

The frequency of activities can be calculated using the activity_frequency function, at the levels log, trace and activity.

-
patients %>%
-    activity_frequency("activity")
+
patients %>%
+    activity_frequency("activity")
## # A tibble: 7 × 3
 ##   handling              absolute relative
 ##   <fct>                    <int>    <dbl>
@@ -675,13 +678,13 @@ 

Activity Frequency

## 6 Blood test 237 0.0871 ## 7 MRI SCAN 236 0.0867
-
-

Start Activities

+
+

Start Activities

The start of cases can be described using the start_activities function. Available levels are activity, case, log, resource and resource activity.

-
patients %>%
-    start_activities("resource-activity")
+
patients %>%
+    start_activities("resource-activity")
## # A tibble: 1 × 5
 ##   employee handling     absolute relative cum_sum
 ##   <fct>    <fct>           <int>    <dbl>   <dbl>
@@ -689,13 +692,13 @@ 

Start Activities

This shows that in this event log, all cases are started with the Registration by resource r1.

-
-

End Activities

+
+

End Activities

Conversely, the end_activities functions describes the end of cases, using the same levels: log, case, activity, resource and resource-activity.

-
patients %>%
-    end_activities("resource-activity")
+
patients %>%
+    end_activities("resource-activity")
## # A tibble: 5 × 5
 ##   employee handling              absolute relative cum_sum
 ##   <fct>    <fct>                    <int>    <dbl>   <dbl>
@@ -707,37 +710,81 @@ 

End Activities

In contract to the start of cases, the end of cases seems to differ more frequently, although it is mostly the Check-Out activity.

-
-

Trace Coverage

+
+

Trace Coverage

The trace coverage metric shows the relationship between the number of different activity sequences (i.e. traces) and the number of cases they cover.

-
patients %>%
-    trace_coverage("trace") %>%
-    plot()
-

+
patients %>%
+    trace_coverage("trace") %>%
+    plot()
+

In the patients log, there are only 7 different traces, and 2 of them cover nearly 100% of the event log.

-
-

Trace Length

+
+

Trace Length

The trace length metric describes the length of traces, i.e. the number of activity instances for each case. It can be computed at the levels case, trace and log.

-
patients %>%
-    trace_length("log") %>%
-    plot
-

+
patients %>%
+    trace_length("log") %>%
+    plot
+

It can be seen that in this simple event log, most cases have a trace length of 5 or 6, while a minority has a trace length lower than 5.

-

Rework

-

Documentation coming soon

+

Several metrics to measure rework (repeated work) are provided by +bupaR. A distinction is made between self-loops and repetitions. A +self-loop is an immediate recurrence of the same activity (i.e. no other +activity in between), while a repetition is a recurrence after some +other activities.

+

The metrics number_of_repetitions and +number_of_selfloops can be used to analyse these +occurrences at the levels of log, case, activity, resource and +resource-activity. The metrics size_of_repetitions and +size_of_selfloops (available at the same levels) provide +further insight into the extent of the repeats within a single case +(e.g. is it repeated only once, or multiple times?). Finally, all these +metrics are able to distinguish between two types of rework: +repeat rework, where the same resource does the rework, and +redo rework, where the rework is done by another research. This +can be specified with the type argument. Specifying +type = all makes no distinction based on resources.

+
sepsis %>%
+    number_of_repetitions() 
+
## # A tibble: 1 × 8
+##     min    q1 median  mean    q3   max st_dev   iqr
+##   <dbl> <dbl>  <dbl> <dbl> <dbl> <dbl>  <dbl> <dbl>
+## 1     0     0      2  1.64     3     5   1.28     3
+
sepsis %>%
+    number_of_selfloops()   
+
## # A tibble: 1 × 8
+##     min    q1 median  mean    q3   max st_dev   iqr
+##   <dbl> <dbl>  <dbl> <dbl> <dbl> <dbl>  <dbl> <dbl>
+## 1     0     0      0 0.827     1    33   1.82     1
+
sepsis %>%
+    size_of_repetitions()   
+
## Using default type: all
+
## Using default level: log
+
## # A tibble: 1 × 8
+##     min    q1 median  mean    q3   max st_dev   iqr
+##   <dbl> <dbl>  <dbl> <dbl> <dbl> <dbl>  <dbl> <dbl>
+## 1     1     1      2  2.67     3    58   3.72     2
+
sepsis %>%
+    size_of_selfloops() 
+
## Using default type: all
+## Using default level: log
+
## # A tibble: 1 × 8
+##     min    q1 median  mean    q3   max st_dev   iqr
+##   <dbl> <dbl>  <dbl> <dbl> <dbl> <dbl>  <dbl> <dbl>
+## 1     1     1      1  1.19     1     8  0.717     0
+
-
-

Introduction

+
+

Rule-based conformance

Using the packages processcheckr prodecural rules can be checked in an event log. Checking rules will add a boolean case attribute, which can be used for filtering or in analysis.

@@ -748,15 +795,15 @@

Introduction

In the following example, the first rule checks the starting activity, while the second rule checks whether CRP and LacticAcid occur together.

-
library(bupaR)
-library(processcheckR)
-sepsis %>%
-  # check if cases starts with "ER Registration"
-  check_rule(starts("ER Registration"), label = "r1") %>%
-  # check if activities "CRP" and "LacticAcid" occur together
-  check_rule(and("CRP","LacticAcid"), label = "r2") %>%
-  group_by(r1, r2) %>%
-  n_cases() 
+
library(bupaR)
+library(processcheckR)
+sepsis %>%
+  # check if cases starts with "ER Registration"
+  check_rule(starts("ER Registration"), label = "r1") %>%
+  # check if activities "CRP" and "LacticAcid" occur together
+  check_rule(and("CRP","LacticAcid"), label = "r2") %>%
+  group_by(r1, r2) %>%
+  n_cases() 
## # A tibble: 4 × 3
 ##   r1    r2    n_cases
 ##   <lgl> <lgl>   <int>
@@ -769,12 +816,12 @@ 

Checking multiple rules

Using the function check_rules, multiple rules can be checked with one function call, by providing them as named arguments. The following code is equivalent to that above.

-
sepsis %>%
-  check_rules(
-    r1 = starts("ER Registration"),
-    r2 = and("CRP","LacticAcid")) %>%
-  group_by(r1, r2) %>%
-  n_cases() 
+
sepsis %>%
+  check_rules(
+    r1 = starts("ER Registration"),
+    r2 = and("CRP","LacticAcid")) %>%
+  group_by(r1, r2) %>%
+  n_cases() 
## # A tibble: 4 × 3
 ##   r1    r2    n_cases
 ##   <lgl> <lgl>   <int>
@@ -788,16 +835,15 @@ 

Rule-based filtering

Instead of adding logical values for each rule, you can also immediately filter the cases which adhere to one or more rules, using the filter_rules

-
sepsis %>%
-  filter_rules(
-    r1 = starts("ER Registration"),
-    r2 = and("CRP","LacticAcid")) %>%
-  n_cases() 
+
sepsis %>%
+  filter_rules(
+    r1 = starts("ER Registration"),
+    r2 = and("CRP","LacticAcid")) %>%
+  n_cases() 
## [1] 858
-
-
-

Rules

+
+

Rules

Currently the following declarative rules can be checked:

Cardinality rules:

    @@ -828,10 +874,10 @@

    Rules

    together

The available rules are explained in more detail below.

-
-

Cardinality rules

-
-

contains

+
+

Cardinality rules

+
+
contains

Arguments:

  • activity: a single activity name.
  • @@ -842,18 +888,18 @@

    contains

    times or more.

    [Example] How many cases have three or more occurences of Leucocytes?

    -
    sepsis %>% 
    -    check_rule(processcheckR::contains("Leucocytes", n = 3)) %>%
    -    group_by(contains_Leucocytes_3) %>%
    -    n_cases()
    +
    sepsis %>% 
    +    check_rule(processcheckR::contains("Leucocytes", n = 3)) %>%
    +    group_by(contains_Leucocytes_3) %>%
    +    n_cases()
    ## # A tibble: 2 × 2
     ##   contains_Leucocytes_3 n_cases
     ##   <lgl>                   <int>
     ## 1 FALSE                     590
     ## 2 TRUE                      460
-
-

contains_exactly

+
+
contains_exactly

Arguments:

  • activity: a single activity name.
  • @@ -862,10 +908,10 @@

    contains_exactly

[Example] How many cases have exactly four more occurences of Leucocytes?

-
sepsis %>% 
-    check_rule(contains_exactly("Leucocytes", n = 4), label = "r1") %>%
-    group_by(r1) %>%
-    n_cases()
+
sepsis %>% 
+    check_rule(contains_exactly("Leucocytes", n = 4), label = "r1") %>%
+    group_by(r1) %>%
+    n_cases()
## # A tibble: 2 × 2
 ##   r1    n_cases
 ##   <lgl>   <int>
@@ -873,8 +919,8 @@ 

contains_exactly

## 2 TRUE 90

Returns: cases where activity occurs n.

-
-

contains_between

+
+
contains_between

Arguments:

  • activity: a single activity name.
  • @@ -887,18 +933,18 @@

    contains_between

    min and max times.

    [Example] How many cases have between 0 and 10 occurences of Leucocytes?

    -
    sepsis %>% 
    -    check_rule(contains_between("Leucocytes", min = 0, max = 10), label = "r1") %>%
    -    group_by(r1) %>%
    -    n_cases()
    +
    sepsis %>% 
    +    check_rule(contains_between("Leucocytes", min = 0, max = 10), label = "r1") %>%
    +    group_by(r1) %>%
    +    n_cases()
    ## # A tibble: 2 × 2
     ##   r1    n_cases
     ##   <lgl>   <int>
     ## 1 FALSE      38
     ## 2 TRUE     1012
-
-

absent

+
+
absent

Arguments:

  • activity: a single activity name.
  • @@ -911,10 +957,10 @@

    absent

    contains_between(min = 0, max = x)

    [Example] How many cases have between 0 and 10 occurences of Leucocytes?

    -
    sepsis %>% 
    -    check_rule(absent("Leucocytes", n = 10), label = "r1") %>%
    -    group_by(r1) %>%
    -    n_cases()
    +
    sepsis %>% 
    +    check_rule(absent("Leucocytes", n = 10), label = "r1") %>%
    +    group_by(r1) %>%
    +    n_cases()
    ## # A tibble: 2 × 2
     ##   r1    n_cases
     ##   <lgl>   <int>
    @@ -922,46 +968,46 @@ 

    absent

    ## 2 TRUE 38
-
-

Ordering rules

-
-

starts

+
+

Ordering rules

+
+
starts

Arguments:

  • activity: a single activity name

Returns: cases that start with activity.

[Example] How many cases start with “ER Registration”

-
sepsis %>% 
-    check_rule(starts("ER Registration"), label = "r1") %>%
-    group_by(r1) %>%
-    n_cases()
+
sepsis %>% 
+    check_rule(starts("ER Registration"), label = "r1") %>%
+    group_by(r1) %>%
+    n_cases()
## # A tibble: 2 × 2
 ##   r1    n_cases
 ##   <lgl>   <int>
 ## 1 FALSE      55
 ## 2 TRUE      995
-
-

ends

+
+
ends

Arguments:

  • activity: a single activity name

Returns: cases that end with activity.

[Example] How many cases end with “Release A”

-
sepsis %>% 
-    check_rule(ends("Release A"), label = "r1") %>%
-    group_by(r1) %>%
-    n_cases()
+
sepsis %>% 
+    check_rule(ends("Release A"), label = "r1") %>%
+    group_by(r1) %>%
+    n_cases()
## # A tibble: 2 × 2
 ##   r1    n_cases
 ##   <lgl>   <int>
 ## 1 FALSE     657
 ## 2 TRUE      393
-
-

succession

+
+
succession

Arguments:

  • activity_a: a single activity name
  • @@ -971,18 +1017,18 @@

    succession

    eventually followed by (an instance of) activity_b, if either activity_a or activity_b occurs.

    [Example] How many cases is “ER Sepsis Triage” succeeded by “CRP”

    -
    sepsis %>% 
    -    check_rule(succession("ER Sepsis Triage","CRP"), label = "r1") %>%
    -    group_by(r1) %>%
    -    n_cases()
    +
    sepsis %>% 
    +    check_rule(succession("ER Sepsis Triage","CRP"), label = "r1") %>%
    +    group_by(r1) %>%
    +    n_cases()
    ## # A tibble: 2 × 2
     ##   r1    n_cases
     ##   <lgl>   <int>
     ## 1 FALSE     229
     ## 2 TRUE      821
-
-

response

+
+
response

Arguments:

  • activity_a: a single activity name
  • @@ -992,18 +1038,18 @@

    response

    eventually followed by (an instance of) activity_b, if activity_a occurs. [Example] How many cases is “ER Sepsis Triage” followed by “CRP”, if “ER Sespis Triage” occurs.

    -
    sepsis %>% 
    -    check_rule(response("ER Sepsis Triage","CRP"), label = "r1") %>%
    -    group_by(r1) %>%
    -    n_cases()
    +
    sepsis %>% 
    +    check_rule(response("ER Sepsis Triage","CRP"), label = "r1") %>%
    +    group_by(r1) %>%
    +    n_cases()
    ## # A tibble: 2 × 2
     ##   r1    n_cases
     ##   <lgl>   <int>
     ## 1 FALSE     106
     ## 2 TRUE      944
-
-

precedence

+
+
precedence

Arguments:

  • activity_a: a single activity name
  • @@ -1014,18 +1060,18 @@

    precedence

    activity_b occurs.

    [Example] How many cases is “CRP” preceded “ER Sepsis Triage”, if “CPR” occurs.

    -
    sepsis %>% 
    -    check_rule(precedence("ER Sepsis Triage","CRP"), label = "r1") %>%
    -    group_by(r1) %>%
    -    n_cases()
    +
    sepsis %>% 
    +    check_rule(precedence("ER Sepsis Triage","CRP"), label = "r1") %>%
    +    group_by(r1) %>%
    +    n_cases()
    ## # A tibble: 2 × 2
     ##   r1    n_cases
     ##   <lgl>   <int>
     ## 1 FALSE     186
     ## 2 TRUE      864
-
-

responded_existence

+
+
responded_existence

Arguments:

  • activity_a: a single activity name
  • @@ -1035,10 +1081,10 @@

    responded_existence

    activity_b occurs (but not vice versa)

    [Example] How many cases contain both “CRP” and “ER Sepsis Triage”, if “CPR” occurs.

    -
    sepsis %>% 
    -    check_rule(responded_existence("CRP", "ER Sepsis Triage"), label = "r1") %>%
    -    group_by(r1) %>%
    -    n_cases()
    +
    sepsis %>% 
    +    check_rule(responded_existence("CRP", "ER Sepsis Triage"), label = "r1") %>%
    +    group_by(r1) %>%
    +    n_cases()
    ## # A tibble: 2 × 2
     ##   r1    n_cases
     ##   <lgl>   <int>
    @@ -1046,10 +1092,10 @@ 

    responded_existence

    ## 2 TRUE 1049
-
-

Exclusiveness rules

-
-

and

+
+

Exclusiveness rules

+
+
and

Arguments:

  • activity_a: a single activity name
  • @@ -1059,18 +1105,18 @@

    and

    activity_b occur or both are absent

    [Example] How many cases contain both “CRP” and “ER Sepsis Triage”.

    -
    sepsis %>% 
    -    check_rule(and("CRP", "ER Sepsis Triage"), label = "r1") %>%
    -    group_by(r1) %>%
    -    n_cases()
    +
    sepsis %>% 
    +    check_rule(and("CRP", "ER Sepsis Triage"), label = "r1") %>%
    +    group_by(r1) %>%
    +    n_cases()
    ## # A tibble: 2 × 2
     ##   r1    n_cases
     ##   <lgl>   <int>
     ## 1 FALSE      44
     ## 2 TRUE     1006
-
-

xor

+
+
xor

Arguments:

  • activity_a: a single activity name
  • @@ -1079,10 +1125,10 @@

    xor

    Returns: cases where either activity_a or activity_b occur, but not both.

    [Example] How many cases contain “CRP” OR “ER Sepsis Triage”.

    -
    sepsis %>% 
    -    check_rule(xor("CRP", "ER Sepsis Triage"), label = "r1") %>%
    -    group_by(r1) %>%
    -    n_cases()
    +
    sepsis %>% 
    +    check_rule(xor("CRP", "ER Sepsis Triage"), label = "r1") %>%
    +    group_by(r1) %>%
    +    n_cases()
    ## # A tibble: 2 × 2
     ##   r1    n_cases
     ##   <lgl>   <int>
    @@ -1091,6 +1137,8 @@ 

    xor

+
+

Copyright © 2023 bupaR - Hasselt University

diff --git a/control_flow_analysis_files/figure-html/unnamed-chunk-2-1.png b/control_flow_analysis_files/figure-html/unnamed-chunk-3-1.png similarity index 100% rename from control_flow_analysis_files/figure-html/unnamed-chunk-2-1.png rename to control_flow_analysis_files/figure-html/unnamed-chunk-3-1.png diff --git a/control_flow_analysis_files/figure-html/unnamed-chunk-6-1.png b/control_flow_analysis_files/figure-html/unnamed-chunk-6-1.png deleted file mode 100644 index 0a8448d..0000000 Binary files a/control_flow_analysis_files/figure-html/unnamed-chunk-6-1.png and /dev/null differ diff --git a/control_flow_analysis_files/figure-html/unnamed-chunk-7-1.png b/control_flow_analysis_files/figure-html/unnamed-chunk-7-1.png index 9b465d0..0a8448d 100644 Binary files a/control_flow_analysis_files/figure-html/unnamed-chunk-7-1.png and b/control_flow_analysis_files/figure-html/unnamed-chunk-7-1.png differ diff --git a/control_flow_analysis_files/figure-html/unnamed-chunk-8-1.png b/control_flow_analysis_files/figure-html/unnamed-chunk-8-1.png new file mode 100644 index 0000000..9b465d0 Binary files /dev/null and b/control_flow_analysis_files/figure-html/unnamed-chunk-8-1.png differ diff --git a/control_flow_analysis_files/figure-html5/unnamed-chunk-2-1.png b/control_flow_analysis_files/figure-html5/unnamed-chunk-2-1.png deleted file mode 100644 index af4e123..0000000 Binary files a/control_flow_analysis_files/figure-html5/unnamed-chunk-2-1.png and /dev/null differ diff --git a/control_flow_analysis_files/figure-html5/unnamed-chunk-6-1.png b/control_flow_analysis_files/figure-html5/unnamed-chunk-6-1.png deleted file mode 100644 index fa44dbb..0000000 Binary files a/control_flow_analysis_files/figure-html5/unnamed-chunk-6-1.png and /dev/null differ diff --git a/control_flow_analysis_files/figure-html5/unnamed-chunk-7-1.png b/control_flow_analysis_files/figure-html5/unnamed-chunk-7-1.png deleted file mode 100644 index e24dd25..0000000 Binary files a/control_flow_analysis_files/figure-html5/unnamed-chunk-7-1.png and /dev/null differ diff --git a/create_logs.html b/create_logs.html index 4a235c4..9d3c079 100644 --- a/create_logs.html +++ b/create_logs.html @@ -13,21 +13,21 @@ bupaR Docs | Create Logs - + - - - - + + + + - - - + + + - + +

The table below show the same data as above, but now using the activitylog format. It can be seen that there are now just @@ -859,27 +817,27 @@

Logs: eventlog vs activitylog

Registration -470 +333 r1 -470 -2018-04-06 03:00:23 -2018-04-06 01:29:41 +333 +2017-11-15 18:45:18 +2017-11-15 16:50:59 Triage and Assessment -470 +333 r2 -970 -2018-04-07 09:22:23 -2018-04-06 20:04:09 +833 +2017-11-17 08:21:08 +2017-11-16 20:37:26 Blood test -470 +333 r3 -1226 -2018-04-12 06:57:58 -2018-04-12 01:53:27 +1152 +2017-11-18 03:16:03 +2017-11-17 22:27:09 @@ -951,34 +909,40 @@

Scenario 1

-188 -Check-out -2017-07-09 16:27:02 -2017-07-09 18:01:06 +464 +Blood test +2018-04-06 20:04:09 +2018-04-07 01:18:17 -188 +464 +Check-out +2018-04-12 19:02:11 +2018-04-12 21:41:01 + + +464 Discuss Results -2017-07-09 12:17:58 -2017-07-09 16:27:02 +2018-04-12 11:00:16 +2018-04-12 13:59:44 + + +464 +MRI SCAN +2018-04-07 06:30:56 +2018-04-07 09:37:26 -188 +464 Registration -2017-07-03 05:21:36 -2017-07-03 09:22:46 +2018-03-20 19:07:17 +2018-03-20 21:15:41 -188 +464 Triage and Assessment -2017-07-03 16:49:13 -2017-07-04 08:14:12 - - -188 -X-Ray -2017-07-09 01:43:34 -2017-07-09 06:55:29 +2018-03-21 15:58:55 +2018-03-22 05:21:56 @@ -1002,12 +966,12 @@

Scenario 1

activitylog(case_id = "patient", activity_id = "handling", timestamps = c("start", "complete"))
-
## # Log of 10 events consisting of:
+
## # Log of 12 events consisting of:
 ## 1 trace 
 ## 1 case 
-## 5 instances of 5 activities 
+## 6 instances of 6 activities 
 ## 0 resources 
-## Events occurred from 2017-07-03 05:21:36 until 2017-07-09 18:01:06 
+## Events occurred from 2018-03-20 19:07:17 until 2018-04-12 21:41:01 
 ##  
 ## # Variables were mapped as follows:
 ## Case identifier:     patient 
@@ -1015,14 +979,15 @@ 

Scenario 1

## Resource identifier: employee ## Timestamps: start, complete ## -## # A tibble: 5 × 5 +## # A tibble: 6 × 5 ## patient handling start complete .order ## <chr> <fct> <dttm> <dttm> <int> -## 1 188 Check-out 2017-07-09 16:27:02 2017-07-09 18:01:06 1 -## 2 188 Discuss Results 2017-07-09 12:17:58 2017-07-09 16:27:02 2 -## 3 188 Registration 2017-07-03 05:21:36 2017-07-03 09:22:46 3 -## 4 188 Triage and Assessment 2017-07-03 16:49:13 2017-07-04 08:14:12 4 -## 5 188 X-Ray 2017-07-09 01:43:34 2017-07-09 06:55:29 5
+## 1 464 Blood test 2018-04-06 20:04:09 2018-04-07 01:18:17 1 +## 2 464 Check-out 2018-04-12 19:02:11 2018-04-12 21:41:01 2 +## 3 464 Discuss Results 2018-04-12 11:00:16 2018-04-12 13:59:44 3 +## 4 464 MRI SCAN 2018-04-07 06:30:56 2018-04-07 09:37:26 4 +## 5 464 Registration 2018-03-20 19:07:17 2018-03-20 21:15:41 5 +## 6 464 Triage and Assessment 2018-03-21 15:58:55 2018-03-22 05:21:56 6

Note that in case a resource identifier is available, this information can be added in the activitylog call.

@@ -1053,100 +1018,100 @@

Scenario 2

-470 +227 Registration r1 -470 +227 started -2018-04-06 01:29:41 +2017-08-09 19:55:30 -470 -Registration -r1 -470 -completed -2018-04-06 03:00:23 - - -470 +227 Triage and Assessment r2 -970 +727 started -2018-04-06 20:04:09 +2017-08-09 22:17:43 + + +227 +Registration +r1 +227 +completed +2017-08-09 22:17:43 -470 +227 Triage and Assessment r2 -970 +727 completed -2018-04-07 09:22:23 +2017-08-10 15:21:30 -470 +227 Blood test r3 -1226 +1109 started -2018-04-12 01:53:27 +2017-08-17 03:01:24 -470 +227 Blood test r3 -1226 +1109 completed -2018-04-12 06:57:58 +2017-08-17 09:17:20 -470 +227 MRI SCAN r4 -1463 +1346 started -2018-04-12 11:00:16 +2017-08-17 13:15:04 -470 +227 MRI SCAN r4 -1463 +1346 completed -2018-04-12 13:47:54 +2017-08-17 18:47:44 -470 +227 Discuss Results r6 -2204 +1961 started -2018-04-13 00:40:10 +2017-08-22 13:33:38 -470 -Discuss Results -r6 -2204 -completed -2018-04-13 03:03:07 - - -470 +227 Check-out r7 -2699 +2456 started -2018-04-13 15:38:18 +2017-08-22 15:38:38 + + +227 +Discuss Results +r6 +1961 +completed +2017-08-22 15:38:38 -470 +227 Check-out r7 -2699 +2456 completed -2018-04-13 17:48:09 +2017-08-22 17:12:46 @@ -1213,84 +1178,100 @@

Scenario 3

-198 +116 Registration -r6 -198 +r2 +116 started -2017-07-12 06:43:07 +2017-04-29 03:24:59 -198 +116 Registration r6 -198 +116 completed -2017-07-12 10:27:51 +2017-04-29 06:23:09 -198 +116 Triage and Assessment -r7 -698 +r1 +616 started -2017-07-12 15:46:36 +2017-04-29 15:41:27 -198 +116 Triage and Assessment -r5 -698 +r7 +616 completed -2017-07-13 06:31:09 +2017-04-30 03:04:21 -198 -X-Ray -r2 -1576 +116 +Blood test +r4 +1054 started -2017-07-18 14:10:06 +2017-04-30 15:13:28 -198 -X-Ray -r2 -1576 +116 +Blood test +r6 +1054 +completed +2017-04-30 21:24:18 + + +116 +MRI SCAN +r1 +1291 +started +2017-05-01 01:12:51 + + +116 +MRI SCAN +r4 +1291 completed -2017-07-18 20:56:08 +2017-05-01 05:32:37 -198 +116 Discuss Results -r5 -1932 +r3 +1850 started -2017-07-19 06:02:50 +2017-05-01 09:44:20 -198 +116 Discuss Results -r1 -1932 +r7 +1850 completed -2017-07-19 08:20:45 +2017-05-01 14:00:48 -198 +116 Check-out -r1 -2427 +r3 +2345 started -2017-07-19 10:33:43 +2017-05-03 04:02:35 -198 +116 Check-out -r7 -2427 +r2 +2345 completed -2017-07-19 12:13:53 +2017-05-03 06:16:03 @@ -1318,13 +1299,13 @@

Scenario 3

timestamp = "time", resource_id = "employee")
## Warning in validate_eventlog(eventlog): The following activity instances are
-## connected to more than one resource: 1932,2427,698
-
## # Log of 10 events consisting of:
+## connected to more than one resource: 1054,116,1291,1850,2345,616
+
## # Log of 12 events consisting of:
 ## 1 trace 
 ## 1 case 
-## 5 instances of 5 activities 
-## 5 resources 
-## Events occurred from 2017-07-12 06:43:07 until 2017-07-19 12:13:53 
+## 6 instances of 6 activities 
+## 6 resources 
+## Events occurred from 2017-04-29 03:24:59 until 2017-05-03 06:16:03 
 ##  
 ## # Variables were mapped as follows:
 ## Case identifier:     patient 
@@ -1334,20 +1315,22 @@ 

Scenario 3

## Timestamp: time ## Lifecycle transition: registration_type ## -## # A tibble: 10 × 7 -## patient handling emplo…¹ handl…² regis…³ time .order -## <chr> <fct> <fct> <chr> <fct> <dttm> <int> -## 1 198 Registration r6 198 start 2017-07-12 06:43:07 1 -## 2 198 Registration r6 198 comple… 2017-07-12 10:27:51 2 -## 3 198 Triage and Assess… r7 698 start 2017-07-12 15:46:36 3 -## 4 198 Triage and Assess… r5 698 comple… 2017-07-13 06:31:09 4 -## 5 198 X-Ray r2 1576 start 2017-07-18 14:10:06 5 -## 6 198 X-Ray r2 1576 comple… 2017-07-18 20:56:08 6 -## 7 198 Discuss Results r5 1932 start 2017-07-19 06:02:50 7 -## 8 198 Discuss Results r1 1932 comple… 2017-07-19 08:20:45 8 -## 9 198 Check-out r1 2427 start 2017-07-19 10:33:43 9 -## 10 198 Check-out r7 2427 comple… 2017-07-19 12:13:53 10 -## # … with abbreviated variable names ¹​employee, ²​handling_id, ³​registration_type
+## # A tibble: 12 × 7 +## patient handling employee handling_id registration_type time +## <chr> <fct> <fct> <chr> <fct> <dttm> +## 1 116 Registrat… r2 116 start 2017-04-29 03:24:59 +## 2 116 Registrat… r6 116 complete 2017-04-29 06:23:09 +## 3 116 Triage an… r1 616 start 2017-04-29 15:41:27 +## 4 116 Triage an… r7 616 complete 2017-04-30 03:04:21 +## 5 116 Blood test r4 1054 start 2017-04-30 15:13:28 +## 6 116 Blood test r6 1054 complete 2017-04-30 21:24:18 +## 7 116 MRI SCAN r1 1291 start 2017-05-01 01:12:51 +## 8 116 MRI SCAN r4 1291 complete 2017-05-01 05:32:37 +## 9 116 Discuss R… r3 1850 start 2017-05-01 09:44:20 +## 10 116 Discuss R… r7 1850 complete 2017-05-01 14:00:48 +## 11 116 Check-out r3 2345 start 2017-05-03 04:02:35 +## 12 116 Check-out r2 2345 complete 2017-05-03 06:16:03 +## # ℹ 1 more variable: .order <int>

Note that we need an eventlog irrespective of which attribute values are differing, i.e. it can be resources, but also any additional variables you have in your data set. For the special case of @@ -1493,95 +1476,113 @@

Inconsistent Resources

-232 +206 Registration -r5 -232 +r4 +206 start -2017-08-13 19:50:42 +2017-07-19 15:48:14 1 -232 -Registration -r7 -232 -complete -2017-08-13 23:07:38 +206 +Triage and Assessment +r6 +706 +start +2017-07-19 17:03:44 2 -232 -Triage and Assessment -r7 -732 -start -2017-08-14 16:33:50 +206 +Registration +r3 +206 +complete +2017-07-19 17:03:44 3 -232 +206 Triage and Assessment -r1 -732 +r7 +706 complete -2017-08-15 05:41:07 +2017-07-20 07:28:53 4 -232 -X-Ray +206 +Blood test r1 -1596 +1100 start -2017-08-15 22:43:19 +2017-07-25 03:02:14 5 -232 -X-Ray -r2 -1596 +206 +Blood test +r3 +1100 complete -2017-08-16 03:55:58 +2017-07-25 08:14:46 6 -232 -Discuss Results +206 +MRI SCAN r6 -1966 +1337 start -2017-08-16 13:20:54 +2017-07-25 12:37:36 7 -232 -Discuss Results -r6 -1966 +206 +MRI SCAN +r2 +1337 complete -2017-08-16 17:14:01 +2017-07-25 16:52:16 8 -232 -Check-out -r5 -2461 +206 +Discuss Results +r2 +1940 start -2017-08-22 15:38:38 +2017-07-26 07:36:36 9 -232 -Check-out -r2 -2461 +206 +Discuss Results +r4 +1940 complete -2017-08-22 16:55:37 +2017-07-26 11:08:03 10 + +206 +Check-out +r1 +2435 +start +2017-07-28 02:54:17 +11 + + +206 +Check-out +r7 +2435 +complete +2017-07-28 03:55:13 +12 +

If you have a large dataset, and want to have an overview of the @@ -1590,13 +1591,15 @@

Inconsistent Resources

function.

log %>%
     detect_resource_inconsistencies()
-
## # A tibble: 4 × 5
+
## # A tibble: 6 × 5
 ##   patient handling              handling_id complete start
 ##   <chr>   <fct>                 <chr>       <chr>    <chr>
-## 1 232     Check-out             2461        r2       r5   
-## 2 232     Registration          232         r7       r5   
-## 3 232     Triage and Assessment 732         r1       r7   
-## 4 232     X-Ray                 1596        r2       r1
+## 1 206 Blood test 1100 r3 r1 +## 2 206 Check-out 2435 r7 r1 +## 3 206 Discuss Results 1940 r4 r2 +## 4 206 MRI SCAN 1337 r2 r6 +## 5 206 Registration 206 r3 r4 +## 6 206 Triage and Assessment 706 r7 r6

If you want to remove these inconsistencies, a quick fix is to merge the resource labels together with fix_resource_inconsistencies(). Note that this is not @@ -1609,22 +1612,24 @@

Inconsistent Resources

log %>%
     fix_resource_inconsistencies()
## *** OUTPUT ***
-
## A total of 4 activity executions in the event log are classified as inconsistencies.
+
## A total of 6 activity executions in the event log are classified as inconsistencies.
## They are spread over the following cases and activities:
-
## # A tibble: 4 × 5
+
## # A tibble: 6 × 5
 ##   patient handling              handling_id complete start
 ##   <chr>   <fct>                 <chr>       <chr>    <chr>
-## 1 232     Check-out             2461        r2       r5   
-## 2 232     Registration          232         r7       r5   
-## 3 232     Triage and Assessment 732         r1       r7   
-## 4 232     X-Ray                 1596        r2       r1
+## 1 206 Blood test 1100 r3 r1 +## 2 206 Check-out 2435 r7 r1 +## 3 206 Discuss Results 1940 r4 r2 +## 4 206 MRI SCAN 1337 r2 r6 +## 5 206 Registration 206 r3 r4 +## 6 206 Triage and Assessment 706 r7 r6
## Inconsistencies solved succesfully.
-
## # Log of 10 events consisting of:
+
## # Log of 12 events consisting of:
 ## 1 trace 
 ## 1 case 
-## 5 instances of 5 activities 
-## 5 resources 
-## Events occurred from 2017-08-13 19:50:42 until 2017-08-22 16:55:37 
+## 6 instances of 6 activities 
+## 6 resources 
+## Events occurred from 2017-07-19 15:48:14 until 2017-07-28 03:55:13 
 ##  
 ## # Variables were mapped as follows:
 ## Case identifier:     patient 
@@ -1634,20 +1639,22 @@ 

Inconsistent Resources

## Timestamp: time ## Lifecycle transition: registration_type ## -## # A tibble: 10 × 7 -## patient handling emplo…¹ handl…² regis…³ time .order -## <chr> <fct> <chr> <chr> <fct> <dttm> <int> -## 1 232 Registration r7 - r5 232 start 2017-08-13 19:50:42 1 -## 2 232 Registration r7 - r5 232 comple… 2017-08-13 23:07:38 2 -## 3 232 Triage and Assess… r1 - r7 732 start 2017-08-14 16:33:50 3 -## 4 232 Triage and Assess… r1 - r7 732 comple… 2017-08-15 05:41:07 4 -## 5 232 X-Ray r2 - r1 1596 start 2017-08-15 22:43:19 5 -## 6 232 X-Ray r2 - r1 1596 comple… 2017-08-16 03:55:58 6 -## 7 232 Discuss Results r6 1966 start 2017-08-16 13:20:54 7 -## 8 232 Discuss Results r6 1966 comple… 2017-08-16 17:14:01 8 -## 9 232 Check-out r2 - r5 2461 start 2017-08-22 15:38:38 9 -## 10 232 Check-out r2 - r5 2461 comple… 2017-08-22 16:55:37 10 -## # … with abbreviated variable names ¹​employee, ²​handling_id, ³​registration_type
+## # A tibble: 12 × 7 +## patient handling employee handling_id registration_type time +## <chr> <fct> <chr> <chr> <fct> <dttm> +## 1 206 Registrat… r3 - r4 206 start 2017-07-19 15:48:14 +## 2 206 Triage an… r7 - r6 706 start 2017-07-19 17:03:44 +## 3 206 Registrat… r3 - r4 206 complete 2017-07-19 17:03:44 +## 4 206 Triage an… r7 - r6 706 complete 2017-07-20 07:28:53 +## 5 206 Blood test r3 - r1 1100 start 2017-07-25 03:02:14 +## 6 206 Blood test r3 - r1 1100 complete 2017-07-25 08:14:46 +## 7 206 MRI SCAN r2 - r6 1337 start 2017-07-25 12:37:36 +## 8 206 MRI SCAN r2 - r6 1337 complete 2017-07-25 16:52:16 +## 9 206 Discuss R… r4 - r2 1940 start 2017-07-26 07:36:36 +## 10 206 Discuss R… r4 - r2 1940 complete 2017-07-26 11:08:03 +## 11 206 Check-out r7 - r1 2435 start 2017-07-28 02:54:17 +## 12 206 Check-out r7 - r1 2435 complete 2017-07-28 03:55:13 +## # ℹ 1 more variable: .order <int>

Read more:

diff --git a/data_quality.html b/data_quality.html index 8b3b375..42b7026 100644 --- a/data_quality.html +++ b/data_quality.html @@ -13,15 +13,15 @@ bupaR Docs | Data Quality - + - - - - + + + + @@ -696,15 +696,14 @@

Attribute Dependencies

## Timestamps: start, complete ## ## # A tibble: 5 × 8 -## patient_visi…¹ activ…² origi…³ start complete triag…⁴ -## <dbl> <chr> <chr> <dttm> <dttm> <dbl> -## 1 528 Regist… Nurse 6 2017-11-21 18:10:17 2017-11-21 18:15:04 3 -## 2 535 Regist… Clerk 3 2017-11-22 10:04:57 2017-11-22 10:06:46 2 -## 3 536 Regist… Clerk 9 2017-11-22 10:26:41 2017-11-22 10:32:56 5 -## 4 535 Regist… Clerk 6 2017-11-22 11:05:42 2017-11-22 11:11:11 2 -## 5 534 Regist… <NA> 2017-11-22 18:35:00 2017-11-22 18:37:00 0 -## # … with 2 more variables: specialization <chr>, .order <int>, and abbreviated -## # variable names ¹​patient_visit_nr, ²​activity, ³​originator, ⁴​triagecode +## patient_visit_nr activity originator start complete +## <dbl> <chr> <chr> <dttm> <dttm> +## 1 528 Registrat… Nurse 6 2017-11-21 18:10:17 2017-11-21 18:15:04 +## 2 535 Registrat… Clerk 3 2017-11-22 10:04:57 2017-11-22 10:06:46 +## 3 536 Registrat… Clerk 9 2017-11-22 10:26:41 2017-11-22 10:32:56 +## 4 535 Registrat… Clerk 6 2017-11-22 11:05:42 2017-11-22 11:11:11 +## 5 534 Registrat… <NA> 2017-11-22 18:35:00 2017-11-22 18:37:00 +## # ℹ 3 more variables: triagecode <dbl>, specialization <chr>, .order <int>

Case ID Sequence Gaps

@@ -762,13 +761,12 @@

Duration Outliers

## Timestamps: start, complete ## ## # A tibble: 1 × 14 -## patient_visi…¹ activ…² origi…³ start complete triag…⁴ -## <dbl> <chr> <chr> <dttm> <dttm> <dbl> -## 1 523 Treatm… Nurse … 2017-11-21 18:26:04 2017-11-21 18:55:00 3 -## # … with 8 more variables: specialization <chr>, .order <int>, duration <dbl>, -## # mean <dbl>, sd <dbl>, bound_sd <dbl>, lower_bound <dbl>, upper_bound <dbl>, -## # and abbreviated variable names ¹​patient_visit_nr, ²​activity, ³​originator, -## # ⁴​triagecode +## patient_visit_nr activity originator start complete +## <dbl> <chr> <chr> <dttm> <dttm> +## 1 523 Treatment Nurse 17 2017-11-21 18:26:04 2017-11-21 18:55:00 +## # ℹ 9 more variables: triagecode <dbl>, specialization <chr>, .order <int>, +## # duration <dbl>, mean <dbl>, sd <dbl>, bound_sd <dbl>, lower_bound <dbl>, +## # upper_bound <dbl>

Or, the duration of “Treatment” should be within 0 to 15 minutes.

hospital_actlog %>%
   detect_duration_outliers(Treatment = duration_within(lower_bound = 0, upper_bound = 15))
@@ -791,13 +789,12 @@

Duration Outliers

## Timestamps: start, complete ## ## # A tibble: 1 × 14 -## patient_visi…¹ activ…² origi…³ start complete triag…⁴ -## <dbl> <chr> <chr> <dttm> <dttm> <dbl> -## 1 523 Treatm… Nurse … 2017-11-21 18:26:04 2017-11-21 18:55:00 3 -## # … with 8 more variables: specialization <chr>, .order <int>, duration <dbl>, -## # mean <dbl>, sd <dbl>, bound_sd <dbl>, lower_bound <dbl>, upper_bound <dbl>, -## # and abbreviated variable names ¹​patient_visit_nr, ²​activity, ³​originator, -## # ⁴​triagecode +## patient_visit_nr activity originator start complete +## <dbl> <chr> <chr> <dttm> <dttm> +## 1 523 Treatment Nurse 17 2017-11-21 18:26:04 2017-11-21 18:55:00 +## # ℹ 9 more variables: triagecode <dbl>, specialization <chr>, .order <int>, +## # duration <dbl>, mean <dbl>, sd <dbl>, bound_sd <dbl>, lower_bound <dbl>, +## # upper_bound <dbl>

Inactive Periods

@@ -872,14 +869,13 @@

Incorrect Activity Names

## Timestamps: start, complete ## ## # A tibble: 4 × 8 -## patient_visi…¹ activ…² origi…³ start complete triag…⁴ -## <dbl> <chr> <chr> <dttm> <dttm> <dbl> -## 1 510 regist… Clerk 9 2017-11-20 10:18:17 2017-11-20 10:20:06 3 -## 2 520 Trage Nurse … 2017-11-21 13:43:16 2017-11-21 13:39:00 5 -## 3 522 Triaga Nurse 5 2017-11-21 15:15:25 2017-11-21 15:18:04 2 -## 4 533 0 <NA> 2017-11-22 18:35:00 2017-11-22 18:37:00 7 -## # … with 2 more variables: specialization <chr>, .order <int>, and abbreviated -## # variable names ¹​patient_visit_nr, ²​activity, ³​originator, ⁴​triagecode +## patient_visit_nr activity originator start complete +## <dbl> <chr> <chr> <dttm> <dttm> +## 1 510 registrat… Clerk 9 2017-11-20 10:18:17 2017-11-20 10:20:06 +## 2 520 Trage Nurse 17 2017-11-21 13:43:16 2017-11-21 13:39:00 +## 3 522 Triaga Nurse 5 2017-11-21 15:15:25 2017-11-21 15:18:04 +## 4 533 0 <NA> 2017-11-22 18:35:00 2017-11-22 18:37:00 +## # ℹ 3 more variables: triagecode <dbl>, specialization <chr>, .order <int>

Missing Values

@@ -924,48 +920,45 @@

Missing Values

## Timestamps: start, complete ## ## # A tibble: 4 × 8 -## patient_visi…¹ activ…² origi…³ start complete triag…⁴ -## <dbl> <chr> <chr> <dttm> <dttm> <dbl> -## 1 510 Clinic… Doctor… 2017-11-20 11:35:01 2017-11-20 11:36:09 NA -## 2 533 0 <NA> 2017-11-22 18:35:00 2017-11-22 18:37:00 7 -## 3 534 Regist… <NA> 2017-11-22 18:35:00 2017-11-22 18:37:00 0 -## 4 512 Clinic… Doctor… NA 2017-11-20 11:33:57 3 -## # … with 2 more variables: specialization <chr>, .order <int>, and abbreviated -## # variable names ¹​patient_visit_nr, ²​activity, ³​originator, ⁴​triagecode +## patient_visit_nr activity originator start complete +## <dbl> <chr> <chr> <dttm> <dttm> +## 1 510 Clinical … Doctor 7 2017-11-20 11:35:01 2017-11-20 11:36:09 +## 2 533 0 <NA> 2017-11-22 18:35:00 2017-11-22 18:37:00 +## 3 534 Registrat… <NA> 2017-11-22 18:35:00 2017-11-22 18:37:00 +## 4 512 Clinical … Doctor 7 NA 2017-11-20 11:33:57 +## # ℹ 3 more variables: triagecode <dbl>, specialization <chr>, .order <int>
hospital_actlog %>% 
   detect_missing_values(level_of_aggregation = "activity")
## Selected level of aggregation:activity
## *** OUTPUT ***
## Absolute number of missing values per column (per activity):
## # A tibble: 9 × 8
-##   activity             patient_vi…¹ origi…² start compl…³ triag…⁴ speci…⁵ .order
-##   <chr>                       <int>   <int> <int>   <int>   <int>   <int>  <int>
-## 1 0                               0       1     0       0       0       0      0
-## 2 Clinical exam                   0       0     1       0       1       0      0
-## 3 Registration                    0       1     0       0       0       0      0
-## 4 Trage                           0       0     0       0       0       0      0
-## 5 Treatment                       0       0     0       0       0       0      0
-## 6 Treatment evaluation            0       0     0       0       0       0      0
-## 7 Triaga                          0       0     0       0       0       0      0
-## 8 Triage                          0       0     0       0       0       0      0
-## 9 registration                    0       0     0       0       0       0      0
-## # … with abbreviated variable names ¹​patient_visit_nr, ²​originator, ³​complete,
-## #   ⁴​triagecode, ⁵​specialization
+## activity patient_visit_nr originator start complete triagecode specialization +## <chr> <int> <int> <int> <int> <int> <int> +## 1 0 0 1 0 0 0 0 +## 2 Clinical… 0 0 1 0 1 0 +## 3 Registra… 0 1 0 0 0 0 +## 4 Trage 0 0 0 0 0 0 +## 5 Treatment 0 0 0 0 0 0 +## 6 Treatmen… 0 0 0 0 0 0 +## 7 Triaga 0 0 0 0 0 0 +## 8 Triage 0 0 0 0 0 0 +## 9 registra… 0 0 0 0 0 0 +## # ℹ 1 more variable: .order <int>
## Relative number of missing values per column (per activity, expressed as percentage):
## # A tibble: 9 × 8
-##   activity             patient_vi…¹ origi…² start compl…³ triag…⁴ speci…⁵ .order
-##   <chr>                       <dbl>   <dbl> <dbl>   <dbl>   <dbl>   <dbl>  <dbl>
-## 1 0                               0  1      0           0   0           0      0
-## 2 Clinical exam                   0  0      0.111       0   0.111       0      0
-## 3 Registration                    0  0.0714 0           0   0           0      0
-## 4 Trage                           0  0      0           0   0           0      0
-## 5 Treatment                       0  0      0           0   0           0      0
-## 6 Treatment evaluation            0  0      0           0   0           0      0
-## 7 Triaga                          0  0      0           0   0           0      0
-## 8 Triage                          0  0      0           0   0           0      0
-## 9 registration                    0  0      0           0   0           0      0
-## # … with abbreviated variable names ¹​patient_visit_nr, ²​originator, ³​complete,
-## #   ⁴​triagecode, ⁵​specialization
+## activity patient_visit_nr originator start complete triagecode specialization +## <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> +## 1 0 0 1 0 0 0 0 +## 2 Clinical… 0 0 0.111 0 0.111 0 +## 3 Registra… 0 0.0714 0 0 0 0 +## 4 Trage 0 0 0 0 0 0 +## 5 Treatment 0 0 0 0 0 0 +## 6 Treatmen… 0 0 0 0 0 0 +## 7 Triaga 0 0 0 0 0 0 +## 8 Triage 0 0 0 0 0 0 +## 9 registra… 0 0 0 0 0 0 +## # ℹ 1 more variable: .order <dbl>
## Overview of activity log rows which are incomplete:
## # Log of 7 events consisting of:
 ## 3 traces 
@@ -981,14 +974,13 @@ 

Missing Values

## Timestamps: start, complete ## ## # A tibble: 4 × 8 -## patient_visi…¹ activ…² origi…³ start complete triag…⁴ -## <dbl> <chr> <chr> <dttm> <dttm> <dbl> -## 1 510 Clinic… Doctor… 2017-11-20 11:35:01 2017-11-20 11:36:09 NA -## 2 533 0 <NA> 2017-11-22 18:35:00 2017-11-22 18:37:00 7 -## 3 534 Regist… <NA> 2017-11-22 18:35:00 2017-11-22 18:37:00 0 -## 4 512 Clinic… Doctor… NA 2017-11-20 11:33:57 3 -## # … with 2 more variables: specialization <chr>, .order <int>, and abbreviated -## # variable names ¹​patient_visit_nr, ²​activity, ³​originator, ⁴​triagecode
+## patient_visit_nr activity originator start complete +## <dbl> <chr> <chr> <dttm> <dttm> +## 1 510 Clinical … Doctor 7 2017-11-20 11:35:01 2017-11-20 11:36:09 +## 2 533 0 <NA> 2017-11-22 18:35:00 2017-11-22 18:37:00 +## 3 534 Registrat… <NA> 2017-11-22 18:35:00 2017-11-22 18:37:00 +## 4 512 Clinical … Doctor 7 NA 2017-11-20 11:33:57 +## # ℹ 3 more variables: triagecode <dbl>, specialization <chr>, .order <int>
hospital_actlog %>% 
   detect_missing_values(
   level_of_aggregation = "column",
@@ -1013,11 +1005,10 @@ 

Missing Values

## Timestamps: start, complete ## ## # A tibble: 1 × 8 -## patient_visi…¹ activ…² origi…³ start complete triag…⁴ -## <dbl> <chr> <chr> <dttm> <dttm> <dbl> -## 1 510 Clinic… Doctor… 2017-11-20 11:35:01 2017-11-20 11:36:09 NA -## # … with 2 more variables: specialization <chr>, .order <int>, and abbreviated -## # variable names ¹​patient_visit_nr, ²​activity, ³​originator, ⁴​triagecode
+## patient_visit_nr activity originator start complete +## <dbl> <chr> <chr> <dttm> <dttm> +## 1 510 Clinical … Doctor 7 2017-11-20 11:35:01 2017-11-20 11:36:09 +## # ℹ 3 more variables: triagecode <dbl>, specialization <chr>, .order <int>

Multiregistration

@@ -1046,19 +1037,18 @@

Multiregistration

## Timestamps: start, complete ## ## # A tibble: 9 × 8 -## originator patient_v…¹ activ…² start complete triag…³ -## <chr> <dbl> <chr> <dttm> <dttm> <dbl> -## 1 Doctor 7 512 Clinic… 2017-11-20 11:27:12 2017-11-20 11:33:57 3 -## 2 Doctor 7 512 Clinic… NA 2017-11-20 11:33:57 3 -## 3 Nurse 27 536 Triage 2017-11-22 15:15:39 2017-11-22 15:25:01 5 -## 4 Nurse 27 536 Treatm… 2017-11-22 15:15:41 2017-11-22 15:25:03 5 -## 5 Nurse 5 524 Triage 2017-11-21 17:04:03 2017-11-21 17:06:05 3 -## 6 Nurse 5 525 Triage 2017-11-21 17:04:13 2017-11-21 17:06:08 3 -## 7 Nurse 5 526 Triage 2017-11-21 17:04:15 2017-11-21 17:06:10 4 -## 8 <NA> 533 0 2017-11-22 18:35:00 2017-11-22 18:37:00 7 -## 9 <NA> 534 Regist… 2017-11-22 18:35:00 2017-11-22 18:37:00 0 -## # … with 2 more variables: specialization <chr>, .order <int>, and abbreviated -## # variable names ¹​patient_visit_nr, ²​activity, ³​triagecode +## originator patient_visit_nr activity start complete +## <chr> <dbl> <chr> <dttm> <dttm> +## 1 Doctor 7 512 Clinical … 2017-11-20 11:27:12 2017-11-20 11:33:57 +## 2 Doctor 7 512 Clinical … NA 2017-11-20 11:33:57 +## 3 Nurse 27 536 Triage 2017-11-22 15:15:39 2017-11-22 15:25:01 +## 4 Nurse 27 536 Treatment 2017-11-22 15:15:41 2017-11-22 15:25:03 +## 5 Nurse 5 524 Triage 2017-11-21 17:04:03 2017-11-21 17:06:05 +## 6 Nurse 5 525 Triage 2017-11-21 17:04:13 2017-11-21 17:06:08 +## 7 Nurse 5 526 Triage 2017-11-21 17:04:15 2017-11-21 17:06:10 +## 8 <NA> 533 0 2017-11-22 18:35:00 2017-11-22 18:37:00 +## 9 <NA> 534 Registrat… 2017-11-22 18:35:00 2017-11-22 18:37:00 +## # ℹ 3 more variables: triagecode <dbl>, specialization <chr>, .order <int>

Overlaps

@@ -1154,16 +1144,15 @@

Time Anomalies

## Timestamps: start, complete ## ## # A tibble: 5 × 10 -## patient_visi…¹ activ…² origi…³ start complete triag…⁴ -## <dbl> <chr> <chr> <dttm> <dttm> <dbl> -## 1 518 Regist… Clerk … 2017-11-21 11:45:16 2017-11-21 11:22:16 4 -## 2 518 Regist… Clerk 6 2017-11-21 11:45:16 2017-11-21 11:22:16 4 -## 3 518 Regist… Clerk 9 2017-11-21 11:45:16 2017-11-21 11:22:16 4 -## 4 520 Trage Nurse … 2017-11-21 13:43:16 2017-11-21 13:39:00 5 -## 5 528 Clinic… Doctor… 2017-11-21 19:00:00 2017-11-21 19:00:00 3 -## # … with 4 more variables: specialization <chr>, .order <int>, duration <dbl>, -## # type <chr>, and abbreviated variable names ¹​patient_visit_nr, ²​activity, -## # ³​originator, ⁴​triagecode +## patient_visit_nr activity originator start complete +## <dbl> <chr> <chr> <dttm> <dttm> +## 1 518 Registrat… Clerk 12 2017-11-21 11:45:16 2017-11-21 11:22:16 +## 2 518 Registrat… Clerk 6 2017-11-21 11:45:16 2017-11-21 11:22:16 +## 3 518 Registrat… Clerk 9 2017-11-21 11:45:16 2017-11-21 11:22:16 +## 4 520 Trage Nurse 17 2017-11-21 13:43:16 2017-11-21 13:39:00 +## 5 528 Clinical … Doctor 1 2017-11-21 19:00:00 2017-11-21 19:00:00 +## # ℹ 5 more variables: triagecode <dbl>, specialization <chr>, .order <int>, +## # duration <dbl>, type <chr>

Unique Values

@@ -1188,20 +1177,20 @@

Unique Values

## Timestamps: start, complete ## ## # A tibble: 53 × 6 -## activity patien…¹ origi…² start complete .order -## <chr> <dbl> <chr> <dttm> <dttm> <int> -## 1 registration 510 Clerk 9 2017-11-20 10:18:17 2017-11-20 10:20:06 1 -## 2 Registration 512 Clerk … 2017-11-20 10:33:14 2017-11-20 10:37:00 2 -## 3 Triage 510 Nurse … 2017-11-20 10:34:08 2017-11-20 10:41:48 3 -## 4 Triage 512 Nurse … 2017-11-20 10:44:12 2017-11-20 10:50:17 4 -## 5 Clinical exam 512 Doctor… 2017-11-20 11:27:12 2017-11-20 11:33:57 5 -## 6 Clinical exam 510 Doctor… 2017-11-20 11:35:01 2017-11-20 11:36:09 6 -## 7 Triage 517 Nurse … 2017-11-21 11:35:16 2017-11-21 11:39:00 7 -## 8 Registration 518 Clerk … 2017-11-21 11:45:16 2017-11-21 11:22:16 8 -## 9 Registration 518 Clerk 6 2017-11-21 11:45:16 2017-11-21 11:22:16 9 -## 10 Registration 518 Clerk 9 2017-11-21 11:45:16 2017-11-21 11:22:16 10 -## # … with 43 more rows, and abbreviated variable names ¹​patient_visit_nr, -## # ²​originator +## activity patient_visit_nr originator start complete +## <chr> <dbl> <chr> <dttm> <dttm> +## 1 registra… 510 Clerk 9 2017-11-20 10:18:17 2017-11-20 10:20:06 +## 2 Registra… 512 Clerk 12 2017-11-20 10:33:14 2017-11-20 10:37:00 +## 3 Triage 510 Nurse 27 2017-11-20 10:34:08 2017-11-20 10:41:48 +## 4 Triage 512 Nurse 27 2017-11-20 10:44:12 2017-11-20 10:50:17 +## 5 Clinical… 512 Doctor 7 2017-11-20 11:27:12 2017-11-20 11:33:57 +## 6 Clinical… 510 Doctor 7 2017-11-20 11:35:01 2017-11-20 11:36:09 +## 7 Triage 517 Nurse 17 2017-11-21 11:35:16 2017-11-21 11:39:00 +## 8 Registra… 518 Clerk 12 2017-11-21 11:45:16 2017-11-21 11:22:16 +## 9 Registra… 518 Clerk 6 2017-11-21 11:45:16 2017-11-21 11:22:16 +## 10 Registra… 518 Clerk 9 2017-11-21 11:45:16 2017-11-21 11:22:16 +## # ℹ 43 more rows +## # ℹ 1 more variable: .order <int>
hospital_actlog %>%
   detect_unique_values(column_labels = c("activity", "originator"))
@@ -1222,20 +1211,20 @@

Unique Values

## Timestamps: start, complete ## ## # A tibble: 53 × 6 -## activity origin…¹ patie…² start complete .order -## <chr> <chr> <dbl> <dttm> <dttm> <int> -## 1 registration Clerk 9 510 2017-11-20 10:18:17 2017-11-20 10:20:06 1 -## 2 Registration Clerk 12 512 2017-11-20 10:33:14 2017-11-20 10:37:00 2 -## 3 Triage Nurse 27 510 2017-11-20 10:34:08 2017-11-20 10:41:48 3 -## 4 Triage Nurse 27 512 2017-11-20 10:44:12 2017-11-20 10:50:17 4 -## 5 Clinical exam Doctor 7 512 2017-11-20 11:27:12 2017-11-20 11:33:57 5 -## 6 Clinical exam Doctor 7 510 2017-11-20 11:35:01 2017-11-20 11:36:09 6 -## 7 Triage Nurse 17 517 2017-11-21 11:35:16 2017-11-21 11:39:00 7 -## 8 Registration Clerk 12 518 2017-11-21 11:45:16 2017-11-21 11:22:16 8 -## 9 Registration Clerk 6 518 2017-11-21 11:45:16 2017-11-21 11:22:16 9 -## 10 Registration Clerk 9 518 2017-11-21 11:45:16 2017-11-21 11:22:16 10 -## # … with 43 more rows, and abbreviated variable names ¹​originator, -## # ²​patient_visit_nr +## activity originator patient_visit_nr start complete +## <chr> <chr> <dbl> <dttm> <dttm> +## 1 registra… Clerk 9 510 2017-11-20 10:18:17 2017-11-20 10:20:06 +## 2 Registra… Clerk 12 512 2017-11-20 10:33:14 2017-11-20 10:37:00 +## 3 Triage Nurse 27 510 2017-11-20 10:34:08 2017-11-20 10:41:48 +## 4 Triage Nurse 27 512 2017-11-20 10:44:12 2017-11-20 10:50:17 +## 5 Clinical… Doctor 7 512 2017-11-20 11:27:12 2017-11-20 11:33:57 +## 6 Clinical… Doctor 7 510 2017-11-20 11:35:01 2017-11-20 11:36:09 +## 7 Triage Nurse 17 517 2017-11-21 11:35:16 2017-11-21 11:39:00 +## 8 Registra… Clerk 12 518 2017-11-21 11:45:16 2017-11-21 11:22:16 +## 9 Registra… Clerk 6 518 2017-11-21 11:45:16 2017-11-21 11:22:16 +## 10 Registra… Clerk 9 518 2017-11-21 11:45:16 2017-11-21 11:22:16 +## # ℹ 43 more rows +## # ℹ 1 more variable: .order <int>

Value Range Violations

@@ -1275,18 +1264,17 @@

Value Range Violations

## Timestamps: start, complete ## ## # A tibble: 7 × 9 -## column_checked patie…¹ activ…² origi…³ start complete -## <chr> <dbl> <chr> <chr> <dttm> <dttm> -## 1 triagecode 510 Clinic… Doctor… 2017-11-20 11:35:01 2017-11-20 11:36:09 -## 2 triagecode 529 Treatm… Doctor… 2017-11-22 16:30:00 2017-11-22 17:00:00 -## 3 triagecode 530 Triage Nurse … 2017-11-22 18:00:00 2017-11-22 18:05:00 -## 4 triagecode 531 Triage Nurse … 2017-11-22 18:05:00 2017-11-22 18:10:00 -## 5 triagecode 532 Treatm… Nurse … 2017-11-22 18:15:00 2017-11-22 18:25:00 -## 6 triagecode 532 Treatm… Doctor… 2017-11-22 18:27:00 2017-11-23 18:33:00 -## 7 triagecode 533 0 <NA> 2017-11-22 18:35:00 2017-11-22 18:37:00 -## # … with 3 more variables: triagecode <dbl>, specialization <chr>, -## # .order <int>, and abbreviated variable names ¹​patient_visit_nr, ²​activity, -## # ³​originator +## column_checked patient_visit_nr activity originator start +## <chr> <dbl> <chr> <chr> <dttm> +## 1 triagecode 510 Clinical exam Doctor 7 2017-11-20 11:35:01 +## 2 triagecode 529 Treatment eval… Doctor 1 2017-11-22 16:30:00 +## 3 triagecode 530 Triage Nurse 17 2017-11-22 18:00:00 +## 4 triagecode 531 Triage Nurse 17 2017-11-22 18:05:00 +## 5 triagecode 532 Treatment Nurse 17 2017-11-22 18:15:00 +## 6 triagecode 532 Treatment eval… Doctor 7 2017-11-22 18:27:00 +## 7 triagecode 533 0 <NA> 2017-11-22 18:35:00 +## # ℹ 4 more variables: complete <dttm>, triagecode <dbl>, specialization <chr>, +## # .order <int>

Read more:

diff --git a/developer_guide.html b/developer_guide.html index b6fddbb..4b9ea73 100644 --- a/developer_guide.html +++ b/developer_guide.html @@ -13,15 +13,15 @@ Developer Guide - + - - - - + + + + @@ -757,14 +757,14 @@

Object classes

filter(case_id(patients) == 1)
## EMPTY EVENT LOG
 ## # A tibble: 0 × 7
-## # … with 7 variables: handling <fct>, patient <chr>, employee <fct>,
+## # ℹ 7 variables: handling <fct>, patient <chr>, employee <fct>,
 ## #   handling_id <chr>, registration_type <fct>, time <dttm>, .order <int>

just as the following will not work.

patients %>%
     filter("patient" == 1)
## EMPTY EVENT LOG
 ## # A tibble: 0 × 7
-## # … with 7 variables: handling <fct>, patient <chr>, employee <fct>,
+## # ℹ 7 variables: handling <fct>, patient <chr>, employee <fct>,
 ## #   handling_id <chr>, registration_type <fct>, time <dttm>, .order <int>

In order to successfully do this, we could use the symbol:

patients %>%
@@ -785,21 +785,21 @@ 

Object classes

## Lifecycle transition: registration_type ## ## # A tibble: 12 × 7 -## handling patient emplo…¹ handl…² regis…³ time .order -## <fct> <chr> <fct> <chr> <fct> <dttm> <int> -## 1 Registration 1 r1 1 start 2017-01-02 11:41:53 1 -## 2 Triage and Assess… 1 r2 501 start 2017-01-02 12:40:20 2 -## 3 Blood test 1 r3 1001 start 2017-01-05 08:59:04 3 -## 4 MRI SCAN 1 r4 1238 start 2017-01-05 21:37:12 4 -## 5 Discuss Results 1 r6 1735 start 2017-01-07 07:57:49 5 -## 6 Check-out 1 r7 2230 start 2017-01-09 17:09:43 6 -## 7 Registration 1 r1 1 comple… 2017-01-02 12:40:20 7 -## 8 Triage and Assess… 1 r2 501 comple… 2017-01-02 22:32:25 8 -## 9 Blood test 1 r3 1001 comple… 2017-01-05 14:34:27 9 -## 10 MRI SCAN 1 r4 1238 comple… 2017-01-06 01:54:23 10 -## 11 Discuss Results 1 r6 1735 comple… 2017-01-07 10:18:08 11 -## 12 Check-out 1 r7 2230 comple… 2017-01-09 19:45:45 12 -## # … with abbreviated variable names ¹​employee, ²​handling_id, ³​registration_type
+## handling patient employee handling_id registration_type time +## <fct> <chr> <fct> <chr> <fct> <dttm> +## 1 Registrat… 1 r1 1 start 2017-01-02 11:41:53 +## 2 Triage an… 1 r2 501 start 2017-01-02 12:40:20 +## 3 Blood test 1 r3 1001 start 2017-01-05 08:59:04 +## 4 MRI SCAN 1 r4 1238 start 2017-01-05 21:37:12 +## 5 Discuss R… 1 r6 1735 start 2017-01-07 07:57:49 +## 6 Check-out 1 r7 2230 start 2017-01-09 17:09:43 +## 7 Registrat… 1 r1 1 complete 2017-01-02 12:40:20 +## 8 Triage an… 1 r2 501 complete 2017-01-02 22:32:25 +## 9 Blood test 1 r3 1001 complete 2017-01-05 14:34:27 +## 10 MRI SCAN 1 r4 1238 complete 2017-01-06 01:54:23 +## 11 Discuss R… 1 r6 1735 complete 2017-01-07 10:18:08 +## 12 Check-out 1 r7 2230 complete 2017-01-09 19:45:45 +## # ℹ 1 more variable: .order <int>

More on symbols and !!: https://adv-r.hadley.nz/quasiquotation.html

@@ -822,21 +822,21 @@

Object classes

## Lifecycle transition: registration_type ## ## # A tibble: 12 × 7 -## handling patient emplo…¹ handl…² regis…³ time .order -## <fct> <chr> <fct> <chr> <fct> <dttm> <int> -## 1 Registration 1 r1 1 start 2017-01-02 11:41:53 1 -## 2 Triage and Assess… 1 r2 501 start 2017-01-02 12:40:20 2 -## 3 Blood test 1 r3 1001 start 2017-01-05 08:59:04 3 -## 4 MRI SCAN 1 r4 1238 start 2017-01-05 21:37:12 4 -## 5 Discuss Results 1 r6 1735 start 2017-01-07 07:57:49 5 -## 6 Check-out 1 r7 2230 start 2017-01-09 17:09:43 6 -## 7 Registration 1 r1 1 comple… 2017-01-02 12:40:20 7 -## 8 Triage and Assess… 1 r2 501 comple… 2017-01-02 22:32:25 8 -## 9 Blood test 1 r3 1001 comple… 2017-01-05 14:34:27 9 -## 10 MRI SCAN 1 r4 1238 comple… 2017-01-06 01:54:23 10 -## 11 Discuss Results 1 r6 1735 comple… 2017-01-07 10:18:08 11 -## 12 Check-out 1 r7 2230 comple… 2017-01-09 19:45:45 12 -## # … with abbreviated variable names ¹​employee, ²​handling_id, ³​registration_type +## handling patient employee handling_id registration_type time +## <fct> <chr> <fct> <chr> <fct> <dttm> +## 1 Registrat… 1 r1 1 start 2017-01-02 11:41:53 +## 2 Triage an… 1 r2 501 start 2017-01-02 12:40:20 +## 3 Blood test 1 r3 1001 start 2017-01-05 08:59:04 +## 4 MRI SCAN 1 r4 1238 start 2017-01-05 21:37:12 +## 5 Discuss R… 1 r6 1735 start 2017-01-07 07:57:49 +## 6 Check-out 1 r7 2230 start 2017-01-09 17:09:43 +## 7 Registrat… 1 r1 1 complete 2017-01-02 12:40:20 +## 8 Triage an… 1 r2 501 complete 2017-01-02 22:32:25 +## 9 Blood test 1 r3 1001 complete 2017-01-05 14:34:27 +## 10 MRI SCAN 1 r4 1238 complete 2017-01-06 01:54:23 +## 11 Discuss R… 1 r6 1735 complete 2017-01-07 10:18:08 +## 12 Check-out 1 r7 2230 complete 2017-01-09 19:45:45 +## # ℹ 1 more variable: .order <int>

The .data here is a special command, a pronoun, that can be used in dplyr functions. More information here: Select ## Lifecycle transition: lifecycle ## ## # A tibble: 15,214 × 8 -## oligurie case_id activity activ…¹ timestamp resou…² lifec…³ .order -## <lgl> <chr> <fct> <chr> <dttm> <fct> <fct> <int> -## 1 FALSE A ER Regis… 1 2014-10-22 11:15:41 A comple… 1 -## 2 NA A Leucocyt… 2 2014-10-22 11:27:00 B comple… 2 -## 3 NA A CRP 3 2014-10-22 11:27:00 B comple… 3 -## 4 NA A LacticAc… 4 2014-10-22 11:27:00 B comple… 4 -## 5 NA A ER Triage 5 2014-10-22 11:33:37 C comple… 5 -## 6 NA A ER Sepsi… 6 2014-10-22 11:34:00 A comple… 6 -## 7 NA A IV Liquid 7 2014-10-22 14:03:47 A comple… 7 -## 8 NA A IV Antib… 8 2014-10-22 14:03:47 A comple… 8 -## 9 NA A Admissio… 9 2014-10-22 14:13:19 D comple… 9 -## 10 NA A CRP 10 2014-10-24 09:00:00 B comple… 10 -## # … with 15,204 more rows, and abbreviated variable names -## # ¹​activity_instance_id, ²​resource, ³​lifecycle +## oligurie case_id activity activity_instance_id timestamp resource +## <lgl> <chr> <fct> <chr> <dttm> <fct> +## 1 FALSE A ER Regist… 1 2014-10-22 11:15:41 A +## 2 NA A Leucocytes 2 2014-10-22 11:27:00 B +## 3 NA A CRP 3 2014-10-22 11:27:00 B +## 4 NA A LacticAcid 4 2014-10-22 11:27:00 B +## 5 NA A ER Triage 5 2014-10-22 11:33:37 C +## 6 NA A ER Sepsis… 6 2014-10-22 11:34:00 A +## 7 NA A IV Liquid 7 2014-10-22 14:03:47 A +## 8 NA A IV Antibi… 8 2014-10-22 14:03:47 A +## 9 NA A Admission… 9 2014-10-22 14:13:19 D +## 10 NA A CRP 10 2014-10-24 09:00:00 B +## # ℹ 15,204 more rows +## # ℹ 2 more variables: lifecycle <fct>, .order <int>

This behavior can be turned by setting force_df = TRUE. In that case, the select will work just like a traditional select(), and the result will be a data.frame, @@ -924,7 +924,7 @@

Select

## 8 NA ## 9 NA ## 10 NA -## # … with 15,204 more rows +## # ℹ 15,204 more rows

Because of this, you can select just the event log mapping using select().

sepsis %>%
@@ -945,20 +945,20 @@ 

Select

## Lifecycle transition: lifecycle ## ## # A tibble: 15,214 × 7 -## case_id activity activit…¹ timestamp resou…² lifec…³ .order -## <chr> <fct> <chr> <dttm> <fct> <fct> <int> -## 1 A ER Registration 1 2014-10-22 11:15:41 A comple… 1 -## 2 A Leucocytes 2 2014-10-22 11:27:00 B comple… 2 -## 3 A CRP 3 2014-10-22 11:27:00 B comple… 3 -## 4 A LacticAcid 4 2014-10-22 11:27:00 B comple… 4 -## 5 A ER Triage 5 2014-10-22 11:33:37 C comple… 5 -## 6 A ER Sepsis Triage 6 2014-10-22 11:34:00 A comple… 6 -## 7 A IV Liquid 7 2014-10-22 14:03:47 A comple… 7 -## 8 A IV Antibiotics 8 2014-10-22 14:03:47 A comple… 8 -## 9 A Admission NC 9 2014-10-22 14:13:19 D comple… 9 -## 10 A CRP 10 2014-10-24 09:00:00 B comple… 10 -## # … with 15,204 more rows, and abbreviated variable names -## # ¹​activity_instance_id, ²​resource, ³​lifecycle
+## case_id activity activity_instance_id timestamp resource lifecycle +## <chr> <fct> <chr> <dttm> <fct> <fct> +## 1 A ER Regis… 1 2014-10-22 11:15:41 A complete +## 2 A Leucocyt… 2 2014-10-22 11:27:00 B complete +## 3 A CRP 3 2014-10-22 11:27:00 B complete +## 4 A LacticAc… 4 2014-10-22 11:27:00 B complete +## 5 A ER Triage 5 2014-10-22 11:33:37 C complete +## 6 A ER Sepsi… 6 2014-10-22 11:34:00 A complete +## 7 A IV Liquid 7 2014-10-22 14:03:47 A complete +## 8 A IV Antib… 8 2014-10-22 14:03:47 A complete +## 9 A Admissio… 9 2014-10-22 14:13:19 D complete +## 10 A CRP 10 2014-10-24 09:00:00 B complete +## # ℹ 15,204 more rows +## # ℹ 1 more variable: .order <int>

If you want to select only specific eventlog classifiers, you can use selects_ids(). Because you would typically not select all id’s (otherwise you can use @@ -979,7 +979,7 @@

Select

## 8 IV Antibiotics A ## 9 Admission NC A ## 10 CRP A -## # … with 15,204 more rows +## # ℹ 15,204 more rows

Note how the different classifiers are defined: using the _id() functions, but without the brackets. And not using characters.

@@ -1018,19 +1018,20 @@

Group by

## Lifecycle transition: registration_type ## ## # A tibble: 5,442 × 7 -## handling patient employee handling_id regist…¹ time .order -## <fct> <chr> <fct> <chr> <fct> <dttm> <int> -## 1 Registration 1 r1 1 start 2017-01-02 11:41:53 1 -## 2 Registration 2 r1 2 start 2017-01-02 11:41:53 2 -## 3 Registration 3 r1 3 start 2017-01-04 01:34:05 3 -## 4 Registration 4 r1 4 start 2017-01-04 01:34:04 4 -## 5 Registration 5 r1 5 start 2017-01-04 16:07:47 5 -## 6 Registration 6 r1 6 start 2017-01-04 16:07:47 6 -## 7 Registration 7 r1 7 start 2017-01-05 04:56:11 7 -## 8 Registration 8 r1 8 start 2017-01-05 04:56:11 8 -## 9 Registration 9 r1 9 start 2017-01-06 05:58:54 9 -## 10 Registration 10 r1 10 start 2017-01-06 05:58:54 10 -## # … with 5,432 more rows, and abbreviated variable name ¹​registration_type +## handling patient employee handling_id registration_type time +## <fct> <chr> <fct> <chr> <fct> <dttm> +## 1 Registrat… 1 r1 1 start 2017-01-02 11:41:53 +## 2 Registrat… 2 r1 2 start 2017-01-02 11:41:53 +## 3 Registrat… 3 r1 3 start 2017-01-04 01:34:05 +## 4 Registrat… 4 r1 4 start 2017-01-04 01:34:04 +## 5 Registrat… 5 r1 5 start 2017-01-04 16:07:47 +## 6 Registrat… 6 r1 6 start 2017-01-04 16:07:47 +## 7 Registrat… 7 r1 7 start 2017-01-05 04:56:11 +## 8 Registrat… 8 r1 8 start 2017-01-05 04:56:11 +## 9 Registrat… 9 r1 9 start 2017-01-06 05:58:54 +## 10 Registrat… 10 r1 10 start 2017-01-06 05:58:54 +## # ℹ 5,432 more rows +## # ℹ 1 more variable: .order <int>

is equivalent to

patients %>%
     group_by(.data[[case_id(patients)]])
@@ -1051,19 +1052,20 @@

Group by

## Lifecycle transition: registration_type ## ## # A tibble: 5,442 × 7 -## handling patient employee handling_id regist…¹ time .order -## <fct> <chr> <fct> <chr> <fct> <dttm> <int> -## 1 Registration 1 r1 1 start 2017-01-02 11:41:53 1 -## 2 Registration 2 r1 2 start 2017-01-02 11:41:53 2 -## 3 Registration 3 r1 3 start 2017-01-04 01:34:05 3 -## 4 Registration 4 r1 4 start 2017-01-04 01:34:04 4 -## 5 Registration 5 r1 5 start 2017-01-04 16:07:47 5 -## 6 Registration 6 r1 6 start 2017-01-04 16:07:47 6 -## 7 Registration 7 r1 7 start 2017-01-05 04:56:11 7 -## 8 Registration 8 r1 8 start 2017-01-05 04:56:11 8 -## 9 Registration 9 r1 9 start 2017-01-06 05:58:54 9 -## 10 Registration 10 r1 10 start 2017-01-06 05:58:54 10 -## # … with 5,432 more rows, and abbreviated variable name ¹​registration_type +## handling patient employee handling_id registration_type time +## <fct> <chr> <fct> <chr> <fct> <dttm> +## 1 Registrat… 1 r1 1 start 2017-01-02 11:41:53 +## 2 Registrat… 2 r1 2 start 2017-01-02 11:41:53 +## 3 Registrat… 3 r1 3 start 2017-01-04 01:34:05 +## 4 Registrat… 4 r1 4 start 2017-01-04 01:34:04 +## 5 Registrat… 5 r1 5 start 2017-01-04 16:07:47 +## 6 Registrat… 6 r1 6 start 2017-01-04 16:07:47 +## 7 Registrat… 7 r1 7 start 2017-01-05 04:56:11 +## 8 Registrat… 8 r1 8 start 2017-01-05 04:56:11 +## 9 Registrat… 9 r1 9 start 2017-01-06 05:58:54 +## 10 Registrat… 10 r1 10 start 2017-01-06 05:58:54 +## # ℹ 5,432 more rows +## # ℹ 1 more variable: .order <int>

While, except for the more common resource-activity, not all relevant combinations of groupings are provided as a shortcut, the internal group_by_ids() allows the use of any combination of @@ -1087,19 +1089,20 @@

Group by

## Lifecycle transition: registration_type ## ## # A tibble: 5,442 × 7 -## handling patient employee handling_id regist…¹ time .order -## <fct> <chr> <fct> <chr> <fct> <dttm> <int> -## 1 Registration 1 r1 1 start 2017-01-02 11:41:53 1 -## 2 Registration 2 r1 2 start 2017-01-02 11:41:53 2 -## 3 Registration 3 r1 3 start 2017-01-04 01:34:05 3 -## 4 Registration 4 r1 4 start 2017-01-04 01:34:04 4 -## 5 Registration 5 r1 5 start 2017-01-04 16:07:47 5 -## 6 Registration 6 r1 6 start 2017-01-04 16:07:47 6 -## 7 Registration 7 r1 7 start 2017-01-05 04:56:11 7 -## 8 Registration 8 r1 8 start 2017-01-05 04:56:11 8 -## 9 Registration 9 r1 9 start 2017-01-06 05:58:54 9 -## 10 Registration 10 r1 10 start 2017-01-06 05:58:54 10 -## # … with 5,432 more rows, and abbreviated variable name ¹​registration_type +## handling patient employee handling_id registration_type time +## <fct> <chr> <fct> <chr> <fct> <dttm> +## 1 Registrat… 1 r1 1 start 2017-01-02 11:41:53 +## 2 Registrat… 2 r1 2 start 2017-01-02 11:41:53 +## 3 Registrat… 3 r1 3 start 2017-01-04 01:34:05 +## 4 Registrat… 4 r1 4 start 2017-01-04 01:34:04 +## 5 Registrat… 5 r1 5 start 2017-01-04 16:07:47 +## 6 Registrat… 6 r1 6 start 2017-01-04 16:07:47 +## 7 Registrat… 7 r1 7 start 2017-01-05 04:56:11 +## 8 Registrat… 8 r1 8 start 2017-01-05 04:56:11 +## 9 Registrat… 9 r1 9 start 2017-01-06 05:58:54 +## 10 Registrat… 10 r1 10 start 2017-01-06 05:58:54 +## # ℹ 5,432 more rows +## # ℹ 1 more variable: .order <int>

Note that the notation is analogous to select_ids(): specify the id functions, without quotation marks or brackets.

diff --git a/dotted_chart.html b/dotted_chart.html index 2c8a6d2..5d8d286 100644 --- a/dotted_chart.html +++ b/dotted_chart.html @@ -13,14 +13,14 @@ bupaR Docs | Dotted Charts - + - - - + + + + - - - - + + + + - + - + +
+

Trim to Time Window

diff --git a/faq.html b/faq.html index 54c0f17..ae1568a 100644 --- a/faq.html +++ b/faq.html @@ -13,17 +13,18 @@ Frequently Asked Questions - + - - - + + + - - + + +
-

Visualize

-
+
How can I remove infrequent edges in a process map?
-
+
bupaR does not contain a magic slider that can simplify a process_map. We believe that process maps should always be a transparent visualization of the log, and simplifying should be done by the conscious use of filters. You might consider filter_infrequent_flows(), filter_trace_frequency() or filter_activity_frequency() for this job.
+
-
+
Can I use process maps in a Shiny app?
-
Yes, you can! Use the functions renderProcessMap() in the Server, and processMapOutput in the UI of your app. Make sure to use the width and height arguments to set proper dimensions for the map.
+
Yes, you can! Use the functions renderProcessMap() in the Server, and processMapOutput in the UI of your app. Make sure to use the width and height arguments to set proper dimensions for the map.
+
-
+
Can I save the process map to a file?
-
You can save a process map to a PDF, PNG, PS or EPS using export_map(). To do this, note that you should use the argument render = FALSE in the call to process_map(). Use the argument title to add a caption to the image, and width and height to adjust the file dimensions.
+
You can save a process map to a PDF, PNG, PS or EPS using export_map(). To do this, note that you should use the argument render = FALSE in the call to process_map(). Use the argument title to add a caption to the image, and width and height to adjust the file dimensions.
+
diff --git a/frequency_maps.html b/frequency_maps.html index 592879a..181f0f4 100644 --- a/frequency_maps.html +++ b/frequency_maps.html @@ -13,22 +13,22 @@ bupaR Docs | Frequency Maps - + - - - - + + + + - + - + +
+

Note that this is the default process map configuration, and is thus equivalent to the following.

tmp %>%
     process_map()
-
- +
+

Absolute case

@@ -745,8 +745,8 @@

Absolute case

because of the self-loop on the activity.

tmp %>%
     process_map(frequency("absolute-case"))
-
- +
+

Relative

@@ -756,8 +756,8 @@

Relative

was followed by another Payment.

tmp %>%
     process_map(frequency("relative"))
-
- +
+

Relative case

@@ -766,8 +766,8 @@

Relative case

Payment.

tmp %>%
     process_map(frequency("relative-case"))
-
- +
+

Relative antecedence

@@ -789,8 +789,8 @@

Relative consequent

executions.

tmp %>%
     process_map(frequency("relative-consequent"))
-
- +
+

Read more:

diff --git a/generic_filtering.html b/generic_filtering.html index 76529e8..093c37e 100644 --- a/generic_filtering.html +++ b/generic_filtering.html @@ -13,15 +13,15 @@ Generic filtering - + - - - - + + + + @@ -675,33 +675,32 @@

filter

## Lifecycle transition: lifecycle ## ## # A tibble: 20 × 18 -## case_id activity lifec…¹ resou…² timestamp amount article dismi…³ -## <chr> <fct> <fct> <fct> <dttm> <chr> <dbl> <chr> -## 1 A10060 Create Fi… comple… 541 2007-03-08 00:00:00 36.0 157 NIL -## 2 A10497 Create Fi… comple… 558 2007-03-30 00:00:00 36.0 157 NIL -## 3 A10818 Create Fi… comple… 561 2007-04-08 00:00:00 36.0 157 NIL -## 4 A11707 Create Fi… comple… 550 2007-04-24 00:00:00 36.0 157 NIL -## 5 A11936 Create Fi… comple… 557 2007-04-29 00:00:00 36.0 157 NIL -## 6 A12073 Create Fi… comple… 557 2007-05-03 00:00:00 36.0 157 NIL -## 7 A1408 Create Fi… comple… 559 2006-08-20 00:00:00 35.0 157 NIL -## 8 A14883 Create Fi… comple… 561 2007-06-29 00:00:00 36.0 157 NIL -## 9 A17130 Create Fi… comple… 541 2007-07-15 00:00:00 36.0 157 NIL -## 10 A1815 Create Fi… comple… 563 2006-08-10 00:00:00 35.0 157 NIL -## 11 A19109 Create Fi… comple… 556 2007-07-17 00:00:00 36.0 157 NIL -## 12 A23000 Create Fi… comple… 550 2007-12-29 00:00:00 36.0 157 NIL -## 13 A24247 Create Fi… comple… 561 2007-12-03 00:00:00 36.0 157 NIL -## 14 A24366 Create Fi… comple… 541 2008-02-09 00:00:00 36.0 157 NIL -## 15 A24634 Create Fi… comple… 537 2007-11-21 00:00:00 36.0 157 NIL -## 16 A24942 Create Fi… comple… 561 2007-12-30 00:00:00 36.0 157 NIL -## 17 A25581 Create Fi… comple… 559 2007-11-23 00:00:00 36.0 157 NIL -## 18 A25599 Create Fi… comple… 559 2007-11-24 00:00:00 36.0 157 NIL -## 19 A26099 Create Fi… comple… 559 2007-12-09 00:00:00 36.0 157 NIL -## 20 A26277 Create Fi… comple… 538 2008-01-07 00:00:00 36.0 157 NIL -## # … with 10 more variables: expense <chr>, lastsent <chr>, matricola <dbl>, -## # notificationtype <chr>, paymentamount <dbl>, points <dbl>, +## case_id activity lifecycle resource timestamp amount article +## <chr> <fct> <fct> <fct> <dttm> <chr> <dbl> +## 1 A10060 Create Fine complete 541 2007-03-08 00:00:00 36.0 157 +## 2 A10497 Create Fine complete 558 2007-03-30 00:00:00 36.0 157 +## 3 A10818 Create Fine complete 561 2007-04-08 00:00:00 36.0 157 +## 4 A11707 Create Fine complete 550 2007-04-24 00:00:00 36.0 157 +## 5 A11936 Create Fine complete 557 2007-04-29 00:00:00 36.0 157 +## 6 A12073 Create Fine complete 557 2007-05-03 00:00:00 36.0 157 +## 7 A1408 Create Fine complete 559 2006-08-20 00:00:00 35.0 157 +## 8 A14883 Create Fine complete 561 2007-06-29 00:00:00 36.0 157 +## 9 A17130 Create Fine complete 541 2007-07-15 00:00:00 36.0 157 +## 10 A1815 Create Fine complete 563 2006-08-10 00:00:00 35.0 157 +## 11 A19109 Create Fine complete 556 2007-07-17 00:00:00 36.0 157 +## 12 A23000 Create Fine complete 550 2007-12-29 00:00:00 36.0 157 +## 13 A24247 Create Fine complete 561 2007-12-03 00:00:00 36.0 157 +## 14 A24366 Create Fine complete 541 2008-02-09 00:00:00 36.0 157 +## 15 A24634 Create Fine complete 537 2007-11-21 00:00:00 36.0 157 +## 16 A24942 Create Fine complete 561 2007-12-30 00:00:00 36.0 157 +## 17 A25581 Create Fine complete 559 2007-11-23 00:00:00 36.0 157 +## 18 A25599 Create Fine complete 559 2007-11-24 00:00:00 36.0 157 +## 19 A26099 Create Fine complete 559 2007-12-09 00:00:00 36.0 157 +## 20 A26277 Create Fine complete 538 2008-01-07 00:00:00 36.0 157 +## # ℹ 11 more variables: dismissal <chr>, expense <chr>, lastsent <chr>, +## # matricola <dbl>, notificationtype <chr>, paymentamount <dbl>, points <dbl>, ## # totalpaymentamount <chr>, vehicleclass <chr>, activity_instance_id <chr>, -## # .order <int>, and abbreviated variable names ¹​lifecycle, ²​resource, -## # ³​dismissal +## # .order <int>

slice

@@ -735,19 +734,20 @@

slice

## Lifecycle transition: registration_type ## ## # A tibble: 110 × 7 -## handling patient employee handling_id regist…¹ time .order -## <fct> <chr> <fct> <chr> <fct> <dttm> <int> -## 1 Registration 1 r1 1 start 2017-01-02 11:41:53 1 -## 2 Registration 2 r1 2 start 2017-01-02 11:41:53 2 -## 3 Registration 3 r1 3 start 2017-01-04 01:34:05 3 -## 4 Registration 4 r1 4 start 2017-01-04 01:34:04 4 -## 5 Registration 5 r1 5 start 2017-01-04 16:07:47 5 -## 6 Registration 6 r1 6 start 2017-01-04 16:07:47 6 -## 7 Registration 7 r1 7 start 2017-01-05 04:56:11 7 -## 8 Registration 8 r1 8 start 2017-01-05 04:56:11 8 -## 9 Registration 9 r1 9 start 2017-01-06 05:58:54 9 -## 10 Registration 10 r1 10 start 2017-01-06 05:58:54 10 -## # … with 100 more rows, and abbreviated variable name ¹​registration_type +## handling patient employee handling_id registration_type time +## <fct> <chr> <fct> <chr> <fct> <dttm> +## 1 Registrat… 1 r1 1 start 2017-01-02 11:41:53 +## 2 Registrat… 2 r1 2 start 2017-01-02 11:41:53 +## 3 Registrat… 3 r1 3 start 2017-01-04 01:34:05 +## 4 Registrat… 4 r1 4 start 2017-01-04 01:34:04 +## 5 Registrat… 5 r1 5 start 2017-01-04 16:07:47 +## 6 Registrat… 6 r1 6 start 2017-01-04 16:07:47 +## 7 Registrat… 7 r1 7 start 2017-01-05 04:56:11 +## 8 Registrat… 8 r1 8 start 2017-01-05 04:56:11 +## 9 Registrat… 9 r1 9 start 2017-01-06 05:58:54 +## 10 Registrat… 10 r1 10 start 2017-01-06 05:58:54 +## # ℹ 100 more rows +## # ℹ 1 more variable: .order <int>

slice_activities

The next piece of code returns the first 10 activity @@ -770,29 +770,29 @@

slice_activities

## Lifecycle transition: registration_type ## ## # A tibble: 20 × 7 -## handling patient employee handling_id regist…¹ time .order -## <fct> <chr> <fct> <chr> <fct> <dttm> <int> -## 1 Registration 1 r1 1 start 2017-01-02 11:41:53 1 -## 2 Registration 2 r1 2 start 2017-01-02 11:41:53 2 -## 3 Registration 3 r1 3 start 2017-01-04 01:34:05 3 -## 4 Registration 4 r1 4 start 2017-01-04 01:34:04 4 -## 5 Registration 5 r1 5 start 2017-01-04 16:07:47 5 -## 6 Registration 6 r1 6 start 2017-01-04 16:07:47 6 -## 7 Registration 7 r1 7 start 2017-01-05 04:56:11 7 -## 8 Registration 8 r1 8 start 2017-01-05 04:56:11 8 -## 9 Registration 9 r1 9 start 2017-01-06 05:58:54 9 -## 10 Registration 10 r1 10 start 2017-01-06 05:58:54 10 -## 11 Registration 1 r1 1 complete 2017-01-02 12:40:20 11 -## 12 Registration 2 r1 2 complete 2017-01-02 15:16:38 12 -## 13 Registration 3 r1 3 complete 2017-01-04 06:36:54 13 -## 14 Registration 4 r1 4 complete 2017-01-04 04:25:06 14 -## 15 Registration 5 r1 5 complete 2017-01-04 20:07:50 15 -## 16 Registration 6 r1 6 complete 2017-01-04 18:12:46 16 -## 17 Registration 7 r1 7 complete 2017-01-05 06:27:49 17 -## 18 Registration 8 r1 8 complete 2017-01-05 07:58:17 18 -## 19 Registration 9 r1 9 complete 2017-01-06 07:18:32 19 -## 20 Registration 10 r1 10 complete 2017-01-06 09:13:28 20 -## # … with abbreviated variable name ¹​registration_type +## handling patient employee handling_id registration_type time +## <fct> <chr> <fct> <chr> <fct> <dttm> +## 1 Registrat… 1 r1 1 start 2017-01-02 11:41:53 +## 2 Registrat… 2 r1 2 start 2017-01-02 11:41:53 +## 3 Registrat… 3 r1 3 start 2017-01-04 01:34:05 +## 4 Registrat… 4 r1 4 start 2017-01-04 01:34:04 +## 5 Registrat… 5 r1 5 start 2017-01-04 16:07:47 +## 6 Registrat… 6 r1 6 start 2017-01-04 16:07:47 +## 7 Registrat… 7 r1 7 start 2017-01-05 04:56:11 +## 8 Registrat… 8 r1 8 start 2017-01-05 04:56:11 +## 9 Registrat… 9 r1 9 start 2017-01-06 05:58:54 +## 10 Registrat… 10 r1 10 start 2017-01-06 05:58:54 +## 11 Registrat… 1 r1 1 complete 2017-01-02 12:40:20 +## 12 Registrat… 2 r1 2 complete 2017-01-02 15:16:38 +## 13 Registrat… 3 r1 3 complete 2017-01-04 06:36:54 +## 14 Registrat… 4 r1 4 complete 2017-01-04 04:25:06 +## 15 Registrat… 5 r1 5 complete 2017-01-04 20:07:50 +## 16 Registrat… 6 r1 6 complete 2017-01-04 18:12:46 +## 17 Registrat… 7 r1 7 complete 2017-01-05 06:27:49 +## 18 Registrat… 8 r1 8 complete 2017-01-05 07:58:17 +## 19 Registrat… 9 r1 9 complete 2017-01-06 07:18:32 +## 20 Registrat… 10 r1 10 complete 2017-01-06 09:13:28 +## # ℹ 1 more variable: .order <int>

slice_events

@@ -815,19 +815,19 @@

slice_events

## Lifecycle transition: registration_type ## ## # A tibble: 10 × 7 -## handling patient employee handling_id regist…¹ time .order -## <fct> <chr> <fct> <chr> <fct> <dttm> <int> -## 1 Registration 1 r1 1 start 2017-01-02 11:41:53 1 -## 2 Registration 2 r1 2 start 2017-01-02 11:41:53 2 -## 3 Registration 3 r1 3 start 2017-01-04 01:34:05 3 -## 4 Registration 4 r1 4 start 2017-01-04 01:34:04 4 -## 5 Registration 5 r1 5 start 2017-01-04 16:07:47 5 -## 6 Registration 6 r1 6 start 2017-01-04 16:07:47 6 -## 7 Registration 7 r1 7 start 2017-01-05 04:56:11 7 -## 8 Registration 8 r1 8 start 2017-01-05 04:56:11 8 -## 9 Registration 9 r1 9 start 2017-01-06 05:58:54 9 -## 10 Registration 10 r1 10 start 2017-01-06 05:58:54 10 -## # … with abbreviated variable name ¹​registration_type +## handling patient employee handling_id registration_type time +## <fct> <chr> <fct> <chr> <fct> <dttm> +## 1 Registrat… 1 r1 1 start 2017-01-02 11:41:53 +## 2 Registrat… 2 r1 2 start 2017-01-02 11:41:53 +## 3 Registrat… 3 r1 3 start 2017-01-04 01:34:05 +## 4 Registrat… 4 r1 4 start 2017-01-04 01:34:04 +## 5 Registrat… 5 r1 5 start 2017-01-04 16:07:47 +## 6 Registrat… 6 r1 6 start 2017-01-04 16:07:47 +## 7 Registrat… 7 r1 7 start 2017-01-05 04:56:11 +## 8 Registrat… 8 r1 8 start 2017-01-05 04:56:11 +## 9 Registrat… 9 r1 9 start 2017-01-06 05:58:54 +## 10 Registrat… 10 r1 10 start 2017-01-06 05:58:54 +## # ℹ 1 more variable: .order <int>
@@ -857,19 +857,19 @@

first_n, last_n

## Lifecycle transition: registration_type ## ## # A tibble: 10 × 7 -## handling patient emplo…¹ handl…² regis…³ time .order -## <fct> <chr> <fct> <chr> <fct> <dttm> <int> -## 1 Registration 1 r1 1 start 2017-01-02 11:41:53 1 -## 2 Registration 2 r1 2 start 2017-01-02 11:41:53 2 -## 3 Triage and Assess… 1 r2 501 start 2017-01-02 12:40:20 4 -## 4 Registration 1 r1 1 comple… 2017-01-02 12:40:20 6 -## 5 Registration 2 r1 2 comple… 2017-01-02 15:16:38 7 -## 6 Triage and Assess… 2 r2 502 start 2017-01-02 22:32:25 5 -## 7 Triage and Assess… 1 r2 501 comple… 2017-01-02 22:32:25 9 -## 8 Triage and Assess… 2 r2 502 comple… 2017-01-03 12:34:01 10 -## 9 Registration 4 r1 4 start 2017-01-04 01:34:04 3 -## 10 Registration 4 r1 4 comple… 2017-01-04 04:25:06 8 -## # … with abbreviated variable names ¹​employee, ²​handling_id, ³​registration_type +## handling patient employee handling_id registration_type time +## <fct> <chr> <fct> <chr> <fct> <dttm> +## 1 Registrat… 1 r1 1 start 2017-01-02 11:41:53 +## 2 Registrat… 2 r1 2 start 2017-01-02 11:41:53 +## 3 Triage an… 1 r2 501 start 2017-01-02 12:40:20 +## 4 Registrat… 1 r1 1 complete 2017-01-02 12:40:20 +## 5 Registrat… 2 r1 2 complete 2017-01-02 15:16:38 +## 6 Triage an… 2 r2 502 start 2017-01-02 22:32:25 +## 7 Triage an… 1 r2 501 complete 2017-01-02 22:32:25 +## 8 Triage an… 2 r2 502 complete 2017-01-03 12:34:01 +## 9 Registrat… 4 r1 4 start 2017-01-04 01:34:04 +## 10 Registrat… 4 r1 4 complete 2017-01-04 04:25:06 +## # ℹ 1 more variable: .order <int>

This is not impacted by a different ordering of the data since it will take the time aspect into account.

patients %>%
@@ -891,19 +891,19 @@ 

first_n, last_n

## Lifecycle transition: registration_type ## ## # A tibble: 10 × 7 -## handling patient emplo…¹ handl…² regis…³ time .order -## <fct> <chr> <fct> <chr> <fct> <dttm> <int> -## 1 Registration 1 r1 1 start 2017-01-02 11:41:53 1 -## 2 Registration 2 r1 2 start 2017-01-02 11:41:53 2 -## 3 Triage and Assess… 1 r2 501 start 2017-01-02 12:40:20 4 -## 4 Registration 1 r1 1 comple… 2017-01-02 12:40:20 6 -## 5 Registration 2 r1 2 comple… 2017-01-02 15:16:38 7 -## 6 Triage and Assess… 2 r2 502 start 2017-01-02 22:32:25 5 -## 7 Triage and Assess… 1 r2 501 comple… 2017-01-02 22:32:25 9 -## 8 Triage and Assess… 2 r2 502 comple… 2017-01-03 12:34:01 10 -## 9 Registration 4 r1 4 start 2017-01-04 01:34:04 3 -## 10 Registration 4 r1 4 comple… 2017-01-04 04:25:06 8 -## # … with abbreviated variable names ¹​employee, ²​handling_id, ³​registration_type
+## handling patient employee handling_id registration_type time +## <fct> <chr> <fct> <chr> <fct> <dttm> +## 1 Registrat… 1 r1 1 start 2017-01-02 11:41:53 +## 2 Registrat… 2 r1 2 start 2017-01-02 11:41:53 +## 3 Triage an… 1 r2 501 start 2017-01-02 12:40:20 +## 4 Registrat… 1 r1 1 complete 2017-01-02 12:40:20 +## 5 Registrat… 2 r1 2 complete 2017-01-02 15:16:38 +## 6 Triage an… 2 r2 502 start 2017-01-02 22:32:25 +## 7 Triage an… 1 r2 501 complete 2017-01-02 22:32:25 +## 8 Triage an… 2 r2 502 complete 2017-01-03 12:34:01 +## 9 Registrat… 4 r1 4 start 2017-01-04 01:34:04 +## 10 Registrat… 4 r1 4 complete 2017-01-04 04:25:06 +## # ℹ 1 more variable: .order <int>

Incombination with group_by_case, it is very easy to select the heads or tails of each case. Below, we explore the 95% most common first 3 activities in the sepsis log.

@@ -920,12 +920,12 @@

sample_n

patients.

patients %>%
     sample_n(size = 10)
-
## # Log of 108 events consisting of:
-## 3 traces 
+
## # Log of 110 events consisting of:
+## 2 traces 
 ## 10 cases 
-## 54 instances of 7 activities 
+## 55 instances of 7 activities 
 ## 7 resources 
-## Events occurred from 2017-03-29 22:12:55 until 2018-05-04 21:50:07 
+## Events occurred from 2017-04-01 22:15:15 until 2018-02-25 14:21:06 
 ##  
 ## # Variables were mapped as follows:
 ## Case identifier:     patient 
@@ -935,20 +935,21 @@ 

sample_n

## Timestamp: time ## Lifecycle transition: registration_type ## -## # A tibble: 108 × 7 -## handling patient employee handling_id regist…¹ time .order -## <fct> <chr> <fct> <chr> <fct> <dttm> <int> -## 1 Registration 80 r1 80 start 2017-03-29 22:12:55 1 -## 2 Registration 92 r1 92 start 2017-04-04 17:42:26 2 -## 3 Registration 156 r1 156 start 2017-06-03 10:05:28 3 -## 4 Registration 170 r1 170 start 2017-06-17 15:10:30 4 -## 5 Registration 202 r1 202 start 2017-07-17 03:11:39 5 -## 6 Registration 231 r1 231 start 2017-08-13 19:50:42 6 -## 7 Registration 328 r1 328 start 2017-11-12 04:23:27 7 -## 8 Registration 434 r1 434 start 2018-02-19 02:53:00 8 -## 9 Registration 462 r1 462 start 2018-03-20 07:37:11 9 -## 10 Registration 497 r1 497 start 2018-04-30 09:42:11 10 -## # … with 98 more rows, and abbreviated variable name ¹​registration_type
+## # A tibble: 110 × 7 +## handling patient employee handling_id registration_type time +## <fct> <chr> <fct> <chr> <fct> <dttm> +## 1 Registrat… 83 r1 83 start 2017-04-01 22:15:15 +## 2 Registrat… 124 r1 124 start 2017-05-03 12:50:34 +## 3 Registrat… 149 r1 149 start 2017-05-26 15:01:49 +## 4 Registrat… 206 r1 206 start 2017-07-19 15:48:14 +## 5 Registrat… 239 r1 239 start 2017-08-20 03:17:18 +## 6 Registrat… 257 r1 257 start 2017-09-12 23:14:23 +## 7 Registrat… 295 r1 295 start 2017-10-14 00:21:58 +## 8 Registrat… 298 r1 298 start 2017-10-15 18:31:02 +## 9 Registrat… 430 r1 430 start 2018-02-17 15:44:17 +## 10 Registrat… 434 r1 434 start 2018-02-19 02:53:00 +## # ℹ 100 more rows +## # ℹ 1 more variable: .order <int>

Note that this function can also be used with a sample size bigger than the number of cases in the event log, if you allow for the replacements of drawn cases.

diff --git a/index.html b/index.html index c6a9f45..e9e5c6c 100644 --- a/index.html +++ b/index.html @@ -13,21 +13,22 @@ bupaR Docs - + - - - + + + - - + + +
-
-
-
-
+
+
Create
-
+ +
-
-
-
-
+
+
Manipulate
-
+ +
-
-
-
-
+
+
Analyze
-
+ +
-
-
-
-
+
+
Visualize
-
+ +
-
-
-
-
+
+
Predict
-
+ -
+
diff --git a/inspect_logs.html b/inspect_logs.html index 80d9eaf..66920e4 100644 --- a/inspect_logs.html +++ b/inspect_logs.html @@ -13,15 +13,15 @@ bupaR Docs | Inspect log - + - - - - + + + + @@ -741,21 +741,21 @@

Activities

Cases

patients %>% cases()
## # A tibble: 500 × 10
-##    patient trace…¹ numbe…² start_timestamp     complete_timestamp  trace trace…³
-##    <chr>     <int>   <int> <dttm>              <dttm>              <chr>   <dbl>
-##  1 1             6       6 2017-01-02 11:41:53 2017-01-09 19:45:45 Regi…       4
-##  2 10            5       5 2017-01-06 05:58:54 2017-01-10 15:41:59 Regi…       7
-##  3 100           5       5 2017-04-11 16:34:31 2017-04-22 09:58:07 Regi…       7
-##  4 101           5       5 2017-04-16 06:38:58 2017-04-23 02:55:23 Regi…       7
-##  5 102           5       5 2017-04-16 06:38:58 2017-04-22 10:50:04 Regi…       7
-##  6 103           6       6 2017-04-19 20:22:01 2017-04-23 02:36:55 Regi…       4
-##  7 104           6       6 2017-04-19 20:22:01 2017-04-23 02:07:20 Regi…       4
-##  8 105           6       6 2017-04-21 02:19:09 2017-04-27 01:09:05 Regi…       4
-##  9 106           6       6 2017-04-21 02:19:09 2017-05-01 09:54:39 Regi…       4
-## 10 107           5       5 2017-04-22 18:32:16 2017-04-27 02:45:57 Regi…       7
-## # … with 490 more rows, 3 more variables: duration <drtn>,
-## #   first_activity <fct>, last_activity <fct>, and abbreviated variable names
-## #   ¹​trace_length, ²​number_of_activities, ³​trace_id
+## patient trace_length number_of_activities start_timestamp +## <chr> <int> <int> <dttm> +## 1 1 6 6 2017-01-02 11:41:53 +## 2 10 5 5 2017-01-06 05:58:54 +## 3 100 5 5 2017-04-11 16:34:31 +## 4 101 5 5 2017-04-16 06:38:58 +## 5 102 5 5 2017-04-16 06:38:58 +## 6 103 6 6 2017-04-19 20:22:01 +## 7 104 6 6 2017-04-19 20:22:01 +## 8 105 6 6 2017-04-21 02:19:09 +## 9 106 6 6 2017-04-21 02:19:09 +## 10 107 5 5 2017-04-22 18:32:16 +## # ℹ 490 more rows +## # ℹ 6 more variables: complete_timestamp <dttm>, trace <chr>, trace_id <dbl>, +## # duration <drtn>, first_activity <fct>, last_activity <fct>

Resources

@@ -775,16 +775,15 @@

Resources

Traces

patients %>% traces()
## # A tibble: 7 × 3
-##   trace                                                          absol…¹ relat…²
-##   <chr>                                                            <int>   <dbl>
-## 1 Registration,Triage and Assessment,X-Ray,Discuss Results,Chec…     258   0.516
-## 2 Registration,Triage and Assessment,Blood test,MRI SCAN,Discus…     234   0.468
-## 3 Registration,Triage and Assessment,Blood test,MRI SCAN,Discus…       2   0.004
-## 4 Registration,Triage and Assessment,X-Ray                             2   0.004
-## 5 Registration,Triage and Assessment                                   2   0.004
-## 6 Registration,Triage and Assessment,X-Ray,Discuss Results             1   0.002
-## 7 Registration,Triage and Assessment,Blood test                        1   0.002
-## # … with abbreviated variable names ¹​absolute_frequency, ²​relative_frequency
+## trace absolute_frequency relative_frequency +## <chr> <int> <dbl> +## 1 Registration,Triage and Assessment,X-Ra… 258 0.516 +## 2 Registration,Triage and Assessment,Bloo… 234 0.468 +## 3 Registration,Triage and Assessment,Bloo… 2 0.004 +## 4 Registration,Triage and Assessment,X-Ray 2 0.004 +## 5 Registration,Triage and Assessment 2 0.004 +## 6 Registration,Triage and Assessment,X-Ra… 1 0.002 +## 7 Registration,Triage and Assessment,Bloo… 1 0.002
diff --git a/install.html b/install.html index 80047af..b1955f5 100644 --- a/install.html +++ b/install.html @@ -13,15 +13,15 @@ Install bupaR - + - - - - + + + + diff --git a/manipulate.html b/manipulate.html index 150b815..4331130 100644 --- a/manipulate.html +++ b/manipulate.html @@ -13,17 +13,18 @@ Manipulate process data - + - - - + + + - - + + +
-
-
-
-
+
+
Enrich
-
+
-
+ +
-
-
-
-
+
+
Aggregate
-
+
-
+
diff --git a/multi_dimensional_analysis.html b/multi_dimensional_analysis.html index c87e368..ca8dbb7 100644 --- a/multi_dimensional_analysis.html +++ b/multi_dimensional_analysis.html @@ -13,14 +13,14 @@ bupaR Docs | Multi-dimensional analysis - + - - - + + + + - - - - + + + + @@ -691,25 +691,25 @@

Calculating variables

## Lifecycle transition: lifecycle ## ## # A tibble: 15,214 × 35 -## case_id activity lifec…¹ resou…² timestamp age crp diagn…³ -## <chr> <fct> <fct> <fct> <dttm> <dbl> <dbl> <chr> -## 1 A ER Registrat… comple… A 2014-10-22 11:15:41 85 NA A -## 2 A Leucocytes comple… B 2014-10-22 11:27:00 NA NA <NA> -## 3 A CRP comple… B 2014-10-22 11:27:00 NA 210 <NA> -## 4 A LacticAcid comple… B 2014-10-22 11:27:00 NA NA <NA> -## 5 A ER Triage comple… C 2014-10-22 11:33:37 NA NA <NA> -## 6 A ER Sepsis Tr… comple… A 2014-10-22 11:34:00 NA NA <NA> -## 7 A IV Liquid comple… A 2014-10-22 14:03:47 NA NA <NA> -## 8 A IV Antibioti… comple… A 2014-10-22 14:03:47 NA NA <NA> -## 9 A Admission NC comple… D 2014-10-22 14:13:19 NA NA <NA> -## 10 A CRP comple… B 2014-10-24 09:00:00 NA 1090 <NA> -## # … with 15,204 more rows, 27 more variables: diagnosticartastrup <lgl>, -## # diagnosticblood <lgl>, diagnosticecg <lgl>, diagnosticic <lgl>, -## # diagnosticlacticacid <lgl>, diagnosticliquor <lgl>, diagnosticother <lgl>, -## # diagnosticsputum <lgl>, diagnosticurinaryculture <lgl>, -## # diagnosticurinarysediment <lgl>, diagnosticxthorax <lgl>, disfuncorg <lgl>, -## # hypotensie <lgl>, hypoxie <lgl>, infectionsuspected <lgl>, infusion <lgl>, -## # lacticacid <dbl>, leucocytes <chr>, oligurie <lgl>, … +## case_id activity lifecycle resource timestamp age crp diagnose +## <chr> <fct> <fct> <fct> <dttm> <dbl> <dbl> <chr> +## 1 A ER Regis… complete A 2014-10-22 11:15:41 85 NA A +## 2 A Leucocyt… complete B 2014-10-22 11:27:00 NA NA <NA> +## 3 A CRP complete B 2014-10-22 11:27:00 NA 210 <NA> +## 4 A LacticAc… complete B 2014-10-22 11:27:00 NA NA <NA> +## 5 A ER Triage complete C 2014-10-22 11:33:37 NA NA <NA> +## 6 A ER Sepsi… complete A 2014-10-22 11:34:00 NA NA <NA> +## 7 A IV Liquid complete A 2014-10-22 14:03:47 NA NA <NA> +## 8 A IV Antib… complete A 2014-10-22 14:03:47 NA NA <NA> +## 9 A Admissio… complete D 2014-10-22 14:13:19 NA NA <NA> +## 10 A CRP complete B 2014-10-24 09:00:00 NA 1090 <NA> +## # ℹ 15,204 more rows +## # ℹ 27 more variables: diagnosticartastrup <lgl>, diagnosticblood <lgl>, +## # diagnosticecg <lgl>, diagnosticic <lgl>, diagnosticlacticacid <lgl>, +## # diagnosticliquor <lgl>, diagnosticother <lgl>, diagnosticsputum <lgl>, +## # diagnosticurinaryculture <lgl>, diagnosticurinarysediment <lgl>, +## # diagnosticxthorax <lgl>, disfuncorg <lgl>, hypotensie <lgl>, hypoxie <lgl>, +## # infectionsuspected <lgl>, infusion <lgl>, lacticacid <dbl>, …

Before continuing to further analyses, not that you might want to ungroup the log using ungroup_eventlog(). More on grouping.

diff --git a/organisational_analysis.html b/organisational_analysis.html index 20e372c..ef1d4fb 100644 --- a/organisational_analysis.html +++ b/organisational_analysis.html @@ -13,22 +13,22 @@ Organisational Analysis - + - - - - + + + + - + - + +
patients %>%
+    resource_map()
+
+

Resource precedence matrix

A more compact representation of hand-over-of-work is given by the resource_matrix function, which works the same as the -precedence matrix functions.

-
patients %>%
-    resource_matrix() %>%
-    plot()
-

+process matrix functions.

+
patients %>%
+    resource_matrix() %>%
+    plot()
+

+

diff --git a/organisational_analysis_files/figure-html/unnamed-chunk-7-1.png b/organisational_analysis_files/figure-html/unnamed-chunk-8-1.png similarity index 100% rename from organisational_analysis_files/figure-html/unnamed-chunk-7-1.png rename to organisational_analysis_files/figure-html/unnamed-chunk-8-1.png diff --git a/performance_analysis.html b/performance_analysis.html index 9a4d983..5b1453c 100644 --- a/performance_analysis.html +++ b/performance_analysis.html @@ -13,15 +13,15 @@ Performance Analysis - + - - - - + + + + @@ -647,20 +647,10 @@

Performance Analysis

-

The metrics for exploring and describing event data which are -available are based on literature in the field of operational excellence -and are organized in the following (sub)categories

-
    -
  • Time perspective
  • -
  • Organizational perspective
  • -
  • Structuredness perspective -
      -
    • Variance
    • -
    • Rework
    • -
  • -
-
-

Time perspective

+

+
+
+

Performance analysis

Three different time metrics can be computed: