s<-tibble::tribble(
~FACILITY, ~DEPARTMENT, ~PROVIDER_ID, ~APPOINTMENT_DATE, ~APPOINTMENT_TIME, ~PATIENT_ID, ~APPOINTMENT_TYPE, ~BOOKING_DATE, ~BOOKING_TIME, ~SHOW_CODE, ~CHECKIN_DATE, ~CHECKIN_TIME,
"SCH", "MED", 67350046, "4/12/2009", "17:30:00", 12210741, "Telephone Visit", "4/12/2009", "15:05:00", "Y", "4/12/2009", "17:30:00",
"SCH", "MED", 67350046, "4/12/2009", "17:40:00", 5491175, "Telephone Visit", "4/12/2009", "16:15:00", "Y", "4/12/2009", "17:40:00",
"SCH", "MED", 67350046, "4/12/2009", "17:50:00", 15740599, "Telephone Visit", "4/12/2009", "16:43:00", "Y", "4/12/2009", "17:50:00",
"SCH", "MED", 67350046, "4/12/2009", "18:00:00", 80420422, "Telephone Visit", "4/12/2009", "16:53:00", "Y", "4/12/2009", "18:00:00",
"SCH", "MED", 67350046, "4/12/2009", "18:10:00", 86030202, "Telephone Visit", "4/12/2009", "16:57:00", "Y", "4/12/2009", "18:10:00",
"SCH", "MED", 67350046, "4/12/2009", "18:20:00", 68651098, "Telephone Visit", "4/12/2009", "17:14:00", "Y", "4/12/2009", "18:20:00",
"SCH", "MED", 67350046, "4/12/2009", "18:30:00", 91221095, "Telephone Visit", "4/12/2009", "17:01:00", "Y", "4/12/2009", "18:30:00",
"SCH", "MED", 67350046, "4/12/2009", "18:50:00", 45771319, "Telephone Visit", "4/12/2009", "17:16:00", "Y", "4/12/2009", "18:50:00",
"SCH", "MED", 67350046, "4/12/2009", "19:00:00", 63531063, "Telephone Visit", "4/12/2009", "17:25:00", "Y", "4/12/2009", "19:00:00",
"SCH", "MED", 67350046, "4/12/2009", "19:10:00", 96011310, "Telephone Visit", "4/12/2009", "17:47:00", "Y", "4/12/2009", "19:10:00",
"SCH", "MED", 67350046, "4/12/2009", "19:20:00", 1071301, "Telephone Visit", "4/12/2009", "17:54:00", "Y", "4/12/2009", "19:20:00",
"SCH", "MED", 67350046, "4/12/2009", "19:30:00", 28841329, "Telephone Visit", "4/12/2009", "18:21:00", "Y", "4/12/2009", "19:30:00",
"SCH", "MED", 67350046, "4/12/2009", "19:40:00", 95001285, "Telephone Visit", "4/12/2009", "18:40:00", "Y", "4/12/2009", "19:40:00",
"SCH", "MED", 67350046, "8/12/2009", "17:30:00", 43170522, "Telephone Visit", "8/12/2009", "15:12:00", "Y", "8/12/2009", "17:30:00",
"SCH", "MED", 67350046, "8/12/2009", "17:40:00", 85241162, "Telephone Visit", "8/12/2009", "17:38:00", "Y", "8/12/2009", "17:47:00",
"SCH", "MED", 67350046, "8/12/2009", "18:00:00", 3340506, "Telephone Visit", "8/12/2009", "17:58:00", "Y", "8/12/2009", "18:00:00",
"SCH", "MED", 67350046, "8/12/2009", "18:20:00", 76670349, "Telephone Visit", "8/12/2009", "17:49:00", "Y", "8/12/2009", "18:20:00",
"SCH", "MED", 67350046, "8/12/2009", "18:30:00", 62731301, "Telephone Visit", "8/12/2009", "17:56:00", "Y", "8/12/2009", "18:30:00",
"SCH", "MED", 67350046, "8/12/2009", "19:00:00", 3731365, "Telephone Visit", "8/12/2009", "18:07:00", "Y", "8/12/2009", "19:00:00",
"SCH", "MED", 67350046, "8/12/2009", "19:10:00", 97390513, "Telephone Visit", "8/12/2009", "18:56:00", "Y", "8/12/2009", "19:10:00",
"SCH", "MED", 67350046, "31-12-2009", "17:30:00", 63181235, "Telephone Visit", "31-12-2009", "15:19:00", "Y", "31-12-2009", "17:30:00",
"SCH", "MED", 67350046, "31-12-2009", "17:40:00", 69411106, "Telephone Visit", "31-12-2009", "16:38:00", "Y", "31-12-2009", "17:40:00",
"SCH", "MED", 67350046, "31-12-2009", "17:50:00", 45160188, "Telephone Visit", "31-12-2009", "16:54:00", "Y", "31-12-2009", "17:50:00",
"SCH", "MED", 67350046, "31-12-2009", "18:00:00", 91450306, "Telephone Visit", "31-12-2009", "16:53:00", "Y", "31-12-2009", "18:00:00",
"SCH", "MED", 67350046, "31-12-2009", "18:10:00", 5050502, "Telephone Visit", "31-12-2009", "17:09:00", "Y", "31-12-2009", "18:10:00",
"SCH", "MED", 67350046, "31-12-2009", "18:20:00", 75900475, "Telephone Visit", "31-12-2009", "17:19:00", "Y", "31-12-2009", "18:20:00",
"SCH", "MED", 67350046, "31-12-2009", "18:30:00", 20340517, "Telephone Visit", "31-12-2009", "17:32:00", "Y", "31-12-2009", "18:30:00",
"SCH", "MED", 67350046, "31-12-2009", "18:50:00", 9370441, "Telephone Visit", "31-12-2009", "17:57:00", "Y", "31-12-2009", "18:50:00",
"SCH", "MED", 67350046, "31-12-2009", "19:00:00", 91431322, "Telephone Visit", "31-12-2009", "17:58:00", "Y", "31-12-2009", "19:00:00",
"SCH", "MED", 67350046, "31-12-2009", "19:10:00", 83251369, "Telephone Visit", "31-12-2009", "18:42:00", "Y", "31-12-2009", "19:10:00",
"SCH", "MED", 67350046, "31-12-2009", "19:30:00", 82490338, "Telephone Visit", "31-12-2009", "16:12:00", "Y", "31-12-2009", "19:30:00",
"SCH", "MED", 67350046, "31-12-2009", "19:40:00", 90960652, "Telephone Visit", "31-12-2009", "19:00:00", "Y", "31-12-2009", "19:40:00",
"SCH", "MED", 67350046, "8/1/2010", "17:30:00", 54330589, "Telephone Visit", "8/1/2010", "16:41:00", "P", NA, NA,
"SCH", "MED", 67350046, "8/1/2010", "17:40:00", 65701082, "Telephone Visit", "8/1/2010", "16:37:00", "P", NA, NA,
"SCH", "MED", 67350046, "8/1/2010", "17:50:00", 97241181, "Telephone Visit", "8/1/2010", "16:49:00", "P", NA, NA,
"SCH", "MED", 67350046, "8/1/2010", "18:00:00", 51920445, "Telephone Visit", "8/1/2010", "16:46:00", "P", NA, NA,
"SCH", "MED", 67350046, "8/1/2010", "18:10:00", 91940202, "Telephone Visit", "8/1/2010", "17:00:00", "P", NA, NA,
"SCH", "MED", 67350046, "8/1/2010", "18:20:00", 54330589, "Telephone Visit", "8/1/2010", "17:07:00", "P", NA, NA,
"SCH", "MED", 67350046, "8/1/2010", "18:30:00", 60380961, "Telephone Visit", "8/1/2010", "17:07:00", "P", NA, NA,
"SCH", "MED", 67350046, "8/1/2010", "18:50:00", 7230637, "Telephone Visit", "8/1/2010", "17:16:00", "P", NA, NA,
"SCH", "MED", 67350046, "8/1/2010", "19:00:00", 370185, "Telephone Visit", "8/1/2010", "17:39:00", "P", NA, NA,
"SCH", "MED", 67350046, "8/1/2010", "19:10:00", 91401298, "Telephone Visit", "8/1/2010", "17:45:00", "P", NA, NA,
"SCH", "MED", 67350046, "8/1/2010", "19:20:00", 98480513, "Telephone Visit", "8/1/2010", "18:02:00", "P", NA, NA,
"SCH", "MED", 67350046, "8/1/2010", "19:30:00", 39531029, "Telephone Visit", "8/1/2010", "18:05:00", "P", NA, NA,
"SCH", "MED", 67350046, "8/1/2010", "19:40:00", 20691046, "Telephone Visit", "8/1/2010", "18:12:00", "P", NA, NA,
"SCH", "MED", 67350046, "10/1/2010", "19:00:00", 39280227, "Telephone Visit", "10/1/2010", "16:20:00", "N", NA, NA,
"SCH", "MED", 67350046, "10/1/2010", "19:10:00", 32030482, "Telephone Visit", "10/1/2010", "16:38:00", "N", NA, NA,
"SCH", "MED", 67350046, "10/1/2010", "19:20:00", 37071301, "Telephone Visit", "10/1/2010", "18:17:00", "N", NA, NA,
"SCH", "MED", 67350046, "10/1/2010", "19:45:00", 87420744, "In-Person Visit", "10/1/2010", "19:11:00", "Y", "10/1/2010", "19:35:00",
"SCH", "MED", 67350046, "14-01-2010", "17:30:00", 71870098, "Telephone Visit", "14-01-2010", "16:23:00", "Y", "14-01-2010", "17:30:00",
"SCH", "MED", 67350046, "14-01-2010", "17:40:00", 82130578, "Telephone Visit", "14-01-2010", "17:07:00", "Y", "14-01-2010", "17:40:00",
"SCH", "MED", 67350046, "14-01-2010", "17:50:00", 40570786, "Telephone Visit", "14-01-2010", "17:10:00", "Y", "14-01-2010", "17:50:00",
"SCH", "MED", 67350046, "14-01-2010", "18:00:00", 86170552, "Telephone Visit", "14-01-2010", "16:42:00", "Y", "14-01-2010", "18:00:00",
"SCH", "MED", 67350046, "14-01-2010", "18:10:00", 65150619, "Telephone Visit", "14-01-2010", "17:19:00", "Y", "14-01-2010", "18:10:00",
"SCH", "MED", 67350046, "14-01-2010", "18:20:00", 11851156, "Telephone Visit", "14-01-2010", "17:59:00", "Y", "14-01-2010", "18:20:00",
"SCH", "MED", 67350046, "14-01-2010", "18:30:00", 13911370, "Telephone Visit", "14-01-2010", "17:43:00", "Y", "14-01-2010", "18:30:00",
"SCH", "MED", 67350046, "14-01-2010", "18:50:00", 86680304, "Telephone Visit", "14-01-2010", "18:06:00", "Y", "14-01-2010", "18:50:00",
"SCH", "MED", 67350046, "14-01-2010", "19:00:00", 69110801, "Telephone Visit", "14-01-2010", "17:49:00", "Y", "14-01-2010", "19:00:00",
"SCH", "MED", 67350046, "14-01-2010", "19:10:00", 72930309, "Telephone Visit", "14-01-2010", "18:21:00", "Y", "14-01-2010", "19:10:00",
"SCH", "MED", 67350046, "14-01-2010", "19:20:00", 76391368, "Telephone Visit", "14-01-2010", "18:09:00", "Y", "14-01-2010", "19:20:00",
"SCH", "MED", 67350046, "14-01-2010", "19:30:00", 38580322, "Telephone Visit", "14-01-2010", "18:44:00", "Y", "14-01-2010", "19:30:00",
"SCH", "MED", 67350046, "14-01-2010", "19:40:00", 31730200, "Telephone Visit", "14-01-2010", "19:02:00", "Y", "14-01-2010", "19:40:00",
"SCH", "MED", 67350046, "9/2/2010", "17:30:00", 50050591, "Telephone Visit", "9/2/2010", "16:34:00", "Y", "9/2/2010", "17:30:00",
"SCH", "MED", 67350046, "9/2/2010", "17:40:00", 50150350, "Telephone Visit", "9/2/2010", "16:57:00", "Y", "9/2/2010", "17:40:00",
"SCH", "MED", 67350046, "9/2/2010", "17:50:00", 88160881, "Telephone Visit", "9/2/2010", "17:14:00", "Y", "9/2/2010", "17:50:00",
"SCH", "MED", 67350046, "9/2/2010", "18:00:00", 94240791, "Telephone Visit", "9/2/2010", "17:21:00", "Y", "9/2/2010", "18:00:00",
"SCH", "MED", 67350046, "9/2/2010", "18:20:00", 48631025, "Telephone Visit", "9/2/2010", "17:36:00", "Y", "9/2/2010", "18:20:00",
"SCH", "MED", 67350046, "9/2/2010", "18:30:00", 52131015, "Telephone Visit", "9/2/2010", "17:31:00", "Y", "9/2/2010", "18:30:00",
"SCH", "MED", 67350046, "9/2/2010", "18:40:00", 72090679, "Telephone Visit", "9/2/2010", "17:42:00", "Y", "9/2/2010", "18:40:00",
"SCH", "MED", 67350046, "9/2/2010", "18:50:00", 75271274, "Telephone Visit", "9/2/2010", "17:51:00", "Y", "9/2/2010", "18:50:00",
"SCH", "MED", 67350046, "9/2/2010", "19:00:00", 13020455, "Telephone Visit", "9/2/2010", "18:18:00", "Y", "9/2/2010", "19:00:00",
"SCH", "MED", 67350046, "9/2/2010", "19:10:00", 4520787, "Telephone Visit", "9/2/2010", "18:49:00", "Y", "9/2/2010", "19:10:00",
"SCH", "MED", 67350046, "27-02-2010", "18:15:00", 80620711, "In-Person Visit", "27-02-2010", "16:10:00", "Y", "27-02-2010", "18:15:00",
"SCH", "MED", 67350046, "27-02-2010", "18:40:00", 45981296, "Telephone Visit", "27-02-2010", "15:21:00", "Y", "27-02-2010", "18:40:00",
"SCH", "MED", 67350046, "27-02-2010", "18:50:00", 99371106, "Telephone Visit", "27-02-2010", "15:54:00", "Y", "27-02-2010", "18:50:00",
"SCH", "MED", 67350046, "27-02-2010", "19:15:00", 71101068, "In-Person Visit", "27-02-2010", "16:12:00", "Y", "27-02-2010", "19:12:00",
"SCH", "MED", 67350046, "27-02-2010", "19:30:00", 50611359, "Telephone Visit", "27-02-2010", "16:08:00", "Y", "27-02-2010", "19:30:00",
"SCH", "MED", 67350046, "27-02-2010", "19:40:00", 81150308, "Telephone Visit", "27-02-2010", "16:17:00", "Y", "27-02-2010", "19:40:00",
"SCH", "MED", 67350046, "27-02-2010", "19:50:00", 54571329, "Telephone Visit", "27-02-2010", "16:24:00", "Y", "27-02-2010", "19:50:00",
"SCH", "MED", 67350046, "27-02-2010", "20:15:00", 72661327, "In-Person Visit", "27-02-2010", "16:45:00", "Y", "27-02-2010", "20:06:00",
"SCH", "MED", 67350046, "27-02-2010", "20:30:00", 45610365, "In-Person Visit", "27-02-2010", "16:46:00", "Y", "27-02-2010", "20:13:00",
"SCH", "MED", 67350046, "14-03-2010", "9:00:00", 1581300, "Telephone Visit", "13-03-2010", "20:06:00", "Y", "14-03-2010", "9:00:00",
"SCH", "MED", 67350046, "14-03-2010", "9:10:00", 39561301, "Telephone Visit", "13-03-2010", "20:50:00", "Y", "14-03-2010", "9:10:00",
"SCH", "MED", 67350046, "14-03-2010", "9:20:00", 45681028, "Telephone Visit", "13-03-2010", "21:39:00", "Y", "14-03-2010", "9:20:00",
"SCH", "MED", 67350046, "14-03-2010", "9:30:00", 5770570, "Telephone Visit", "13-03-2010", "22:00:00", "Y", "14-03-2010", "9:30:00",
"SCH", "MED", 67350046, "14-03-2010", "9:40:00", 62970903, "Telephone Visit", "14-03-2010", "7:42:00", "Y", "14-03-2010", "9:40:00",
"SCH", "MED", 67350046, "14-03-2010", "9:50:00", 3110251, "Telephone Visit", "14-03-2010", "8:26:00", "Y", "14-03-2010", "10:01:00",
"SCH", "MED", 67350046, "14-03-2010", "10:10:00", 11260298, "Telephone Visit", "13-03-2010", "20:39:00", "Y", "14-03-2010", "10:10:00",
"SCH", "MED", 67350046, "14-03-2010", "10:20:00", 39471067, "Telephone Visit", "14-03-2010", "8:57:00", "Y", "14-03-2010", "10:20:00",
"SCH", "MED", 67350046, "14-03-2010", "10:30:00", 58660262, "Telephone Visit", "13-03-2010", "20:46:00", "Y", "14-03-2010", "10:30:00",
"SCH", "MED", 67350046, "14-03-2010", "10:40:00", 46581239, "Telephone Visit", "14-03-2010", "9:41:00", "Y", "14-03-2010", "10:40:00",
"SCH", "MED", 67350046, "14-03-2010", "10:50:00", 400877, "Telephone Visit", "14-03-2010", "9:49:00", "Y", "14-03-2010", "10:50:00",
"SCH", "MED", 67350046, "14-03-2010", "11:00:00", 36661178, "Telephone Visit", "14-03-2010", "9:59:00", "Y", "14-03-2010", "11:00:00",
"SCH", "MED", 67350046, "14-03-2010", "11:20:00", 60820165, "Telephone Visit", "14-03-2010", "10:17:00", "Y", "14-03-2010", "11:25:00",
"SCH", "MED", 67350046, "14-03-2010", "11:30:00", 51011175, "Telephone Visit", "14-03-2010", "10:33:00", "Y", "14-03-2010", "11:30:00",
"SCH", "MED", 67350046, "14-03-2010", "11:40:00", 79631370, "Telephone Visit", "14-03-2010", "10:39:00", "Y", "14-03-2010", "11:40:00",
"SCH", "MED", 67350046, "14-03-2010", "11:50:00", 6001242, "Telephone Visit", "14-03-2010", "10:58:00", "Y", "14-03-2010", "11:50:00",
"SCH", "MED", 67350046, "14-03-2010", "12:00:00", 12970773, "Telephone Visit", "14-03-2010", "11:12:00", "Y", "14-03-2010", "12:00:00",
"SCH", "MED", 67350046, "14-03-2010", "12:10:00", 20090865, "Telephone Visit", "14-03-2010", "11:13:00", "Y", "14-03-2010", "12:10:00",
"SCH", "MED", 67350046, "14-03-2010", "13:30:00", 4190798, "In-Person Visit", "14-03-2010", "10:10:00", "Y", "14-03-2010", "13:23:00",
"SCH", "MED", 67350046, "14-03-2010", "13:45:00", 70420937, "In-Person Visit", "14-03-2010", "10:38:00", "Y", "14-03-2010", "13:15:00",
"SCH", "MED", 67350046, "14-03-2010", "14:00:00", 94661283, "In-Person Visit", "14-03-2010", "11:00:00", "Y", "14-03-2010", "13:50:00",
"SCH", "MED", 67350046, "14-03-2010", "14:15:00", 91820845, "In-Person Visit", "14-03-2010", "11:20:00", "Y", "14-03-2010", "14:22:00",
"SCH", "MED", 67350046, "14-03-2010", "14:45:00", 33640992, "In-Person Visit", "14-03-2010", "11:58:00", "Y", "14-03-2010", "14:41:00",
"SCH", "MED", 67350046, "14-03-2010", "15:00:00", 99420809, "In-Person Visit", "14-03-2010", "14:05:00", "Y", "14-03-2010", "14:58:00",
"SCH", "MED", 67350046, "14-03-2010", "15:15:00", 76811285, "In-Person Visit", "14-03-2010", "13:14:00", "Y", "14-03-2010", "15:12:00",
"SCH", "MED", 67350046, "14-03-2010", "15:30:00", 70620487, "In-Person Visit", "14-03-2010", "13:47:00", "Y", "14-03-2010", "15:52:00",
"SCH", "MED", 67350046, "14-03-2010", "16:00:00", 77080452, "In-Person Visit", "14-03-2010", "13:25:00", "Y", "14-03-2010", "16:01:00",
"SCH", "MED", 67350046, "14-03-2010", "16:15:00", 59640859, "In-Person Visit", "14-03-2010", "15:16:00", "Y", "14-03-2010", "16:13:00",
"SCH", "MED", 67350046, "14-03-2010", "16:30:00", 53681327, "In-Person Visit", "14-03-2010", "14:27:00", "Y", "14-03-2010", "16:30:00",
"SCH", "MED", 67350046, "14-03-2010", "16:45:00", 66020217, "In-Person Visit", "14-03-2010", "16:13:00", "Y", "14-03-2010", "16:18:00",
"SCH", "MED", 67350046, "18-04-2010", "9:00:00", 48950239, "Telephone Visit", "17-04-2010", "19:02:00", "Y", "18-04-2010", "9:00:00",
"SCH", "MED", 67350046, "18-04-2010", "9:10:00", 55720597, "Telephone Visit", "17-04-2010", "19:02:00", "Y", "18-04-2010", "9:10:00",
"SCH", "MED", 67350046, "18-04-2010", "9:20:00", 63270206, "Telephone Visit", "17-04-2010", "20:18:00", "Y", "18-04-2010", "9:20:00",
"SCH", "MED", 67350046, "18-04-2010", "9:30:00", 34350507, "Telephone Visit", "17-04-2010", "20:24:00", "Y", "18-04-2010", "9:30:00",
"SCH", "MED", 67350046, "18-04-2010", "9:40:00", 85410790, "Telephone Visit", "17-04-2010", "21:25:00", "Y", "18-04-2010", "9:40:00",
"SCH", "MED", 67350046, "18-04-2010", "9:50:00", 58760397, "Telephone Visit", "17-04-2010", "23:00:00", "Y", "18-04-2010", "9:50:00",
"SCH", "MED", 67350046, "18-04-2010", "10:10:00", 17091324, "Telephone Visit", "17-04-2010", "23:55:00", "Y", "18-04-2010", "10:10:00",
"SCH", "MED", 67350046, "18-04-2010", "10:20:00", 27551239, "Telephone Visit", "18-04-2010", "7:24:00", "Y", "18-04-2010", "10:20:00",
"SCH", "MED", 67350046, "18-04-2010", "10:30:00", 44910588, "Telephone Visit", "18-04-2010", "7:50:00", "Y", "18-04-2010", "10:30:00",
"SCH", "MED", 67350046, "18-04-2010", "10:40:00", 84710811, "Telephone Visit", "18-04-2010", "8:21:00", "Y", "18-04-2010", "10:40:00",
"SCH", "MED", 67350046, "18-04-2010", "10:50:00", 2031008, "Telephone Visit", "18-04-2010", "8:25:00", "Y", "18-04-2010", "10:50:00",
"SCH", "MED", 67350046, "18-04-2010", "11:00:00", 57051304, "Telephone Visit", "18-04-2010", "8:30:00", "Y", "18-04-2010", "11:00:00",
"SCH", "MED", 67350046, "18-04-2010", "11:20:00", 80430721, "Telephone Visit", "18-04-2010", "8:52:00", "Y", "18-04-2010", "11:20:00",
"SCH", "MED", 67350046, "18-04-2010", "11:30:00", 35181170, "Telephone Visit", "18-04-2010", "9:00:00", "Y", "18-04-2010", "11:30:00",
"SCH", "MED", 67350046, "18-04-2010", "11:40:00", 23941141, "Telephone Visit", "18-04-2010", "9:29:00", "Y", "18-04-2010", "11:40:00",
"SCH", "MED", 67350046, "18-04-2010", "11:50:00", 81780581, "Telephone Visit", "18-04-2010", "9:35:00", "Y", "18-04-2010", "11:50:00",
"SCH", "MED", 67350046, "18-04-2010", "12:00:00", 84921325, "Telephone Visit", "18-04-2010", "9:47:00", "Y", "18-04-2010", "12:00:00",
"SCH", "MED", 67350046, "18-04-2010", "12:10:00", 7840708, "Telephone Visit", "18-04-2010", "10:02:00", "Y", "18-04-2010", "12:10:00",
"SCH", "MED", 67350046, "18-04-2010", "13:30:00", 90890843, "Telephone Visit", "18-04-2010", "10:03:00", "Y", "18-04-2010", "13:30:00",
"SCH", "MED", 67350046, "18-04-2010", "13:40:00", 65520243, "Telephone Visit", "18-04-2010", "10:03:00", "Y", "18-04-2010", "13:40:00",
"SCH", "MED", 67350046, "18-04-2010", "13:50:00", 51631371, "Telephone Visit", "18-04-2010", "10:22:00", "Y", "18-04-2010", "13:50:00",
"SCH", "MED", 67350046, "18-04-2010", "14:00:00", 39541320, "Telephone Visit", "18-04-2010", "11:16:00", "Y", "18-04-2010", "14:00:00",
"SCH", "MED", 67350046, "18-04-2010", "14:10:00", 78741252, "Telephone Visit", "18-04-2010", "11:00:00", "Y", "18-04-2010", "14:10:00",
"SCH", "MED", 67350046, "18-04-2010", "14:20:00", 30201029, "Telephone Visit", "18-04-2010", "11:29:00", "Y", "18-04-2010", "14:20:00",
"SCH", "MED", 67350046, "18-04-2010", "14:40:00", 36581376, "Telephone Visit", "18-04-2010", "12:01:00", "Y", "18-04-2010", "14:40:00",
"SCH", "MED", 67350046, "18-04-2010", "14:50:00", 5630527, "Telephone Visit", "18-04-2010", "12:22:00", "Y", "18-04-2010", "14:50:00",
"SCH", "MED", 67350046, "18-04-2010", "15:00:00", 9030189, "Telephone Visit", "18-04-2010", "12:28:00", "Y", "18-04-2010", "15:00:00",
"SCH", "MED", 67350046, "18-04-2010", "15:10:00", 86610579, "Telephone Visit", "18-04-2010", "13:49:00", "Y", "18-04-2010", "15:10:00",
"SCH", "MED", 67350046, "18-04-2010", "15:20:00", 88050532, "Telephone Visit", "18-04-2010", "14:24:00", "Y", "18-04-2010", "15:20:00",
"SCH", "MED", 67350046, "18-04-2010", "15:30:00", 11900820, "Telephone Visit", "18-04-2010", "14:16:00", "Y", "18-04-2010", "15:30:00",
"SCH", "MED", 67350046, "18-04-2010", "16:20:00", 65560364, "Telephone Visit", "18-04-2010", "15:46:00", "Y", "18-04-2010", "16:00:00",
"SCH", "MED", 67350046, "18-04-2010", "17:10:00", 84680527, "Telephone Visit", "18-04-2010", "16:38:00", "Y", "18-04-2010", "17:10:00",
"SCH", "MED", 67350046, "7/5/2010", "17:30:00", 21130631, "Telephone Visit", "7/5/2010", "16:38:00", "Y", "7/5/2010", "17:30:00",
"SCH", "MED", 67350046, "7/5/2010", "17:40:00", 66380930, "Telephone Visit", "7/5/2010", "16:49:00", "Y", "7/5/2010", "17:40:00",
"SCH", "MED", 67350046, "7/5/2010", "17:50:00", 57270715, "Telephone Visit", "7/5/2010", "17:08:00", "Y", "7/5/2010", "17:50:00",
"SCH", "MED", 67350046, "7/5/2010", "18:00:00", 74590916, "Telephone Visit", "7/5/2010", "16:42:00", "Y", "7/5/2010", "18:00:00",
"SCH", "MED", 67350046, "7/5/2010", "18:10:00", 48591358, "Telephone Visit", "7/5/2010", "17:36:00", "Y", "7/5/2010", "18:10:00",
"SCH", "MED", 67350046, "7/5/2010", "18:20:00", 48380640, "Telephone Visit", "7/5/2010", "17:27:00", "Y", "7/5/2010", "18:20:00",
"SCH", "MED", 67350046, "7/5/2010", "18:30:00", 83630529, "Telephone Visit", "7/5/2010", "17:39:00", "Y", "7/5/2010", "18:30:00",
"SCH", "MED", 67350046, "7/5/2010", "18:50:00", 24990769, "Telephone Visit", "7/5/2010", "17:43:00", "N", NA, NA,
"SCH", "MED", 67350046, "7/5/2010", "19:00:00", 93730683, "Telephone Visit", "7/5/2010", "17:41:00", "Y", "7/5/2010", "19:00:00",
"SCH", "MED", 67350046, "7/5/2010", "19:10:00", 90720562, "Telephone Visit", "7/5/2010", "17:52:00", "Y", "7/5/2010", "19:10:00",
"SCH", "MED", 67350046, "7/5/2010", "19:20:00", 9130746, "Telephone Visit", "7/5/2010", "18:07:00", "Y", "7/5/2010", "19:20:00",
"SCH", "MED", 67350046, "7/5/2010", "19:30:00", 41390157, "Telephone Visit", "7/5/2010", "18:42:00", "Y", "7/5/2010", "19:30:00",
"SCH", "MED", 67350046, "7/5/2010", "19:40:00", 30790850, "Telephone Visit", "7/5/2010", "19:05:00", "N", NA, NA,
"SCH", "MED", 67350046, "14-05-2010", "17:30:00", 15100895, "Telephone Visit", "14-05-2010", "16:27:00", "Y", "14-05-2010", "17:30:00",
"SCH", "MED", 67350046, "14-05-2010", "17:40:00", 8820665, "Telephone Visit", "14-05-2010", "16:44:00", "Y", "14-05-2010", "17:40:00",
"SCH", "MED", 67350046, "14-05-2010", "17:50:00", 24480005, "Telephone Visit", "14-05-2010", "17:02:00", "Y", "14-05-2010", "17:50:00",
"SCH", "MED", 67350046, "14-05-2010", "18:00:00", 90990756, "Telephone Visit", "14-05-2010", "16:49:00", "Y", "14-05-2010", "18:00:00",
"SCH", "MED", 67350046, "14-05-2010", "18:10:00", 10490595, "Telephone Visit", "14-05-2010", "17:06:00", "Y", "14-05-2010", "18:10:00",
"SCH", "MED", 67350046, "14-05-2010", "18:20:00", 98521117, "Telephone Visit", "14-05-2010", "17:22:00", "Y", "14-05-2010", "18:20:00"
)
# data is now in dataframe s
#Let us convert dates from character to proper dates
library(tidyverse)
library(lubridate)
#>
#> Attaching package: 'lubridate'
#> The following object is masked from 'package:base':
#>
#> date
names(s)
#> [1] "FACILITY" "DEPARTMENT" "PROVIDER_ID"
#> [4] "APPOINTMENT_DATE" "APPOINTMENT_TIME" "PATIENT_ID"
#> [7] "APPOINTMENT_TYPE" "BOOKING_DATE" "BOOKING_TIME"
#> [10] "SHOW_CODE" "CHECKIN_DATE" "CHECKIN_TIME"
s %>% mutate(APPOINTMENT_DATE = mdy(APPOINTMENT_DATE)) %>%
mutate(BOOKING_DATE = mdy(BOOKING_DATE)) %>%
mutate(CHECKIN_DATE = mdy(CHECKIN_DATE)) %>%
## note that there is a problem with 102 dates failing to parse
## Let us look at these
table(s$APPOINTMENT_DATE)
#> Warning: 102 failed to parse.
#> Warning: 102 failed to parse.
#> Warning: 102 failed to parse.
#> Error: Must use a vector in `[`, not an object of class matrix.
## OK two different date formats. this is likely the problem. #
## Possibly fixable with a casewhen #
s %>%
mutate(BOOKING_DATE = case_when(
grepl("-", BOOKING_DATE) ~ dmy(BOOKING_DATE),
grepl("/", BOOKING_DATE) ~ mdy(BOOKING_DATE))) ->
s2
#> Warning: 102 failed to parse.
table(s2$BOOKING_DATE)
#>
#> 2009-04-12 2009-08-12 2009-12-31 2010-01-14 2010-02-27 2010-03-13
#> 13 7 12 13 9 6
#> 2010-03-14 2010-04-17 2010-04-18 2010-05-14 2010-07-05 2010-08-01
#> 24 7 25 6 13 13
#> 2010-09-02 2010-10-01
#> 10 4
## Now let us try to find the gap in days
## and see if we still get negative #s
s2 %>%
group_by(PROVIDER_ID) %>%
arrange(BOOKING_DATE) %>%
mutate(days_gap = BOOKING_DATE - lag(BOOKING_DATE)) %>%
select(PROVIDER_ID, BOOKING_DATE, days_gap) ->
s3
table(s3$days_gap)
#>
#> 0 1 14 26 27 29 32 34 44 52 122 141
#> 148 2 2 1 1 1 1 1 1 1 1 1
Created on 2019-02-24 by the reprex package (v0.2.1)strong text