-
Notifications
You must be signed in to change notification settings - Fork 3
/
README.Rmd
158 lines (116 loc) · 6.32 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
---
output: github_document
always_allow_html: true
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
echo = FALSE,
collapse = TRUE,
comment = "#>",
out.width = "75%",
fig.align = "center"
)
library(magrittr)
load("R/sysdata.rda")
```
```{r, setup}
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 <img src='man/figures/hex.png' align="right" height="200"/>
<!-- badges: start -->
[![R build status](https://github.com/dylanrussellmd/nsqipr/workflows/R-CMD-check/badge.svg)](https://github.com/dylanrussellmd/nsqipr/actions)
![Github All Releases](https://img.shields.io/github/downloads/dylanrussellmd/nsqipr/total?style=plastic)
<!-- badges: end -->
What would you like to see implemented in `nsqipr`? [Open an issue](https://github.com/doctortickle/nsqipr/issues)! Are you interested in using or helping develop `nsqipr`? [Send me an email](dyl.russell@gmail.com)!
> **See the [companion book](https://www.dylanrussellmd.com/nsqipr_book) for a more detailed guide!**
# About ACS NSQIP<sup>©</sup>
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**<sup>©</sup>). If not, you can read about it [here](https://www.facs.org/quality-programs/acs-nsqip). The ACS NSQIP <sup>©</sup> 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](https://www.facs.org/search/nsqip-participants?allresults=) 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<sup>©</sup> captures and reports 30-day morbidity and mortality outcomes for all major inpatient and outpatient surgical procedures as determined by Current Procedural Terminology (CPT<sup>©</sup>) code. This list is updated annually as new codes become available. Excluded cases are:
* Patients under the age of 18 years.
* \>3 inguinal herniorrhaphies in an 8-day period.
* \>3 breast lumpectomies in an 8-day period.
* \>3 laparoscopic cholecystectomies in an 8-day period.
* \>3 TURPs and/or TURBTs in an 8-day period.
## Publications
The data from ACS NSQIP<sup>©</sup> 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](https://pubmed.ncbi.nlm.nih.gov/?term=NSQIP) for the search term "NSQIP".
```{r, pubmed_search}
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.
```{r, journals, out.width="100%"}
include_graphic("nsqip_journal_circular")
```
# About `nsqipr`
## Purpose
ACS NSQIP<sup>©</sup> 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.
```{r race_comp, results="asis"}
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<sup>©</sup> PUFs.
For a detailed dive into `nsqipr`, please refer to the [companion book](https://www.dylanrussellmd.com/nsqipr_book) or the documentation:
```r
help("nsqipr")
```
## Installation
You can install or upgrade `nsqipr` with:
```r
devtools::install_github("dylanrussellmd/nsqipr")
```
We are not (yet) available on CRAN.
## Use
1. Execute all `.exe` executable files from ACS NSQIP<sup>©</sup> 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<sup>©</sup> data for data analysis!
## Progress
Track progress on how the various data sets are being incorporated into `nsqipr` here.
```{r colorize}
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")
}
```
- Main PUF - `r ready()`
- Vascular - `r ip()`
- Abdominal Aortic Aneurysm - `r ip()`
- Aortoiliac Endovascular - `r ip()`
- Aortoiliac Open - `r ip()`
- Carotid Artery Stenting - `r stop()`
- Carotid Endarterectomy - `r stop()`
- Endovascular Aneurysm Repair - `r stop()`
- Lower Extremity Endovascular - `r stop()`
- Lower Extremity Open - `r stop()`
- Colectomy - `r ready()`
- Pancreatectomy - `r ip()`
- Proctectomy - `r stop()`
- Hepatectomy - `r ip()`
- Thyroidectomy - `r stop()`
- Esophagectomy - `r stop()`
- Appendectomy - `r ready()`
- Gynecology - `r stop()`
- Hysterectomy - `r stop()`
- Hip Fracture - `r stop()`
- Cystectomy - `r stop()`
- Nephrectomy - `r stop()`
- Prostatectomy - `r stop()`
Check back often for updates!