Efficient Diagnosis Assignment Using Unstructured Clinical Notes (2023)

Abstract: Electronic phenotyping entails using electronic health records (EHRs) to identify patients with specific health outcomes and determine when those outcomes occurred. Unstructured clinical notes, which contain a vast amount of information, are a valuable resource for electronic phenotyping. However, traditional methods, such as rule-based labeling functions or neural networks, require significant manual effort to tune and may not generalize well to multiple indications. To address these challenges, we propose HyDE (hybrid diagnosis extractor). HyDE is a simple framework for electronic phenotyping that integrates labeling functions and a disease-agnostic neural network to assign diagnoses to patients. By training HyDE’s model to correct predictions made by labeling functions, we are able to disambiguate hypertension true positives and false positives with a supervised area under the precision-recall curve (AUPRC) of 0.85. We extend this hypertension-trained model to zero-shot evaluation of four other diseases, generating AUPRC values ranging from 0.82 - 0.95 and outperforming a labeling function baseline by 44 points in F1 score and a Word2Vec baseline by 24 points in F1 score on average. Furthermore, we demonstrate a speedup of >4x by pruning the length of inputs into our language model to ~2.3% of the full clinical notes, with negligible impact to the AUPRC. HyDE has the potential to improve the efficiency and efficacy of interpreting large-scale unstructured clinical notes for accurate EHR phenotyping.

## introduction the widespread adoption of electronic health records (ehrs) by health systems has created vast clinical datastores. one of the essential steps in utilizing these data is identifying patients with specific clinical outcomes and the timing of these outcomes, through a process called electronic phenotyping @xcite . electronic phenotyping is critical for using ehr data to support clinical care @xcite , inform public health decision-making @xcite , and train predictive models @xcite @xcite @xcite . electronic phenotyping is a complex task that involves combining structured data (e.g. lab results and codes) with unstructured data (e.g. clinical notes). rule-based heuristics can be applied to structured data. however, the unstructured nature of information rich @xcite @xcite clinical notes makes phenotyping based on these notes particularly challenging. several solutions exist for electronic phenotyping using unstructured clinical notes @xcite @xcite , but lack convenience for generalizing to new conditions. for example, labeling functions that consist of rules authored by domain experts are interpretable and readily shared without compromising data privacy, but can be laborious to create. neural networks (nns) that are trained to identify specific diseases can eliminate the need for handcrafted labeling functions and often provide more accurate results. however, nns require extensive manual labeling time and often generalize poorly to diseases not seen during training. to address this, we introduce hyde (hybrid diagnosis extractor). hyde is a simple approach to electronic phenotyping that combines the strengths of labeling functions and neural networks and allows for generalization to new diseases with minimal overhead. our key contributions are as follows: ## methods our proposed method, hyde (hybrid diagnosis extractor), aims to accurately identify the earliest occurrence of specific diseases in clinical patient encounter notes. we accomplish this by using a combination of labeling functions and a fine-tuned biomedical language model. the labeling functions are designed to be simple and identify as many mentions of the disease as possible, including false positives. the neural network is then used to differentiate between the true positives and false positives by analyzing small segments of the clinical notes around the location identified by the labeling functions. this approach allows for identifying potential mentions of the disease, while also utilizing the neural network to improve precision. it is worth noting that the components of hyde are modular, allowing for the substitution of other methods for identifying disease-specific mentions beyond the labeling functions used in this paper. for example, trove @xcite , offers ontology-based labeling functions that eliminate the need for coding task-specific labeling rules. our method (fig. 1 ), involves the following steps: the user first develops a simple labeling function for the disease of interest. in the case of diabetes, this could be the regular expression diabetes | diabetic. this labeling function is then applied to the clinical notes to identify mentions of the disease. additionally, the user identifies peripheral terms that frequently appear before or after mentions of the disease, such as insulin-dependent or mellitus in the case of diabetes. the text matching the labeling function and peripheral terms are then replaced with [mask], and a context around the resulting mask is extracted, resulting in a masked contextual mention (mcm). these mcms are used to fine-tune a biomedical language model to determine whether the context suggests that the patient actually has the condition in question. we hypothesize that this approach allows the language model to generalize to various conditions without additional training. thus, for a zero-shot transfer to other diseases, only a simple disease-specific labeling function and peripheral terms are required. we adopt the term zero-shot in this context as each disease comes with distinct comorbidities, symptoms, and interventions. ## conclusion with its minimal setup, computational efficiency, and generalization capability, hyde offers a promising tool for electronic phenotyping from unstructured clinical notes. by improving the ability to extract patient health status, we hope that hyde will enable more informative large scale studies using ehr data, ultimately leading to public health insights and improved patient care.