Table of contents

  1. Introduction
  2. Section I
    1. Number of Records
    2. Dataset Column names
    3. Duplications
    4. Unique records
    5. Identify and Delete empty columns
    6. Hospital locations
    7. Stages
  3. Section II: Identify characteristics enriched in people with HAPUs
    1. Identify enriched diagnoses
    2. Identify enriched OR procedures
    3. Identify enriched Lab values
    4. Identify enriched medications
    5. Identify trends in Blood Pressure prior to HAPU appearance
  4. Section III: HAPU and non-HAPU differentiating attributes
  5. Section IV: HAPU Predictive Model
  6. Section V: Future directions
    1. Model Implementation
    2. Therapeutic Interventions
  7. References
  8. Data cleaning and concerns
  9. Functions


Introduction

Affecting 2.5 million people annually, hospital acquired pressure ulcers (HAPUs) are defined as skin integrity disruption that causes deep tissue injury, cavitation, and infection (1-4). HAPUs most commonly result from impaired tissue perfusion due to unrelieved pressure over a boney surface (4-5). The degree of pressure ulcer severity ranges from alterations in skin coloration, temperature, and consistency (Stage I); epidermal and/or dermal skin loss (Stage II); subcutaneous skin necrosis extending through fascia (Stage III); full thickness tissue necrosis, including muscle, bone, or supporting tissue damage (Stage IV, Deep Tissue Injury); or the appearance of “dry black” necrotic tissue (Unstageable) (6). Physiologically, HAPU severity is dependent upon the length of time an individual resides in an undisturbed position. Non ambulatory or bed ridden individuals rely on aid from care takers to facilitate body movement. HAPUs that develop within the clinical setting (long-term facilities, hospitals) are classified as iatrogenic, and therefore treatment for HAPUs is not eligible for Medicare and Medicaid reimbursement, placing healthcare organizations at not only financial risk but also risk for litigation (8 ).

The cost of a HAPU ranges from $20,900 to $151,700, with an average cost of $43,180 per hospitalization (1-4). Nationally, this amounts to $9.1-$11.6 billion in annual charges (1-4). Administratively, additional personnel resources are required for successful prevention, management, and treatment of HAPUs. However, despite normalization of currently identified components of HAPU pathogenesis, including care provider neglect and length of motionless surface contact, HAPU appearance is not universally observed among hospital admissions. This suggests an individual mechanistic or physiological component to HAPU pathogenesis that is currently unresolved hampering identification of at risk individuals driving resource allocation.

To address this issue, we analyzed admitted client profiles, including diagnoses, interventions, common lab values, and medications to systematically define characteristics or parameters correlated with HAPU pathogenesis. These data were used to create a statistical model differentiating HAPU and non-HAPU hospital admissions. This document is broken down into five sections. Section I explores characteristics of the data gathered on people greater than 18 years of age who developed a HAPU at Loma Linda University Medical Center between 1/1/2015 and 10/1/2017. Section II investigates and identifies diagnoses, high/low lab values, operating room (OR) procedures, and medications that are correlated with HAPU incidence. Section III explores the identified attributes differentiating between people who develop a HAPU and those that do not. Section IV fits a model based on predictive attributes to discriminate between HAPU and non-HAPU individuals. Finally, in section V, we discuss future directions for implementation of these findings into hospital protocol and decision making to reduce HAPU prevalence.

Functions to reproduce this script can be found at the end of the document, at the following link: https://github.com/brengong/ClinicalDataMineR, and/or installed with the following code:

devtools::install_github('brengong/ClinicalDataMineR')




Back to top

options(warn=-1)
options(datatable.print.topn=200)
options(scipen=10)

suppressMessages(library(data.table))
suppressMessages(library(tidyverse))
suppressMessages(library(readxl))
suppressMessages(library(ggpubr))
suppressMessages(library(dplyr))
suppressMessages(library(dtplyr))
suppressMessages(library(purrr))
suppressMessages(library(stringr))
suppressMessages(library(gridExtra))
suppressMessages(library(caret))
suppressMessages(library(ClinicalDataMineR))

Section I: Exploration of data characteristics

In this section, we explore key aspects of the dataset that are relevant to the analysis in sections II, III, and IV. To accomplish the goal of identifying characteristics of people who develop HAPUs, we split the dataset to analyze 122 attributes from individuals who developed a HAPU for a total of 2,404 records. Of these records, we found a number of duplicated records constituting a significant portion of the dataset with the maximum record duplicated 69 times. However, these duplications were not always transferred to other columns in the dataset making the 2,404 records unique. We also identified 16 attributes containing no data and excluded them from the dataset. There were several other issues related to data formulated that require manual separation or editing to ensure all columns represent the column titles.

setwd("C:/Users/breng/Dropbox/Brendan Documents/Research/Research project/Pressure Ulcer project/data/HAPU data")
ulcer <- rbindlist(map(list.files(path = ".", pattern="*.csv"), loaddata),use.names=TRUE, fill=TRUE) %>% tbl_dt   
setwd("C:/Users/Breng/Dropbox/Brendan Documents/Research/Research project/Pressure Ulcer project")
#### load control dataset ####
setwd("C:/Users/Breng/Dropbox/Brendan Documents/Research/Research project/Pressure Ulcer project/data/control data")
noulcer <- rbindlist(map(list.files(path = ".", pattern="*.csv"), loaddata),use.names=TRUE, fill=TRUE) %>% tbl_dt   
setwd("C:/Users/Breng/Dropbox/Brendan Documents/Research/Research project/Pressure Ulcer project")

Number of Records

dim(ulcer)
## [1] 2404  122

Dataset Column names

names(ulcer)[c(1:2, 6:ncol(ulcer))]
##   [1] "admdatetime"                               
##   [2] "dischdatetime"                             
##   [3] "dateofdeath"                               
##   [4] "pressureulcerstaging"                      
##   [5] "patientdiagnosis"                          
##   [6] "unithapudocumented"                        
##   [7] "losfromhaputodischarge"                    
##   [8] "losfromadmissiontodischarge"               
##   [9] "orprocedures"                              
##  [10] "lengthoftimeined"                          
##  [11] "edacuity"                                  
##  [12] "transfers"                                 
##  [13] "patenccsnid"                               
##  [14] "inpatientdataid"                           
##  [15] "bpprior"                                   
##  [16] "bpafter"                                   
##  [17] "tempprior"                                 
##  [18] "heartrateprior"                            
##  [19] "heartrateafter"                            
##  [20] "resprateprior"                             
##  [21] "resprateafter"                             
##  [22] "pulseoximetryprior"                        
##  [23] "pulseoximetryafter"                        
##  [24] "arteriallinebloodpressurepr"               
##  [25] "arteriallinebloodpressureaftr"             
##  [26] "mapalinepr"                                
##  [27] "mapalineaftr"                              
##  [28] "pappr"                                     
##  [29] "papaftr"                                   
##  [30] "devicepapmeanpr"                           
##  [31] "devicepapmeanaftr"                         
##  [32] "centralvenouspressurepr"                   
##  [33] "centralvenouspressureaftr"                 
##  [34] "pulmonarycapillarywedgepressurepr"         
##  [35] "pulmonarycapillarywedgepressureaftr"       
##  [36] "cardiacoutputpr"                           
##  [37] "cardiacoutputaftr"                         
##  [38] "devicecontinuouscardiacoutputpr"           
##  [39] "devicecontinuouscardiacoutputaftr"         
##  [40] "cardiacindexpr"                            
##  [41] "cardiacindexaftr"                          
##  [42] "devicecontinuouscardiacindexpr"            
##  [43] "devicecontinuouscardiacindexaftr"          
##  [44] "systemicvascularresistancecomplexpr"       
##  [45] "systemicvascularresistancecomplexaftr"     
##  [46] "systemicvascularresistanceindexcomplexpr"  
##  [47] "systemicvascularresistanceindexcomplexaftr"
##  [48] "strokevolumecomplexpr"                     
##  [49] "strokevolumecomplexaftr"                   
##  [50] "strokevolumeindexcomplexpr"                
##  [51] "strokevolumeindexcomplexaftr"              
##  [52] "strokevolumevariancepr"                    
##  [53] "strokevolumevarianceaftr"                  
##  [54] "deltastrokevolumepr"                       
##  [55] "deltastrokevolumeaftr"                     
##  [56] "centralvenoussaturationcomplexpr"          
##  [57] "centralvenoussaturationcomplexaftr"        
##  [58] "saturatedvenouso2pr"                       
##  [59] "saturatedvenouso2aftr"                     
##  [60] "intracranialpressuremeanpr"                
##  [61] "intracranialpressuremeanaftr"              
##  [62] "cerebralperfusionpressurepr"               
##  [63] "cerebralperfusionpressureaftr"             
##  [64] "nibpcerebralperfusionpressurepr"           
##  [65] "nibpcerebralperfusionpressureaftr"         
##  [66] "braintemperaturepr"                        
##  [67] "braintemperatureaftr"                      
##  [68] "braintissuemoniotorpbto2pr"                
##  [69] "braintissuemoniotorpbto2aftr"              
##  [70] "bladderintraabdominalpressurepr"           
##  [71] "bladderintraabdominalpressureaftr"         
##  [72] "ipinvasiveventmodepr"                      
##  [73] "ipinvasiveventmodeaftr"                    
##  [74] "ventrespratesetpr"                         
##  [75] "ventrespratesetaftr"                       
##  [76] "venttidalvolumesetpr"                      
##  [77] "venttidalvolumesetaftr"                    
##  [78] "ventpeeppr"                                
##  [79] "ventpeepaftr"                              
##  [80] "ventinsptimepr"                            
##  [81] "ventinsptimeaftr"                          
##  [82] "ventinsptimeperctpr"                       
##  [83] "ventinsptimeperctaftr"                     
##  [84] "ventpresssupportpr"                        
##  [85] "ventpresssupportaftr"                      
##  [86] "rtinspiratorypressurepr"                   
##  [87] "rtinspiratorypressureaftr"                 
##  [88] "rtjetsetratepr"                            
##  [89] "rtjetsetrateaftr"                          
##  [90] "rtnavalevelpr"                             
##  [91] "rtnavalevelaftr"                           
##  [92] "aprvtimehighpr"                            
##  [93] "aprvtimehighaftr"                          
##  [94] "aprvtimelowpr"                             
##  [95] "aprvtimelowaftr"                           
##  [96] "ventnoppmsetpr"                            
##  [97] "ventnoppmsetaftr"                          
##  [98] "ventnoppmobspr"                            
##  [99] "ventnoppmobsaftr"                          
## [100] "ventppmno2obspr"                           
## [101] "ventppmno2obsaftr"                         
## [102] "oxygendevicepr"                            
## [103] "oxygendeviceaftr"                          
## [104] "fio2pr"                                    
## [105] "fio2aftr"                                  
## [106] "oxygenflowratepr"                          
## [107] "oxygenflowrateaftr"                        
## [108] "ipendtidalco2pr"                           
## [109] "ipendtidalco2aftr"                         
## [110] "rttcmtcpo2pr"                              
## [111] "rttcmtcpo2aftr"                            
## [112] "rttcmtcpco2pr"                             
## [113] "rttcmtcpco2aftr"                           
## [114] "labsprior"                                 
## [115] "labsafter"                                 
## [116] "ptameds"                                   
## [117] "medsprior"                                 
## [118] "medsafter"                                 
## [119] "wherefrom"

Duplications

frequenciesdyn("ulcer","patmrnid")
## Source: local data table [945 x 3]
## 
## # A tibble: 945 x 3
##    patmrnid count percent
##       <int> <int>   <dbl>
##  1  1237569    69   2.87 
##  2  1426519    26   1.08 
##  3  6344907    25   1.04 
##  4  1939126    22   0.915
##  5  7350905    22   0.915
##  6  7203642    20   0.832
##  7  7340607    18   0.749
##  8  6132320    17   0.707
##  9  7344881    16   0.666
## 10  7223490    16   0.666
## # ... with 935 more rows

Unique records

uniqueN(ulcer,by=names(ulcer))
## [1] 2404

Identify empty columns

# identify and delete all missing data columns
DT <- copy(ulcer)
DT$recno <- 1:nrow(DT)
dim(DT)
## [1] 2404  123
# identify all missing data columns
names(DT)[which(map_int(names(DT),function(s) sum(!(DT[[s]]=="" | is.na(DT[[s]]))))==0)]
##  [1] "pulmonarycapillarywedgepressurepr"
##  [2] "devicecontinuouscardiacindexpr"   
##  [3] "devicecontinuouscardiacindexaftr" 
##  [4] "deltastrokevolumepr"              
##  [5] "deltastrokevolumeaftr"            
##  [6] "saturatedvenouso2pr"              
##  [7] "saturatedvenouso2aftr"            
##  [8] "braintemperaturepr"               
##  [9] "braintemperatureaftr"             
## [10] "braintissuemoniotorpbto2pr"       
## [11] "braintissuemoniotorpbto2aftr"     
## [12] "ventinsptimeperctaftr"            
## [13] "rtjetsetratepr"                   
## [14] "rtjetsetrateaftr"                 
## [15] "rtnavalevelpr"                    
## [16] "rtnavalevelaftr"                  
## [17] "rttcmtcpo2aftr"                   
## [18] "rttcmtcpco2aftr"

Delete empty columns

# now delete them
DT[,names(DT)[which(map_int(names(DT),function(s) sum(!(DT[[s]]=="" | is.na(DT[[s]]))))==0)] := NULL]
dim(DT)
## [1] 2404  105
#check missing columns again
names(DT)[which(map_int(names(DT),function(s) sum(!(DT[[s]]=="" | is.na(DT[[s]]))))==0)]
## character(0)

Back to top

Hospital locations

Next, an exploration of the locations correlated to HAPU incidence and prevalence was conducted. After tabulating the number of records according to their location, we identified 76% of HAPUs to be correlated with the Emergency Room (ER). As the majority of LLU admissions occur through the ER, this finding may not be due to ER staff conduct but instead is more likely secondary to client volume. There was no correlation between length of stay in the ER and pressure ulcer prevalence. Additionally, a large percentage of HAPU sufferers resided in multiple locations as a result of interdepartmental transfers.

frequenciesdyn("DT","wherefrom")
## Source: local data table [5 x 3]
## 
## # A tibble: 5 x 3
##   wherefrom count percent
##   <chr>     <int>   <dbl>
## 1 ER         1829   76.1 
## 2 surgeries   318   13.2 
## 3 ICU         193    8.03
## 4 neuro        33    1.37
## 5 OR           31    1.29
df <- frequenciesdyn("DT","wherefrom")
df$mercol <- paste(df$wherefrom, 1:nrow(df), sep = "_")
setnames(df, colnames(df), c("Location", "Count", "percent",  "mercol"))

g1 <- ggbarplot(df, x = "Location", y = "Count",
          fill = "Location",               # change fill color by cyl
          color = "white",            # Set bar border colors to white
          palette = "jco",            # jco journal color palett. see ?ggpar
          sort.val = "desc",          # Sort the value in dscending order
          sort.by.groups = FALSE,     # Don't sort inside each group
          x.text.angle = 40           # Rotate vertically x axis texts
)
print(g1)

# ggplotly(g1)

Identify common pressure ulcer stages

The staging prevalence of institutional wide HAPUs was computed. To accomplish this, we developed a function that scans the “pressureulcerstaging” column and standardizes the HAPU naming convention into “Stage I”, “Stage II”, “Stage III”, “Stage IV”, “Unstageable”, “Mucosal”, or “Not Staged”, categories. Additionally, records containing multiple stages were separated into individual records, each containing a unique stage. The “Not Staged” category represents individuals who developed a HAPU but were not annotated with any staging information. Following this data cleaning step, Stage II HAPUs are the most prevalent followed by Stage IV.

stage <- StageCleanR(DT)
stage[is.na(stage$pressureulcerstaging),]$pressureulcerstaging <- "Not Staged"
frequenciesdyn("stage","pressureulcerstaging") 
##    pressureulcerstaging count   percent
## 1:             Stage II   997 36.994434
## 2:   Deep Tissue Injury   531 19.703154
## 3:              Stage I   449 16.660482
## 4:           Unstagable   268  9.944341
## 5:           Not Staged   167  6.196660
## 6:            Stage III   115  4.267161
## 7:              Mucosal    96  3.562152
## 8:             Stage IV    72  2.671614
df <- frequenciesdyn("stage","pressureulcerstaging")
# df$mercol <- paste(df$pressureulcerstaging, 1:nrow(df), sep = "_")
setnames(df, colnames(df), c("Staging", "Count", "percent"))

g1 <- ggbarplot(df, x = "Staging", y = "Count",
          fill = "Staging",               # change fill color by cyl
          color = "white",            # Set bar border colors to white
          palette = "jco",            # jco journal color palett. see ?ggpar
          sort.val = "desc",          # Sort the value in dscending order
          sort.by.groups = FALSE,     # Don't sort inside each group
          x.text.angle = 40           # Rotate vertically x axis texts
)
print(g1)

# ggplotly(g)

Section II: Identify characteristics that are enriched in people who get HAPUs.

Currently, prolonged immobility is considered the sole HAPU causative factor yet does not accurately predict HAPU occurrence in all individuals. To elucidate potential causal characteristics of HAPU unique to LLUMC cliental, we began by conducting an exploration of enriched characteristics in multivariable columns, including diagnoses, Operating Room (OR) procedures, lab values, and medications. Articulated in the following subsections, we identified a number of variables enriched prior to HAPU appearance, which are correlative in nature and do not prove cause and effect. In this section, we also analyzed the prevalence of systolic and diastolic blood pressure (BP) trends prior to HAPU appearance to explore the prevalent belief of a strong correlation between hypotension and HAPU pathogenesis.

Identify enriched diagnoses

The diagnosis column of this dataset lists a diagnosis code followed by a description of the diagnosis. Due to the large degree of variability in diagnosis descriptions in addition to a number of diagnosis codes lacking a description, computations were conducted according to the diagnosis code only. Therefore, in order to identify diagnoses that are common among people who develop HAPUs, we wrote a function that identifies each diagnosis codes and parses them into individual records for each client. Only duplicated diagnosis records were removed for a given client. Therefore, a number of duplicated records are retained, each with unique diagnosis classifications. However, the initial output identified several different codes for a particular diagnosis. This required manual research old and new codes for diagnoses and sub categories of diagnoses to the codes can be merged or combined for the same diagnosis. We then tabulated the number of times each diagnosis code appeared and ranked them according to abundance.

un <- unique(DT,  by = c("patname", "patmrnid", "patientdiagnosis"))
#### clean up records ####
diagDT <- DiagnosisCleaner(DT = un)
diagDT$recno <- as.numeric(diagDT$recno) 

#### Annotate missing values ####
ann <- diagDT[752:nrow(diagDT),][,c(1,2)]
ann <- ann[!duplicated(ann$diagnosis),]
diag <- diagDT[,c(1,3)]
mer <- merge(diag, ann, by = "diagnosis", all.x = TRUE)
mer <- mer[order(mer$recno),]
df <- frequenciesdyn("mer","Annotation")
df <- df[!is.na(df$Annotation),]
df <- df[!df$Annotation == "NA NA",]

#### Plot results ####
maxct <- max(df$count)
howmany <- nrow(df)
g1 <- ggplot(df[1:howmany], 
             aes(y=count, x=reorder(Annotation,-count), ymin=0, ymax=count), col="blue") +
  geom_point(size=1, color="#E7B800") + #geom_point(size=1, color="blue") + 
  geom_linerange(size=0.5, color="#00AFBB") +# geom_linerange(size=.5, color="blue") +
  theme(plot.title = element_text(size = 10,colour="black")) +  
  # coord_flip() +
  theme_pubr()+#     theme(axis.text=element_text(size=rel(0.5)),axis.title=element_text(size=rel(0.6))) +
  # geom_text(aes(label = paste(count,sep=":::"), y = count + .05*maxct), size = 2) +
  ggtitle("Diagnosis Frequency\n") +
  ylab("Frequency") +
  xlab("Diagnosis\n")

# ggplotly(g1)
g1 + rremove("x.text") + rremove("x.ticks")

# print(g1)




maxct <- max(df$count)
howmany <- 50#nrow(df)
g1 <- ggplot(df[1:howmany], 
             aes(y=count, x=reorder(Annotation,count), ymin=0, ymax=count), col="blue") +
  geom_point(size=2, color="#E7B800") + #geom_point(size=1, color="blue") + 
  geom_linerange(size=1, color="#00AFBB") +# geom_linerange(size=.5, color="blue") +
  theme(plot.title = element_text(size = 10,colour="black")) +  
  coord_flip() +
  theme_pubr()+#     theme(axis.text=element_text(size=rel(0.5)),axis.title=element_text(size=rel(0.6))) +
  geom_text(aes(label = paste(count,sep=":::"), y = count + .05*maxct), size = 4) +
  ggtitle("Diagnosis Frequency (Top 50)\n") +
  ylab("Frequency") +
  xlab("Diagnosis\n")

# ggplotly(g1)
print(g1)

#### create diagnosis Score ####
df$score <- (df$count/nrow(un))
diagscore <- df

Identify enriched OR procedures

In this sub section, our goal is to identify specific OR procedures that are commonly conducted on individuals who develop HAPUs. Only duplicated OR procedures were removed for a given client. Therefore, a number of duplicated records are retained, each with a unique set of OR procedures. Following duplication removal, due to the variability in documentation, we wrote a function to uniformly annotate all OR procedures. This was accomplished by recognizing and substituting discrepancies within the documentation of identical procedures. Once uniformly labeled, all OR procedures were parsed into multiple records for each individual client. We then tabulated the number of times each OR procedure appeared and ranked them according to abundance. The most abundant diagnoses are illustrated in the graphs.

#### remove duplicated procedures for each record number ####
un <- unique(DT,  by = c("patname", "patmrnid", "orprocedures"))
#### clean up records ####
proc <- ProcedureCleaner(DT = un)
#### remove people who don't have a procedure
proc <- proc[!is.na(proc$orprocedures),]
#### pressure ulcer independent of staging ####
df <- frequenciesdyn("proc","orprocedures")
df2 <- df
df2$orprocedures <- gsub("_", " ", df$orprocedures)#### New code

#### Plot results ####
maxct <- max(df2$count)
howmany <- nrow(df2)
g1 <- ggplot(df2[1:howmany],
             aes(y=count, x=reorder(orprocedures,-count), ymin=0, ymax=count), col="blue") +
  geom_point(size=2, color="#E7B800") + #geom_point(size=1, color="blue") + 
  geom_linerange(size=1, color="#00AFBB") +# geom_linerange(size=.5, color="blue") +
  theme(plot.title = element_text(size = 10,colour="black")) +
  # coord_flip() +
  theme_pubr()+#theme(axis.text=element_text(size=rel(0.5)),axis.title=element_text(size=rel(0.6))) +
  # geom_text(aes(label = paste(count,sep=":::"), y = count + .05*maxct), size = 2) +
  ggtitle("OR Procedure Frequency\n") +
  ylab("Frequency") +
  xlab("OR Procedure\n")
g1 + rremove("x.text") + rremove("x.ticks")




maxct <- max(df2$count)
howmany <- 50#75
g1 <- ggplot(df2[1:howmany],
             aes(y=count, x=reorder(orprocedures,count), ymin=0, ymax=count), col="blue") +
  geom_point(size=2, color="#E7B800") + #geom_point(size=1, color="blue") + 
  geom_linerange(size=1, color="#00AFBB") +# geom_linerange(size=.5, color="blue") +
  theme(plot.title = element_text(size = 10,colour="black")) +
  coord_flip() +
  theme_pubr()+#theme(axis.text=element_text(size=rel(0.5)),axis.title=element_text(size=rel(0.6))) +
  geom_text(aes(label = paste(count,sep=":::"), y = count + .05*maxct), size = 4) +
  ggtitle("OR Procedure Frequency (Top 50)\n") +
  ylab("Frequency") +
  xlab("OR procedure\n")
print(g1)

#### create procedure Score ####
df$score <- (df$count/nrow(un))
procscore <- df

Identify enriched Lab values

In this sub section, our goal is to identify overall high, low, or normal lab values that are common to individuals prior to HAPU appearance. Only duplicated lab sets were removed for a given client. Therefore, a number of duplicated records are retained, each with unique set of lab values. To accomplish our objective in this subsection, we wrote two functions. The first one recognizes the lab test and the lab value. It then parses these two values into individual columns, removes the unit measurement from the lab value, and parses this data into multiple records for each client. The second function then reads a comprehensive data table containing high/low lab values and categorized each lab into high, low, or normal ranges. We then tabulated the number of times each high, low, or normal lab value appeared and ranked them according to abundance. The most abundant lab annotations are illustrated in the graphs below.

#### remove duplicated labs for each record number ####
un <- unique(DT,  by = c("patname", "patmrnid", "labsprior"))
#### clean up records ####
labpriorDT <- Labcleanr(DT =un, type = "prior")
labpriorDT$labs_prior <- as.character(labpriorDT$labs_prior)
labpriorDT$values_prior <- as.numeric(labpriorDT$values_prior)
#### remove people who don't have a blood pressure
labpriorDT <- labpriorDT[!labpriorDT$labs_prior == "N/A",]
#### Annotate with high/low values ####
normval <- fread("./normal lab values/Normal lab values.csv")
setnames(normval, colnames(normval), c("labs_prior", "low", "high")   )
LJ <- merge(x = labpriorDT, y = normval, by = "labs_prior", all.x = TRUE)
LJ <- LJ[order(LJ$recno),]
LJ <- LJ[!is.na(LJ$low),]
LJ <- LJ[!is.na(LJ$high),]
lab_annotation <- labAnnotatR(LJ, type = "prior")
LJ$labannotation <- lab_annotation
LJ <- data.table(LJ)
df <- frequenciesdyn("LJ","labannotation")
df2 <- df 
df2$labannotation <- gsub("_", " ", df$labannotation)

#### plot results ####
maxct <- max(df2$count)
howmany <- nrow(df2)
g1 <- ggplot(df2[1:howmany],
             aes(y=count, x=reorder(labannotation,-count), ymin=0, ymax=count), col="blue") +
  geom_point(size=2, color="#E7B800") + #geom_point(size=1, color="blue") + 
  geom_linerange(size=1, color="#00AFBB") +# geom_linerange(size=.5, color="blue") +
  theme(plot.title = element_text(size = 10,colour="black")) +
  # coord_flip() +
    theme_pubr()+#     theme(axis.text=element_text(size=rel(0.5)),axis.title=element_text(size=rel(0.6))) +
  # geom_text(aes(label = paste(count,sep=":::"), y = count + .05*maxct), size = 2) +
  ggtitle("Lab Value Frequency\n") +
  ylab("Frequency") +
  xlab("Lab value\n")
g1 + rremove("x.text") + rremove("x.ticks")




maxct <- max(df2$count)
howmany <- 50
g1 <- ggplot(df2[1:howmany],
             aes(y=count, x=reorder(labannotation,count), ymin=0, ymax=count), col="blue") +
  geom_point(size=2, color="#E7B800") + #geom_point(size=1, color="blue") + 
  geom_linerange(size=1, color="#00AFBB") +# geom_linerange(size=.5, color="blue") +
  theme(plot.title = element_text(size = 10,colour="black")) +
  coord_flip() +
  theme_pubr()+#     theme(axis.text=element_text(size=rel(0.5)),axis.title=element_text(size=rel(0.6))) +
  geom_text(aes(label = paste(count,sep=":::"), y = count + .05*maxct), size = 3) +
  ggtitle("Lab Value Frequency (Top 50)\n") +
  ylab("Frequency") +
  xlab("Lab value\n")

print(g1)

#### create labs Score ####
df$score <- (df$count/nrow(un))
labscore <- df

Identify enriched medications

In this sub section, our goal was to identify medications that are commonly prescribed to individuals prior to HAPU appearance. Only duplicated medication sets were removed for a given client. Therefore, a number of duplicated records are retained, each with a unique set of prescribed medications. Additionally, due to protocol standardization of medication prescriptions, we were only interested in the prescribed medication and not the dose. To accomplish our objectives in this subsection, we wrote a function that identifies the name of the prescribed medication, separates it from the dose, and parses it into multiple rows for each client. We then tabulated the number of times each medication appeared and ranked them according to abundance. The most abundant medications are illustrated in the graphs below.

#### remove duplicated diagnoses for each record number ####
un <- unique(DT,  by = c("patname", "patmrnid", "medsprior"))
#### clean up records ####
DTlab <- MedsCleanR(DT = un, type = "prior")
#### remove people who don't have any meds
DTlab <- DTlab[!DTlab$meds_prior == "N/A",]
df <- frequenciesdyn("DTlab","meds_prior")

#### plot results ####
maxct <- max(df$count)
howmany <- nrow(df)
g1 <- ggplot(df[1:howmany],
             aes(y=count, x=reorder(meds_prior,-count), ymin=0, ymax=count), col="blue") +
  geom_point(size=2, color="#E7B800") + #geom_point(size=1, color="blue") + 
  geom_linerange(size=1, color="#00AFBB") +# geom_linerange(size=.5, color="blue") +
  theme(plot.title = element_text(size = 10,colour="black")) +
  # coord_flip() +
  theme_pubr()+#     theme(axis.text=element_text(size=rel(0.5)),axis.title=element_text(size=rel(0.6))) +
  # geom_text(aes(label = paste(count,sep=":::"), y = count + .05*maxct), size = 2) +
  ggtitle("Medication Frequency\n") +
  ylab("Frequency") +
  xlab("Medication\n")
g1 + rremove("x.text") + rremove("x.ticks")




maxct <- max(df$count)
howmany <- 50
g1 <- ggplot(df[1:howmany],
             aes(y=count, x=reorder(meds_prior,count), ymin=0, ymax=count), col="blue") +
  geom_point(size=2, color="#E7B800") + #geom_point(size=1, color="blue") + 
  geom_linerange(size=1, color="#00AFBB") +# geom_linerange(size=.5, color="blue") +
  theme(plot.title = element_text(size = 10,colour="black")) +
  coord_flip() +
  theme_pubr()+#     theme(axis.text=element_text(size=rel(0.5)),axis.title=element_text(size=rel(0.6))) +
  geom_text(aes(label = paste(count,sep=":::"), y = count + .05*maxct), size = 3) +
  ggtitle("Medication Frequency (Top 50)\n") +
  ylab("Frequency") +
  xlab("Medication\n")

print(g1)

#### create med Score ####
df$score <- (df$count/nrow(un))
medscore <- df

Section III: HAPU and non-HAPU differentiating attributes

Section II identifies attributes of individuals who develop a pressure ulcer in multivariate columns of the dataset including diagnoses, OR procedures, labs, and medications. To accomplish this, we developed a quantification system to score these individual components to assess risk of HAPU appearance. This scoring system, in addition to the most abundantly measured dataset attributes, are compared to control HAPU free individuals to identify predictive power.

The Diagnosis, Procedure, Lab, and Medication Scores consist of the numerical enrichment number divided by the total number of attributes for each multivariate column illustrated in Section II. Each individual is then annotated with corresponding scores according to the multivariate column attributes, which are summed into an overall Diagnosis, Procedure, Lab, or Medication Score. Illustrated in the first four density plots below, these scores differentiate between HAPU and non-HAPU individuals. However, averaging or summating these scores is of little value. Of the remaining single variant columns in the dataset, we focused on the ones measured most frequently prior to HAPU appearance. Of these columns, the length of stay has the most predictive power with a higher average length of stay among HAPU sufferers.

#### Diagnosis ####
p1 <- ggdensity(finDT, x = "Log_Diagnosis_Score",
          add = "mean", rug = TRUE,
          color = "Appearance", fill = "Appearance",
          palette = c("#00AFBB", "#E7B800"),
          title = "Log Diagnosis Score")

#### Procedure ####
p2 <- ggdensity(finDT, x = "Procedure_Score",
          add = "mean", rug = TRUE,
          color = "Appearance", fill = "Appearance",
          palette = c("#00AFBB", "#E7B800"),
          title = "Procedure Score")

#### labs ####
p3 <- ggdensity(finDT, x = "Lab_Score",
          add = "mean", rug = TRUE,
          color = "Appearance", fill = "Appearance",
          palette = c("#00AFBB", "#E7B800"),
          title = "Lab Score")

#### meds ####
p4 <- ggdensity(finDT, x = "Medication_Score",
          add = "mean", rug = TRUE,
          color = "Appearance", fill = "Appearance",
          palette = c("#00AFBB", "#E7B800"),
          title = "Medication Score")

#### Overall score
p5 <- ggdensity(finDT, x = "Average_Score",
                add = "mean", rug = TRUE,
                color = "Appearance", fill = "Appearance",
                palette = c("#00AFBB", "#E7B800"),
                title = "ave diag, proc, lab, med")

#### time of length of stay only ####
p6 <- ggdensity(finDT, x = "length_of_Stay",
          add = "mean", rug = TRUE,
          color = "Appearance", fill = "Appearance",
          palette = c("#00AFBB", "#E7B800"),
          title = "Length of Stay",
          xlim = c(0,100))

#### temperature only ####
p7 <- ggdensity(finDT, x = "Temperature",
          add = "mean", rug = TRUE,
          color = "Appearance", fill = "Appearance",
          palette = c("#00AFBB", "#E7B800"),
          title = "Temperature",
          xlim = c(90,110))

#### Heart rate only ####
p8 <- ggdensity(finDT, x = "HR",
          add = "mean", rug = TRUE,
          color = "Appearance", fill = "Appearance",
          palette = c("#00AFBB", "#E7B800"),
          title = "Heart Rate")

#### SpO2 only ####
p9 <- ggdensity(finDT, x = "SPO2",
          add = "mean", rug = TRUE,
          color = "Appearance", fill = "Appearance",
          palette = c("#00AFBB", "#E7B800"),
          title = "SpO2",
          xlim = c(88,100))

#### Respiratory rate only ####
p10 <- ggdensity(finDT, x = "RR",
          add = "mean", rug = TRUE,
          color = "Appearance", fill = "Appearance",
          palette = c("#00AFBB", "#E7B800"),
          title = "Respiratory Rate",
          xlim = c(0,50))

#### MAP only ####
p11 <- ggdensity(finDT, x = "MAP",
          add = "mean", rug = TRUE,
          color = "Appearance", fill = "Appearance",
          palette = c("#00AFBB", "#E7B800"),
          title = "MAP")

#### Systolic Prior Blood pressures ####
p12 <- ggdensity(finDT, x = "systolic_prior",
                 add = "mean", rug = TRUE,
                 color = "Appearance", fill = "Appearance",
                 palette = c("#00AFBB", "#E7B800"),
                 title = "Systolic BP")

#### Diastolic Prior Blood pressures ####
p13 <- ggdensity(finDT, x = "diastolic_prior",
                 add = "mean", rug = TRUE,
                 color = "Appearance", fill = "Appearance",
                 palette = c("#00AFBB", "#E7B800"),
                 title = "Diastolic BP")

#### Arterial line Systolic Prior Blood pressures ####
p14 <- ggdensity(finDT, x = "arterial_line_systolic_prior",
                 add = "mean", rug = TRUE,
                 color = "Appearance", fill = "Appearance",
                 palette = c("#00AFBB", "#E7B800"),
                 title = "A Line Systolic BP")

#### Arterial line Diastolic Prior Blood pressures ####
p15 <- ggdensity(finDT, x = "arterial_line_diastolic_prior",
                 add = "mean", rug = TRUE,
                 color = "Appearance", fill = "Appearance",
                 palette = c("#00AFBB", "#E7B800"),
                 title = "A Line Diastolic BP")

#### FiO2 prior ####
p16 <- ggdensity(finDT, x = "fio2pr",
                 add = "mean", rug = TRUE,
                 color = "Appearance", fill = "Appearance",
                 palette = c("#00AFBB", "#E7B800"),
                 title = "FiO2")

grid.arrange(p1, p2, p3, p4, ncol=2)

grid.arrange(p5, p6, p7, p8,ncol=2)

grid.arrange(p9, p10, p11, p12, ncol=2)

grid.arrange(p13, p14, p15, p16, ncol=2)

Section IV: HAPU Predictive Model

Previous sections have identified characteristics of individuals sustaining HAPUs (Section II), quantifying those characteristics (Section III), and identifying characteristic that discern HAPU from non-HAPU individuals (Section III). This section builds on those findings to create a predictive model that accurately discriminates between HAPU and non-HAPU individuals. To test this hypothesis, we bound the non-HAPU and HAPU datasets together. Once bound, we calculated a Procedure, Lab, Diagnosis, and Medication Score for each record, followed by calculating their score average and binding this dataset together, with systolic and diastolic BP, length of stay, temperature, HR, SPO2, RR, FiO2, O2 flow rate, and MAP. We then partitioned the data into training and testing datasets, fit a random forest model to the training data, and tested the accuracy of the fit model against the testing data. Only complete cases were used for training and testing.

Data table of computed values

finDT$systolic_prior <- as.numeric(finDT$systolic_prior)
finDT$diastolic_prior <- as.numeric(finDT$diastolic_prior)
finDT$length_of_Stay <- as.numeric(finDT$length_of_Stay)
finDT$HR <- as.numeric(finDT$HR)
finDT$SPO2  <- as.numeric(finDT$SPO2)
finDT$RR <- as.numeric(finDT$RR)
finDT$MAP <- as.numeric(finDT$MAP)
finDT$arterial_line_systolic_prior <- as.numeric(finDT$arterial_line_systolic_prior)
finDT$arterial_line_diastolic_prior <- as.numeric(finDT$arterial_line_diastolic_prior)
finDT$fio2pr <- as.numeric(finDT$fio2pr)

head(finDT)
##    recno          SU Appearance Average_Score Log_Diagnosis_Score
## 1:     1 0.001568627      ULCER    -9.3162815                  NA
## 2:     2 1.323660558      ULCER     0.4045332                  NA
## 3:     3 7.094213630      ULCER     2.8266428                  NA
## 4:     4 4.464333787      ULCER     2.1584449                  NA
## 5:     5 3.192701331      ULCER     1.6747776                  NA
## 6:     6 9.318262409      ULCER     3.2200610                  NA
##    Procedure_Score Lab_Score Medication_Score systolic_prior
## 1:     0.001568627  0.000000        0.0000000            118
## 2:     0.003137255  1.320523        0.0000000            144
## 3:     0.093333333  6.088307        0.9125729            123
## 4:     0.093333333  4.110384        0.2606162            119
## 5:     0.093333333  2.211774        0.8875937            132
## 6:     0.093333333  9.130008        0.0949209            139
##    diastolic_prior arterial_line_systolic_prior
## 1:              50                          113
## 2:              88                           NA
## 3:              54                           NA
## 4:              37                          118
## 5:              88                          125
## 6:              74                          172
##    arterial_line_diastolic_prior fio2pr oxygenflowratepr length_of_Stay
## 1:                            42     50               NA             28
## 2:                            NA     35                5              8
## 3:                            NA     28               10             23
## 4:                            36     30               60             34
## 5:                            81     50               NA             79
## 6:                            61     30               75            107
##    Temperature HR SPO2 RR MAP Pulse_Pressure
## 1:        98.6 60  100 10  64             68
## 2:        98.5 84  100 16  NA             56
## 3:        98.1 88  100 23  NA             69
## 4:        98.1 77   98 17  54             82
## 5:        98.5 95   97 20  99             44
## 6:        98.4 75   95 27  90             65
tail(finDT)
##    recno        SU Appearance Average_Score Log_Diagnosis_Score
## 1:  6568 1.0098119    NOULCER    0.01408664                  NA
## 2:  6569 1.2412825    NOULCER    0.31183154           -2.846349
## 3:  6570 0.1939805    NOULCER   -2.36601656                  NA
## 4:  6571 1.2890350    NOULCER    0.36629143           -3.105436
## 5:  6572 0.2980604    NOULCER   -1.74632329                  NA
## 6:  6573 0.6336942    NOULCER   -0.65814125           -2.064630
##    Procedure_Score Lab_Score Medication_Score systolic_prior
## 1:               0 1.0098119       0.00000000            107
## 2:               0 1.0098119       0.09242298            118
## 3:               0 0.1831562       0.01082431            121
## 4:               0 1.0188062       0.15403830            136
## 5:               0 0.1831562       0.11490425            107
## 6:               0 0.1831562       0.21149042            133
##    diastolic_prior arterial_line_systolic_prior
## 1:              76                           NA
## 2:              62                           NA
## 3:              70                           NA
## 4:              71                           NA
## 5:              71                           NA
## 6:              95                           NA
##    arterial_line_diastolic_prior fio2pr oxygenflowratepr length_of_Stay
## 1:                            NA     NA               NA              4
## 2:                            NA     NA               NA              5
## 3:                            NA     NA               NA              4
## 4:                            NA     NA               10              2
## 5:                            NA     NA               NA              3
## 6:                            NA     NA               NA             11
##    Temperature  HR SPO2 RR MAP Pulse_Pressure
## 1:        98.3  89   NA 17  NA             31
## 2:        97.7  68  100 18  NA             56
## 3:        98.2  85   NA 18  NA             51
## 4:       100.5 109   97 14  NA             65
## 5:        98.0  72  100 18  NA             36
## 6:        98.6  90   97 18  NA             38

dimensions of training and testing datasets

set.seed(123)
TRAIN <- .70
TEST <- 1 - TRAIN
nr <- nrow(finDT)
train <- round(nr*TRAIN)
samp <- sample(nr,nr)
housing_train <- finDT[samp[1:train]]
housing_test <- finDT[samp[(train+1):nr]]
dim(housing_train)
## [1] 4601   21
dim(housing_test)
## [1] 1972   21

Fit and test a statistical model

#### Train Model ####
train <- housing_train
train <- train[,c(3,5:8, 15, 17:19)]
train <- train[complete.cases(train),]

test <- housing_test
test <- test[,c(3,5:8, 15, 17:19)]
test <- test[complete.cases(test),]
modFitRF <- train(Appearance~.,data=train, method="rf",prox=TRUE)
confusionMatrix(as.factor(test$Appearance),predict(modFitRF,test))
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction NOULCER ULCER
##    NOULCER     487    48
##    ULCER        19   644
##                                           
##                Accuracy : 0.9441          
##                  95% CI : (0.9295, 0.9564)
##     No Information Rate : 0.5776          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.8863          
##                                           
##  Mcnemar's Test P-Value : 0.0006245       
##                                           
##             Sensitivity : 0.9625          
##             Specificity : 0.9306          
##          Pos Pred Value : 0.9103          
##          Neg Pred Value : 0.9713          
##              Prevalence : 0.4224          
##          Detection Rate : 0.4065          
##    Detection Prevalence : 0.4466          
##       Balanced Accuracy : 0.9465          
##                                           
##        'Positive' Class : NOULCER         
## 

Fit and test a statistical model with only top 50 scoring attributes of mulivariable columns.

Section V: Future directions

Previous sections engaged in an analysis resulting in the identification of several aspects of individuals who develop HAPUs at LLUMC leading to the development of a statistical platform that can accurately discriminates between HAPU and non-HAPU individuals. The implementation of this platform into hospital wide campaigns and protocols will likely have a significant impact at reducing HAPU prevalence at LLUMC. Although other institutions have implemented task forces aimed at reducing HAPU prevalence, none of them have implemented predictive models to guide clinical decision making. Therefore, additional “real time” testing is required before gaining our enthusiastic support for model implementation. Additionally, once identified, interventional and prophylactic strategies will be required, which will require protocol revision, hospital staff education, and implementation.

Model Implementation

A major limitation is that these data were collected with the knowledge of information on individuals that developed HAPU or not throughout the entire course of their hospital stay. Additionally, additional verification is needed to prevent statistical model overfitting. We are still waiting for another data set for retrospective analysis model testing. Once we have had the opportunity to perfume the retrospective analyses and revise accordingly, we propose a trial to investigate overall model success at predicting HAPU candidates upon admission or in the days prior to HAPU appearance. This will require automatic importation of hospital wide leap data into developed R statistical platforms in a double blinded manner daily for one year to test out the fit model.

Therapeutic Interventions

In the event that the fit model is accurate at predicting HAPU pathogenesis prior to surface manifestations, in addition to placing these clients on current pressure ulcer protocols, which may or may not be implemented without prediction, what additional therapeutic strategies can drive hospital decision making and protocol management? To address this issue, we are proposing a Bioinformatics approach at identifying predictive biomarkers and supplemental pharmacological compounds that may discourage HAPU formation and promote wound healing. Our data analysis indicates that certain lab values or pathologies are correlated with HAPU pathogenesis. Biochemically, we have developed Bioinformatics computational methods that have been successful at identifying novel components of signaling pathways that are therapeutically exploitable for the treatment of cardiovascular and cognitive pathologies (9-10). Applicable to this investigation, these algorithms work by identifying common attributes of intercellular signaling. At the organ and organismal levels, resolution of organ systems effected by individuals sustaining a HAPU (Section II) cross referenced to datasets containing biomarkers or aberrant physiological molecules, such as hormones secreted from specific organ systems, will allow resolution of aberrantly regulated molecules. Once identified, these physiological molecules can be verified through common laboratory tests and supplemented therapeutically with additional clinical trials.

References

  1. Are we ready for this change?. Content last reviewed October 2014. Agency for Healthcare Research and Quality, Rockville, MD. http://www.ahrq.gov/professionals/systems/hospital/pressureulcertoolkit/putool1.html

  2. Brem H, Maggi J, Nierman D, Rolnitzky L, Bell D, Rennert R, Golinko M, Yan A, Lyder C, Vladeck B. High cost of stage IV pressure ulcers. Am J Surg. 2010 Oct;200(4):473-7. https://www.ncbi.nlm.nih.gov/pubmed/20887840

  3. Filius A, Damen TH, Schuijer-Maaskant KP, Polinder S, Hovius SE, Walbeehm ET. Cost analysis of surgically treated pressure sores stage III and IV. J Plast Reconstr Aesthet Surg. 2013 Nov;66(11):1580-6. https://www.ncbi.nlm.nih.gov/pubmed/23759717

  4. Health Quality Ontario. Management of chronic pressure ulcers: an evidence-based analysis. Ont Health Technol Assess Ser. 2009;9(3):1-203. Epub 2009 Jul 1. https://www.ncbi.nlm.nih.gov/pubmed/23074533

  5. Ziraldo C, Solovyev A, Allegretti A, Krishnan S, Henzel MK, Sowa GA, Brienza D, An G, Mi Q, Vodovotz Y. A Computational, Tissue-Realistic Model of Pressure Ulcer Formation in Individuals with Spinal Cord Injury. PLoS Comput Biol. 2015 Jun 25;11(6):e1004309. https://www.ncbi.nlm.nih.gov/pubmed/26111346

  6. Bhattacharya S, Mishra RK. Pressure ulcers: Current understanding and newer modalities of treatment. Indian J Plast Surg. 2015 Jan-Apr;48(1):4-16. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4413488/

  7. Wake WT. Pressure ulcers: what clinicians need to know.Perm J. 2010 Summer;14(2):56-60. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2912087/

  8. Cox J. Pressure Injury Risk Factors in Adult Critical Care Patients: A Review of the Literature. Ostomy Wound Manage. 2017 Nov;63(11):30-43.

  9. Marin TL, Gongol B, Martin M, King SJ, Smith L, Johnson DA, Subramaniam S, Chien S, Shyy JY. Identification of AMP-activated protein kinase targets by a consensus sequence search of the proteome. BMC Syst Biol. 2015 Mar 11;9:13. https://www.ncbi.nlm.nih.gov/pubmed/25890336

  10. Marin TL, Gongol B, Zhang F, Martin M, Johnson DA, Xiao H, Wang Y, Subramaniam S, Chien S, Shyy JY. AMPK promotes mitochondrial biogenesis and function by phosphorylating the epigenetic factors DNMT1, RBBP7, and HAT1. Sci Signal. 2017 Jan 31;10(464). pii: eaaf7478. https://www.ncbi.nlm.nih.gov/pubmed/28143904

Current issues with data:

Inconsistencies with the pressure ulcer diagnosis: Some of the individuals in the HAPU dataset have an empty staging column.
Many of the records that have a HAPU stage do not have a HAPU diagnosis
Many of the columns have few datapoints. As predictive models can only be run on complete cases, it is difficult to utilize these columns for predictive modeling.

Data analytics directions

We are currently using absolute high or low lab values to identify trends. However, identifying new threshold values differentiating HAPU verses control cases may improve predictive value.

Duplicated or different diagnosis annotatons and codes:

Partial list of duplicated codes:

1: I71.4 Abdominal aortic aneurysm 62 2: I71.3 Abdominal aortic aneurysm 486 3: 789.06 Abdominal pain 770 4: 789.07 Abdominal pain 770 5: R79.1 Abnormal coagulation profile 36 6: 790.92 Abnormal coagulation profile 262 7: S90.812A Abrasion foot 1889 8: S90.811A Abrasion foot 1914 9: S80.811A Abrasion lower leg 507 10: S80.812A Abrasion lower leg 507 11: E87.2 Acidosis 32 12: 276.2 Acidosis 235 13: Z90.710 Acquired absence of both cervix and uterus 91 14: V88.01 Acquired absence of both cervix and uterus 290 15: Z90.5 Acquired absence of kidney 139 16: V45.73 Acquired absence of kidney 375 17: J20.9 Acute bronchitis 104 18: 466.0 Acute bronchitis 258 19: K81.0 Acute cholecystitis 111 20: 575.0 Acute cholecystitis 918 21: N17.9 Acute kidney failure 35 22: 584.9 Acute kidney failure 228 23: G89.11 Acute pain due to trauma 121 24: 338.11 Acute pain due to trauma 415 25: K85.9 Acute pancreatitis 42 26: 577.0 Acute pancreatitis 316 27: I30.9 Acute pericarditis 73 28: 420.90 Acute pericarditis 967 29: D62 Acute posthemorrhagic anemia 32 30: 285.1 Acute posthemorrhagic anemia 235 31: J01.90 Acute sinusitis 149 32: 461.9 Acute sinusitis 288 33: F43.22 Adjustment disorder with anxiety 74 34: 309.24 Adjustment disorder with anxiety 326 35: F43.21 Adjustment disorder with depressed mood 56 36: 309.0 Adjustment disorder with depressed mood 294 37: F43.23 Adjustment disorder with mixed anxiety and depressed mood 128 38: 309.28 Adjustment disorder with mixed anxiety and depressed mood 325 39: R62.7 Adult failure to thrive 190 40: 783.7 Adult failure to thrive 697 41: T50.995S Adverse effect of other drugs and biological substances 94 42: T50.995A Adverse effect of other drugs and biological substances 203 43: H25.10 Age-related nuclear cataract eye 182 44: H25.12 Age-related nuclear cataract eye 1889 45: 523.31 Aggressive periodontitis 355 46: K05.21 Aggressive periodontitis 1323 47: F10.10 Alcohol abuse 44 48: 305.00 Alcohol abuse 225 49: E87.3 Alkalosis 32 50: 276.3 Alkalosis 237 51: V15.05 Allergy to other foods 424 52: Z91.018 Allergy to other foods 1394 53: Z91.013 Allergy to seafood 131 54: V15.04 Allergy to seafood 424 55: R41.82 Altered mental status 70 56: 780.97 Altered mental status 770 57: G30.9 Alzheimer’s disease 134 58: 331.0 Alzheimer’s disease 260 59: K60.2 Anal fissure 487 60: 565.0 Anal fissure 2223 61: D64.9 Anemia 33 62: 285.9 Anemia 229 63: D63.0 Anemia in neoplastic disease 180 64: 285.22 Anemia in neoplastic disease 266 65: H57.02 Anisocoria 71 66: 379.41 Anisocoria 1305 67: 783.0 Anorexia 284 68: R63.0 Anorexia 1543 69: R47.01 Aphasia 47 70: 784.3 Aphasia 233 71: I77.6 Arteritis 217 72: 447.6 Arteritis 361 73: Z98.1 Arthrodesis status 52 74: V45.4 Arthrodesis status 265 75: I70.261 Atherosclerosis of native arteries of extremities with gangrene leg 124 76: I70.262 Atherosclerosis of native arteries of extremities with gangrene leg 500 77: I44.2 Atrioventricular block 90 78: 426.10 Atrioventricular block 770 79: I44.0 Atrioventricular block degree 48 80: I44.1 Atrioventricular block degree 49 81: Z76.82 Awaiting organ transplant status 82 82: V49.83 Awaiting organ transplant status 263 83: R78.81 Bacteremia 61 84: 790.7 Bacteremia 273 85: Z98.84 Bariatric surgery status 99 86: V45.86 Bariatric surgery status 366 87: Z74.01 Bed confinement status 78 88: V49.84 Bed confinement status 378 89: 351.0 Bell’s palsy 277 90: G51.0 Bell’s palsy 1657 91: G93.2 Benign intracranial hypertension 94 92: 348.2 Benign intracranial hypertension 235 93: F31.9 Bipolar disorder 92 94: 296.80 Bipolar disorder 295 95: H54.42 Blindness eye vision right eye 147 96: H54.12 Blindness eye vision right eye 1737 97: 999.32 Bloodstream infection due to central venous catheter 285 98: T80.211A Bloodstream infection due to central venous catheter 445 99: J40 Bronchitis specified as acute or chronic 33 100: 490 Bronchitis specified as acute or chronic 288 101: N20.0 Calculus of kidney 118 102: 592.0 Calculus of kidney 293 103: 112.1 Candidiasis of vulva and vagina 979 104: B37.3 Candidiasis of vulva and vagina 1266 105: F12.10 Cannabis abuse 167 106: 305.20 Cannabis abuse 229 107: 305.21 Cannabis abuse 285 108: I31.4 Cardiac tamponade 73 109: 423.3 Cardiac tamponade 304 110: Z22.322 Carrier or suspected carrier of methicillin resistant Staphylococcus aureus 110 111: V02.54 Carrier or suspected carrier of methicillin resistant Staphylococcus aureus 319 112: Z98.49 Cataract extraction status eye 150 113: Z98.41 Cataract extraction status eye 1773 114: Z98.42 Cataract extraction status eye 1773 115: I67.1 Cerebral aneurysm 135 116: 437.3 Cerebral aneurysm 384 117: 437.0 Cerebral atherosclerosis 386 118: I67.2 Cerebral atherosclerosis 1803 119: M54.2 Cervicalgia 80 120: 723.1 Cervicalgia 385 121: R07.9 Chest pain 108 122: 786.50 Chest pain 861 123: K83.0 Cholangitis 63 124: 576.1 Cholangitis 353 125: K81.9 Cholecystitis 97 126: 575.10 Cholecystitis 267 127: N18.3 Chronic kidney disease 37 128: N18.9 Chronic kidney disease 61 129: 585.9 Chronic kidney disease 291 130: 473.0 Chronic maxillary sinusitis 377 131: J32.0 Chronic maxillary sinusitis 1128 132: M86.451 Chronic osteomyelitis with draining sinus femur 1714 133: M86.452 Chronic osteomyelitis with draining sinus femur 1714 134: G89.4 Chronic pain syndrome 197 135: 338.4 Chronic pain syndrome 360 136: K76.1 Chronic passive congestion of liver 479 137: 573.0 Chronic passive congestion of liver 942 138: 523.40 Chronic periodontitis 942 139: 523.42 Chronic periodontitis 1016 140: 839.06 Closed dislocation cervical vertebra 261 141: 839.07 Closed dislocation cervical vertebra 261 142: 839.01 Closed dislocation cervical vertebra 439 143: F14.10 Cocaine abuse 112 144: 305.60 Cocaine abuse 348 145: R40.2312 Coma scale motor response arrival to emergency department 1318 146: R40.2322 Coma scale motor response arrival to emergency department 1421 147: R40.2113 Coma scale open hospital admission 448 148: R40.2143 Coma scale open hospital admission 462 149: I87.1 Compression of vein 98 150: 459.2 Compression of vein 348 151: S06.0X1A Concussion with loss of consciousness of 30 minutes or less 51 152: 850.11 Concussion with loss of consciousness of 30 minutes or less 261 153: Q23.1 Congenital insufficiency of aortic valve 79 154: 746.4 Congenital insufficiency of aortic valve 285 155: 922.2 Contusion of abdominal wall 259 156: S30.1XXA Contusion of abdominal wall 1748 157: S27.322A Contusion of lung 44 158: S27.329A Contusion of lung 493 159: S27.321A Contusion of lung 499 160: 786.2 Cough 348 161: R05 Cough 1266 162: G72.81 Critical illness myopathy 99 163: 359.81 Critical illness myopathy 430 164: E86.0 Dehydration 104 165: 276.51 Dehydration 284 166: 294.20 Dementia behavior 295 167: 294.21 Dementia behavior 770 168: Z99.81 Dependence on supplemental oxygen 50 169: V46.2 Dependence on supplemental oxygen 300 170: R19.7 Diarrhea 55 171: 787.91 Diarrhea 258 172: J98.6 Disorders of diaphragm 149 173: 519.4 Disorders of diaphragm 296 174: S92.321A Displaced fracture of second metatarsal bone foot for closed fracture 97 175: S92.322A Displaced fracture of second metatarsal bone foot for closed fracture 121 176: T81.31XA Disruption of external operation (surgical) wound 36 177: 998.32 Disruption of external operation (surgical) wound 284 178: T81.32XA Disruption of internal operation (surgical) wound 40 179: 998.31 Disruption of internal operation (surgical) wound 267 180: R13.13 Dysphagia phase 74 181: R13.14 Dysphagia phase 243 182: 787.24 Dysphagia phase 333 183: 787.23 Dysphagia phase 339 184: R13.11 Dysphagiaal phase 72 185: 787.21 Dysphagiaal phase 1118 186: R13.12 Dysphagiaopharyngeal phase 218 187: 787.22 Dysphagiaopharyngeal phase 297 188: R49.0 Dysphonia 43 189: 784.42 Dysphonia 348 190: R60.9 Edema 145 191: 782.3 Edema 277 192: J38.4 Edema of larynx 152 193: 478.6 Edema of larynx 749 194: M25.461 Effusion knee 123 195: M25.462 Effusion knee 160 196: G93.40 Encephalopathy 37 197: 348.30 Encephalopathy 228 198: Z51.5 Encounter for palliative care 53 199: V66.7 Encounter for palliative care 236 200: G40.909 Epilepsy intractable status epilepticus 43 1: G40.901 Epilepsy intractable status epilepticus 131 2: G40.919 Epilepsy status epilepticus 72 3: G40.911 Epilepsy status epilepticus 1918 4: R04.0 Epistaxis 98 5: 784.7 Epistaxis 288 6: K20.9 Esophagitis 111 7: 530.10 Esophagitis 312 8: 401.0 Essential hypertension 229 9: 401.1 Essential hypertension 295 10: R29.810 Facial weakness 39 11: 781.94 Facial weakness 225 12: R50.9 Fever 46 13: 780.60 Fever 229 14: R50.81 Fever presenting with conditions classified elsewhere 42 15: 780.61 Fever presenting with conditions classified elsewhere 711 16: 787.60 Full incontinence of feces 286 17: R15.9 Full incontinence of feces 492 18: K31.84 Gastroparesis 54 19: 536.3 Gastroparesis 232 20: M10.9 Gout 39 21: 274.9 Gout 270 22: R31.0 Gross hematuria 35 23: 599.71 Gross hematuria 287 24: I50.9 Heart failure 41 25: 428.9 Heart failure 391 26: K92.0 Hematemesis 66 27: 578.0 Hematemesis 304 28: R31.9 Hematuria 60 29: 599.70 Hematuria 273 30: R04.2 Hemoptysis 32 31: 786.30 Hemoptysis 411 32: R58 Hemorrhage 84 33: 459.0 Hemorrhage 1098 34: R16.0 Hepatomegaly 142 35: 789.1 Hepatomegaly 293 36: 042 Human immunodeficiency virus (HIV) disease 324 37: B20 Human immunodeficiency virus (HIV) disease 1350 38: E83.52 Hypercalcemia 32 39: 275.42 Hypercalcemia 361 40: 252.00 Hyperparathyroidism 1053 41: E21.3 Hyperparathyroidism 1293 42: 362.11 Hypertensive retinopathy 329 43: H35.033 Hypertensive retinopathy 2373 44: E83.51 Hypocalcemia 63 45: 275.41 Hypocalcemia 267 46: E16.2 Hypoglycemia 36 47: 251.2 Hypoglycemia 311 48: I95.9 Hypotension 35 49: 458.9 Hypotension 274 50: E86.1 Hypovolemia 92 51: 276.52 Hypovolemia 267 52: R09.02 Hypoxemia 72 53: 799.02 Hypoxemia 229 54: 996.64 Infection and inflammatory reaction due to indwelling urinary catheter 1178 55: T83.51XA Infection and inflammatory reaction due to indwelling urinary catheter 1546 56: T87.44 Infection of amputation stump lower extremity 119 57: T87.43 Infection of amputation stump lower extremity 217 58: G47.00 Insomnia 32 59: 780.52 Insomnia 263 60: D50.9 Iron deficiency anemia 45 61: 280.9 Iron deficiency anemia 285 62: D50.0 Iron deficiency anemia secondary to blood loss (chronic) 122 63: 280.0 Iron deficiency anemia secondary to blood loss (chronic) 289 64: S81.811A Laceration without foreign body lower leg 462 65: S81.812A Laceration without foreign body lower leg 2157 66: Z53.31 Laparoscopic surgical procedure converted to open procedure 210 67: V64.41 Laparoscopic surgical procedure converted to open procedure 270 68: 369.4 Legal blindness defined in USA 232 69: H54.8 Legal blindness defined in USA 1523 70: D25.9 Leiomyoma of uterus 202 71: 218.9 Leiomyoma of uterus 328 72: 288.62 Leukemoid reaction 1117 73: D72.823 Leukemoid reaction 2153 74: 864.02 Liver laceration mention of open wound into cavity 311 75: 864.03 Liver laceration mention of open wound into cavity 347 76: G40.201 Localization-related (focal) (partial) symptomatic epilepsy and epileptic syndromes with complex partial seizures intractable status epilepticus 155 77: G40.209 Localization-related (focal) (partial) symptomatic epilepsy and epileptic syndromes with complex partial seizures intractable status epilepticus 1295 78: G40.119 Localization-related (focal) (partial) symptomatic epilepsy and epileptic syndromes with simple partial seizures status epilepticus 34 79: G40.111 Localization-related (focal) (partial) symptomatic epilepsy and epileptic syndromes with simple partial seizures status epilepticus 1339 80: 715.33 Localized osteoarthrosis not specified whether primary or secondary 295 81: 715.34 Localized osteoarthrosis not specified whether primary or secondary 721 82: I45.81 Long QT syndrome 51 83: 426.82 Long QT syndrome 1089 84: Z79.01 Long term (current) use of anticoagulants 38 85: V58.61 Long term (current) use of anticoagulants 230 86: V49.75 Lower limb amputation knee 350 87: V49.76 Lower limb amputation knee 776 88: F32.9 Major depressive disorder 32 89: 296.20 Major depressive disorder 291 90: F33.0 Major depressive disorder 1266 91: F33.9 Major depressive disorder 1464 92: F32.1 Major depressive disorder 1878 93: F33.1 Major depressive disorder 2014 94: F33.2 Major depressive disorder severe without psychotic features 43 95: F32.2 Major depressive disorder severe without psychotic features 1368 96: 802.4 Malar and maxillary bones fracture 333 97: 802.5 Malar and maxillary bones fracture 1231 98: 789.51 Malignant ascites 327 99: R18.0 Malignant ascites 443 100: C34.11 Malignant neoplasm of upper lobe bronchus or lung 116 101: C34.12 Malignant neoplasm of upper lobe bronchus or lung 575 102: J91.0 Malignant pleural effusion 208 103: 511.81 Malignant pleural effusion 587 104: S02.401A Maxillary fracture side for closed fracture 44 105: S02.40CA Maxillary fracture side for closed fracture 120 106: G93.41 Metabolic encephalopathy 32 107: 348.31 Metabolic encephalopathy 232 108: G43.909 Migraine intractable status migrainosus 71 109: G43.901 Migraine intractable status migrainosus 149 110: F70 Mild intellectual disabilities 1901 111: 317 Mild intellectual disabilities 2235 112: E78.2 Mixed hyperlipidemia 65 113: 272.2 Mixed hyperlipidemia 289 114: 318.0 Moderate intellectual disabilities 421 115: F71 Moderate intellectual disabilities 2147 116: S22.41XA Multiple fractures of ribs side for closed fracture 34 117: S22.42XA Multiple fractures of ribs side for closed fracture 87 118: M62.81 Muscle weakness (generalized) 185 119: 728.87 Muscle weakness (generalized) 277 120: D46.9 Myelodysplastic syndrome 74 121: 238.75 Myelodysplastic syndrome 746 122: 333.2 Myoclonus 385 123: G25.3 Myoclonus 1514 124: G72.9 Myopathy 218 125: 359.9 Myopathy 319 126: 802.0 Nasal bones fracture 340 127: 802.1 Nasal bones fracture 1231 128: R11.2 Nausea with vomiting 144 129: 787.01 Nausea with vomiting 265 130: T87.54 Necrosis of amputation stump lower extremity 36 131: T87.53 Necrosis of amputation stump lower extremity 65 132: 338.3 Neoplasm related pain (acute) (chronic) 286 133: G89.3 Neoplasm related pain (acute) (chronic) 442 134: K59.2 Neurogenic bowel 66 135: 564.81 Neurogenic bowel 238 136: D70.9 Neutropenia 32 137: 288.00 Neutropenia 324 138: F17.200 Nicotine dependence 33 139: F17.210 Nicotine dependence 55 140: 305.70 Nondependent amphetamine or related acting sympathomimetic abuse 225 141: 305.71 Nondependent amphetamine or related acting sympathomimetic abuse 382 142: M79.A3 Nontraumatic compartment syndrome of abdomen 137 143: 729.73 Nontraumatic compartment syndrome of abdomen 291 144: M79.81 Nontraumatic hematoma of soft tissue 37 145: 729.92 Nontraumatic hematoma of soft tissue 308 146: I61.5 Nontraumatic intracerebral hemorrhage 33 147: I61.9 Nontraumatic intracerebral hemorrhage 150 148: I61.1 Nontraumatic intracerebral hemorrhage in hemisphere 98 149: I61.0 Nontraumatic intracerebral hemorrhage in hemisphere 197 150: E66.9 Obesity 47 151: 278.00 Obesity 235 152: K83.1 Obstruction of bile duct 35 153: 576.2 Obstruction of bile duct 338 154: G91.1 Obstructive hydrocephalus 33 155: 331.4 Obstructive hydrocephalus 268 156: G47.33 Obstructive sleep apnea (adult) (pediatric) 50 157: 327.23 Obstructive sleep apnea (adult) (pediatric) 229 158: I25.2 Old myocardial infarction 33 159: 412 Old myocardial infarction 238 160: I95.1 Orthostatic hypotension 91 161: 458.0 Orthostatic hypotension 582 162: 790.29 Other abnormal glucose 228 163: R73.09 Other abnormal glucose 1256 164: M86.151 Other acute osteomyelitis femur 217 165: M86.152 Other acute osteomyelitis femur 506 166: J93.82 Other air leak 145 167: 512.84 Other air leak 782 168: 303.90 Other and unspecified alcohol dependence drinking behavior 292 169: 303.91 Other and unspecified alcohol dependence drinking behavior 918 170: R18.8 Other ascites 35 171: 789.59 Other ascites 266 172: R07.89 Other chest pain 205 173: 786.59 Other chest pain 288 174: G89.29 Other chronic pain 50 175: 338.29 Other chronic pain 263 176: T81.89XS Other complications of procedures 53 177: T81.89XA Other complications of procedures 460 178: 564.09 Other constipation 333 179: K59.09 Other constipation 1554 180: 478.5 Other diseases of vocal cords 744 181: J38.3 Other diseases of vocal cords 1407 182: R13.19 Other dysphagia 189 183: 787.29 Other dysphagia 409 184: G93.49 Other encephalopathy 39 185: 348.39 Other encephalopathy 238 186: K20.8 Other esophagitis 221 187: 530.19 Other esophagitis 323 188: 802.8 Other facial bones fracture 367 189: 802.9 Other facial bones fracture 1231 190: E87.79 Other fluid overload 82 191: 276.69 Other fluid overload 229 192: G40.409 Other generalized epilepsy and epileptic syndromes intractable status epilepticus 66 193: G40.401 Other generalized epilepsy and epileptic syndromes intractable status epilepticus 2031 194: 607.2 Other inflammatory disorders of penis 356 195: N48.29 Other inflammatory disorders of penis 2052 196: R31.2 Other microscopic hematuria 1438 197: R31.29 Other microscopic hematuria 1860 198: R91.8 Other nonspecific abnormal finding of lung field 82 199: 793.19 Other nonspecific abnormal finding of lung field 878 200: J93.83 Other pneumothorax 199 1: 512.89 Other pneumothorax 289 2: D69.59 Other secondary thrombocytopenia 35 3: 287.49 Other secondary thrombocytopenia 321 4: M85.88 Other specified disorders of bone density and structure site 98 5: M85.80 Other specified disorders of bone density and structure site 187 6: E07.89 Other specified disorders of thyroid 157 7: 246.8 Other specified disorders of thyroid 783 8: Z98.89 Other specified postprocedural states 63 9: Z98.890 Other specified postprocedural states 194 10: M65.821 Other synovitis and tenosynovitis upper arm 1480 11: M65.822 Other synovitis and tenosynovitis upper arm 1480 12: J38.01 Paralysis of vocal cords and larynx 100 13: J38.00 Paralysis of vocal cords and larynx 213 14: J38.02 Paralysis of vocal cords and larynx 441 15: 530.4 Perforation of esophagus 351 16: K22.3 Perforation of esophagus 495 17: K04.7 Periapical abscess without sinus 92 18: 522.5 Periapical abscess without sinus 353 19: I73.9 Peripheral vascular disease 57 20: 443.9 Peripheral vascular disease 314 21: Z92.21 Personal history of antineoplastic chemotherapy 74 22: V87.41 Personal history of antineoplastic chemotherapy 332 23: Z86.011 Personal history of benign neoplasm of the brain 162 24: V12.41 Personal history of benign neoplasm of the brain 828 25: Z85.3 Personal history of malignant neoplasm of breast 61 26: V10.3 Personal history of malignant neoplasm of breast 270 27: Z85.41 Personal history of malignant neoplasm of cervix uteri 186 28: V10.41 Personal history of malignant neoplasm of cervix uteri 262 29: Z85.01 Personal history of malignant neoplasm of esophagus 128 30: V10.03 Personal history of malignant neoplasm of esophagus 674 31: Z85.21 Personal history of malignant neoplasm of larynx 490 32: V10.21 Personal history of malignant neoplasm of larynx 582 33: Z85.05 Personal history of malignant neoplasm of liver 41 34: V10.07 Personal history of malignant neoplasm of liver 726 35: V10.43 Personal history of malignant neoplasm of ovary 696 36: Z85.43 Personal history of malignant neoplasm of ovary 1622 37: Z85.46 Personal history of malignant neoplasm of prostate 80 38: V10.46 Personal history of malignant neoplasm of prostate 334 39: Z85.850 Personal history of malignant neoplasm of thyroid 71 40: V10.87 Personal history of malignant neoplasm of thyroid 238 41: Z85.828 Personal history of other malignant neoplasm of skin 110 42: V10.83 Personal history of other malignant neoplasm of skin 350 43: V12.71 Personal history of peptic ulcer disease 921 44: Z87.11 Personal history of peptic ulcer disease 1230 45: Z86.711 Personal history of pulmonary embolism 47 46: V12.55 Personal history of pulmonary embolism 413 47: Z86.74 Personal history of sudden cardiac arrest 90 48: V12.53 Personal history of sudden cardiac arrest 1308 49: Z87.820 Personal history of traumatic brain injury 203 50: V15.52 Personal history of traumatic brain injury 383 51: Z87.442 Personal history of urinary calculi 183 52: V13.01 Personal history of urinary calculi 356 53: J15.20 Pneumonia due to Staphylococcus 493 54: 482.40 Pneumonia due to Staphylococcus 788 55: I81 Portal vein thrombosis 38 56: 452 Portal vein thrombosis 409 57: 627.1 Postmenopausal bleeding 409 58: N95.0 Postmenopausal bleeding 456 59: 998.01 Postoperative shock 304 60: 998.09 Postoperative shock 305 61: 998.02 Postoperative shock 352 62: Z98.2 Presence of cerebrospinal fluid drainage device 165 63: V45.2 Presence of cerebrospinal fluid drainage device 296 64: 707.07 Pressure ulcer 268 65: 707.01 Pressure ulcer 281 66: 707.04 Pressure ulcer 321 67: L89.812 Pressure ulcer of head 95 68: L89.810 Pressure ulcer of head 469 69: L89.322 Pressure ulcer of left buttock 151 70: L89.320 Pressure ulcer of left buttock 153 71: L89.622 Pressure ulcer of left heel 85 72: L89.620 Pressure ulcer of left heel 203 73: L89.220 Pressure ulcer of left hip 1466 74: L89.222 Pressure ulcer of left hip 2086 75: L89.892 Pressure ulcer of other site 215 76: L89.890 Pressure ulcer of other site 494 77: L89.312 Pressure ulcer of right buttock 447 78: L89.310 Pressure ulcer of right buttock 1822 79: L89.612 Pressure ulcer of right heel 89 80: L89.610 Pressure ulcer of right heel 1277 81: L89.212 Pressure ulcer of right hip 180 82: L89.210 Pressure ulcer of right hip 456 83: L89.152 Pressure ulcer of sacral region 35 84: L89.150 Pressure ulcer of sacral region 74 85: L89.102 Pressure ulcer of unspecified part of back 32 86: L89.100 Pressure ulcer of unspecified part of back 199 87: M19.012 Primary osteoarthritis shoulder 110 88: M19.011 Primary osteoarthritis shoulder 1802 89: F73 Profound intellectual disabilities 66 90: 318.2 Profound intellectual disabilities 921 91: A81.2 Progressive multifocal leukoencephalopathy 189 92: 046.3 Progressive multifocal leukoencephalopathy 912 93: S71.131A Puncture wound without foreign body thigh 1437 94: S71.132A Puncture wound without foreign body thigh 1437 95: E78.0 Pure hypercholesterolemia 45 96: E78.00 Pure hypercholesterolemia 143 97: 272.0 Pure hypercholesterolemia 234 98: E78.1 Pure hyperglyceridemia 131 99: 272.1 Pure hyperglyceridemia 289 100: L88 Pyoderma gangrenosum 217 101: 686.01 Pyoderma gangrenosum 979 102: G82.50 Quadriplegia 126 103: 344.00 Quadriplegia 265 104: 782.1 Rash and other nonspecific skin eruption 402 105: R21 Rash and other nonspecific skin eruption 505 106: N25.0 Renal osteodystrophy 164 107: 588.0 Renal osteodystrophy 361 108: R33.9 Retention of urine 33 109: 788.20 Retention of urine 268 110: M62.82 Rhabdomyolysis 36 111: 728.88 Rhabdomyolysis 235 112: H90.3 Sensorineural hearing loss 104 113: 389.10 Sensorineural hearing loss 1263 114: 318.1 Severe intellectual disabilities 884 115: F72 Severe intellectual disabilities 1917 116: R57.9 Shock 106 117: 785.50 Shock 235 118: K11.20 Sialoadenitis 42 119: 527.2 Sialoadenitis 742 120: R91.1 Solitary pulmonary nodule 82 121: 793.11 Solitary pulmonary nodule 274 122: M48.02 Spinal stenosis region 53 123: M48.06 Spinal stenosis region 96 124: R16.1 Splenomegaly 41 125: 789.2 Splenomegaly 1120 126: M47.816 Spondylosis without myelopathy or radiculopathy region 74 127: M47.812 Spondylosis without myelopathy or radiculopathy region 188 128: J93.0 Spontaneous tension pneumothorax 90 129: 512.0 Spontaneous tension pneumothorax 306 130: 320.3 Staphylococcal meningitis 277 131: G00.3 Staphylococcal meningitis 1323 132: Z92.82 Status post administration of tPA (rtPA) in a different facility within the last 24 hours prior to admission to current facility 81 133: V45.88 Status post administration of tPA (rtPA) in a different facility within the last 24 hours prior to admission to current facility 358 134: R00.0 Tachycardia 69 135: 785.0 Tachycardia 229 136: I51.81 Takotsubo syndrome 73 137: 429.83 Takotsubo syndrome 1077 138: I71.2 Thoracic aortic aneurysm 100 139: I71.1 Thoracic aortic aneurysm 1410 140: D69.6 Thrombocytopenia 32 141: 287.5 Thrombocytopenia 235 142: G92 Toxic encephalopathy 194 143: 349.82 Toxic encephalopathy 272 144: K71.11 Toxic liver disease with hepatic necrosis coma 94 145: K71.10 Toxic liver disease with hepatic necrosis coma 2031 146: E88.3 Tumor lysis syndrome 208 147: 277.88 Tumor lysis syndrome 799 148: E11.3521 Type 2 diabetes mellitus with proliferative diabetic retinopathy with traction retinal detachment involving the macula eye 119 149: E11.3522 Type 2 diabetes mellitus with proliferative diabetic retinopathy with traction retinal detachment involving the macula eye 119 150: K62.6 Ulcer of anus and rectum 55 151: 569.41 Ulcer of anus and rectum 339 152: M16.10 Unilateral primary osteoarthritis hip 78 153: M16.12 Unilateral primary osteoarthritis hip 480 154: H26.9 Unspecified cataract 129 155: 366.9 Unspecified cataract 356 156: 389.9 Unspecified hearing loss 295 157: H91.93 Unspecified hearing loss 1568 158: F79 Unspecified intellectual disabilities 72 159: 319 Unspecified intellectual disabilities 226 160: K56.60 Unspecified intestinal obstruction 126 161: 560.9 Unspecified intestinal obstruction 339 162: H70.93 Unspecified mastoiditis 219 163: 383.9 Unspecified mastoiditis 277 164: H70.91 Unspecified mastoiditis ear 202 165: H70.90 Unspecified mastoiditis ear 1128 166: E46 Unspecified protein-calorie malnutrition 44 167: 263.9 Unspecified protein-calorie malnutrition 229 168: R32 Unspecified urinary incontinence 98 169: 788.30 Unspecified urinary incontinence 233 170: B19.20 Unspecified viral hepatitis C without hepatic coma 95 171: 070.70 Unspecified viral hepatitis C without hepatic coma 290 172: N36.5 Urethral false passage 488 173: 599.4 Urethral false passage 1019 174: N39.0 Urinary tract infection not specified 33 175: 599.0 Urinary tract infection not specified 226 176: S02.402A Zygomatic fracture side for closed fracture 68 177: S02.40EA Zygomatic fracture side for closed fracture 120

Inconsistencies with documentation

Partial list of inconsistencies:

“tremor 345.90”, “tremor, 345.90” “respirator Z78.1”, “respirator, Z78.1” “tremor 401.9”, “tremor, 401.9” “unspecifiedR09.02”, “unspecified, R09.02” “unspecified584.9”, “unspecified, 584.9” “unspecifiedZ66”, “unspecified, Z66” “unspecifiedM54.30”, “unspecified, M54.30” “, thoracic”, " thoracic" “unspecified785.52 Septic shock(785.52)”, “, 785.52 Septic shock(785.52)” “unspecifiedM41.9 Scoliosis”, “, M41.9 Scoliosis” “Stridor 787.20”, “Stridor, 787.20” “tremor G57.91”, “tremor, G57.91” “unspecified995.91”, “unspecified, 995.91” “, C1-C4”, " C1-C4" “, C5-C7”, " C5-C7" “IIIA, IIIB, or IIIC”, “IIIA IIIB or IIIC” “, 24 hours or more after”, " 24 hours or more after" “organ, lung”, " organ lung" “IIIA, IIIB,”, “IIIA IIIB” “IIIA,”, “IIIA” “Major depressive disorder, single episode, severe, without mention of psychotic behavior”, “Major depressive disorder single episode severe without mention of psychotic behavior” “disorder, severe”, “disorder severe” “behavior 300.9”, “behavior, 300.9” “elsewhere, antepartum”, “elsewhere antepartum” “episode, severe”, “episode severe” “behavior 296.80”, “behavior, 296.80” “mother, antepartum”, “mother antepartum” “test, negative”, “test negative” “test, positive”, “test positive” “pregnancy, antepartum”, “pregnancy antepartum” “limbs, antepartum(648.73)”, “limbs antepartum” “antipsychotics, neuroleptics”, “antipsychotics neuroleptics” “complication, antepartum(646.83)”, “complication antepartum” “disease, antepartum(647.83)”, “disease antepartum” “mother, complicating”, “mother complicating” “Anemia, antepartum(648.23)”, “Anemia antepartum” “Thyroid dysfunction, antepartum(648.13)”, “Thyroid dysfunction antepartum” “maternal back, pelvis, lower limbs, antepartum(648.73)”, “maternal back pelvis lower limbs antepartum” “Diabetes mellitus, antepartum(648.03)”, “Diabetes mellitus, antepartum(648.03)” “radiculopathy, lumbosacral”, “radiculopathy lumbosacral” “atrium, auricular”, “atrium auricular” “amphetamines, undetermined”, “amphetamines undetermined” “ovary, fallopian”, “ovary fallopian” “lymphoid, hematopoietic”, “lymphoid hematopoietic” “infusion, transfusion”, “infusion transfusion” “aorta, thoracic”, “aorta thoracic” “infarction, episode”, “infarction episode” “strabismus, fourth”, “strabismus fourth” “Neuralgia, neuritis”, “Neuralgia neuritis” “tract, postpartum”, “tract postpartum” “disorder, postpartum(674.04)”, “disorder postpartum” “toe(s), superficial”, “toe(s) superficial” “strabismus, external”, “strabismus external” “enterocele, congenital”, “enterocele congenital” “adhesions, female”, “adhesions female” “Cystocele, midline”, “Cystocele midline” “drug, medical”, “drug medical” “ovary, ovarian”, “ovary ovarian” “gangrene, not”, “gangrene not” “laceration, major”, “laceration major” “deficiency, fibular”, “deficiency fibular” “Kyphosis, postlaminectomy”, “Kyphosis postlaminectomy” “pain, periumbilic”, “pain periumbilic” “delivery, delivered(660.21)”, “delivery delivered(660.21)” “delivery, delivered”, “delivery delivered” “delivery, single”, “delivery single” “Twin gestation, dichorionic/diamniotic (two placentae, two amniotic sacs)(V91.03)”, “Twin gestation dichorionic/diamniotic (two placentae two amniotic sacs)” “eyelid, full-thickness”, “eyelid full-thickness” “disproportion, delivered(653.41)”, “disproportion delivered” “delivery, delivered(660.11)”, “delivery delivered” “gestation, monochorionic/monoamniotic”, “gestation monochorionic/monoamniotic” “Anemia, postpartum(648.24)”, “Anemia postpartum” “mellitus, antepartum(648.03)”, “mellitus antepartum” “tolerance, complicating”, “tolerance complicating” “back, pelvis”, “back pelvis” “tissue, NEC”, “tissue NEC” “abortion, antepartum”, “abortion antepartum” “elsewhere, complicating”, “elsewhere complicating” “brain, supratentorial”, “brain supratentorial” “Spondylolisthesis, lumbosacral”, “Spondylolisthesis lumbosacral” “response, confused”, “response confused” “degeneration, high”, “degeneration high” “spine, cervicothoracic”, “spine cervicothoracic” “elsewhere, postpartum”, “elsewhere postpartum” “myelopathy, thoracic”, “myelopathy thoracic” “fistula, female”, “fistula female” “delivery, twins”, “delivery twins” “loss, antepartum”, “loss antepartum” “ethanol, undetermined”, “ethanol undetermined” “leg, level”, “leg level” “unspecifiedT79.6XXA”, “unspecified, T79.6XXA” “lordosis, lumbosacral”, “lordosis lumbosacral” “pre-eclampsia, complicating”, “pre-eclampsia complicating” “mother, delivered”, “mother delivered” “hemorrhage, postpartum”, “hemorrhage postpartum” “gravidarum, antepartum”, “gravidarum antepartum” “care, third”, “care third” “leukemia, BCR/ABL-positive”, “leukemia BCR/ABL-positive” “degeneration, lumbosacral”, “degeneration lumbosacral” “puerperium, delivered”, “puerperium delivered” “compression, complicating”, “compression complicating” “endometritis, postpartum”, “endometritis postpartum” “cord, complicating”, “cord complicating” “multigravida, third”, “multigravida third” “puerperium, antepartum”, “puerperium antepartum” “behavior 305.1”, “behavior, 305.1” “Postoperative shock (HCC)”, “Postoperative shock”

Functions

Functions to reproduce this script are illustrated below, can be found at the following link: https://github.com/brengong/ClinicalDataMineR, and/or can be installed with the following code:

devtools::install_github('brengong/ClinicalDataMineR')


Function to Graph multiple ggplots in one window:

multiplot <- function(..., plotlist=NULL, file, cols=1, layout=NULL) {
  library(grid)
  
  # Make a list from the ... arguments and plotlist
  plots <- c(list(...), plotlist)
  
  numPlots = length(plots)
  
  # If layout is NULL, then use 'cols' to determine layout
  if (is.null(layout)) {
    # Make the panel
    # ncol: Number of columns of plots
    # nrow: Number of rows needed, calculated from # of cols
    layout <- matrix(seq(1, cols * ceiling(numPlots/cols)),
                     ncol = cols, nrow = ceiling(numPlots/cols))
  }
  
  if (numPlots==1) {
    print(plots[[1]])
    
  } else {
    # Set up the page
    grid.newpage()
    pushViewport(viewport(layout = grid.layout(nrow(layout), ncol(layout))))
    
    # Make each plot, in the correct location
    for (i in 1:numPlots) {
      # Get the i,j matrix positions of the regions that contain this subplot
      matchidx <- as.data.frame(which(layout == i, arr.ind = TRUE))
      
      print(plots[[i]], vp = viewport(layout.pos.row = matchidx$row,
                                      layout.pos.col = matchidx$col))
    }
  }
}