knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(nsqipPancreatectomy)

r nrow(df) records were retrieved from the NSQIP database by querying for records with a primary CPT of 48140. This database was left-joined to the targeted pancreatectomy dataset by the variable caseid. To prove there is only a single primary CPT code in this dataset:

unique(df$cpt)

We can take a look at the various approaches used in the dataset:

df$pan_approach <- factor(df$pan_approach, labels = c("Hybrid","Laparoscopic","NOTES","Open (planned)","Other","Other MIS","Robotic","SILS"))
table(df$pan_approach)

We can select out only the approaches we are interested in and then further clarify the number by each approach with unplanned conversion. We will add in how many also have open assist.

df %>% 
  dplyr::filter(pan_approach %in% c("Laparoscopic","Robotic","Open (planned)")) %>%
  dplyr::group_by(pan_approach) %>% 
  dplyr::summarise(
    n = dplyr::n(),
    unplan_open = sum(pan_unplanned_conversion),
    rate = unplan_open/n,
    open_assist = sum(pan_open_assist))

We can see what it looks like by removing the patients with open assist:

df <- df %>% 
  dplyr::filter(pan_approach %in% c("Laparoscopic","Robotic","Open (planned)"),
                !pan_open_assist)
df %>%
  dplyr::group_by(pan_approach) %>% 
  dplyr::summarise(
    n = dplyr::n(),
    unplan_open = sum(pan_unplanned_conversion),
    rate = unplan_open/n)

This would seem to imply that no cases with open assist had unplanned conversion to open but you have to look at how the original data is coded to understand why: the approach data was originally coded as either "Laparoscopic w/ open assist" or "Laparoscopic w/ unplanned conversion to open" - there is no "laparoscopic w/ open assist w/ unplanned conversion to open". So if you are interested in that, then I can go looking for it in concurrent/other procedures but I'll hold on that for now.

So we now have r nrow(df) patients to work with. We can form three groups - laparoscopic and robotic (MIS) with no conversion vs. MIS with conversion vs. planned open.

df <- df %>% 
  dplyr::mutate(group = ((pan_approach %in% c("Robotic", "Laparoscopic")) + pan_unplanned_conversion),
                group = forcats::as_factor(group),
                group = forcats::fct_recode(group, "Open" = "0","MIS" = "1", "MIS w/ unplanned conversion" = "2"))

df %>% 
  dplyr::group_by(group) %>%
  dplyr::summarise(n = dplyr::n())

Take a look at the NSQIP Pancreatectomy PUF and the NSQIP ACS PUF (both can be found here) and let me know the following:

  1. What outcomes you are interested in (SSIs, reoperation rate, death, Clavien-Dindo, percutaneous drainage, fistula development, etc.)
  2. What preoperative variables or demographics you would like me to match on or include in a univariate/multivariate analysis (i.e., comorbidities, tumor stages (TNM), intraoperative antibiotics, etc.)
  3. Who else would you like me to exclude from this data?
  4. What do you want me to do with splenectomies? The CPT code 48140 includes "with or without splenectomies". Some records will include a CPT code for splenectomy as a concurrent procedure. I can show you exactly how many below.


dylanrussellmd/nsqipPancreatectomy documentation built on Sept. 16, 2020, 12:46 a.m.