Hospital-wide natural language processing summarising the health data of 1 million patients
Paper · 2023 · Daniel M. Bean, Željko Kraljević, Anthony Shek et al.
Summary
A hospital can hold years of information about a patient’s health in letters and notes that a diagnosis list captures only in part. Bean and colleagues asked what a hospital could learn from those documents if it processed them across a whole trust. At King’s College Hospital in London, they used natural language processing to turn clinical expressions into standardised codes and identify which mentions described the patient. The study covered 1.07M patients over 9 years and produced 157M annotations, each linking a piece of text to a concept in the SNOMED clinical terminology. These annotations included diseases, symptoms, substances and procedures. The authors report that the amount of annotated information available per patient per year increased during the study period.
The authors used the resulting data to ask how often disorders appeared in patients’ records, at what ages they first appeared, and which conditions tended to appear together. Hypertension was the most prevalent individual disorder code, appearing in 14.65% of the full study cohort under the authors’ counting rules. The team also applied code sets from the NHS Quality and Outcomes Framework to records from the corresponding reporting year. This put the hospital estimates and primary care figures for England and London on a more comparable footing for condition definitions. Differences remained across all the conditions the authors could compare. Chronic kidney disease and depression were less prevalent in the hospital data than in the London figures, while most of the comparable conditions were more prevalent.
The age profiles recovered several clinically recognisable patterns. Multiple sclerosis, psychosis and inflammatory bowel disease appeared at younger ages than conditions such as dementia and Parkinson’s disease. Type 1 diabetes was a conspicuous exception: the data showed many first detections in middle and later life. The authors point to an older term for insulin-dependent diabetes that the software could link to type 1 diabetes even when the underlying patient had type 2 diabetes and was starting insulin. First detection itself is an age of documentation. A person who arrives with an established condition can have their first local mention years after diagnosis.
To explore how conditions co-occurred, the authors represented patients by their disorder counts and mapped a sample into a space where similar profiles could be examined together. In 72% of the resulting clusters, a disorder was recorded for more than 50% of cluster members. Adjacent groups of patients with asthma, some also with hypertension, illustrate what such a map can reveal about variation within a broad clinical group. The study establishes that a hospital can recover recognisable patterns of disease from its narrative records at scale. Using those patterns for a specific clinical or epidemiological question requires attention to how the hospital’s patients were selected, what clinicians wrote down, and which code definitions the analysis used.
Deep dive: Hospital-wide natural language processing summarising the health data of 1 million patients
Hospital-wide text processing turns clinical notes into structured data on disease prevalence, age at first mention and co-occurring conditions. · about 32 minutes to read
The problem and its context
Why the narrative record matters
An electronic health record serves several audiences. Clinicians use it to describe a patient’s problems, communicate which treatments have been tried and explain what should happen next. Administrative processes need standardised entries that can be counted consistently for reporting or billing. A diagnosis field can fulfil that second purpose without conveying everything relevant to the first. The paper starts from the gap between these uses. A hospital may have a detailed account of a patient’s care in electronic form, yet a researcher working with structured fields may have access to only part of that account.
Clinical notes, letters and reports contain much of the information exchanged between staff. The details that help a colleague understand a patient’s history can include additional diagnoses, symptoms, procedures and medications. Some of that information reaches a problem list or a coded record. The authors explain that clinical coders also read parts of the record and translate information into standard codes for dataset submissions. They work with systems such as ICD10 and OPCS, under rules that call for concise coding. The effort needed to review documents limits how much activity can be coded this way.
In the workflow the paper describes, organisations generally concentrate manual coding on inpatient episodes. Outpatient activity generates many documents of its own, but much of that text falls outside the process. This affects the kinds of patients a researcher can identify from conventional codes. A disorder managed in outpatient care may be described repeatedly in letters and still be poorly represented in a dataset built from inpatient coding. The same problem can arise when a service moves care from admission to an ambulatory setting. In either case, the place where care happens influences which people become visible to a study. The authors call attention to this as a potential source of inclusion bias.
The argument builds on earlier work about what clinical notes contain and how they might be used. The introduction points to research on the value of narrative data for identifying geriatric syndromes and to discussions of the tension between structured recording and flexible documentation. It also cites a study of the uses of unstructured content in electronic records. Assale and colleagues’ work on clinical notes
What changes when the scope is hospital-wide
As the authors describe the field, earlier applications of text analysis frequently started with a defined cohort, condition or document type. An intensive care collection gives investigators access to rich documentation from a particular environment. A study focused on atrial fibrillation, venous thromboembolism or chronic obstructive pulmonary disease can organise its work around a known clinical question. An analysis of discharge notes can work with a specific kind of document. Bean and colleagues point to a critical care database as an example of the cohort-specific scope. MIMIC-III
A hospital-wide study starts with a broader question. It asks what clinical information can be recovered from the narrative record before choosing a disease cohort. A researcher can then examine both familiar diagnoses and the conditions recorded alongside them. The approach also has to deal with more variety in the material it processes. A disease can appear in a specialty letter, in an account of previous treatment or in a statement about a relative. Each of these contains vocabulary that might identify the disease, but each supports a different conclusion about the patient. The task calls for information extraction that captures the context of a mention as well as the term itself.
The authors draw on the precedent of large studies using structured electronic records. They cite work mapping the timing of a broad range of conditions across the English NHS and research on multimorbidity in people with ischaemic heart disease. They also discuss resources such as Hospital Episode Statistics, the Clinical Practice Research Datalink and CALIBER. Structured sources allow analyses across health services and patient populations. Their diagnosis codes are assigned by trained staff, and their usefulness depends on how coding was carried out and what it was intended to capture. The paper also cites work documenting errors in structured codes, so the existence of a code assigned through an established process does not, on its own, settle whether a condition was correctly recorded.
SNOMED offers the authors a way to represent details that matter in the narrative. It assigns identifiers to clinical concepts and connects them through relationships such as those between a specific disorder and its broader categories. A single disorder can belong to several broader categories. That structure suits clinical descriptions in which a condition can legitimately be understood in several ways. It also gives researchers decisions to make when they count cases. They can count an individual code, put selected codes together to represent a condition, or use broader relationships when describing patterns of co-occurrence. Each choice answers a different question about the same underlying annotations.
The project therefore addresses two related problems. One is operational: whether a trust can convert a large collection of documents into structured information using a common process. The other is scientific: whether the resulting patient records preserve patterns that can be interpreted. A sizeable output could still be dominated by generic findings or context errors. The authors use several kinds of evidence to examine the output, including the types of annotation produced, comparisons of disease prevalence, the ages at which conditions appear and joint patterns across patients. The context for those comparisons is secondary and tertiary care at a London acute trust.
Governance is part of the context in which that work was possible. The paper describes oversight through the King’s Electronic Records Research Interface and points to the South London and Maudsley CRIS system as a precedent for patient involvement in oversight. Records written for the care of individuals are highly sensitive when brought together for research. The ability to programme a hospital-wide analysis and the authority to use the underlying material depend on separate arrangements. At King’s, the authors worked within a research opt-out framework and continued patient oversight.
The method, step by step
From a document to a patient record
CogStack provided access to the trust’s electronic text. MedCAT, the Medical Concept Annotation Toolkit, processed that text. Its first job was to find words or phrases referring to a clinical concept and link them to a SNOMED identifier. Finding a term in the text is named entity recognition. Linking is the step that decides which standard concept the expression denotes. This lets records that use different expressions for the same concept contribute to the same count. The chosen concept may describe a disorder, a finding, a substance or a procedure.
MedCAT also supplied information about each mention’s context. The system checked whether the text affirmed or negated the concept, whether the patient or someone else experienced it, and how the document placed it in time. A disorder denied in a note, a disorder mentioned in a relative’s history and a disorder described as part of the patient’s care can all contain the same clinical term. The context fields give the analysis a way to treat those cases differently. A concept code and its context labels together form the evidence that can enter a patient-level count.
From there, the analyses diverged. Estimates for individual disorders depended on deciding when a patient counted as positive for a code. The comparison with NHS primary care estimates used sets of codes from an external condition definition and a shorter observation period. The age analysis looked at the earliest local detection of selected conditions, and the co-occurrence analysis used counts of many disorder codes together. These analyses share the same clinical text processing. They differ in which annotations they admit and how they use them.
From hospital documents to patient-level analyses
The steps in order.
Choosing and preparing the records
The authors set the observation window from 2011-01-01 to 2019-12-31. The start reflects the availability of electronic data, and the end keeps the disruption associated with coronavirus outside the study window. According to the Methods, the documents were clinical notes and letters written for male and female patients who were 18–100 years old at the time of writing. The Results describe the age criterion in relation to admission. The Methods also report excluding 4571 patients whose age or sex information was missing.
A clinical note could contain multiple entries with their own dates. The authors separated those entries for processing. This matters when an analysis depends on which information appears first. A single container for several dated entries can hold evidence from different times in the patient’s record. Splitting it lets the pipeline process those entries separately. Forms and checklists were excluded because their structure supplies part of the context needed to interpret a field and the pipeline was designed around narrative text. A label in a form, for instance, may acquire its meaning from its placement and the response associated with it. The authors restricted the input to material their text processing procedure was designed to handle.
The study used MedCAT version 1.3.0. Automatic spell checking was enabled, and the configuration ignored words shorter than 3 characters. The reported upper-case limit was 4, and the linking similarity threshold was 0.3. The similarity threshold is a setting for accepting concept links. A threshold controls which candidate links survive the linking step, while the filters determine which expressions can be considered. The values were tuned for the local records. The concept annotation and context components had already been trained on data from the same setting. The paper uses them to build and describe a corpus and gives no independent training and test partition for the hospital-wide analysis.
The study operated under ethics approval for the King’s Electronic Records Research Interface. An approved opt-out arrangement governed use of patient records without the researchers seeking individual consent. A local committee approved the project for evaluating natural language processing in clinical coding, with patient oversight continuing through the work. The full patient-level dataset contains material that could permit re-identification, so the authors describe a registration through the Health Data Research UK Innovation Gateway and a procedure for seeking summary or aggregated data.
Turning a mention into evidence of a condition
MedCAT generated annotations of individual passages instead of a diagnosis list for each patient. The researchers had to decide when those annotations were sufficient to count someone. For the general code analysis, the Methods required at least 2 qualifying mentions. A qualifying mention affirmed the concept, referred to the patient and had a recent or historical time label under the rule described in Methods. The Results describe their main analytical subset as positive, referring to the patient and current or recent. Those descriptions differ in how they refer to historical mentions. The paper gives no reconciliation of the wording, so the precise treatment of historical mentions is uncertain.
The repeated-mention rule was a practical response to the scale of the corpus. A single mistaken link can create a spurious positive for a patient. Requiring repetition can remove some such cases when the error occurs only once. The rule can also exclude a correctly identified condition that appears only once in the available documents. Repetition supplies evidence about what is written in the record. It has limited value against a consistent vocabulary problem, where repeated uses of the same expression can all be linked to the same unsuitable code.
The unit for prevalence is the patient. Once a patient meets the rule for a particular code, additional mentions for that patient do not raise that code’s prevalence. By comparison, an analysis of annotation volume counts entries that may come from the same patient many times. Keeping these units distinct matters in a hospital where some people generate substantial records and others generate relatively little text. A large number of annotations for a particular disorder could arise from extensive documentation of a smaller group of patients or from mentions distributed across a larger group. The prevalence calculation addresses the latter question.
The authors estimated how prevalent each of the 16,187 SNOMED disorder codes was, including every code found in one or more patients. An analysis of an individual code answers how many people met the evidence rule for that particular entry in the terminology. A phenotype in this study is the specification used to identify people with a condition in the data. It can use a set of clinically related codes when people with the same condition might be recorded with different levels of detail. The authors distinguish these code sets from the analysis of individual entries. A seemingly broad name such as heart failure still denotes a particular code when it appears in a single-code result. Other concepts that also describe a patient with heart failure may be counted under separate codes.
Making the comparison with primary care
The comparison with the NHS Quality and Outcomes Framework, or QoF, narrowed the hospital records to 01 April 2018–31 March 2019. This was the most recent QoF reporting year that fit within the hospital observation window. The authors applied NHS business rules version 41, using the specified sets of SNOMED codes for the conditions they could map directly. They made comparisons for a comparable age range and took published England and London estimates as national and regional points of comparison.
A shared code set gives the comparison a clear meaning. When several codes qualify someone for the QoF definition of a condition, the hospital analysis can count those codes too. Matching the report’s observation period also limits the advantage the hospital analysis would have from searching several years of notes. The hospital and primary care populations still have different routes into their records. The shared definitions address the measurement rule for a condition within the scope of the available data.
For this restricted period the authors accepted any number of positive mentions, dropping the usual threshold of 2. The reason given is that there is less time for a qualifying condition to be documented repeatedly. The direct comparison therefore differs from the full-period analysis in its dates, code sets and evidence rule. When a condition has a different estimate in the two analyses, those differences in design must be considered together. The paper does not estimate the contribution of each change separately.
Locating the earliest detection
The authors chose 14 major conditions to cover several specialties and a range of expected ages at onset. For each condition, they used specific SNOMED codes to identify mentions and examined the age at which the condition first appeared in the record. The analysis compared the age distributions across diseases and examined age and prevalence by sex. The figures give a way to see patterns in the distribution that an average alone can conceal.
The origin of this clock is the hospital’s available documentation. If a patient arrives with a long-standing condition and a clinician records it, the first local detection can be the correct age for the event the researchers measured even when the age at diagnosis was much earlier. The same issue applies if relevant notes predate the electronic study period. Conversely, a condition that is documented as it is being recognised can have an age of first appearance close to the age of diagnosis. The annotation supplies evidence of an appearance in the record, and the analysis uses the distribution of those appearances to compare conditions.
Mapping profiles of co-occurring disorders
For the analysis of co-occurrence, the authors drew a random sample of 100,000 patients. Each patient was represented by a vector: a list of counts with the same disorder code occupying the same position for every patient. The Methods report that 872 codes each occurred in 1,000 or more patients in the sample. Restricting the inputs to commonly detected codes kept the representation focused on disorders with substantial support in the sample. The original text also included findings, procedures and substances. The inputs to this particular map were disorder codes.
Because patients had different amounts of documentation, the count vector was normalised by the patient’s total annotations. Each coordinate expressed a share of the annotations instead of an absolute volume. This makes a comparison of profiles less directly dependent on whether one patient has accumulated more notes than another. The resulting proportions can still reflect differences in what is repeatedly discussed. A disorder that dominates a patient’s notes will contribute strongly to their profile, and an existing condition that attracts little attention in the record may contribute very little.
The authors used principal component analysis, or PCA, to reduce those vectors to 50 dimensions. A dimension at this point represents a combination of the original code counts, and the reduction keeps prominent patterns of variation in a more compact form. They then used t-SNE to place patients in 2 dimensions for visual inspection. This method arranges points to make local similarities visible in a plot. The reported perplexity setting was 200, and the run used 1000 iterations. Perplexity controls the scale at which the procedure considers neighbourhoods. The resulting position is a way to view similarities among recorded disorder profiles.
The next step was to choose regions of the map to examine. The authors tried mini-batch k-means with increasing cluster counts and looked at cluster inertia, a measure of how tightly observations are grouped around their assigned centres. They selected 50 clusters using that analysis. They then used agglomerative clustering with Ward linkage for the reported map because it gave qualitatively better groups. Agglomerative clustering builds groups by joining smaller groups. Ward linkage favours joins that keep the spread within groups small. A connectivity graph of 100 neighbours restricted the joins to local connections. The study made these clustering choices before examining the enrichment of particular disorders in the resulting groups.
Labelling a cluster involved a further use of SNOMED. For patients in each region, the researchers counted detected concepts and propagated those counts to their parent concepts. A specific disorder can thus contribute evidence to a broader clinical label. This can help describe a region in which several related codes are common without requiring one specific code to account for the entire group. Broad labels such as “Finding” or “Disorder” were excluded because they tell a reader little about what the patients have in common. The remaining labels were reviewed manually. The paper identifies accompanying code for the clustering procedure and an interactive display of the resulting embedding.
How the comparisons were assessed
The authors used a two-sided t-test for continuous measurements such as age and a two-sided Fisher’s exact test for differences in proportions, including the prevalence comparisons presented for the common disorders. Their general statistical procedure used Bonferroni correction, which adjusts the threshold for declaring significance when several comparisons are made. These tests address evidence for a difference between the quantities being compared. In the comparison with primary care, for example, the tests use recorded proportions. They do not test whether a difference arose from who received care, how a condition was documented or how MedCAT treated the words in the records.
Experiments and results
The amount and character of the data
The full-period results cover 1.07M patients. The overall patient count in the common-disorder table is 1,073,183. The paper gives 9.5M documents in its abstract and 212M separate notes or processed documents in the Results and Methods. The Methods describe splitting notes that contained multiple dated entries, but the paper does not explicitly identify the two totals as counts before and after that operation. The annotation total reported in both places is 157M. That is a count of concept annotations, with repeated concepts and multiple annotations from an individual patient contributing to the total.
Available data grew in more than one way. The authors attribute much of the increase in annual patient numbers to the merger with Princess Royal University Hospital in 2015 and subsequent incorporation of its data. Documentation also became denser by the study’s annotation measure. The median number of annotations per patient per year went from 14 to 25. This distinction is important when reading a trend across the study period. Growth in annotation volume reflects both expansion in the collection of records and a rise in the amount of coded information per patient by this measure.
Most annotations were in the SNOMED classes for disorders, findings, substances and procedures. The paper reports that 85.9% of all annotations were positive, that 93.1% referred to the patient and that 92.9% fell in the current or recent category described in the Results. These percentages describe separate properties of the mentions. The subset with all the required properties was reported as 123M annotations, or 78.3% of all annotations. That joint count gives an idea of the amount of material remaining when context is taken into account. It is an annotation total, separate from how many patients met the evidence rule for a condition.
Prevalence in the full hospital cohort
The cohort was 54.7% female, and the mean age at the first included admission was 46.95 ± 18.99 years, with the second value giving the standard deviation. For the 485,603 male patients, mean age was 47.69 years with a standard deviation of 18.70 years. For the 587,580 female patients, the corresponding values were 46.38 years and 19.22 years. The t-test for the age difference gave p < 0.001. The group sizes matter for interpreting this result. A comparison can provide strong statistical evidence for a difference even when the reported group averages are close together.
Hypertension led the individual-disorder results for the full cohort and for both groups. Its overall prevalence was 14.65%, with 15.44% in male patients and 14.00% in female patients. Other common codes show how the composition of the leading disorders changes across the groups. In the full cohort, asthma appeared in 5.69% of patients, depressive disorder in 5.55%, and contusion in 5.43%. In the group comparisons, asthma was recorded for 6.44% of female patients and 4.78% of male patients. Depressive disorder was recorded for 5.90% of female patients and 5.12% of male patients. The authors describe the direction of the asthma and depression differences as consistent with expectations.
The paper reports significant male–female prevalence differences for 1904 SNOMED codes, or 11.8% of detected codes, at p < 0.05 after multiple-comparison correction. The figure for common disorders includes 14 distinct disorders drawn from the most prevalent codes in the overall, male and female groups. The figure and accompanying table report p < 0.001 for the male–female prevalence comparisons they display, using Fisher’s exact test. The visualisation shows that a disorder’s position in the overall ranking can conceal a different pattern within a group. It remains a comparison of recorded prevalence. The comparisons alone do not identify the role of differences in age, attendance or documentation.
A generic code for cyst illustrates a different feature of this ranking. Its prevalence in female patients was 4.99%. The authors suggest that different cyst mentions may often have been linked to a generic concept rather than to more specific concepts. If many distinct descriptions converge on a broad code, that code can become prominent even though it summarises several kinds of clinical finding. A ranking of code frequencies is sensitive to how much specificity the linking step retains, as well as to how often clinicians describe the underlying disorder.
Prevalence in the QoF reporting year
The QoF comparison uses an external set of prevalence estimates, rather than benchmark predictions for the same patient documents. In the hospital data from 01 April 2018–31 March 2019, with the QoF code definitions and relaxed mention rule, the estimates differed from both the England and the London primary care estimates for all comparable conditions. The pairwise comparisons reported p<0.001 after Fisher’s exact test and Bonferroni correction. The authors expect higher prevalence for many conditions in a secondary care cohort. The magnitude and direction of a particular difference can also reflect the way the condition is recorded and defined.
The charts use the same prevalence measure across the hospital, England and London columns. Higher values indicate a larger recorded share of the corresponding population. They carry no implication of greater clinical accuracy. The starred entry identifies the estimate derived from King’s College Hospital text.
Hypertension prevalence in hospital text and primary care, 2018/19 QoF definitions
Hypertension was more prevalent in the hospital data than in either primary care comparison.
The numbers
| System or setting | prevalence % |
|---|---|
| QoF London | 10.96 |
| QoF England | 13.96 |
| King's College Hospital text (this paper) | 19.34 |
The hypertension chart illustrates the importance of matching the analysis to the number being quoted. The full-period result uses the individual code for systemic arterial hypertension. The chart uses the QoF phenotype and the population and evidence rule for the restricted comparison. Both figures describe the hospital records, under a different specification in each case. The correspondence between the full-period code result and the England QoF figure is a broad point of context. The matched-definition analysis gives the relevant hospital estimate for comparing the same specified set of codes in the same reporting year.
Several other conditions had higher recorded prevalence in the hospital comparison than in either QoF population. Cancer had a prevalence of 9.56% in the hospital data, compared with 2.98% in England and 2.03% in London. The estimates for diabetes were 11.89% in the hospital data, 6.93% in England and 6.63% in London. For stroke the corresponding figures were 6.13%, 1.77% and 1.06%. These are comparisons of the proportion of patients meeting the respective criteria in each setting. They put the hospital’s disorder burden in context while leaving the underlying causes of each difference open.
Chronic kidney disease prevalence in hospital text and primary care, 2018/19 QoF definitions
The hospital estimate for chronic kidney disease was below both primary care figures.
The numbers
| System or setting | prevalence % |
|---|---|
| King's College Hospital text (this paper) | 1.1 |
| QoF London | 2.44 |
| QoF England | 4.09 |
Chronic kidney disease, or CKD, offers an example where the authors could examine the effect of missing specificity. The QoF definition called for grade 3a to 5. The hospital text identified 3782 patients who met the definition. It also yielded 2546 additional patients for whom CKD was detected without a grade. The latter count shows that clinicians did sometimes document the disorder without a detail essential to the comparison. It leaves the true grades of those patients undetermined. The authors suggest that structured estimated glomerular filtration rate results, which reflect kidney function, could help classify some of these patients and identify cases that clinicians did not explicitly describe in text.
Depression prevalence in hospital text and primary care, 2018/19 QoF definitions
Depression prevalence in the hospital data was below both primary care estimates.
The numbers
| System or setting | prevalence % |
|---|---|
| King's College Hospital text (this paper) | 7.32 |
| QoF London | 7.65 |
| QoF England | 10.74 |
Depression and CKD were the only conditions with lower hospital estimates than in the London comparison. For depression, the hospital estimate using the QoF definitions was also below the England figure. The paper reports a separate full-period prevalence of 5.55% for the individual depressive disorder code. The QoF result admits the relevant set of codes and uses the reporting-year procedure. The comparison shows why it helps to know both the scope of the diagnosis definition and the source of the records before attaching clinical meaning to a prevalence number.
The age at first recorded mention
The age distributions for the selected diseases showed that the corpus retained information about when different disorders tend to become visible in hospital care. Multiple sclerosis, psychosis and inflammatory bowel disease were associated with younger groups in the study’s profiles. Dementia, Parkinson’s disease and heart failure were associated with older groups. Each estimate comes from the first time a qualifying code was found locally. The authors use the age profiles to assess whether the relative patterns across conditions are clinically recognisable.
For psychosis, the mean age at first detection was 46.12 for male patients and 50.87 for female patients, with p<0.01 for the difference. The paper also reports dementia prevalence of 2.47% in female patients and 2.3% in male patients in the selected-disease analysis. It describes female patients as having a later first detection, with ages of 80.15 years in female patients and 77.73 years in male patients. These comparisons describe the age and sex patterns available through the extracted record. The paper explicitly cautions that a patient could arrive at this hospital with a previously established diagnosis.
The authors found earlier first detection for type 1 than for type 2 diabetes in both groups, yet the age distribution for type 1 diabetes still included a conspicuous number of older patients. That result is a reason to inspect the wording behind that code. The authors suggest that insulin-dependent diabetes may have been recorded for people with type 2 diabetes starting insulin and linked to the specific type 1 diabetes concept. In this example, a link can look defensible in isolation if an outdated expression is treated as a synonym. The distribution across patients reveals the problem that this interpretation may create.
Patterns of co-occurrence among patients
The random sample of 100,000 patients used for the map was compared with the rest of the dataset. The authors report p = 0.45 for the age comparison by t-test and p = 0.90 for the sex comparison by Fisher’s exact test. They found no significant difference on either measure. Those checks concern the characteristics compared, and the map uses the disorder information available for the patients in the sample.
The resulting map was divided into 50 clusters. In 72% of these, at least one SNOMED disorder appeared in over 50% of patients in the cluster. The most common disorder affected three quarters or more of the members in 48% of the clusters. These statistics describe the concentration of a recorded disorder within each region. They give a way to assess whether the map contains groups that are clinically interpretable. A cluster whose label comes from a parent concept can reflect related but more specific disorders across its members.
The asthma example helps explain how to read the result. The authors identify neighbouring areas for patients with asthma, including an area where hypertension also figures prominently. The clustering procedure gives those areas distinct labels. Their proximity is compatible with an asthma region in which the presence of another major disorder varies. Such a map lets a researcher inspect potential multimorbidity patterns without assuming that every patient with a given diagnosis has the same set of other conditions.
What the ablations show
The paper reports no formal ablation of the text pipeline and instead analyses the annotations, compares hospital and QoF prevalence estimates, inspects first-detection profiles, and examines disorder enrichment in the patient embedding.
Which conclusions depend on the counting rule
The authors report negation, experiencer and time labels separately, then give the size of the subset meeting their context criteria together. That analysis shows how much clinical material remains available when the task is restricted to mentions that can support patient-level interpretation. It would take a different comparison to establish what each context field contributes to the accuracy of patient classification. The reported percentages describe frequency, so a common label can account for much of the corpus even if the rarer cases are critical for a particular disease. A family history or negated mention can be especially consequential when the disease itself is uncommon in the records.
Individual-code and QoF estimates also show how sensitive the answer is to what constitutes a case. The move to QoF definitions changes a bundle of choices at once. It changes which codes count, which admissions are included and how much mention evidence is required. The paper uses the resulting estimates to compare populations under more closely aligned definitions. An analysis holding the reporting window and mention rule fixed while changing the code set would answer how much the code set itself contributes. The paper gives the results of the combined procedure.
The CKD analysis gets closer to identifying a specific source of disagreement because it reports an observable group of potentially relevant patients who lack a required grade in the annotations. The gap between a general mention and a graded phenotype is visible directly in those counts. That is evidence of a limitation in what the text-derived case definition can use. Whether those patients would qualify under the QoF rule depends on their underlying grades. The paper’s proposed check with structured kidney function results addresses that missing evidence.
What the comparisons say about the map
The paper describes a change from mini-batch k-means to Ward agglomerative clustering after the authors assessed the clusters qualitatively. The former supplied the analysis used to choose the cluster count. The latter produced the groups the paper interprets, with a neighbourhood constraint. The authors report a qualitative improvement and give the enrichment statistics for the final groups. They do not report equivalent enrichment scores for competing procedures. The change supports their choice of a map for inspection without quantifying an advantage over the initial grouping.
The enrichment checks answer whether some regions are dominated by recognisable disorders. They use labels chosen after clustering, with counts also propagated to more general concepts. The features used to draw the map were themselves derived from disorder mentions. A concentration of those disorders in parts of the map is therefore consistent with the way patients were positioned. The result shows that similar profiles can form interpretable regions and that some adjacent regions differ in the other diagnoses they contain. It leaves open whether those regions predict outcomes or can be reproduced in another trust.
The unexpected type 1 diabetes profile is an error analysis instead of a rerun with a changed configuration. The authors identify an ambiguous expression and propose treating it as such instead of automatically linking it to the type 1 code. The plotted age distribution supplies a reason to suspect the vocabulary mapping. Quantifying the effect of the proposed correction would require an evaluation of the affected mentions and another analysis of the revised profile. The cyst result also points to a possible mapping issue, this time a loss of specificity. Together these cases show how the paper uses aggregate patterns to locate aspects of the annotation process that merit closer inspection.
Limitations
Limits the authors identify
The authors stress that errors can accumulate in a dataset of this size even when the annotation system performs well in local validation. Different errors can have different effects on an analysis. A few incorrect links dispersed across common conditions may have little influence on their rank. A recurring link from an ambiguous term to a specific disease can change the age distribution for that disease and create a misleading pattern in a subset of patients. The paper gives type 1 diabetes as an example of the latter possibility. Collecting more manually labelled text is the improvement route the authors emphasise, and they identify the effort required to create those labels as a bottleneck.
The authors also say they do not know whether annotation performance was stable over time. Clinical terms change. Older wording for insulin dependence can persist, and clinicians may start using more specific concepts or change the labels they use for functional neurological disorders. A shift in vocabulary could change which SNOMED codes are assigned while the underlying clinical problem remains similar. The authors describe examining the actual words behind the codes as a way to investigate that possibility. An increase in annotations per patient is evidence about captured data volume under this pipeline. Its interpretation as a clinical trend would require accounting for changes in language and record coverage.
Phenotype definitions are another stated limitation. SNOMED’s multiple parent relationships allow a condition to be represented in several clinically meaningful ways. This is useful when a cluster includes related disorders that can be described by a shared parent term. It complicates a study that needs mutually exclusive groups or consistent counts across a large number of diseases. The authors contrast this with the convenience of a classification such as ICD10 for aggregation. They use carefully selected code sets for major conditions and adopt QoF definitions where those can be applied directly. The work of deciding which codes to include remains necessary for analyses that need clinically validated groups at scale.
The authors also caution against treating the trust as representative of England or of other local populations. The records come from a large acute trust in south London and reflect secondary and tertiary care. Patients who attend a hospital differ from those counted in primary care, and the geographic catchment introduces its own demographic characteristics. The trust’s merger affected which patients and records were included over time. The authors urge future researchers to test whether the patterns hold across demographic factors, including ethnic background. The results presented here derive from the particular population and services covered at King’s.
Manually assigned diagnosis codes were unavailable to the study. The authors propose comparing them with the text-derived codes in future work as a way to examine agreement or support validation. The comparisons with QoF are at population level and cannot show whether an individual patient’s extracted diagnosis is correct. The authors also point out that manual codes can contain mistakes and were frequently collected for purposes such as billing or commissioning. Agreement and disagreement between the two coding routes would both need interpretation in light of those purposes.
The age analysis has a further boundary that the authors state explicitly. Age at first detection may reflect a new diagnosis, a previously diagnosed condition first recorded by the trust, or the first electronic mention available during the study window. A patient entering the system late in a disease course contributes their observed age at detection. The age profiles support comparisons of how diseases appear in the hospital record. An estimate of biological onset or diagnostic delay requires additional evidence about earlier disease history and when the diagnosis was made.
Further limits apparent from the design
The repeated-mention heuristic ties inclusion in part to how much text a patient generates. Patients with many notes have more opportunities to acquire qualifying mentions. A code can be absent from the constructed dataset because it was never written, appeared only once, was recorded in an excluded document, or was expressed in a way the linker missed. These possibilities matter when interpreting a low estimate for a condition. The change of threshold for QoF acknowledges the effect of available observation time, but the analysis gives limited evidence about how the heuristic performs across conditions or among patients with very different amounts of documentation.
The differing descriptions of temporality affect precise reproduction. The Results describe a current or recent subset, while the Methods mention recent and historical evidence when stating the patient-level rule. Inclusion of historical mentions could matter for conditions often carried forward in the record. Similarly, the difference between the abstract’s document count and the Methods’ processed count affects how a reader interprets document-level coverage. The paper gives a common annotation total and describes splitting dated entries, but the unit behind each document count is unresolved. Rates per document derived by choosing either count would depend on that choice.
The comparison with primary care holds some aspects of measurement in common while using sources with different patterns of documentation. The CKD grade example makes that dependence visible. A code set may call for information a primary care register systematically uses, whereas a hospital letter may mention only the broader disease. Some hospital estimates may also reflect more frequent encounters with severe disease or the emphasis of the specialties that use the trust. A significant difference provides evidence that recorded proportions differ under the comparison. Assigning the difference to a larger underlying burden would require separating those mechanisms.
The embedding also carries the consequences of its representation. It inherits the errors and omissions of the extracted disorders. It gives priority to codes that reached the frequency cutoff and then compresses many dimensions into a visual map. A patient with a rare condition can still appear on the map through their other diagnoses, but that rare condition may never have shaped their position. Normalising by total annotations reduces the direct influence of volume. It also means a disorder’s weight depends on what else is recorded for the same patient. A substantial weight can reflect repeated clinical attention as well as co-occurrence with other diagnoses.
The hard cluster boundaries are a feature of the grouping procedure. The authors explicitly interpret the embedding as continuous, and their asthma example shows why a small boundary between nearby patients should carry little weight by itself. As a design matter, judging the clusters through the codes used to position the patients establishes interpretability within the same record. Establishing that similarly placed patients share treatment responses, future outcomes or clinical trajectories would require outcome data and a separate evaluation. The study’s use of the map is descriptive and intended to support exploration.
Finally, research access and reproducibility depend on different resources. The paper points to the clustering code and a visualisation that help a reader understand the analysis and inspect the reported patterns. Patient-level records remain sensitive and are not directly available. A researcher could examine the procedure without being able to check the words behind a particular disputed diagnosis or reproduce the corpus from its original records. This is especially relevant where a proposed explanation, such as the use of older diabetes terminology, depends on seeing the corresponding text.
What came after
Subsequent studies adopting the hospital-wide pipeline are undocumented here. The authors identify several prospective uses. One is to build and validate phenotype definitions that can be used consistently at scale. They discuss curated libraries and automated mappings as possible routes to aggregating clinically related SNOMED codes. Their own comparisons show why this matters: the analysis can recover individual concepts in very large numbers, yet answering a question about a disease often requires a carefully chosen set of concepts and evidence that the set identifies the intended patients.
A second direction is to use the patient embedding to generate hypotheses. The authors suggest examining how outcomes vary across regions of the map and using similarities in disorder profiles to identify groups for studies of multimorbidity. They also raise the possibility of virtual trials involving patients with several conditions. The study demonstrates concentration of disorders within some regions of the embedding. Its proposed applications would require defining the outcomes, validating the patient groups and determining whether the observed similarities are relevant to the comparison being made.
The paper also proposes extending text processing to primary care, mental health or other community records and using hospital text as an additional source alongside existing coded data. Such extensions would put the method into settings where vocabulary, patient contact and documentation differ. The King’s College Hospital study provides a concrete starting point for that work by showing what can be measured from a trust’s narrative records and where the resulting measurements remain dependent on the original clinical language.
Cite
Cite as Daniel M. Bean, Željko Kraljević, Anthony Shek, James Teo and Richard Dobson. 2023. Hospital-wide natural language processing summarising the health data of 1 million patients. PLOS Digital Health.
@inproceedings{bean2023hospital,
title = {{Hospital-wide natural language processing summarising the health data of 1 million patients}},
author = {Daniel M. Bean, Željko Kraljević, Anthony Shek, James Teo and Richard Dobson},
booktitle = {PLOS Digital Health},
year = {2023},
doi = {10.1371/journal.pdig.0000218},
url = {https://doi.org/10.1371/journal.pdig.0000218}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/bean-2023-hospital-wide-natural-language-processing/