make_cpt_long: Convert CPT, Procedure Name, and WRVU from wide to long...

make_cpt_longR Documentation

Convert CPT, Procedure Name, and WRVU from wide to long format

Description

Convert CPT, Procedure Name, and WRVU from wide to long format

Usage

make_cpt_long(df)

Arguments

df

a data.table

Details

If all of the requisite columns are present in a data.table, this function will create a long format data table that contains the CPT, procedure name, and WRVU of each procedure each patient underwent. caseid is retained in order to allow joining back to a main table. Each procedure is numbered sequentially beginning at 1. This is stored in nproc. The only number that holds significance is "1", as this is the "primary procedure" as entered into the original data set. If any CPT codes are "NA", these records are removed and the "nproc" column is renumbered appropriately.

In order to distinguish between an "other" procedure and a "concurrent" procedure, utilize the primarysurg variable: TRUE is equivalent to an "other" procedure and FALSE is equivalent to a "concurrent" procedure. This variable is so named because the only difference between an "other" procedure and a "concurrent" procedure is that the latter is a procedure not performed by the primary surgical team.

Value

a data.table


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