MedPromptExtract (Medical Data Extraction Tool): Anonymization and Hi-fidelity Automated data extraction using NLP and prompt engineering

Roomani Srivastava,Suraj Prasad,Lipika Bhat,Sarvesh Deshpande,Barnali Das,Kshitij Jadhav
2024-09-06
Abstract:Introduction: The labour-intensive nature of data extraction from sources like discharge summaries (DS) poses significant obstacles to the digitisation of medical records particularly for low- and middle-income countries (LMICs). In this paper we present a completely automated method MedPromptExtract to efficiently extract data from DS while maintaining confidentiality. Methods: The source of data was Discharge Summaries (DS) from Kokilaben Dhirubhai Ambani Hospital (KDAH) of patients having Acute Kidney Injury (AKI). A pre-existing tool EIGEN which leverages semi-supervised learning techniques for high-fidelity information extraction was used to anonymize the DS, Natural Language Processing (NLP) was used to extract data from regular fields. We used Prompt Engineering and Large Language Model(LLM) to extract custom clinical information from free flowing text describing the patients stay in the hospital. Twelve features associated with occurrence of AKI were extracted. The LLM responses were validated against clinicians annotations. Results: The MedPromptExtracttool first subjected DS to the anonymization pipeline which took three seconds per summary. Successful anonymization was verified by clinicians, thereafter NLP pipeline extracted structured text from the anonymized pdfs at the rate of 0.2 seconds per summary with 100% accuracy.Finally DS were analysed by the LLM pipeline using Gemini Pro for the twelve features. Accuracy metrics were calculated by comparing model responses to clinicians annotations with seven features achieving AUCs above 0.9, indicating high fidelity of the extraction process. Conclusion: MedPromptExtract serves as an automated adaptable tool for efficient data extraction from medical records with a dynamic user interface. Keywords: Digitizing Medical Records, Automated Anonymisation, Information Retrieval, Large Language Models, Prompt Engineering
Artificial Intelligence,Information Retrieval
What problem does this paper attempt to address?
The paper aims to address the issue of efficiently extracting data from Discharge Summaries (DS) while ensuring the maintenance of patient privacy during the extraction process. Specifically, the paper proposes a fully automated tool named MedPromptExtract for efficiently extracting data from discharge summaries, with a particular focus on the digitization of medical records in low- and middle-income countries (LMICs). The tool achieves its objectives through the following steps: 1. **Anonymization**: Utilizing the EIGEN tool to perform semi-supervised learning techniques for high-fidelity information extraction and anonymization of discharge summaries. 2. **Structured Data Extraction**: Using Natural Language Processing (NLP) techniques, particularly regular expression algorithms (RegEx), to extract structured textual information from discharge summaries. 3. **Unstructured Text Analysis**: Combining prompt engineering with large language models (LLM) to extract specific clinical information from free text describing the patient's condition during hospitalization. The paper focuses on demonstrating how MedPromptExtract effectively extracts 12 features related to Acute Kidney Injury (AKI) from discharge summaries and validates its accuracy and reliability. Additionally, the paper discusses the advantages and limitations of the current methods and proposes directions for future improvements.