This is the second iteration of an exploratory data analysis - the following changes have been made to this analysis:
1. Get rid of smoking as an exclusion variable. Not a weight related comorbidity. Adds 322 patients back in.
2. Remove COPD as an exclusion variable. Not a weight related comorbidity. Adds 47 patients back in.
3. Remove EtOH as an exclusion variable. I think NSQIP stopped tracking this at some point so we shouldn’t be using it in any targeted data analysis.
4. Remove Esophageal Varices as an exclusion variable. I think NSQIP stopped tracking this at some point so we shouldn’t be using it in any targeted data analysis.
5. Remove Pre-op wound infection as a variable. This is not a weight related comorbidity. Adds 14 patients back in.
7. Consider removing dependent status and changing it to a matching variable. This would add 31 patients back in.
8. (this is the big one). There’s got to be more than that. I think this is a CPT code issue.
My guess is that the majority of the patients are actually going to be 44204 because 44207 implies a low pelvic anastomosis (LAR). Just did a quick analysis on an old targeted PUF through 2017 and over 40% of the chronic diverticulitis patients were 44204.
If this is the case, I think we should also add 44140, 44143, 44204 and 44206. We didn’t really want to look at Hartmann’s patients but they might be unplanned conversion to open patients with a secondary outcome of ostomy formation. And if they aren’t we can exclude them as a “discordance of approach.”
Do patients with a BMI of 25-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_44143, cpt_44145, cpt_44146, cpt_44204, cpt_44206, cpt_44207, cpt_44208
from
(
select caseid,
countif(cpt = "44140") cpt_44140,
countif(cpt = "44143") cpt_44143,
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","44143","44145", "44146", "44204", "44206", "44207", "44208"))
)
where (cpt_44140 + cpt_44143 + cpt_44145 + cpt_44146 + cpt_44204 + cpt_44206 + cpt_44207 + cpt_44208) = 1
)
unpivot (cpt for col in (cpt_44140, cpt_44143, 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_44143, cpt_44145, cpt_44146, cpt_44204, cpt_44206, cpt_44207, cpt_44208
from
(
select caseid,
countif(cpt = "44140") cpt_44140,
countif(cpt = "44143") cpt_44143,
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","44143","44145", "44146", "44204", "44206", "44207", "44208"))
)
where (cpt_44140 + cpt_44143 + cpt_44145 + cpt_44146 + cpt_44204 + cpt_44206 + cpt_44207 + cpt_44208) = 1
)
unpivot (cpt for col in (cpt_44140, cpt_44143, 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_44143, cpt_44145, cpt_44146, cpt_44204, cpt_44206, cpt_44207, cpt_44208
from
(
select caseid,
countif(cpt = "44140") cpt_44140,
countif(cpt = "44143") cpt_44143,
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","44143","44145", "44146", "44204", "44206", "44207", "44208"))
)
where (cpt_44140 + cpt_44143 + cpt_44145 + cpt_44146 + cpt_44204 + cpt_44206 + cpt_44207 + cpt_44208) = 1
)
unpivot (cpt for col in (cpt_44140, cpt_44143, 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 66558 patients.
| cpt | n |
|---|---|
| 44140 | 12777 |
| 44143 | 7175 |
| 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. 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 | 26271 |
| Chronic diverticular disease | 9719 |
| Other | 9016 |
| Non-malignant polyp | 6778 |
| Acute diverticulitis | 6723 |
| Colon cancer w/ obstruction | 2882 |
| Volvulus | 2786 |
| Chrohn’s disease | 1392 |
| Bleeding | 491 |
| Ulcerative colitis | 286 |
| Enterocolitis | 120 |
| NA | 94 |
A total of 9719 patients have chronic diverticular disease. This exclusion criteria eliminates 56839 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 | 6203 |
| Open | 1758 |
| Robotic | 1683 |
| SILS | 38 |
| Hybrid | 18 |
| Endoscopic | 6 |
| Other MIS | 6 |
| Other | 5 |
| NOTES | 2 |
A total of 7886 patients undergo laparoscopic or robotic surgery. This exclusion criteria eliminates 1833 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 | 4906 |
| TRUE | 2980 |
A total of 4906 patients do not have an open assist documented. This exclusion criteria eliminates 2980 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 | 146 |
| 44143 | FALSE | 16 |
| 44145 | FALSE | 55 |
| 44146 | FALSE | 3 |
| 44140 | TRUE | 193 |
| 44143 | TRUE | 48 |
| 44145 | TRUE | 193 |
| 44146 | TRUE | 18 |
A total of 452 patients have an open CPT with a laparoscopic or robotic approach and a conversion to open documented. A discordant documented approach eliminates 220 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 | 276 |
| TRUE | 4410 |
| emergncy | n |
|---|---|
| FALSE | 4626 |
| TRUE | 60 |
| col_emergent | n |
|---|---|
| Bleeding | 4 |
| Obstruction | 17 |
| Other | 8 |
| Perforation | 30 |
| NA | 4627 |
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 | 4407 |
| FALSE | FALSE | FALSE | 219 |
| FALSE | TRUE | TRUE | 56 |
| TRUE | TRUE | TRUE | 3 |
| FALSE | TRUE | FALSE | 1 |
A total of 4407 patients undergo elective surgery. This exclusion criteria eliminates 279 patients.
The next exclusion criteria will be inpatient surgery. Only a single variable is relevant to this criteria - inout.
| inout | n |
|---|---|
| FALSE | 28 |
| TRUE | 4379 |
As the table makes clear, only 28 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 | 4387 |
| Acute care hospital | 7 |
| Other | 5 |
| Chronic care facility | 3 |
| NA | 3 |
| Outside emergency department | 2 |
A total of 4387 patients are admitted from home. This exclusion criteria eliminates 20 patients.
The next exclusion criteria will be surgical specialty other than general surgery. Only a single variable is relevant - surgspec.
| surgspec | n |
|---|---|
| General surgery | 4365 |
| Vascular | 20 |
| Orthopedics | 1 |
| Urology | 1 |
A total of 4365 patients are operated on by a general surgeon. This exclusion criteria eliminates 22 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:3905 FALSE:4365 FALSE:4365 FALSE:4357
#> TRUE :460 TRUE :8
#> hxmi hypermed discancr type_prsepis
#> Mode :logical Mode :logical Mode :logical Sepsis: 7
#> FALSE:2 FALSE:2547 FALSE:4352 SIRS : 24
#> NA's :4363 TRUE :1818 TRUE :13 NA's :4334
A total of 2417 patients do not have any of these excluding co-morbid conditions. This exclusion criteria eliminates 1948 patients.
#> diabetes ventilat ascites hxchf hxmi
#> Mode :logical Mode :logical Mode :logical Mode :logical Mode:logical
#> FALSE:2417 FALSE:2417 FALSE:2417 FALSE:2417 NA's:2417
#> hypermed discancr type_prsepis
#> Mode :logical Mode :logical SIRS: 10
#> FALSE:2417 FALSE:2417 NA's:2407
We need to exclude patients that are missing required data:
height)weight)| Height missing | n |
|---|---|
| FALSE | 2408 |
| TRUE | 9 |
| Weight missing | n |
|---|---|
| FALSE | 2410 |
| TRUE | 7 |
A total of 2408 patients do not have incomplete data. This exclusion criteria eliminates 9 patients.
We must now eliminate patients with BMIs outside of the desired ranges (25-30, 35-40). This will use the variable bmi.
| In range | n |
|---|---|
| FALSE | 1337 |
| TRUE | 1071 |
A total of 1071 patients are within the desired BMI range. This exclusion criteria eliminates 1337 patients.
We can now look at how many patients we have in each arm of the study:
| group | n |
|---|---|
| BMI 25-30 | 867 |
| BMI 35-40 | 204 |
| group | cpt | n |
|---|---|---|
| BMI 25-30 | 44140 | 32 |
| BMI 25-30 | 44143 | 2 |
| BMI 25-30 | 44145 | 20 |
| BMI 25-30 | 44204 | 437 |
| BMI 25-30 | 44206 | 6 |
| BMI 25-30 | 44207 | 363 |
| BMI 25-30 | 44208 | 7 |
| BMI 35-40 | 44140 | 6 |
| BMI 35-40 | 44145 | 11 |
| BMI 35-40 | 44146 | 2 |
| BMI 35-40 | 44204 | 111 |
| BMI 35-40 | 44206 | 2 |
| BMI 35-40 | 44207 | 71 |
| BMI 35-40 | 44208 | 1 |