knitr::opts_chunk$set(
  echo = FALSE,
  collapse = TRUE,
  comment = "#>",
  out.width = "75%",
  fig.align = "center"
)
library(magrittr)
load("R/sysdata.rda")
today <- format(lubridate::date(file.info("R/sysdata.rda")$mtime), "%d %B, %Y")

print_table <- function(table) {
  kableExtra::kbl(x = table) %>%
    kableExtra::kable_styling(full_width = FALSE, position = "center", 
                              bootstrap_options = c("striped", "condensed"), font_size = 14)
}

include_graphic <- function(file) {
  knitr::include_graphics(paste0("man/figures/README-", file, ".png"))
}

nsqipr

R build status Github All Releases

What would you like to see implemented in nsqipr? Open an issue! Are you interested in using or helping develop nsqipr? Send me an email!

See the companion book for a more detailed guide!

About ACS NSQIP©

Welcome to nsqipr! If you're reading this, you are likely already familiar with the American College of Surgeons National Surgical Quality Improvement Program (ACS NSQIP©). If not, you can read about it here. The ACS NSQIP © is a nationally validated, risk-adjusted, outcomes-based program to measure and improve the quality of surgical care.

As of r today, there are currently r .nsqip_hospitals hospitals that participate in and contribute to the program. The entire database contains more than 8 million cases for data analysis.

Inclusion and Exclusion Criteria

ACS NSQIP© captures and reports 30-day morbidity and mortality outcomes for all major inpatient and outpatient surgical procedures as determined by Current Procedural Terminology (CPT©) code. This list is updated annually as new codes become available. Excluded cases are:

Publications

The data from ACS NSQIP© is used to produce an exponentially increasing number of publications per year. As of r today, there are currently r .nsqip_publications PubMed search results for the search term "NSQIP".

include_graphic("nsqip_hits_graph")

These papers are often published in high quality journals. The following graph shows the top 10 most common journals in which the above search results were published.

include_graphic("nsqip_journal_circular")

About nsqipr

Purpose

ACS NSQIP© requires that members request specific datasets for use in research. The files are then delivered as .exe executable files available for download for a limited duration of time. The archived files can be unzipped and contain a .txt tab-delimited file. Some will also contain a PDF version of the Participant Use File (PUF); these define the variables in the dataset. The .txt tab-delimited file must be read into R as a data frame and meticulously cleaned prior to being used for data analysis. Researchers often want to combine data across multiple years. This complicates data preparation as variables are removed or added every year and sometimes the same variable may have differently worded outcomes between years.

options(knitr.kable.NA = '')
load("inst/figures/race_comp.rda")
race_comp %>% print_table

The purpose of nsqipr is to streamline this process. This package is geared towards those surgical interns, residents, and attendings who have limited experience with R, SQL, or "big data" analysis. It is also designed to be a useful tool for that experienced researcher or computer scientist making frequent use of ACS NSQIP© PUFs.

For a detailed dive into nsqipr, please refer to the companion book or the documentation:

help("nsqipr")

Installation

You can install or upgrade nsqipr with:

devtools::install_github("dylanrussellmd/nsqipr")

We are not (yet) available on CRAN.

Use

  1. Execute all .exe executable files from ACS NSQIP© in a single directory (dir) (do not change the default file names).
  2. Now simply run nsqip(dir).

nsqipr will take care of the rest. You're now ready to use the ACS NSQIP© data for data analysis!

Progress

Track progress on how the various data sets are being incorporated into nsqipr here.

colorize <- function(x, color) {
  sprintf("<span style='color: %s;'>%s</span>", color, x)
}

ready <- function() {
  colorize("Done, Documented, Tested", "midnightblue")
}

ip <- function() {
  colorize("In progress, use with caution", "goldenrod")
}

stop <- function() {
  colorize("Not started", "maroon")
}

Check back often for updates!



dylanrussellmd/nsqipr documentation built on Oct. 13, 2023, 11:01 a.m.