{'fraction_non_alphanumeric': 0.035246104377937175, 'fraction_numerical': 0.017808558001484048, 'mean_word_length': 4.981508875739645, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Electronic Phenotyping to Identify Patients with Heart Failure Using a National Clinical Information Database in Japan

. Heart failure (HF) is a grave problem in the clinical and public health sectors. The aim of this study is to develop a phenotyping algorithm to identify patients with HF by using the medical information database network (MID-NET) in Japan. Methods: From April 1 to December 31, 2013, clinical data of patients with HF were obtained from MID-NET. A phenotyping algorithm was developed with machine learning by using disease names, examinations, and medications. Two doctors validated the cases by manually reviewing the medical records according to the Japanese HF guidelines. The algorithm was also validated with different cohorts from an inpatient database of the Department of Cardiovascular Medicine at Tohoku University Hospital. Results: The algorithm, which initially had low precision, was improved by incorporating the value of B-type natriuretic peptide and the combination of medications related to HF. Finally, the algorithm on a different cohort was verified with higher precision (35.0% → 87.8%). Conclusions: Proper algorithms can be used to identify patients with HF.


Introduction
The medical information database network (MID-NET) managed by the Pharmaceuticals and Medical Devices Agency has been available to the public in Japan since 2018 [1,2]. The database has data collected from several medical institutions, including national university hospitals and private hospital groups. Tohoku University Hospital is one of the facilities collaborating in the MID-NET project. Additionally, pharmaceutical companies can use MID-NET for post-marketing surveillance of pharmaceutical products. To correctly extract cases of certain target diseases from the database, the identification of clinical events known as electronic phenotyping is extremely important [3,4]. Heart failure (HF) is a major cause of death in developed countries, including Japan [5]. It is expected that the number of HF cases will continue to rapidly increase because of the aging population [6]. To correctly assess the actual number of HF patients, it is necessary to extract accurate cases of HF rather than using uncertain disease names on electronic medical records. Recently, electronic medical record-based phenotyping has been used to identify certain cases [7]. In this study, we aim to identify patients with HF using MID-NET data and improve the algorithm with machine learning.

Data extraction
We analyzed 15,489 inpatient cases from Tohoku University Hospital (TUH) between April 1 and December 31, 2013, using data extracted from MID-NET. First, we extracted inpatient cases coded as having possible HF using International Classifications of Diseases 10 revision (ICD10) codes [8]. Based on the clinical guidelines released by the Japanese Circulation Society [9], we set the extraction criteria (i.e., the initial rule) to cases that included disease names, examinations, and medications related to HF. As shown in Table 1, the initial rule was set as Disease name a; Examination a, Examination b, or Examination c; and Drug a or Drug b. The dates were considered as follows: The data were retrieved for each examination or drug within one month, before or after the date the disease name was recorded. Next, two physicians, including a cardiologist from TUH, evaluated a random sample of 200 cases and verified the accuracy of the cases by reviewing the electronic medical records. This study was approved by the ethics review committee of Tohoku University (No. 2020-1-459).

Improvement of algorithm
Using the two physicians' evaluations, we trained the XGBoost model using 5-fold cross-validation in R [10] to improve the algorithm, which enabled the extraction of certain factors to enhance its accuracy. Finally, we retrospectively tested the algorithm on a cohort from an inpatient database of the TUH Department of Cardiovascular Medicine [11]. Precision is defined as the number of true positives divided by the sum of the number of true positives and the number of false positives. Recall is defined as the number of true positives divided by the sum of the number of true positives and the number of false negatives. The F-measure is defined as 2 × Precision × Recall/ (Precision + Recall).

Results
A total of 5,282 cases were extracted using only disease names related to HF. From those, 2,799 cases corresponding to the initial rule (Table 1) were retrieved, and 200 cases were randomly sampled and assessed by reviewing the medical records. A total of 70 cases were found to be true HF cases. Thus, the initial positive predictive value was 0.350. Figure 1. BNP is the strongest factor related to heart failure (AUC=0.847).
Next, we modified the algorithm using a machine learning method with XGBoost model, and the results revealed the correlation of HF with several factors. The number of variables was 13,349. As shown in Figure 1, the B-type natriuretic peptide (BNP) value was the strongest factor linked to HF. Using this data, we could determine the conditions contributing to improving the validity of the cases with HF. Figure 2 shows the distribution of true HF cases according to the serum BNP values (high, middle, and low ranges). Then, the high group (BNP>400) was labeled "heart failure," and the low group (BNP<100) was excluded. For the middle group, candidates were additionally categorized according to their prescribed medication for HF. Drugs were classified into six groups: catecholamine (G1); human atrial natriuretic peptide (HANP) (G2); diuretic (G3); spironolactone (G4); angiotensin receptor blocker, angiotensin-converting-enzyme inhibitor, or beta blocker (G5); and digitalis (G6). Using the XGBoost model helped clarify that the combinations of catecholamine and diuretic (G1 and G3), HANP and diuretic (G2 and G3), and diuretic and digitalis (G3 and G6) were strongly correlated with HF ( Figure 3). That is why these three conditions were also added to the modified algorithm.
Finally, our analyses indicate that the precision rate increased to 0.878 from 0.350 when compared with the initial rule, but the recall rate decreased to 0.697 from 0.923. The F-measure also increased from 0.506 to 0.777 (Table 2).

Discussion
We developed an algorithm to identify HF cases with high precision. Disease names coded with ICD 10 were not sufficient to identify true HF cases because such cases extracted by the code also included suspected or chronic cases. The addition of examinations and medications did not improve the accuracy. However, based on machine learning, the use of serum BNP values and the combination of related medications increased the precision, as indicated by a higher F-measure. In addition to the data available from the MID-NET, other structured or unstructured data would further contribute to increasing the accuracy. Nevertheless, it is inevitable that algorithms will have tradeoffs between precision and recall, which is why it is necessary to select appropriate algorithms based on the intended research. However, there are some limitations to this study. First, the total number of cases was relatively small. Second, the revised algorithm was validated in only one institute. Hence, more cases are required for machine learning and validation. However, even with those limitations, our results are similar to some previous studies [12][13][14]. With additional factors such as the results from electrocardiogram (ECG), ultrasound cardiography (UCG), and catheter examinations from a hospital information system [15], novel and better algorithms can be developed in the future. For example, heart rate in an ECG and ejection fraction in a UCG can be one of the best factors to detect HF. In conclusion, we extracted clinical data from a large clinical database in Japan for electronic phenotyping of HF. To accurately identify patients with HF, a machine learning method was implemented. Overall, leveraging large amounts of clinical data can be beneficial for medical research progress.