MedElevator Войти в исследования
← Поиск публикаций

DOI 10.1093/jamiaopen/ooaf154

Медицинская библиотека · JAMIA open · 2025

Using natural language processing to identify symptoms in systemic mastocytosis.

Xie Fagen, Tse Kevin Y, Avila Chantal C, Zhou Matt, Saparudin Mary, Atif Hiba, Zeiger Robert S, Miller Kerri, Powell Dakota, Sullivan Erin, Lampson Ben, Puttock Eric J, Yuen Chris, Chen Wansu

СтатьяПеревод в очереди

Аннотация

BACKGROUND

Systemic mastocytosis (SM) is a rare disorder with heterogeneous, multisystem symptoms that often lead to diagnostic delays. Real-world symptom documentation in unstructured clinical notes may hold untapped potential for earlier recognition, but scalable extraction methods are lacking.

OBJECTIVE

To develop and validate a natural language processing (NLP) algorithm to identify 23 potentially SM-related symptoms from unstructured electronic health record (EHR) documentation and assess its application across SM and comparison groups.

METHODS

We conducted a retrospective study using EHR data from Kaiser Permanente Southern California (2008-2023). SM patients (n = 135) were matched 1:2:3 to chronic spontaneous urticaria (CSU) patients (n = 270) and non-SM/non-CSU controls (n = 405). A rule-based NLP algorithm was developed using manually annotated training data (339 patients, 57 495 notes) and validated against double-annotated notes from 16 SM patients (818 notes). Performance was measured by precision, recall, and F1 score. The algorithm was then applied to 118 252 notes from the full cohort.

RESULTS

The algorithm achieved strong overall performance, with precision and recall exceeding 90% for most symptoms. Lower precision was observed for "epigastric or abdominal bloating" (77%) and "swelling" (80%) due to ambiguous or non-patient references. Notes documenting at least one symptom occurred in 15.9% of the full dataset, including 19.6% of CSU notes, followed by SM (15.5%) and non-SM/non-CSU (11.0%). SM notes had a higher frequency of gastrointestinal (6.8%) and systemic symptoms (3.9%), while CSU notes more often included cutaneous symptoms (13.3%). SM notes also had the greatest proportion documenting 5 or more distinct symptoms (0.7%), suggesting more complex symptom patterns.

CONCLUSION

This study demonstrates the feasibility of using rule-based NLP to identify SM-related symptoms from unstructured EHR narratives. The approach achieved strong performance and revealed meaningful patterns in symptom documentation. These findings support the broader utility of NLP for characterizing rare disease symptoms, informing early recognition, and enhancing data-driven care strategies.

Другие публикации по теме

Для цитирования: Xie Fagen, Tse Kevin Y, Avila Chantal C, Zhou Matt, Saparudin Mary, Atif Hiba, Zeiger Robert S, Miller Kerri, Powell Dakota, Sullivan Erin, Lampson Ben, Puttock Eric J, Yuen Chris, Chen Wansu. Using natural language processing to identify symptoms in systemic mastocytosis.. JAMIA open. 2025. DOI: 10.1093/jamiaopen/ooaf154.

Перевод полного текста: Перевод в очереди

Полный текст источника

https://creativecommons.org/licenses/by-nc/4.0/ This is an Open Access article distributed under the terms of the Creative Commons Attribution-NonCommercial License ( https://creativecommons.org/licenses/by-nc/4.0/ ), which permits non-commercial re-use, distribution, and reproduction in any medium, provided the original work is properly cited. For commercial re-use, please contact reprints@oup.com for reprints and translation rights for reprints. All other permissions can be obtained through our RightsLink service via the Permissions link on the article page on our site—for further information please contact journals.permissions@oup.com.

Introduction

Systemic mastocytosis (SM) is a complex clonal disorder marked by the proliferation and activation of mast cells across multiple organ systems, often resulting in a highly variable and diagnostically elusive presentation. 1–3 Due to these complexities, SM poses significant challenges in clinical recognition. Its nonspecific and multisystem symptoms frequently lead to misdiagnosis or substantial delays in diagnosis. 4–12 In 2 previous studies by our team, 13 , 14 the interval between symptom onset and formal SM diagnosis was found to be both long and variable, underscoring the widespread and systemic nature of diagnostic delay. These delays can contribute to increased disease burden, inefficient diagnostic evaluations, and missed opportunities for earlier intervention.

Improving early recognition of SM remains an important clinical priority. A better understanding of how symptoms are documented in real-world settings may provide critical insight into how SM initially presents and is interpreted in clinical care. While prior studies have characterized SM symptoms, they have typically relied on structured data sources, selected research cohorts, or self-reported survey instruments. 9 , 14–16 These approaches may miss subtleties in symptom presentation and progression as documented by clinicians and experienced by patients during routine encounters.

Unstructured clinical documentation within electronic health records (EHR), including provider notes, patient-provider email communications, telephone encounters, and other free-text sources, offers a rich but underutilized resource for capturing symptom information. These narratives often contain nuanced, context-specific symptom descriptions that are often inaccessible through diagnosis codes or structured fields. However, extracting meaningful data from free-text at scale presents significant methodological challenges. 17 , 18

Natural language processing (NLP) offers a scalable and systematic approach to unlocking clinically relevant information from unstructured text. Previous research has demonstrated the utility of NLP in identifying early symptoms of asthma, infectious diseases, and cancer. 19–24 To our knowledge, no prior studies have systematically applied NLP to identify symptoms potentially associated with SM from EHR narratives. Given the heterogeneous nature of SM and its frequent diagnostic ambiguity, NLP presents a promising strategy for uncovering patterns that may otherwise go unrecognized.

To address this knowledge gap, we developed and validated a rule-based NLP algorithm to extract symptoms potentially associated with SM from free-text clinical documentation within Kaiser Permanente Southern California (KPSC), a large diverse integrated healthcare system. This work aimed to demonstrate the feasibility of symptom extraction from EHR narratives and to support future efforts to enhance early diagnosis, outcome prediction and broader data-driven approaches in SM cares.

Methods

Study setting

This retrospective study was conducted within KPSC, an integrated healthcare system providing comprehensive medical services to over 4.9 million enrollees across 16 medical centers and 250+ medical offices throughout the Southern California region. KPSC's patient population demographically represents Southern California residents. 25 KPSC’s extensive EHR contains structured data (including encounter diagnosis codes and procedure codes, medications dispensing records, immunization records, laboratory results, and pulmonary function test results) and unstructured data (including free-text clinical notes, hospital discharge notes, patient/provider messages and email communications) across all healthcare settings (eg, outpatient, inpatient, emergency department, virtual). The KPSC Institutional Review Board reviewed and approved the study protocol with a waiver of the requirement for informed consent.

Study population

The study cohort included patients with a manually confirmed diagnosis of SM between 2008 and 2023. The date of the first SM diagnosis within this window was defined as the index date. Each SM patient was matched to comparison patients at a 1:2:3 ratio based on age (±1 year), sex, and index date (±1 year). For each SM patient, the first comparison group included 2 patients with chronic spontaneous urticaria (CSU), using the first CSU diagnosis during the same 2008-2023 window as the index date. The second comparison group consisted of 3 patients without any diagnosis of SM or CSU. For these patients, the index date was the diagnosis date of any other condition seen by care providers that matched an SM patient’s index year within ±1 year. CSU was chosen as an active comparator due to its mast-cell–mediated pathophysiology and symptom overlap with SM, particularly in cutaneous, gastrointestinal, and neuropsychiatric domains. This selection provides a robust clinical benchmark for attributing and documenting symptoms. To ensure comparability, patients were matched by age (to address the significant age differences between SM and CSU patients), sex (to account for established sex-related variations in mast-cell disorders and symptom reporting), and calendar time (index date; to align coding practices and treatment availability across all groups).

Symptom keyword selection

A set of 23 potential SM-related symptoms, spanning cutaneous, gastrointestinal, neuropsychiatric, musculoskeletal, systemic, and allergic reaction domains, was analyzed by the study. A list of related phrases and terms was compiled from prior literature 18–24 and the Unified Medical Language System. 26 Clinicians refined and expanded the list based on manual annotation (see “Data Annotation Process”). Synonyms, morphological variants, and common misspellings were identified using a Word2Vec model trained on the study corpus. 27 The final symptom term list is provided in Table S1 .

Extraction and preprocessing of study notes

Clinical notes and patient/provider telephone or email communications within one year before and after the index date (referred to as “notes” hereafter) for each study subject were extracted from the KPSC EHR system. Notes associated with certain medical encounters (eg, anesthesia), note types (eg, patient instructions), and department specialties (eg, surgery, wound care) ( Table S2 ) were excluded from the analysis because symptoms of interest were unlikely to be present in these notes. Remaining notes were then pre-processed based on the following steps: (1) lowercase conversion, sentence splitting, section detection, and word tokenization 28 ; (2) removal of non-alphanumeric characters (except space, period, comma, question mark, and semicolon; (3) standardization of abbreviations and correction of misspellings ( Table S3 ) using Word2vec models, 27 and an internal spelling correction based on an algorithm previously developed. 22–24

Training dataset and validation dataset

From the full study cohort of 810 patients (135 SM, 270 CSU, and 405 non-SM/non-CSU), a subset was selected to develop and validate the NLP algorithm. For the training dataset, we randomly selected 65 SM patients, 69 CSU patients, and 205 non-SM/non-CSU patients, yielding a total of 339 patients and 57 495 notes. A separate validation dataset was created using 16 additional SM patients (not included in the training set) whose notes contained at least one study keyword or phrase ( Table S1 ). This validation dataset consisted of 818 notes, which were used to evaluate NLP algorithm performance and served as the gold standard reference.

Data annotation process

Two trained annotators manually reviewed notes from both the training and validation datasets to label the presence/absence of the 23 study symptoms using the pre-defined keywords/phrases ( Table S1 ) and study-defined inclusion/exclusion criteria ( Table S2 ). The annotation process involved 3 key steps. First, notes containing at least one symptom-related keyword ( Table S2 ) were exported into an MS Excel spreadsheet with relevant terms highlighted. Second, annotators reviewed each pre-processed note and recorded the presence or absence of symptoms. Third, any indeterminable or ambiguous cases were adjudicated by the study clinicians and resolved though consensus during weekly team meetings.

Only notes in the validation dataset were double reviewed. Discrepancies between annotators were resolved through discussion or clinician adjudication. The final adjudicated validation annotations served as the gold standard for algorithm evaluation. Interrater agreement was measured using percent agreement and the kappa coefficient 29 to assess annotation reliability.

NLP algorithm development

We divided the annotated training dataset into 10 batches to develop computerized NLP algorithms through an iterative refinement process to determine the presence or absence of each symptom. In the initial step, we searched notes for symptom-specific phrases, terms, and contextual patterns suggestive of symptom presence or absence ( Table S1 ) using Python regular expression pattern matching on a Linux server. The search patterns incorporated word lemmas and base forms to capture morphological variations (eg, singular and plural forms). The algorithm was designed to assess each sentence and classify whether a symptom was present, absent, or excluded based on contextual cues. To support accurate classification, we compiled and iteratively refined lists of ( Table S4 ):

Negation triggers (eg, no, don’t have, denies, negative for)

Uncertainty or probability terms (eg, likely, suspect, possible)

Affirmative presence terms (eg, present for, positive for, complaint of)

Temporal indicators (eg, one year ago, several months before)

Non-patient references (eg, when symptoms refer to a family member)

General precautionary or instructional text (eg, risks discussed include but are not limited to, if the following symptoms appear, possible side effects include)

These terms were compiled from the training dataset and previously published studies, 22–24 and were refined through repeated testing across each annotated batch. This cycle of testing and refinement continued until the algorithm achieved pre-defined overall performance thresholds, with both sensitivity and PPV exceeding 90%.

The final classification rules for determining the presence or absence of each symptom at the sentence level are summarized in Table S5 . A note-level determination, a classification of “Yes” was assigned if at least one sentence within the note indicated symptom presence. If no sentence met the criteria, the note was classified as “No.”

Evaluation of NLP algorithms

NLP algorithm performance at the note-level was assessed using the adjudicated validation dataset. For each symptom, the numbers of true positive (TP), true negative (TN), false positive (FP), and false negative (FN) cases were used to estimate the sensitivity (or recall), positive predictive value (PPV) (or precision), and the overall F1 score, a harmonic balance measurement of PPV and sensitivity. Sensitivity was defined as the number of TP divided by the total number of symptoms ascertained by the annotators (TP+FN). PPV was defined as the number of TP divided by the total number of symptoms identified by the computerized algorithm (TP+FP). The F1 score was calculated as: 2×PPV×sensitivity/(PPV+sensitivity).

Discrepancy analysis

The discordant results between the computerized algorithm and adjudicated chart review against the validation dataset were analyzed for each symptom. The number of false-positive and false-negative cases for each comparison was summarized in detail.

Implementation of the NLP algorithm

An implementation dataset was constructed to apply the finalized NLP algorithm to the entire study population. This dataset included 118 252 clinical notes from all 810 eligible SM, CSU, and non-SM/non-CSU patients. Each note was processed at the sentence level using the final symptom extraction algorithm, and the results were then aggregated to the note level to assess real-world symptom documentation patterns.

Results

Statistics of study notes and sentences

Table 1 summarizes the number of clinical notes and total sentences across the training, validation, and implementation datasets. The training dataset included 57 495 notes, the validation dataset 818 notes, and the implementation dataset 118 252 notes. The corresponding sentence totals were 572 621, 20 336, and 1 167 442, respectively. The average number of sentences per note was 10.0 in the training dataset and 9.9 in the full study dataset, while the validation dataset showed a substantially higher average of 24.9 sentences per note, reflecting its focus on notes that contained at least one predefined symptom keyword.

Table 1.
Description of the study datasets
Abbreviations: CSU, Chronic spontaneous urticaria; non-SM/non-CSU, neither systemic mastocytosis or chronic spontaneous urticaria; SM, systemic mastocytosis. a Only included notes with at least one of study interesting keywords. b Included patients and notes in training and validation.

Data setsTotal patients, nTotal notes, nNotes per patient, mean (SD)Total sentences, nSentences per note, mean (SD)
Training
SM6523 334359.0 (399.5)247 17910.6 (18.9)
CSU6912 086175.2 (126.9)118 0899.8 (16.1)
Non-SM/non-CSU20522 075107.7 (128.6)207 3539.4 (16.2)
All33957 495169.6 (229.5)572 62110.0 (17.3)
Validation
SM a1681851.1 (39.0)20 33624.9 (25.8)
Study notes b
SM13538 843287.7 (341.3)413 34310.6 (18.8)
CSU27046 924173.8 (150.7)449 1499.6 (16.0)
Non-SM/non-CSU40532 48580.2 (106.1)304 9509.4 (17.1)
All810118 252146.0 (195.3)1 167 4429.9 (17.3)

Interrater reliability of manual annotation

The interrater agreement between the 2 annotators on the validation dataset was high across all symptoms ( Table S6 ). Percent agreement ranged from 97.8% for “spots, lesions, or hives” to 100% for “epigastric or abdominal bloating,” “brain fog or difficulty concentrating,” and “syncope.” The corresponding kappa coefficients ranged from 0.764 for “flushing or redness” to 1.0 for “epigastric or abdominal bloating.”

Performance of the NLP algorithm

The NLP algorithm demonstrated strong performance when validated against the manually adjudicated chart review in the validation dataset, as shown in Table 2 . The precision (ie, PPV) exceeded 90% for most symptoms. Notable exceptions included “epigastric or abdominal bloating” with a precision of 76.67%, “swelling” with 80.43%, “spots, lesions, rashes, or hives” with 84.89%, and “flushing or redness” with 88.89%. Recall (ie, sensitivity) was high across all assessed symptoms, exceeding 92%, while F1 scores were greater than 0.9 for nearly all symptoms. Only “epigastric or abdominal bloating” and “swelling” had slightly lower F1 score of 0.87 and 0.89, respectively. The performance of the algorithm could not be assessed for “burning,” “brain fog or difficulty concentrating,” and “syncope” due to the absence of confirmed positive cases for these symptoms in the validation dataset.

Table 2.
The performance of the computerized algorithm against the adjudicated chart review results in the validation dataset from 16 systemic mastocytosis patients at the note level (n = 818).
a The performance of Burning, Brain fog or difficulty concentrating and Syncope was not evaluated because of no confirmed cases. b Including anaphylaxis. Abbreviations: FN, false negative; FP, false positive; PPV, positive predicted value; TN, true negative; TP, true positive.

Symptoms aTPTNFPFNPPV (%)Sensitivity (%)F1-score
Cutaneous symptoms
Spots, lesions, rashes or hives8372015084.69100.000.91
Itching2579102100.0092.590.96
Flushing or redness247903188.8996.000.92
Swelling377729080.43100.000.89
Gastrointestinal symptoms
Abdominal pain or cramping1979801100.0095.000.97
Epigastric or abdominal bloating138014176.47100.000.87
Diarrhea897254095.70100.000.98
Nausea or vomiting407714390.9193.020.92
Constipation2279600100.00100.001.00
Neuropsychiatric symptoms
Dizziness781100100.00100.001.00
Headache2179700100.00100.001.00
Anxiety980900100.00100.001.00
Depression2179601100.0095.000.97
Insomnia980900100.00100.001.00
Musculoskeletal symptoms
Bone pain1180700100.00100.001.00
Joint pain1280501100.0092.310.96
Muscle pain381500100.00100.001.00
Severe allergic reactions b1280600100.00100.001.00
Systemic symptoms
Fatigue747431098.67100.000.99
Weight loss247931096.00100.000.98

Discrepancy analysis of validation

Discrepancies between the NLP algorithm and the manual chart review were systematically analyzed and are detailed in Table S7 . Among false positives, the most common reasons were the failure to exclude symptoms that referred to internal organ issues (n = 11) (eg, some swelling noted in the colon biopsies), symptoms described as part of a patient’s past medical history (n = 14), and symptoms mentioned in the context of medication side effects, related to procedures or precautionary warnings (n = 14). Among the 9 false negatives observed, the underlying causes included missed keywords (n = 3), false negation identification (n = 3), and incorrect exclusion due to misclassified medication instructions or general symptom descriptions (n = 3).

Note-level symptom documentation in the full study dataset

In the full study dataset of over 118 000 clinical notes, about 16% of notes contained at least one study symptom. This proportion varied by group: roughly 20% of notes from patients with chronic spontaneous urticaria (CSU), 15.5% of notes from SM patients, and 11% of notes from patients without SM or CSU contained at least one symptom. It is important to note that these percentages refer to individual notes, not to the number of patients, since each patient could have many notes.

Among the different types of symptoms, cutaneous symptoms were the most commonly documented overall, especially in CSU notes ( Table 3 ). In contrast, notes from SM patients more frequently contained gastrointestinal symptoms, as well as systemic symptoms and signs of severe allergic reactions. Neuropsychiatric symptoms such as depression, anxiety, and headache were fairly common across all patient groups. Musculoskeletal symptoms, such as joint or muscle pain, were the least frequently documented overall.

Table 3.
Summary of symptoms identified by the computerized algorithm based on the study implementation datasets at note level.
Abbreviations: CSU, Chronic spontaneous urticaria; non-SM/non-CSU, neither systemic mastocytosis or chronic spontaneous urticaria; SM, systemic mastocytosis. a Including anaphylaxis.

SymptomsSM N = 38 843CSU N = 46 924Non-SM/non-CSU N = 32 485All N = 118 252
Cutaneous symptoms2548 (6.56%)6237 (13.29%)1090 (3.36%)9875 (8.35%)
Spots, lesions or hives1315 (3.39%)4545 (9.69%)471 (1.45%)6331 (5.35%)
Itching435 (1.12%)2052 (4.37%)170 (0.52%)2657 (2.25%)
Flushing or redness536 (1.38%)799 (1.70%)222 (0.68%)1557 (1.32%)
Burning24 (0.06%)115 (0.25%)25 (0.08%)164 (0.14%)
Swelling951 (2.45%)1859 (3.96%)451 (1.39%)3261 (2.76%)
Gastrointestinal symptoms2631 (6.77%)1251 (2.67%)828 (2.55%)4710 (3.98%)
Abdominal pain or cramping967 (2.49%)556 (1.18%)421 (1.30%)1944 (1.64%)
Epigastric or abdominal bloating400 (1.03%)144 (0.31%)164 (0.50%)708 (0.60%)
Diarrhea1056 (2.72%)220 (0.47%)150 (0.46%)1426 (1.21%)
Nausea or vomiting937 (2.41%)515 (1.10%)321 (0.99%)1773 (1.50%)
Constipation341 (0.88%)179 (0.38%)100 (0.31%)620 (0.52%)
Neuropsychiatric symptoms1394 (3.59%)2051 (4.37%)1473 (4.53%)4917 (4.16%)
Dizziness315 (0.81%)437 (0.93%)599 (0.49%)1003 (0.85%)
Brain fog or difficulty concentrating119 (0.31%)46 (0.93%)67 (0.21%)232 (0.20%)
Headache491 (1.26%)821 (1.75%)406 (1.25%)1718 (1.45%)
Anxiety309 (0.80%)590 (1.26%)534 (1.64%)1433 (1.21%)
Depression382 (0.98%)561 (1.20%)573 (1.76%)1516 (1.28%)
Insomnia211 (0.54%)222 (0.47%)123 (0.38%)556 (0.47%)
Musculoskeletal symptoms164 (0.42%)442 (0.94%)278 (0.86%)884 (0.75%)
Bone pain31 (0.08%)15 (0.03%)13 (0.04%)59 (0.05%)
Joint pain92 (0.24%)285 (0.61%)177 (0.54%)554 (0.47%)
Muscle pain49 (0.13%)181 (0.39%)103 (0.32%)333 (0.28%)
Systemic symptoms1516 (3.90%)804 (1.71%)625 (1.92%)2945 (2.49%)
Fatigue1148 (2.96%)622 (1.33%)501 (1.54%)2271 (1.92%)
Syncope151 (0.39%)116 (0.25%)16 (0.05%)283 (0.24%)
Weight loss390 (1.00%)86 (0.18%)135 (0.42%)611 (0.52%)
Severe allergic reactions a135 (0.35%)85 (0.18%)1 (0.003%)221 (0.19%)
Number of mutual present symptom
13487 (8.98%)5481 (11.68%)2320 (7.14%)11 288 (9.55%)
21340 (3.45%)2310 (4.92%)812 (2.50%)4462 (3.77%)
3646 (1.96%)946 (2.02%)304 (0.94%)1896 (1.60%)
4286 (0.74%)332 (0.71%)78 (0.24%)696 (0.59%)
5+260 (0.67%)142 (0.30%)44 (0.14%)446 (0.38%)

Looking at specific symptoms, “spots, lesions, or hives” appeared in over 9% of CSU notes and in 3.4% of SM notes ( Table 3 ). Other symptoms like “swelling” and “diarrhea” also showed higher rates in SM and CSU notes compared to the non-SM/non-CSU group. Rare symptoms, such as “bone pain,” “brain fog,” and “burning,” were documented in fewer than 1% of notes across all groups.

Notably, SM patient notes were more likely to document multiple symptoms: nearly 0.7% of SM notes mentioned 5 or more distinct symptoms, which was a higher rate than in CSU (0.30%) or non-SM/non-CSU notes (0.14%). This suggests that, at the note level, symptom complexity may be greater among SM patients.

Discussion

In this study, we developed and validated a computerized NLP algorithm to identify 23 potentially SM-related symptoms from unstructured clinical documentation within an integrated healthcare system. To our knowledge, this is the first study to systematically extract a broad range of symptoms potentially associated with SM using NLP. The algorithm demonstrated strong performance in validation, with both precision and recall exceeding 90% for most symptoms. This enabled accurate symptom identification across a large cohort of SM patients from KPSC and matched comparison groups, demonstrating that unstructured EHR data can be effectively leveraged to study symptom documentation patterns in SM.

Prior research on SM symptoms has primarily relied on structured data fields, patient self-report, or selective clinical trial populations, 9 , 14–16 which may not fully capture real-world symptom expression. By analyzing provider-authored and patient-reported free text, our approach captures subtler and earlier mentions of symptoms that may precede diagnosis. This has the potential to support earlier SM recognition through improved clinical awareness or risk prediction. Post-diagnosis, NLP-based symptom tracking could help characterize disease burden, guide care planning, and support outcome monitoring. Taken together, these applications highlight how NLP can enhance both diagnostic processes and longitudinal management of rare diseases like SM.

This study benefited from several key strengths. We leveraged a large volume of clinical notes and patient-provider communications from a demographically diverse population. The NLP algorithm was developed using a carefully annotated training and validation set, supported by rigorous chart review and clinician adjudication. Our curated symptom lexicon and context-specific exclusion rules (eg, medication side effects, historical mentions, non-patient references) form a reusable resource for future symptom extraction efforts. Furthermore, our study design, matching SM patients to 2 comparison groups, enabled evaluation of symptom specificity and co-occurrence across different populations, a framework that may be generalizable to other rare or underdiagnosed conditions with overlapping symptom profiles.

Despite strong overall performance, accurate extraction of potentially SM-related symptoms from free-text clinical notes posed several challenges. These symptoms could appear in various sections of the note, such as the chief complaint, history of present illness, assessment and plan, problem list, or medication instructions, etc., each requiring careful contextual interpretation. Additionally, some notes contained copied text from previous visits that may not represent the patient’s current status. False positives were most often due to failures in excluding mentions related to internal organ pathology, past medical history, or medication side effect precaution warnings. Conversely, false negatives frequently resulted from missed keyword variants, incorrect handling of complex negations, or overly broad exclusion rules. These challenges highlight the importance of continual refinement and expert-informed rule development to ensure reliable symptom extraction in real-world clinical narratives.

The annotation process itself was time-consuming and required careful design. From this experience, we share several lessons learned. First, we recommend implementing a training plan for annotators, including pilot testing with a shared set of notes to calibrate interpretation and identify early issues. Second, a comprehensive annotation protocol should be developed, clearly specifying which note types and sections are relevant, and documenting inclusion and exclusion criteria for symptom classification. These criteria may need refinement during the review process; if updated, previously annotated notes should be re-reviewed to maintain consistency. Third, chart entries should be double-checked to minimize transcription errors and confirm consistency, particularly when studying multiple symptoms. Lastly, we found that double annotation of a validation subset was essential to ensure a high-quality gold standard for algorithm assessment.

While our rule-based NLP algorithm performed well, future work may benefit from incorporating more advanced machine learning methods. 30 , 31 Hybrid approaches that combine rule-based logic with transformer-based models, such as BERT or other large language models, have shown improved performance in clinical NLP tasks. 22 , 32 , 33 These methods may better handle ambiguous language, rare misspellings, and contextually complex mentions of symptoms. Integration of such models could enhance symptom detection for SM, especially in cases where terms have multiple meanings or are sparsely represented in the training data.

Although our study did not aim to develop an early warning system, the structured capture of symptom information from unstructured notes may inform future development of risk prediction models and clinical decision support tools. Free-text documentation may contain early or atypical manifestations not captured in structured fields, offering a path to earlier identification of SM and potentially other rare diseases. Future studies could explore the clinical utility of NLP-extracted symptoms in supporting diagnostic evaluations and care pathways.

Several limitations should be acknowledged. First, the accuracy of symptom extraction is inherently limited by what is documented in the clinical notes; symptoms not recorded cannot be identified. Second, although the annotated training set was substantial, it may not have captured the full diversity of linguistic expressions, particularly for rare symptoms. Third, we were unable to validate algorithm performance for a small number of infrequently occurring symptoms (eg, “burning,” “syncope,” “brain fog”) due to a lack of confirmed cases in the validation dataset. Therefore, their results should be interpreted with caution. Lastly, while our rule-based algorithm performed well within our health system, generalizability to other settings may be limited. EHR systems vary in their documentation practices, formats, and language usage. As with most NLP tools, adaptation and site-specific validation are likely required to apply this method elsewhere.

In conclusion, this study demonstrates the feasibility and utility of using rule-based NLP to extract potentially SM-related symptoms from unstructured clinical documentations in a large, real-world healthcare system. While the methodology itself was not novel, its application to SM represents a significant advancement in how rare disease symptoms can be systematically captured and analyzed. These findings support the use of EHR narratives to inform early diagnosis and disease monitoring, and lay a foundation for future research into computational approaches for underrecognized conditions.

Supplementary Material

Acknowledgments

The authors thank the patients of Kaiser Permanente for helping us improve care through the use of information collected through our electronic health record systems.

Author contributions

Fagen Xie (Conceptualization, Data curation, Formal analysis, Investigation, Methodology, Software, Validation, Visualization, Writing—original draft), Kevin Y. Tse (Conceptualization, Investigation, Methodology, Validation, Visualization, Writing—review & editing), Chantal C Avila (Conceptualization, Investigation, Methodology, Validation, Visualization, Writing—review & editing), Matt Zhou (Conceptualization, Data curation, Investigation, Methodology, Validation, Visualization, Writing—review & editing), Mary Saparudin (Conceptualization, Investigation, Methodology, Validation, Visualization, Writing—review & editing), Hiba Atif (Conceptualization, Investigation, Methodology, Validation, Visualization, Writing—review & editing), Robert S. Zeiger (Conceptualization, Investigation, Methodology, Validation, Visualization, Writing—review & editing), Kerri Miller (Conceptualization, Investigation, Methodology, Validation, Visualization, Writing—review & editing), Dakota Powell (Conceptualization, Investigation, Methodology, Validation, Visualization, Writing—review & editing), Erin Sullivan (Conceptualization, Investigation, Methodology, Validation, Visualization, Writing—review & editing), Ben Lampson (Conceptualization, Investigation, Methodology, Validation, Visualization, Writing—review & editing), Eric J. Puttock (Conceptualization, Investigation, Methodology, Validation, Visualization, Writing—review & editing), Chris Yuen (Conceptualization, Investigation, Methodology, Validation, Visualization, Writing—review & editing), and Wansu Chen (Conceptualization, Funding acquisition, Investigation, Methodology, Project administration, Resources, Supervision, Validation, Visualization, Writing—original draft)

Supplementary material

Supplementary material is available at JAMIA Open online.

Funding

The study was supported by a grant from Blueprint Medicines (Cambridge, Mass) to Kaiser Permanente Southern California. The content is solely the responsibility of the authors and does not necessarily represent the official views of the funding agency.

Conflicts of interest

Robert Zeiger reports consulting fees from AstraZeneca; grant support from Sanofi; and royalties from UpToDate. Wansu Chen reports grant support from Sanofi. Kerri Miller, Dakota Powell, Erin Sullivan, Ben Lampson and Chris Yuen are employees of Blueprint Medicine. Other authors report no relevant conflict of interest.

Data availability

The data underlying this article was extracted from electronic health records and cannot be shared publicly for the privacy of individuals that participated in the study.

References

1 Pardanani A. Systemic mastocytosis in adults: 2021 update on diagnosis, risk stratification and management . Am J Hematol . 2021 ; 96 : 508 - 525 . 10.1002/ajh.26118 33524167

2 George TI , Horny HP. Systemic mastocytosis . Hematol Oncol Clin North Am . 2011 ; 25 : 1067 - 1083 , vii. 22054735 10.1016/j.hoc.2011.09.012

3 Valent P , Akin C , Hartmann K , et al Updated diagnostic criteria and classification of mast cell disorders: a consensus proposal . Hemasphere . 2021 ; 5 : e646 . 10.1097/HS9.0000000000000646 34901755 PMC8659997

4 Cohen SS , Skovbo S , Vestergaard H , et al Epidemiology of systemic mastocytosis in Denmark . Br J Haematol . 2014 ; 166 : 521 - 528 . 10.1111/bjh.12916 24761987

5 Brockow K. Epidemiology, prognosis, and risk factors in mastocytosis . Immunol Allergy Clin North Am . 2014 ; 34 : 283 - 295 . 10.1111/bjh.12916 24745674

6 Bista A , Uprety D , Vallatharasu Y , et al Systemic mastocytosis in United States: a population based study . Blood . 2018 ; 132 : 1830 - 1830 . 10.1182/blood-2018-99-120192

7 Zanotti R , Bonifacio M , Isolan C , et al A multidisciplinary diagnostic approach reveals a higher prevalence of indolent systemic mastocytosis: 15-years’ experience of the GISM network . Cancers (Basel) . 2021 ; 13 : 6380 . 10.3390/cancers13246380 34944999 PMC8699786

8 Castells M , Austen KF. Mastocytosis: mediator-related signs and symptoms . Int Arch Allergy Immunol . 2002 ; 127 : 147 - 152 . 10.1159/000048188 11919427

9 Tiryaki TO , Özkan SG , Erdem S , et al Comprehensive mastocytosis data analysis from a single center . BMC Cancer . 2023 ; 23 : 82 . 10.1186/s12885-022-10498-3 36694141 PMC9875486

10 Taylor F , Akin C , Lamoureux RE , et al Development of symptom-focused outcome measures for advanced and indolent systemic mastocytosis: the AdvSM-SAF and ISM-SAF© . Orphanet J Rare Dis . 2021 ; 16 : 414 . 10.1186/s13023-021-02035-5 34627355 PMC8501694

11 Sagües-Sesé E , García-Casares N , Álvarez-Twose I. Cognitive, neuropsychiatric and neurological alterations in mastocytosis: a systematic review . Clin Transl Allergy . 2023 ; 13 : e12319 . 10.1002/clt2.12319 38146805 PMC10718195

12 Zanelli M , Pizzi M , Sanguedolce F , et al Gastrointestinal manifestations in systemic mastocytosis: the need of a multidisciplinary approach . Cancers (Basel) . 2021 ; 13 : 3316 . 10.3390/cancers13133316 34282774 PMC8269078

13 Tse KY , Chen W , Puttock EJ , et al MASTering systemic mastocytosis: lessons learned from a large patient cohort . J Allergy Clin Immunol Glob . 2024 ; 3 : 100316 . 10.1016/j.jacig.2024.100316 39234417 PMC11372574

14 Zeiger RS , Tse KY , Li Q , et al Patient-reported burden of indolent systemic mastocytosis in a managed care organization . J Allergy Clin Immunol Pract . 2025 ; 13 : 202 - 212.e7 . 39477015 10.1016/j.jaip.2024.10.021

15 Padilla B , Shields AL , Taylor F , et al Psychometric evaluation of the Indolent Systemic Mastocytosis Symptom Assessment Form (ISM-SAF) in a phase 2 clinical study . Orphanet J Rare Dis . 2021 ; 16 : 434 . 10.1186/s13023-021-02037-3 34663404 PMC8522163

16 Mesa RA , Sullivan EM , Dubinski D , et al Patient-reported outcomes among patients with systemic mastocytosis in routine clinical practice: results of the TouchStone SM Patient Survey . Cancer . 2022 ; 128 : 3691 - 3699 . 10.1002/cncr.34420 35996873 PMC9804682

17 Friedman C , Alderson PO , Austin JH , Cimino JJ , Johnson SB. A general natural-language text processor for clinical radiology . J Am Med Inform Assoc . 1994 ; 1 : 161 - 174 . 10.1136/jamia.1994.95236146 7719797 PMC116194

18 Koleck T , Dreisbach C , Bourne P , Bakken S. Natural language processing of symptoms documented in free-text narratives of electronic health records: a systematic review . J Am Med Inform Assoc . 2019 ; 26 : 364 - 379 . 10.1093/jamia/ocy173 30726935 PMC6657282

19 Wu ST , Sohn S , Ravikumar KE , et al Automated chart review for asthma cohort identification using natural language processing: an exploratory study . Ann Allergy Asthma Immunol . 2013 ; 111 : 364 - 369 . 10.1016/j.anai.2013.07.022 24125142 PMC3839107

20 Wang J , Abu-El-Rub N , Gray J , et al COVID-19 SignSym: a fast adaptation of a general clinical NLP tool to identify and normalize COVID-19 signs and symptoms to OMOP common data model . J Am Med Inform Assoc . 2021 ; 28 : 1275 - 1283 . 10.1093/jamia/ocab015 33674830 PMC7989301

21 Luo X , Gandhi P , Storey S , Huang K. A deep language model for symptom extraction from clinical text and its application to extract COVID-19 symptoms from social media . IEEE J Biomed Health Inform . 2022 ; 26 : 1737 - 1748 . 10.1109/JBHI.2021.3123192 34705659 PMC9074854

22 Xie F , Zeiger RS , Saparudin MM , Al-Salman S , Puttock E , Crawford W , Schatz M , Xu S , Vollmer WM , Chen W. Identifying asthma-related symptoms from electronic health records using a hybrid natural language processing approach within a large integrated health care system: retrospective study . JMIR AI . 2025 ; 4 : e69132 . 10.2196/69132 40611521 PMC12231518

23 Malden DE , Tartof SY , Ackerson BK , et al Natural language processing for improved characterization of COVID-19 symptoms: observational study of 350,000 patients in a large integrated health care system . JMIR Public Health Surveill . 2022 ; 8 : e41529 . 10.2196/41529 36446133 PMC9822566

24 Xie F , Chang J , Luong T , et al Identifying symptoms prior to pancreatic ductal adenocarcinoma diagnosis in real-world care settings: natural language processing approach . JMIR AI . 2024 ; 3 : e51240 . 10.2196/51240 38875566 PMC11041417

25 Koebnick C , Langer-Gould AM , Gould MK , et al Sociodemographic characteristics of members of a large, integrated health care system: comparison with US Census Bureau data . Perm J . 2012 ; 16 : 37 - 41 . 10.7812/tpp/12-031 PMC3442759 23012597

26 Griffon N , Chebil W , Rollin L , et al Performance evaluation of Unified Medical Language System’s synonyms expansion to query PubMed . BMC Med Inform Decis Mak . 2012 ; 12 : 12 . 10.1186/1472-6947-12-12 22376010 PMC3309945

27 Mikolov T , Chen K , Corrado G , Dean J. Efficient estimation of word representations in vector space. In Proceedings of the International Conference on Learning Representations (ICLR’13). arXiv, 2013 ; arXiv:1301.3781v3, preprint: not peer reviewed.

28 Loper E , Bird S. NLTK: the natural language toolkit. In: Proceedings of the ACL-02 Workshop on Effective Tools and Methodologies for Teaching Natural Language Processing and Computational Linguistics. Presented at: TMTNLP 2022; July 7, 2002, 2022 ; Philadelphia, PA. 10.3115/1118108.1118117

29 Viera AJ , Garrett JM. Understanding interobserver agreement: the kappa statistic . Fam Med . 2005 ; 37 : 360 - 363 . 15883903

30 Lu Z , Sim J-A , Wang JX , et al Natural language processing and machine learning methods to characterize unstructured patient-reported outcomes: validation study . J Med Internet Res . 2021 ; 23 : e26777 . 10.2196/26777 34730546 PMC8600437

31 Alsentzer E , Murphy J , Boag W , Weng W , Jindi D , Naumann T. Publicly available clinical BERT embeddings. In: Proceedings of the 2nd Clinical Natural Language Processing Workshop.: Association for Computational Linguistics; 2019 Presented at: 2nd Clinical Natural Language Processing Workshop; June 2019 ; Minneapolis, MN. 10.18653/v1/w19-1909

32 Rijcken E , Zervanou K , Mosteiro P , Scheepers F , Spruit M , Kaymak U. Machine learning vs rule-based methods for document classification of electronic health records within mental health care—a systematic literature review. 2024 . 10.21203/rs.3.rs-2320804/v2

33 Chambon PJ , Wu C , Steinkamp JM , Adleberg J , Cook TS , Langlotz CP. Automated deidentification of radiology reports combining transformer and “hide in plain sight” rule-based methods . J Am Med Inform Assoc . 2023 ; 30 : 318 - 328 . 10.1093/jamia/ocac219 36416419 PMC9846681

Подготовка и перевод публикации
Обработка статьи · этапы, ошибки и управление
Загрузка состояния…

История · было → стало

Состояние обновляется каждые 5 секунд, пока блок открыт. Процент показывается только там, где известен объём работы. Пауза останавливает продолжение этапа; текущий запрос к источнику может завершиться.

Тип публикации указан по данным источника. Уровень доказательности автоматически не присваивается.