nsqip_subset_pufs: Importing the raw National Surgical Quality Improvement...

View source: R/nsqip_subset_pufs.R

nsqip_subset_pufsR Documentation

Importing the raw National Surgical Quality Improvement Program (NSQIP) Dataset

Description

This function is designed to specify a directory with multiple NSQIP datasets to be filtered and merged. Due to the size of many NSQIP datasets, importing each is likely to cause out-of-memory errors on most personal computers. This function is intended to be run prior to running the nsqip_clean_data() function. Exports a merged dataframe object.

Usage

nsqip_subset_pufs(
  puf_folder_path = "Raw Files",
  puf_years = 2012:2020,
  cpt_codes = NULL,
  cpt_codes_primary_only = TRUE,
  icd10_codes = NULL,
  icd9_codes = NULL,
  icd_codes_primary_only = TRUE,
  surgical_specialty = NULL
)

Arguments

puf_folder_path

a text string representing the path of the folder containing the PUF text files; the text string must not end with "/"!

puf_years

the years to include in the extract

cpt_codes

the CPT codes to include in the extract. If NULL, then return all codes. Based on the following fields: "CPT", "OTHERCPT1" - "OTHERCPT10", and "CONCPT1" - "CONCPT10"

cpt_codes_primary_only

if TRUE, then only consider cases where one of the "cpt_codes" is the primary CPT code (the "CPT" field). Ignore if cpt_codes = NULL.

icd10_codes

a character vector of ICD-10 codes to subset the extract to. Ignore when NULL. Based on the following fields: "PODIAG10", "PODIAG_OTHER10", "REOPOR1ICD101", "REOPOR2ICD101", "READMRELICD101", "READMUNRELICD101", "READMRELICD102", "READMUNRELICD102", "READMRELICD103", "READMUNRELICD103", "READMRELICD104", "READMUNRELICD104", "READMRELICD105", "READMUNRELICD105"

icd9_codes

a character vector of ICD-9 codes to subset the extract to (these become rare in more recent years). Ignore when NULL. Based on the following fields: "PODIAG", "PODIAG_OTHER", "REOPORICD91", "REOPOR2ICD91", "READMRELICD91", "READMUNRELICD91", "READMRELICD92", "READMUNRELICD92", "READMRELICD93", "READMUNRELICD93", "READMRELICD94", "READMUNRELICD94", "READMRELICD95", "READMUNRELICD95"

icd_codes_primary_only

if TRUE, then only use the "PODIAG10" and "PODIAG" fields for filtering.

surgical_specialty

a character vector of surgical specialty to subset to (based on the "SURGSPEC" field).


UKBiostatCIRCL/UK-Biostat-CIRCL documentation built on June 30, 2022, 4:42 a.m.