@@ -43,6 +43,7 @@ pak::pak("andrewallenbruce/forager")
43
43
44
44
``` r
45
45
library(tidyverse )
46
+ library(clock )
46
47
library(ymd )
47
48
library(forager )
48
49
library(fuimus )
@@ -55,16 +56,16 @@ library(fuimus)
55
56
# > # A tibble: 15,000 × 10
56
57
# > claimid payer charges balance date_ser…¹ date_rel…² date_sub…³ date_acc…⁴
57
58
# > <chr> <fct> <dbl> <dbl> <date> <date> <date> <date>
58
- # > 1 00008 Oscar 420 . 420. 2024-05-26 2024-06-02 2024-06-05 2024-06-12
59
- # > 2 00108 Omaha 152. 152. 2024-05-26 2024-05-30 2024-06-02 2024-06-07
60
- # > 3 00299 Molina 26 . 26. 2024-05-26 2024-06-04 2024-06-10 2024-06-17
61
- # > 4 00390 Highmark 93 . 0 2024-05-26 2024-06-12 2024-06-17 2024-06-25
62
- # > 5 00415 Medicare 63. 0 2024-05-26 2024-05-31 2024-06-10 2024-06-16
63
- # > 6 00431 GuideWell 127 . 0 2024-05-26 2024-06-01 2024-06-01 2024-06-10
64
- # > 7 00445 Wellcare 4.3 4.3 2024-05-26 2024-06-02 2024-06-08 2024-06-12
65
- # > 8 00451 Cigna 120 . 0 2024-05-26 2024-05-28 2024-05-30 2024-06-05
66
- # > 9 00531 Lincoln … 224 . 0 2024-05-26 2024-05-31 2024-06-02 2024-06-07
67
- # > 10 00568 GuideWell 166 . 166. 2024-05-26 2024-06-09 2024-06-17 2024-06-26
59
+ # > 1 00008 Oscar 115 . 115. 2024-05-26 2024-06-04 2024-06-08 2024-06-14
60
+ # > 2 00343 American 284. 0 2024-05-26 2024-06-17 2024-06-19 2024-06-23
61
+ # > 3 00389 Wellcare 325 . 325. 2024-05-26 2024-06-11 2024-06-19 2024-06-28
62
+ # > 4 00473 Medicaid 35 . 35. 2024-05-26 2024-06-05 2024-06-08 2024-06-20
63
+ # > 5 00604 Humana 50. 50. 2024-05-26 2024-06-03 2024-06-10 2024-06-18
64
+ # > 6 01138 Omaha 107 . 0 2024-05-26 2024-06-07 2024-06-08 2024-06-15
65
+ # > 7 01161 CVS Aetna 27. 27. 2024-05-26 2024-06-01 2024-06-03 2024-06-08
66
+ # > 8 01216 Lincoln … 73 . 73. 2024-05-26 2024-05-26 2024-05-27 2024-06-07
67
+ # > 9 01262 Centene 97 . 0 2024-05-26 2024-05-27 2024-05-29 2024-05-31
68
+ # > 10 01284 Medicaid 43 . 43. 2024-05-26 2024-06-05 2024-06-10 2024-06-21
68
69
# > # ℹ 14,990 more rows
69
70
# > # ℹ abbreviated names: ¹date_service, ²date_release, ³date_submission,
70
71
# > # ⁴date_acceptance
@@ -78,16 +79,16 @@ library(fuimus)
78
79
# > # A tibble: 15,000 × 13
79
80
# > claimid payer charges balance date_service aging_bin dar days_rel…¹
80
81
# > <chr> <fct> <dbl> <dbl> <date> <fct> <dbl> <dbl>
81
- # > 1 00001 Medicaid 401. 0 2024-03-29 0-30 17 1
82
- # > 2 00002 New York Life 171. 0 2024-04-14 0-30 22 2
83
- # > 3 00003 Centene 60 . 60 . 2024-03-02 0-30 17 1
84
- # > 4 00004 Centene 183 . 183 . 2024-05-16 0-30 21 2
85
- # > 5 00005 Cigna 314. 0 2024-03-09 31-60 32 5
86
- # > 6 00006 UnitedHealth 50 . 0 2024-03-21 0-30 30 5
87
- # > 7 00007 Equitable 243 . 0 2024-04-06 0-30 24 5
88
- # > 8 00008 Oscar 420 . 420 . 2024-05-26 31-60 33 7
89
- # > 9 00009 Lincoln Nat'l 79. 79. 2024-04-10 31-60 38 10
90
- # > 10 00010 Medicaid 32 . 32 . 2024-04-30 31-60 35 13
82
+ # > 1 00001 Oscar 166. 166. 2024-05-17 0-30 11 0
83
+ # > 2 00002 Medicare 23. 23. 2024-04-03 0-30 20 2
84
+ # > 3 00003 UnitedHealth 212 . 212 . 2024-03-27 0-30 18 2
85
+ # > 4 00004 GuideWell 84 . 84 . 2024-05-13 31-60 34 6
86
+ # > 5 00005 Lincoln Nat'l 194. 194. 2024-04-03 0-30 29 5
87
+ # > 6 00006 HCSC 98 . 0 2024-04-04 31-60 34 8
88
+ # > 7 00007 Mass Mutual 37 . 37. 2024-05-13 31-60 37 7
89
+ # > 8 00008 Oscar 115 . 115 . 2024-05-26 31-60 37 9
90
+ # > 9 00009 BCBS MI 190. 190. 2024-04-06 31-60 42 10
91
+ # > 10 00010 CVS Aetna 57 . 57 . 2024-04-10 31-60 40 5
91
92
# > # ℹ 14,990 more rows
92
93
# > # ℹ abbreviated name: ¹days_release
93
94
# > # ℹ 5 more variables: days_submission <dbl>, days_acceptance <dbl>,
@@ -102,14 +103,14 @@ summarise_claims(x) |>
102
103
# > Rows: 1
103
104
# > Columns: 9
104
105
# > $ n_claims <int> 15000
105
- # > $ gross_charges <dbl> 2009316
106
- # > $ ending_ar <dbl> 1329560
107
- # > $ mean_release <dbl> 7.9998
108
- # > $ mean_submission <dbl> 3.023933
109
- # > $ mean_acceptance <dbl> 7.507067
110
- # > $ mean_adjudication <dbl> 14.98853
111
- # > $ mean_reconciliation <dbl> 2.208127
112
- # > $ mean_dar <dbl> 34.262
106
+ # > $ gross_charges <dbl> 1998810
107
+ # > $ ending_ar <dbl> 1315266
108
+ # > $ mean_release <dbl> 8.0004
109
+ # > $ mean_submission <dbl> 3.01
110
+ # > $ mean_acceptance <dbl> 7.518067
111
+ # > $ mean_adjudication <dbl> 14.9988
112
+ # > $ mean_reconciliation <dbl> 2.23959
113
+ # > $ mean_dar <dbl> 34.2838
113
114
```
114
115
115
116
``` r
@@ -123,18 +124,18 @@ x |>
123
124
arrange(payer ) | >
124
125
select(year , month , payer , n_claims , ending_ar , mean_dar )
125
126
# > # A tibble: 81 × 6
126
- # > year month payer n_claims ending_ar mean_dar
127
- # > <int> <int> <fct> <int> <dbl> <dbl>
128
- # > 1 2024 3 Medicaid 210 16083 . 34.
129
- # > 2 2024 4 Medicaid 191 17277 . 34.
130
- # > 3 2024 5 Medicaid 158 14752 . 34.
131
- # > 4 2024 3 New York Life 217 19324 . 34.
132
- # > 5 2024 4 New York Life 192 17413 . 34.
133
- # > 6 2024 5 New York Life 180 15011 . 34 .
134
- # > 7 2024 3 Centene 185 16104 . 34 .
135
- # > 8 2024 4 Centene 201 14927 . 35 .
136
- # > 9 2024 5 Centene 158 13403 . 35 .
137
- # > 10 2024 3 Cigna 205 17912 . 34.
127
+ # > year month payer n_claims ending_ar mean_dar
128
+ # > <int> <int> <fct> <int> <dbl> <dbl>
129
+ # > 1 2024 3 Oscar 195 18188 . 34.
130
+ # > 2 2024 4 Oscar 181 15630 . 34.
131
+ # > 3 2024 5 Oscar 148 14025 . 34.
132
+ # > 4 2024 3 Medicare 186 16966 . 34.
133
+ # > 5 2024 4 Medicare 208 17676 . 34.
134
+ # > 6 2024 5 Medicare 157 13925 . 36 .
135
+ # > 7 2024 3 UnitedHealth 179 15377 . 33 .
136
+ # > 8 2024 4 UnitedHealth 182 17476 . 34 .
137
+ # > 9 2024 5 UnitedHealth 156 14550 . 34 .
138
+ # > 10 2024 3 GuideWell 202 19187 . 34.
138
139
# > # ℹ 71 more rows
139
140
```
140
141
@@ -143,17 +144,27 @@ x |>
143
144
``` r
144
145
x | >
145
146
group_by(
146
- year = get_year (date_service ),
147
+ year = year (date_service ),
147
148
qtr = quarter(date_service ),
148
149
payer
149
150
) | >
150
151
summarise_claims() | >
151
152
arrange(payer ) | >
152
153
select(year , qtr , payer , n_claims , ending_ar , mean_dar )
153
- # > Error in `group_by()`:
154
- # > ℹ In argument: `year = get_year(date_service)`.
155
- # > Caused by error in `get_year()`:
156
- # > ! could not find function "get_year"
154
+ # > # A tibble: 54 × 6
155
+ # > year qtr payer n_claims ending_ar mean_dar
156
+ # > <int> <int> <fct> <int> <dbl> <dbl>
157
+ # > 1 2024 1 Oscar 195 18188. 34.
158
+ # > 2 2024 2 Oscar 329 29655. 34.
159
+ # > 3 2024 1 Medicare 186 16966. 34.
160
+ # > 4 2024 2 Medicare 365 31601. 35.
161
+ # > 5 2024 1 UnitedHealth 179 15377. 33.
162
+ # > 6 2024 2 UnitedHealth 338 32026. 34.
163
+ # > 7 2024 1 GuideWell 202 19187. 34.
164
+ # > 8 2024 2 GuideWell 356 31347. 35.
165
+ # > 9 2024 1 Lincoln Nat'l 199 17432. 34.
166
+ # > 10 2024 2 Lincoln Nat'l 392 36733. 34.
167
+ # > # ℹ 44 more rows
157
168
```
158
169
159
170
## Days in AR Calculation
@@ -172,7 +183,24 @@ tibble(
172
183
earb ,
173
184
dart = 35 ,
174
185
by = " month" )
175
- # > Error in date_build(2024, 1:12): could not find function "date_build"
186
+ # > # A tibble: 12 × 15
187
+ # > date gct earb ndip adc dart dar dar_pass ratio_id…¹ ratio_ac…²
188
+ # > <date> <int> <int> <int> <dbl> <dbl> <dbl> <lgl> <dbl> <dbl>
189
+ # > 1 2024-01-01 2.5e5 2.9e5 31 8080. 35 36. FALSE 1.1 1.2
190
+ # > 2 2024-02-01 2.5e5 2.9e5 29 8624. 35 34. TRUE 1.2 1.2
191
+ # > 3 2024-03-01 2.5e5 2.9e5 31 8062. 35 36. FALSE 1.1 1.2
192
+ # > 4 2024-04-01 2.5e5 2.9e5 30 8320. 35 35. TRUE 1.2 1.2
193
+ # > 5 2024-05-01 2.5e5 2.9e5 31 8026. 35 36. FALSE 1.1 1.2
194
+ # > 6 2024-06-01 2.5e5 2.9e5 30 8310. 35 35. TRUE 1.2 1.2
195
+ # > 7 2024-07-01 2.5e5 2.9e5 31 8053. 35 36. FALSE 1.1 1.2
196
+ # > 8 2024-08-01 2.5e5 2.9e5 31 8041. 35 36. FALSE 1.1 1.2
197
+ # > 9 2024-09-01 2.5e5 2.9e5 30 8324. 35 35. TRUE 1.2 1.2
198
+ # > 10 2024-10-01 2.5e5 2.9e5 31 8084. 35 36. FALSE 1.1 1.2
199
+ # > 11 2024-11-01 2.5e5 2.9e5 30 8353. 35 35. TRUE 1.2 1.2
200
+ # > 12 2024-12-01 2.5e5 2.9e5 31 8040. 35 36. FALSE 1.1 1.2
201
+ # > # ℹ abbreviated names: ¹ratio_ideal, ²ratio_actual
202
+ # > # ℹ 5 more variables: ratio_diff <dbl>, earb_target <dbl>, earb_diff <dbl>,
203
+ # > # gct_pct <dbl>, earb_pct <dbl>
176
204
```
177
205
178
206
<br >
@@ -191,7 +219,16 @@ tibble(
191
219
earb ,
192
220
dart = 35 ,
193
221
by = " quarter" )
194
- # > Error in date_build(2024, 1:12): could not find function "date_build"
222
+ # > # A tibble: 4 × 15
223
+ # > date earb gct ndip adc dart dar dar_pass ratio_id…¹ ratio_ac…²
224
+ # > <date> <int> <int> <int> <dbl> <dbl> <dbl> <lgl> <dbl> <dbl>
225
+ # > 1 2024-03-01 285562 7.5e5 91 8249. 35 35. TRUE 0.38 0.38
226
+ # > 2 2024-06-01 285591 7.5e5 91 8253. 35 35. TRUE 0.38 0.38
227
+ # > 3 2024-09-01 285469 7.5e5 92 8149. 35 35. FALSE 0.38 0.38
228
+ # > 4 2024-12-01 285639 7.5e5 92 8131. 35 35. FALSE 0.38 0.38
229
+ # > # ℹ abbreviated names: ¹ratio_ideal, ²ratio_actual
230
+ # > # ℹ 5 more variables: ratio_diff <dbl>, earb_target <dbl>, earb_diff <dbl>,
231
+ # > # gct_pct <dbl>, earb_pct <dbl>
195
232
```
196
233
197
234
## Code of Conduct
0 commit comments