This is the fourth iteration of an exploratory data analysis - the following changes have been made to this analysis:
1. Change control group to BMI <30 as opposed to 25-30.
Do patients with a BMI of less than 30 have better outcomes after outpatient sigmoid colectomy for diverticular disease than do patients with a BMI of 35-40?
My queries will pull from NSQIP 2005-2019.
In order to generate the main dataframe, I have constructed a query to pull only those patients that have undergone one of the above four procedures without any concomitant procedures and only with a single CPT code (a few records had multiple of these four CPT codes):
select *
from (
select caseid, trim(col, 'cpt_') cpt
from
(
select caseid,
cpt_44140, cpt_44141, cpt_44143, cpt_44144, cpt_44145, cpt_44146, cpt_44204, cpt_44206, cpt_44207, cpt_44208
from
(
select caseid,
countif(cpt = "44140") cpt_44140,
countif(cpt = "44141") cpt_44141,
countif(cpt = "44143") cpt_44143,
countif(cpt = "44144") cpt_44144,
countif(cpt = "44145") cpt_44145,
countif(cpt = "44146") cpt_44146,
countif(cpt = "44204") cpt_44204,
countif(cpt = "44206") cpt_44206,
countif(cpt = "44207") cpt_44207,
countif(cpt = "44208") cpt_44208,
from nsqip.puf_cpt
group by caseid
having not logical_or(cpt not in ("44140", "44141","44143", "44144","44145", "44146", "44204", "44206", "44207", "44208"))
)
where (cpt_44140 + cpt_44141 + cpt_44143 + cpt_44144 + cpt_44145 + cpt_44146 + cpt_44204 + cpt_44206 + cpt_44207 + cpt_44208) = 1
)
unpivot (cpt for col in (cpt_44140, cpt_44141, cpt_44143, cpt_44144, cpt_44145, cpt_44146, cpt_44204, cpt_44206, cpt_44207, cpt_44208))
where cpt !=0
) cpt
join (
select *
from nsqip.puf
) puf
using(caseid)
join (
select *
from nsqip.col
) col
using(caseid)
left join (
select distinct(caseid), TRUE as readmission from nsqip.puf_readmission
where readmission is true
) readm
using(caseid)
left join (
select distinct(caseid), TRUE as reoperation from nsqip.puf_reoperation
where reoperation is true
) reop
using(caseid)I will build a companion dataframe for readmissions:
select *
from (
select caseid, trim(col, 'cpt_') cpt
from
(
select caseid,
cpt_44140, cpt_44141, cpt_44143, cpt_44144, cpt_44145, cpt_44146, cpt_44204, cpt_44206, cpt_44207, cpt_44208
from
(
select caseid,
countif(cpt = "44140") cpt_44140,
countif(cpt = "44141") cpt_44141,
countif(cpt = "44143") cpt_44143,
countif(cpt = "44144") cpt_44144,
countif(cpt = "44145") cpt_44145,
countif(cpt = "44146") cpt_44146,
countif(cpt = "44204") cpt_44204,
countif(cpt = "44206") cpt_44206,
countif(cpt = "44207") cpt_44207,
countif(cpt = "44208") cpt_44208,
from nsqip.puf_cpt
group by caseid
having not logical_or(cpt not in ("44140", "44141","44143", "44144","44145", "44146", "44204", "44206", "44207", "44208"))
)
where (cpt_44140 + cpt_44141 + cpt_44143 + cpt_44144 + cpt_44145 + cpt_44146 + cpt_44204 + cpt_44206 + cpt_44207 + cpt_44208) = 1
)
unpivot (cpt for col in (cpt_44140, cpt_44141, cpt_44143, cpt_44144, cpt_44145, cpt_44146, cpt_44204, cpt_44206, cpt_44207, cpt_44208))
where cpt !=0
) cpt
join nsqip.puf_readmission
using(caseid)
where readmission is trueand for reoperations:
select *
from (
select caseid, trim(col, 'cpt_') cpt
from
(
select caseid,
cpt_44140, cpt_44141, cpt_44143, cpt_44144, cpt_44145, cpt_44146, cpt_44204, cpt_44206, cpt_44207, cpt_44208
from
(
select caseid,
countif(cpt = "44140") cpt_44140,
countif(cpt = "44141") cpt_44141,
countif(cpt = "44143") cpt_44143,
countif(cpt = "44144") cpt_44144,
countif(cpt = "44145") cpt_44145,
countif(cpt = "44146") cpt_44146,
countif(cpt = "44204") cpt_44204,
countif(cpt = "44206") cpt_44206,
countif(cpt = "44207") cpt_44207,
countif(cpt = "44208") cpt_44208,
from nsqip.puf_cpt
group by caseid
having not logical_or(cpt not in ("44140", "44141","44143", "44144","44145", "44146", "44204", "44206", "44207", "44208"))
)
where (cpt_44140 + cpt_44141 + cpt_44143 + cpt_44144 + cpt_44145 + cpt_44146 + cpt_44204 + cpt_44206 + cpt_44207 + cpt_44208) = 1
)
unpivot (cpt for col in (cpt_44140, cpt_44141, cpt_44143, cpt_44144, cpt_44145, cpt_44146, cpt_44204, cpt_44206, cpt_44207, cpt_44208))
where cpt !=0
) cpt
join nsqip.puf_reoperation
using(caseid)
where reoperation is trueWe start with a total of 70256 patients.
| cpt | n |
|---|---|
| 44140 | 12777 |
| 44141 | 1869 |
| 44143 | 7175 |
| 44144 | 1829 |
| 44145 | 4087 |
| 44146 | 1074 |
| 44204 | 27692 |
| 44206 | 1697 |
| 44207 | 10903 |
| 44208 | 1153 |
Now we can start culling away patients via exlusion criteria. The first will be indication - we only want patients with an indication of chronic diverticular disease or acute diverticulitis. I will rely strictly on the field col_indication. Additional fields that I may consider using would be col_indication_icd, podiag, or podiag10. But these are ICD codes; I think using the indication field from the colorectal subset is cleaner.
| col_indication | n |
|---|---|
| Colon cancer | 26793 |
| Other | 10277 |
| Chronic diverticular disease | 9940 |
| Acute diverticulitis | 7346 |
| Non-malignant polyp | 6814 |
| Colon cancer w/ obstruction | 3281 |
| Volvulus | 3014 |
| Chrohn’s disease | 1538 |
| Bleeding | 552 |
| Ulcerative colitis | 398 |
| Enterocolitis | 194 |
| NA | 109 |
A total of 17286 patients have chronic diverticular disease or acute diverticulitis. This exclusion criteria eliminates 52970 patients.
The next exclusion criteria will be non-laparoscopic or robotic approach. This will rely on the variable col_approach. We can easily eliminate all records where col_approach is not equal to “Laparoscopic” or “Robotic”.
| col_approach | n |
|---|---|
| Laparoscopic | 8685 |
| Open | 6392 |
| Robotic | 2103 |
| SILS | 54 |
| Hybrid | 21 |
| Endoscopic | 9 |
| Other | 9 |
| Other MIS | 8 |
| NA | 3 |
| NOTES | 2 |
A total of 10788 patients undergo laparoscopic or robotic surgery. This exclusion criteria eliminates 6498 patients.
The next exclusion criteria will remove all patients with a documented open assist technique because there is no ability to document a conversion to open in NSQIP when open-assist is selected. This will use the col_open_assist variable.
| col_open_assist | n |
|---|---|
| FALSE | 6905 |
| TRUE | 3883 |
A total of 6905 patients do not have an open assist documented. This exclusion criteria eliminates 3883 patients.
The next exclusion criteria will remove patients with some kind of discordance in their recorded approach.
We are including CPT codes for open approaches with the assumption that if the col_approach is laparoscopic, this should indicate a conversion to open. This assumption will be easy to validate with the col_unplanned_conversion variable`.
| cpt | col_unplanned_conversion | n |
|---|---|---|
| 44140 | FALSE | 211 |
| 44141 | FALSE | 27 |
| 44143 | FALSE | 72 |
| 44144 | FALSE | 8 |
| 44145 | FALSE | 84 |
| 44146 | FALSE | 12 |
| 44140 | TRUE | 266 |
| 44141 | TRUE | 35 |
| 44143 | TRUE | 192 |
| 44144 | TRUE | 19 |
| 44145 | TRUE | 257 |
| 44146 | TRUE | 31 |
A total of 800 patients have an open CPT with a laparoscopic or robotic approach and a conversion to open documented. A discordant documented approach eliminates 414 patients.
The next exclusion criteria will be non-elective surgery. There are multiple fields that contain relevant data - electsurg, emergncy, and col_emergent. I will utilize all of these fields to exclude patients. I will require that electsurg is TRUE while emergncy is FALSE. col_emergent is a factor - I will require that it is equal to NA. Lets take a look at a breakdown of all three variables:
| electsurg | n |
|---|---|
| FALSE | 925 |
| TRUE | 5563 |
| NA | 3 |
| emergncy | n |
|---|---|
| FALSE | 6100 |
| TRUE | 391 |
| col_emergent | n |
|---|---|
| Bleeding | 5 |
| Obstruction | 33 |
| Other | 35 |
| Perforation | 311 |
| Toxic colitis | 2 |
| NA | 6105 |
It helps to look at all combinations of these three variables to see why we need to consider all three in our determination of what is non-elective surgery.
| electsurg | emergncy | col_emergent | n |
|---|---|---|---|
| TRUE | FALSE | FALSE | 5555 |
| FALSE | FALSE | FALSE | 543 |
| FALSE | TRUE | TRUE | 377 |
| TRUE | TRUE | TRUE | 8 |
| FALSE | TRUE | FALSE | 5 |
| NA | FALSE | FALSE | 2 |
| NA | TRUE | TRUE | 1 |
A total of NA patients undergo elective surgery. This exclusion criteria eliminates NA patients.
The next exclusion criteria will be inpatient surgery. Only a single variable is relevant to this criteria - inout.
| inout | n |
|---|---|
| FALSE | 41 |
| TRUE | 5514 |
As the table makes clear, only 41 patients undergo outpatient surgery. Therefore, we can not use this exclusion critiera.
The next exclusion criteria will be not admitted from home. Only a single variable is relevant to this criteria - transt.
| transt | n |
|---|---|
| Admitted from home | 5529 |
| Acute care hospital | 9 |
| Other | 5 |
| Chronic care facility | 4 |
| Outside emergency department | 4 |
| NA | 4 |
A total of 5529 patients are admitted from home. This exclusion criteria eliminates 26 patients.
The next exclusion criteria will be surgical specialty other than general surgery. Only a single variable is relevant - surgspec.
| surgspec | n |
|---|---|
| General surgery | 5506 |
| Vascular | 21 |
| Orthopedics | 1 |
| Urology | 1 |
A total of 5506 patients are operated on by a general surgeon. This exclusion criteria eliminates 23 patients.
There are various co-morbidities and pre-operative conditions that we will also use to exclude patients. These are:
diabetes)ventilat)ascites)hxchf)hxmi)hypermed)discancr)type_prsepis)#> diabetes ventilat ascites hxchf
#> Mode :logical Mode :logical Mode :logical Mode :logical
#> FALSE:4951 FALSE:5506 FALSE:5506 FALSE:5495
#> TRUE :555 TRUE :11
#> hxmi hypermed discancr type_prsepis
#> Mode :logical Mode :logical Mode :logical Sepsis: 17
#> FALSE:2 FALSE:3207 FALSE:5488 SIRS : 33
#> NA's :5504 TRUE :2299 TRUE :18 NA's :5456
A total of 3049 patients do not have any of these excluding co-morbid conditions. This exclusion criteria eliminates 2457 patients.
#> diabetes ventilat ascites hxchf hxmi
#> Mode :logical Mode :logical Mode :logical Mode :logical Mode:logical
#> FALSE:3049 FALSE:3049 FALSE:3049 FALSE:3049 NA's:3049
#> hypermed discancr type_prsepis
#> Mode :logical Mode :logical SIRS: 14
#> FALSE:3049 FALSE:3049 NA's:3035
We need to exclude patients that are missing required data:
height)weight)| Height missing | n |
|---|---|
| FALSE | 3039 |
| TRUE | 10 |
| Weight missing | n |
|---|---|
| FALSE | 3042 |
| TRUE | 7 |
A total of 3039 patients do not have incomplete data. This exclusion criteria eliminates 10 patients.
We must now eliminate patients with BMIs outside of the desired ranges (<30, 35-40). This will use the variable bmi.
| In range | n |
|---|---|
| FALSE | 822 |
| TRUE | 2217 |
A total of 2217 patients are within the desired BMI range. This exclusion criteria eliminates 822 patients.
We can now look at how many patients we have in each arm of the study:
| group | n |
|---|---|
| BMI <30 | 1954 |
| BMI 35-40 | 263 |
| group | cpt | n |
|---|---|---|
| BMI <30 | 44140 | 67 |
| BMI <30 | 44141 | 2 |
| BMI <30 | 44143 | 10 |
| BMI <30 | 44144 | 4 |
| BMI <30 | 44145 | 50 |
| BMI <30 | 44146 | 3 |
| BMI <30 | 44204 | 968 |
| BMI <30 | 44206 | 22 |
| BMI <30 | 44207 | 808 |
| BMI <30 | 44208 | 20 |
| BMI 35-40 | 44140 | 7 |
| BMI 35-40 | 44145 | 15 |
| BMI 35-40 | 44146 | 2 |
| BMI 35-40 | 44204 | 140 |
| BMI 35-40 | 44206 | 3 |
| BMI 35-40 | 44207 | 93 |
| BMI 35-40 | 44208 | 3 |