22  Summary Dashboard

Metadata

  [ROWS] 90 
[FIELDS] 10 

Data

# A tibble: 90 × 10
   dashboard_row_number data_metrics py_2017 py_2018 py_2019 py_2020
                                      
 1 2                    Total Dolla… 998344… 109882… 118794… 100519…
 2 3                    Total Dolla… 296470… 311980… 371116… 218672…
 3 4                    Total Dolla… 160510… 231246… 748979… 184671…
 4 5                    Total Dolla… 296309… 311749… 371041… 218487…
 5 6                    Total Dolla… 594550… 621907… 654725… 648136…
 6 7                    Total Dolla… 139533… 155362… 176525… 169179…
 7 8                    Total Dolla… 455016… 466545… 478199… 478957…
 8 9                    Total Dolla… 466174… 477411… 488186… 487109…
 9 10                   Total Dolla… 455016… 466545… 478199… 478957…
10 11                   Total Dolla… 362794… 275792… 799696… 496954…
# ℹ 80 more rows
# ℹ 4 more variables: py_2021 , py_2022 , py_2023 ,
#   total 

Tidyup

x <- resp |> 
    mtt(
      metric = data_metrics,
      type   = case(
        grepl("^Total Number of", metric, perl = TRUE)              ~ "count",
        grepl("^Total Dollar Amount of", metric, perl = TRUE)       ~ "dollar",
        grepl("^Total Dollar Amount Invested", metric, perl = TRUE) ~ "invest",
        grepl("^Total value of interest", metric, perl = TRUE)      ~ "value"),
      data_metrics         = NULL,
      dashboard_row_number = NULL) |>
    rsplit(~ type)

  x$count <-  mtt(
    x$count,
    metric = gsub("^Total Number of ", "", metric, perl = TRUE),
    metric = gsub("^all ", "", metric, perl = TRUE),
    type   = cheapr_if_else(grepl("^Payment Records", metric, perl = TRUE), "record", "entity")) |>
    rsplit( ~ type)

  x$count$entity <- rnm(
    x$count$entity,
    `2017` = py_2017,
    `2018` = py_2018,
    `2019` = py_2019,
    `2020` = py_2020,
    `2021` = py_2021,
    `2022` = py_2022,
    `2023` = py_2023,
    ALL = total) |>
    mtt(
      metric = gsub("Companies Making Payments \\(AM/GPO Making Payment\\)",
                    "Companies [AM/GPO] Making Payments", metric, perl = TRUE),
      metric = gsub("Physician Covered Recipients with associated payment records",
                    "Physicians with Payment Records", metric, perl = TRUE),
      metric = gsub("Non-Physician Practitioner Covered Recipients with associated payment records",
                    "NPPs with Payment Records", metric, perl = TRUE),
      metric = gsub("Teaching Hospitals with associated payment records",
                    "Teaching Hospitals with Payment Records", metric, perl = TRUE)) |>
    pivot(ids = "metric", names = list("year", "count")) |>
    roworder(metric, -year) |>
    colorder(year) |>
    mtt(count = as.integer(count)) |>
    as_tbl()

  x$count$record <- rnm(
    x$count$record,
    `2017` = py_2017,
    `2018` = py_2018,
    `2019` = py_2019,
    `2020` = py_2020,
    `2021` = py_2021,
    `2022` = py_2022,
    `2023` = py_2023,
    ALL = total
  ) |>
    mtt(
      type = case(
        grepl("General Payments", metric, perl = TRUE) ~ "General",
        grepl("Research Payments", metric, perl = TRUE) ~ "Research",
        grepl("Ownership Payments", metric, perl = TRUE) ~ "Ownership",
        .default = "All"
      ),
      status = case(
        grepl("Disputed", metric, perl = TRUE) ~ "Disputed",
        grepl("Undisputed", metric, perl = TRUE) ~ "Undisputed"
      ),
      entity = case(
        grepl("- Covered Recipient", metric, perl = TRUE) ~ "Covered Recipient",
        grepl("- Non-Covered Recipient", metric, perl = TRUE) ~ "Non-Covered Recipient",
        grepl("- Physician or Non-Covered Recipient", metric, perl = TRUE) ~ "Physician or Non-Covered Recipient",
        grepl(
          "- Non-Physician Practitioner or Non-Covered Recipient",
          metric,
          perl = TRUE
        ) ~ "Non-Physician Practitioner or Non-Covered Recipient",
        grepl(" to Physicians", metric, perl = TRUE) ~ "Physician",
        grepl(" to Non-Physician Practitioners", metric, perl = TRUE) ~ "Non-Physician Practitioner",
        grepl(" to Teaching Hospitals", metric, perl = TRUE) ~ "Teaching Hospital",
        grepl(" - Non-Covered Recipient Entity", metric, perl = TRUE) ~ "Non-Covered Recipient Entity",
        grepl(" - Non-Covered Recipient Individual", metric, perl = TRUE) ~ "Non-Covered Recipient Individual"
      ),
      metric = NULL
    ) |>
    pivot(ids = c("type", "status", "entity"),
          names = list("year", "count")) |>
    roworder(type, -year) |>
    colorder(year, type, entity) |>
    mtt(count = as.integer(count)) |>
    as_tbl()

  x$invest <- mtt(
    x$invest,
    metric = gsub("^Total Dollar Amount Invested of all Payment Records ", "", metric, perl = TRUE),
    metric = gsub("^-\\s", "", metric, perl = TRUE))

  x$value <- mtt(
    x$value,
    metric = gsub("^Total value of interest of all Payment Records ", "", metric, perl = TRUE),
    metric = gsub("^-\\s", "", metric, perl = TRUE))

  x$dollar <- mtt(
    x$dollar,
    metric = gsub("^Total Dollar Amount of ", "", metric, perl = TRUE),
    metric = gsub("^all ", "", metric, perl = TRUE))
x
$count
$count$entity
# A tibble: 32 × 3
   year  metric                              count
                                   
 1 ALL   Companies [AM/GPO] Making Payments   2843
 2 2023  Companies [AM/GPO] Making Payments   1776
 3 2022  Companies [AM/GPO] Making Payments   1858
 4 2021  Companies [AM/GPO] Making Payments   1855
 5 2020  Companies [AM/GPO] Making Payments   1779
 6 2019  Companies [AM/GPO] Making Payments   1797
 7 2018  Companies [AM/GPO] Making Payments   1755
 8 2017  Companies [AM/GPO] Making Payments   1678
 9 ALL   NPPs with Payment Records          414900
10 2023  NPPs with Payment Records          309427
# ℹ 22 more rows

$count$record
# A tibble: 320 × 5
   year  type  entity                     status    count
                                
 1 ALL   All   NA                         NA     84035057
 2 ALL   All   Physician                  NA     65341949
 3 ALL   All   Non-Physician Practitioner NA     12787445
 4 ALL   All   Teaching Hospital          NA      1131236
 5 2023  All   NA                         NA     15639275
 6 2023  All   Physician                  NA      9630514
 7 2023  All   Non-Physician Practitioner NA      4976520
 8 2023  All   Teaching Hospital          NA       143632
 9 2022  All   NA                         NA     14277900
10 2022  All   Physician                  NA      9036995
# ℹ 310 more rows


$dollar
# A tibble: 35 × 9
   py_2017     py_2018 py_2019 py_2020 py_2021 py_2022 py_2023 total
                            
 1 9983443884… 109882… 118794… 100519… 124674… 127965… 126890… 7243…
 2 2964700222… 311980… 371116… 218672… 325478… 380973… 327760… 2232…
 3 1605102.03  231246… 748979… 184671… 237104… 206960… 122548… 1217…
 4 2963095120… 311749… 371041… 218487… 325240… 380766… 327637… 2231…
 5 5945500870… 621907… 654725… 648136… 766416… 783691… 807165… 4876…
 6 1395333630… 155362… 176525… 169179… 174644… 171621… 157933… 1144…
 7 4550167239… 466545… 478199… 478957… 591771… 612070… 649231… 3731…
 8 4661745514… 477411… 488186… 487109… 599788… 619872… 656340… 3794…
 9 4550167239… 466545… 478199… 478957… 591814… 612112… 649284… 3731…
10 3627948.41  275792… 799696… 496954… 140845… 571428… 208709… 3404…
# ℹ 25 more rows
# ℹ 1 more variable: metric 

$invest
# A tibble: 5 × 9
  py_2017      py_2018 py_2019 py_2020 py_2021 py_2022 py_2023 total
                            
1 268224163.55 542424… 526403… 420228… 416271… 287661… 218848… 2680…
2 23232.00     64837.… 0.00    0.00    0.00    0.00    11600.… 9966…
3 268200931.55 542359… 526403… 420228… 416271… 287661… 218836… 2679…
4 268224163.55 542424… 526403… 420228… 416271… 287661… 218848… 2680…
5 23232.00     64837.… 0.00    0.00    0.00    0.00    11600.… 9966…
# ℹ 1 more variable: metric 

$value
# A tibble: 6 × 9
  py_2017      py_2018 py_2019 py_2020 py_2021 py_2022 py_2023 total
                            
1 1073242791.… 164937… 162102… 138381… 154850… 114988… 133978… 1339…
2 27902592.00  265936… 0.00    0.00    0.00    99992.… 160592… 1605…
3 1045340199.… 164910… 162102… 138381… 154850… 114978… 133961… 1339…
4 1073242791.… 164937… 162102… 138381… 154850… 114988… 133978… 1339…
5 27902592.00  265936… 0.00    0.00    0.00    99992.… 160592… 1605…
6 1045340199.… 164910… 162102… 138381… 154850… 114978… 133961… 1339…
# ℹ 1 more variable: metric 

Overview

cheapr::overview(x$count$entity)
obs: 32 
cols: 3 

----- Numeric -----
    col n_missng p_complt n_unique   mean p0  p25  p50    p75
1 count        0        1       29 203911  0 1224 1788 433972
     p100    iqr     sd  hist
1 1118817 432747 300335 ▇▂▃▁▁

----- Categorical -----
     col n_missng p_complt n_unique n_levels
1   year        0        1        8        8
2 metric        0        1        4       NA
                                 min
1                               2017
2 Companies [AM/GPO] Making Payments
                                      max
1                                     ALL
2 Teaching Hospitals with Payment Records
cheapr::overview(x$count$record)
obs: 320 
cols: 5 

----- Numeric -----
    col n_missng p_complt n_unique    mean p0 p25   p50    p75
1 count        0        1      238 3189547  0 178 33321 849287
      p100    iqr       sd  hist
1 84035057 849109 10387247 ▇▁▁▁▁

----- Categorical -----
     col n_missng p_complt n_unique n_levels               min
1   year        0        1        8        8              2017
2   type        0        1        4       NA               All
3 entity       80     0.75        7       NA Covered Recipient
4 status      160      0.5        2       NA          Disputed
                max
1               ALL
2          Research
3 Teaching Hospital
4        Undisputed
cheapr::overview(x$dollar)
obs: 35 
cols: 9 

----- Categorical -----
      col n_missng p_complt n_unique n_levels             min
1 py_2017        0        1       28       NA            0.00
2 py_2018        0        1       28       NA            0.00
3 py_2019        0        1       28       NA            0.00
4 py_2020        0        1       26       NA            0.00
5 py_2021        0        1       34       NA            0.00
6 py_2022        0        1       34       NA            0.00
7 py_2023        0        1       34       NA            0.00
8   total        0        1       34       NA            0.00
9  metric        0        1       35       NA Payment Records
                                                                     max
1                                                          9983443884.20
2                                                           851039610.78
3                                                            99869144.61
4                                                             8358438.80
5                                                           976017659.44
6                                                                 884.79
7                                                              913407.55
8                                                         72430213436.63
9 Payment Records to Teaching Hospitals - Research Payments - Undisputed
cheapr::overview(x$value)
obs: 6 
cols: 9 

----- Categorical -----
      col n_missng p_complt n_unique n_levels                min
1 py_2017        0        1        3       NA      1045340199.31
2 py_2018        0        1        3       NA      1649109621.92
3 py_2019        0        1        2       NA               0.00
4 py_2020        0        1        2       NA               0.00
5 py_2021        0        1        2       NA               0.00
6 py_2022        0        1        3       NA      1149781801.49
7 py_2023        0        1        3       NA      1339619652.59
8   total        0        1        3       NA      1339619652.59
9  metric        0        1        6       NA Ownership Payments
                                              max
1                                     27902592.00
2                                       265936.00
3                                   1621023068.27
4                                   1383815859.42
5                                   1548506879.01
6                                        99992.65
7                                       160592.65
8                                       160592.65
9 to Physicians - Ownership Payments - Undisputed
cheapr::overview(x$invest)
obs: 5 
cols: 9 

----- Categorical -----
      col n_missng p_complt n_unique n_levels                min
1 py_2017        0        1        3       NA           23232.00
2 py_2018        0        1        3       NA       542359793.14
3 py_2019        0        1        2       NA               0.00
4 py_2020        0        1        2       NA               0.00
5 py_2021        0        1        2       NA               0.00
6 py_2022        0        1        2       NA               0.00
7 py_2023        0        1        3       NA           11600.00
8   total        0        1        3       NA      2679961689.06
9  metric        0        1        5       NA Ownership Payments
                                            max
1                                  268224163.55
2                                      64837.50
3                                  526403105.28
4                                  420228142.68
5                                  416271283.34
6                                  287661921.26
7                                  218848111.81
8                                      99669.50
9 to Physicians - Ownership Payments - Disputed