SURGICAL ANALYSIS


The following objects were exported in .RData format form the surgical_analysis.R file to be imported in this report:

  • the surgeries_stats dataframe

  • the procedures_stats dataframe

1. PROCEDURES

This is the report of the procedures performed between 2012 and 2026.

Table

surgeries_stats |> 
  select(year, procedures) |>
  mutate(cumulative = cumsum(procedures)) |>
  rename(
    "Year" = year,
    "Procedures" = procedures,
    "Running total" = cumulative
  ) |>
  kbl(align="c")|>
  kable_styling(
    bootstrap_options = "striped", 
    full_width = FALSE,      
    position = "center"
  ) |>
  column_spec(1:3, width = "150px")
Year Procedures Running total
2012 81 81
2013 288 369
2014 409 778
2015 273 1051
2016 248 1299
2017 387 1686
2018 847 2533
2019 663 3196
2020 280 3476
2021 467 3943
2022 308 4251
2023 187 4438
2024 188 4626
2025 238 4864
2026 20 4884

Plot

# 1. Create plot theme
  my_plot_theme <- theme_minimal() +
    theme(
      plot.title = element_text(face = "bold", size = 22, hjust = 0.5, margin = margin(t = 10, b = 20)),
      axis.title = element_text(face = "bold", size = 12),
      axis.text  = element_text(face = "bold", size = 12),
      axis.line  = element_line(color = "black", size = 0.5),
      axis.ticks = element_line(color = "black")
    )  
  
# 2. Plot 
  surgeries_plot <- ggplot(
      data = surgeries_stats,
      aes(x = year)
    ) +
    geom_bar(
      aes(y = procedures),
      stat = "identity",
      fill = "lightgrey",
      color = "black",
      alpha = 0.6
    ) +
    geom_text(
      aes(y = procedures, label = procedures),
      vjust = -0.5,
      fontface = "bold",
      size = 5
    ) +
    scale_x_continuous(
      name ="",
      breaks = seq(min(surgeries_stats$year), max(surgeries_stats$year), by = 1)
    ) +
    scale_y_continuous(
      name = "",
      expand = expansion(mult = c(0, 0.05))
    ) +
    labs(
      title = paste0("TOTAL PROCEDURES PER YEAR (", min(surgeries_stats$year), "-", max(surgeries_stats$year), ")")
    ) +
    my_plot_theme
  print(surgeries_plot)


2. PROCEDURES AS LEAD SURGEON

This is the report of the procedures performed as lead surgeon between 2012 and 2026.

The table shows, for each year:

  1. the total amount of performed procedures

  2. the % of procedures performed as lead surgeon relative to the total amount of performed procedures

Data show a clear consistently increasing % of procedures performes as lead surgeon, to indicate a constantly increasing surgical autonomy.

Table

surgeries_stats |> 
  select(year, lead, pct_lead) |>
  mutate(pct_lead = sprintf("%.2f%%", pct_lead)) |>
  mutate(cumulative = cumsum(lead)) |>
  rename(
    "Year" = year,
    "As lead surgeon" = lead,
    "%" = pct_lead,
    "Running total" = cumulative
  ) |>
  kbl(align="c")|>
  kable_styling(
    bootstrap_options = "striped", 
    full_width = FALSE,      
    position = "center"
  ) |>
  column_spec(1:4, width = "150px")
Year As lead surgeon % Running total
2012 4 4.94% 4
2013 23 7.99% 27
2014 18 4.40% 45
2015 10 3.66% 55
2016 5 2.02% 60
2017 90 23.26% 150
2018 278 32.82% 428
2019 240 36.20% 668
2020 145 51.79% 813
2021 166 35.55% 979
2022 95 30.84% 1074
2023 85 45.45% 1159
2024 125 66.49% 1284
2025 175 73.53% 1459
2026 18 90.00% 1477

Plot

# 1. Create plot theme
  my_plot_theme <- theme_minimal() +
    theme(
      plot.title = element_text(face = "bold", size = 22, hjust = 0.5, margin = margin(t = 10, b = 20)),
      axis.title = element_text(face = "bold", size = 12),
      axis.text  = element_text(face = "bold", size = 12),
      axis.line  = element_line(color = "black", size = 0.5),
      axis.ticks = element_line(color = "black")
    )  
  
# 2. Plot   
  lead_plot <- ggplot(
    data = surgeries_stats,
    aes(x = year)
  ) +
    geom_bar(
      aes(y = pct_lead),
      stat = "identity",
      fill = "lightgrey",
      color = "black",
      alpha = 0.6
    ) +
    geom_text(
      aes(y = pct_lead, label = paste0(round(pct_lead, 0), "%")),
      vjust = -0.5,
      fontface = "bold",
      size = 5
    ) +
    scale_x_continuous(
      name ="",
      breaks = seq(min(surgeries_stats$year), max(surgeries_stats$year), by = 1)
    ) +
    scale_y_continuous(
      name = "",
      expand = expansion(mult = c(0, 0.05))
    ) +
    labs(
      title = paste0("% AS LEAD SURGEON PER YEAR (", min(surgeries_stats$year), "-", max(surgeries_stats$year), ")")
    ) +
    my_plot_theme
  print(lead_plot)


3. TOP 15 PROCEDURES

This is the report of the top 15 procedures, performed between 2012 and 2026.

Short and long description of ICD-9 procedures were taken from the CMS.gov website.

Table

procedures_stats |>
  select(procedure, procedures, short_descr)|>
  rename(
    "ICD-9 Code" = procedure,
    "Procedures" = procedures,
    "ICD-9 short description" = short_descr
  ) |>
  kbl(align="ccl")|>
  kable_styling(
    bootstrap_options = "striped", 
    full_width = FALSE,      
    position = "center"
  ) |>
  column_spec(1, width = "150px") |>
  column_spec(2, width = "150px") |>
  column_spec(3, width = "300px")
ICD-9 Code Procedures ICD-9 short description
8385 659 Musc/tend lng change NEC
9353 519 Other cast application
9929 445 Inject/infuse NEC
7865 336 Remove imp device-femur
8118 334 Subtalr jt arthroereisis
7825 311 Limb short proc-femur
7867 190 Remov imp dev-tib/fibula
7728 168 Metatar/tar wedg osteot
7827 168 Limb shorten-tib/fibula
8375 161 Tendon trnsfr/transplant
7738 150 Metatar/tar division NEC
7725 105 Femoral wedge osteotomy
8832 97 Contrast arthrogram
7868 79 Remove imp dev-metat/tar
8192 60 Injection into joint

Plot

# 1. Create plot theme
  my_plot_theme <- theme_minimal() +
    theme(
      plot.title = element_text(face = "bold", size = 22, hjust = 0.5, margin = margin(t = 10, b = 20)),
      axis.title = element_text(face = "bold", size = 12),
      axis.text  = element_text(face = "bold", size = 12),
      axis.line  = element_line(color = "black", size = 0.5),
      axis.ticks = element_line(color = "black")
    )  
  
# 2. Plot  
  procedures_plot <- ggplot(
    data = procedures_stats,
    aes(x = reorder(short_descr, procedures), y = procedures)
  ) +
    geom_col(
      fill = "lightgrey",
      color = "black"
    ) +
    geom_text(
      aes(label = procedure),
      y = 0,
      hjust = -0.1,
      fontface = "bold",
      size = 4
    ) +
    geom_text(
      aes(label = procedures),
      hjust = -0.5, 
      fontface = "bold",
      size = 5
      ) +
    scale_x_discrete(
      name = ""
    ) +
    scale_y_continuous(
      name="",
      expand = expansion(mult = c(0, 0.05))
    ) +
    labs(
      title = paste("TOP",length(procedures_stats$procedure),"ICD-9 PROCEDURES"),
    ) +
    coord_flip() +
    my_plot_theme
  print(procedures_plot)