2.1 Study design, setting, and participants
In the Chi Mei Medical Center (CMMC), we established a multi-disciplinary team including emergency physicians, data scientists, information engineers, nurse practitioners, and quality managers for big data and AI implementation. Adults (age ≥20 years) with hyperglycemic crises who visited the EDs of three hospitals (CMMC, Chi Mei Liouying Hospital, and Chi Mei Chiali Hospital) between 2009 and 2018 were recruited (Figure 1). The criteria for hyperglycemic crises was defined as the final diagnosis of DKA or HHS in the ED, using the International Classification of Diseases, Ninth Revision, Clinical Modification (ICD-9-CM) code of 250.1 or 250.2, and ICD-10 of E11.1 or E11.0. Patients who did not have a record of subsequent follow-up were excluded.
2.2 Definition of feature variables
The 22 feature variables retained for analysis were age, sex, body mass index (BMI), vital signs at triage, bedridden, nasogastric tube (NG) feeding, history of hypertension (ICD-9-CM: 401-405 or ICD-10: I10-I16), hyperlipidemia (ICD-9-CM: 272.0–272.5, 277.7 or ICD-10: E78.0-E78.5, E88.81), malignancy (ICD-9-CM: 140–208 or ICD-10: C00-C69), chronic kidney disease (ICD-9-CM: 585 or ICD-10: N18), and laboratory data, including blood urine nitrogen (Bun), serum creatinine, white blood cell count, hemoglobin, glucose, and high sensitive C-reactive protein (hs-CRP), and concomitant infection (ICD-9-CM: 001–139, 320–326, 390–392, 480–488, 540–543, 555–558, 566–567, 599.0, 601, 604, 614–616, 680–686, 730 or ICD-10: A00-B99, G00-G09, I00-I02, J09-J18, K35-K38, K50-K52, K61, K65, N39.0, N41, N45, N70-N77, L00-L08, M86, R65). The feature variables considered were suggested predictors of adverse outcomes in previous studies, and possible risk factors for adverse outcomes in clinical practice [4, 5, 7, 9, 10]. Past history was defined as diagnosis established before the index visit.
2.3 Outcome measurements
We defined three adverse outcomes: (1) sepsis or septic shock <1 month (ICD-9-CM: 038, 790.7 or ICD-10: A40-A41, R65, R7881), (2) ICU admission <1 month, and (3) all-cause mortality <1 month following the index ED visit.
2.4 Ethical statement
This study was approved by the institutional review board of the Chi Mei Medical Center and conducted according to the Helsinki declaration. Informed consent from the patients was waived because this study is retrospective and contains de-identified information, which does not affect the rights and welfare of the patients.
2.5 Data processing, comparison, and application
First, data was extracted from the HIS, transformed, and validated into a data mart for further analysis. Missing and ambiguous data were defined carefully by a group meeting made of emergency physicians, data scientists, information engineers, nurse practitioners, and quality managers. We deleted the data if the feature variable could not be estimated (such as missing “sex”) or if many feature variables were missing. An average value was added if the missing feature variable could be estimated (missing “BMI” for example). Secondly, we divided the data into training (70%) and testing (30%) groups. Multilayer perceptron (MLP), a class of DL, was used to train, and test the data. Next, we deployed the AI prediction model in the AI web service and integrated it in the HIS. After clinical testing and bugs correction, we launched the AI prediction model in the HIS to assist ED physicians for decision making in real-time. An AI button was set up in the HIS and a real-time prediction result was showed after the physician pressed the AI button. We also compared MLP with other ML algorithms, including random forest, logistic regression, support vector machine (SVM), K-nearest neighbors (KNN), and Light Gradient Boosting Machine (LightGBM) for accuracy, precision, sensitivity, specificity, positive predictive value (PPV), negative predictive value (NPV), F1, and area under the curve (AUC).