make_cpt_long | R Documentation |
Convert CPT, Procedure Name, and WRVU from wide to long format
make_cpt_long(df)
df |
a data.table |
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.
a data.table
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.