WHITE PAPER

From EHR Chaos to Clinical Clarity: A Layered AI Approach to Evidence Generation

 

How an ensemble AI pipeline transforms health data into real-time intelligence for clinical research and real-world evidence generation.

Overview

BEKhealth’s AI-powered chart abstraction and patient matching platform uses an ensemble methodology that brings together multiple cutting-edge technologies in a way that supercharges each one’s strengths and mitigates their weaknesses through a 4 stage filtering process:

Step 0: EHR Data Selection – Collect high-quality structured and unstructured patient data from Electronic Health Records (EHRs) using 32+ proprietary EHR adapters, which includes 85% coverage of the EHR market. Filter out poor data to ensure the raw input to the pipeline is clinically sound.

Step 1: Initial filtering based on structured data – Normalize and map structured data using BEKhealth’s proprietary Ontology with over 24 million medical terms; convert into the BEKhealth Common Data Model and use this normalized dataset to filter to the patient population based on eligibility criteria.

Step 2: Secondary filtering using advanced AI – Apply an ensemble of custom-trained, domain-specific Natural Language Processing (NLP) models to unstructured records like physician notes, documents, scans, and images to extract additional clinical insights; normalize and map the extracted concepts through the BEKhealth Ontology and into the BEKhealth Common Data Model.

Step 3: Final filtering using LLM-powered polishing – Utilize a Large Language Model (LLM)-powered layer to perform the final eligibility analysis on the remaining patients. This stage evaluates nuanced and complex inclusion/exclusion logic, simulating expert-level reasoning and context to finalize a high-confidence list of patient matches.

Each filtration stage shrinks the pool of patients fed into the next stage, allowing BEKhealth to employ increasingly computationally-intensive tools in a cost-effective manner. With each step, the pool of matched patients is reduced; this powerful approach allows BEKhealth to reprocess and update patient lists daily and provides context aware filtering through LLMs and allows for fine grained control of site specific notes to be captured with NLP.  The BEKhealth filtering approach is the perfect marriage of AI technologies.

The BEKhealth Ontology

BEKhealth’s proprietary ontology includes over 24 million medical terms and is designed to standardize data from both structured and unstructured sources. It captures a wide range of relationships such as synonyms, hierarchical links, treatments, and indications to enable consistent mapping and normalization. 

The ontology integrates terminology from widely used clinical coding systems including ICD-10, SNOMED, LOINC, HCPCS, ATC, and RxNorm, and is further enriched with custom codes developed to address gaps or ambiguities in existing vocabularies. For example, custom codes may be added to represent niche or underrepresented clinical concepts not well described by standard coding systems, or to establish missing links between related ontology elements. The BEKhealth Ontology is continuously updated to reflect changes in official standards and to incorporate new codes generated by the BEKhealth clinical team based on emerging clinical needs.

BEKhealth’s Funneled Approach to Chart Abstraction and Patient Matching

Funnel Step 0: EHR Data Selection

BEKhealth has 32 proprietary EHR adapters, each designed to parse data from a specific EHR system and extract only the information relevant for downstream patient cohort matching. Because this raw data serves as the foundation for AI-driven tasks, maintaining its quality is critical. BEKhealth excludes poorly formatted, ambiguous, or extraneous fields during extraction.

Funnel Step 1: Initial Filtering Based on Structured Data

Structured data is the most straightforward to filter. It includes information extracted directly from discrete EHR fields such as demographics, diagnoses, medications, procedures, and lab results. BEKhealth standardizes this data by mapping it to the BEKhealth Ontology and transforming it into the BEKhealth Common Data Model. Eligibility criteria are then converted into queries, enabling the first round of patient filtering based on structured attributes.

Funnel Step 2: Secondary Filtering using Advanced AI

Unstructured data is much more challenging. This includes all of the free text notes, supplemental documents, images, and scans that contain the more nuanced information that isn’t available in the structured sections of the EHR. This is where BEKhealth’s AI shines. BEKhealth leverages Optical Character Recognition (OCR) models and a custom Advanced Visual Processing (AVP) pipeline to extract or create text representations of images, diagrams, tables, checkboxes, and other document elements.  Once all documents have been converted to text, BEKhealth deploys an ensemble of six specialized core Natural Language Processing (NLP) models to extract clinical insights from these unstructured data sources:
  • Entity extraction model
  • Relation extraction model
  • Four distinct medical coding models
Each of these models are transformer-based language models with around one billion parameters. These models are custom trained in-house on proprietary datasets and are fine-tuned for domain-specific tasks, allowing them to extract information with high accuracy (97% entity-level accuracy) and contextual sensitivity. Each model acts as a filter in our funnel, surfacing patients who may qualify and excluding ones who don’t based on information captured from unstructured data

General NLP Model Details

Model Architecture

At its core, each model in BEKhealth’s NLP pipeline is a BERT-based transformer with one billion parameters. Transformer models are the state-of-the-art in language processing because they capture long-range dependencies in text. This capability allows the models to understand how clinical concepts relate across sentences and documents, not just words in isolation.

Pretraining on Clinical Texts

Before being fine-tuned for BEKhealth, each model was pretrained on hundreds of millions of biomedical healthcare documents. Pretraining provides the model with a broad understanding of medical terminology, clinical shorthand, and the unique characteristics of healthcare text. It establishes the foundation necessary for accurately parsing complex clinical narratives.

Fine-Tuning on BEKhealth’s Proprietary Dataset

To adapt the models specifically for patient-trial matching and real-world evidence generation, BEKhealth fine-tunes models on an extensive proprietary dataset of annotated medical records. This dataset was created through years of detailed annotation by BEKhealth’s clinical team, who labeled entities, attributes, and relationships across hundreds of thousands of clinical documents. This domain-specific fine-tuning ensures that the models are optimized for the nuances of real-world medical data.

Entity Extraction Model Details

The first model in BEKhealth’s NLP pipeline is the Entity Extraction Model, responsible for identifying and categorizing clinical terms from unstructured text. The model highlights individual entities and classifies them into predefined categories. Attributes that provide additional context such as severity, frequency or negation are also captured and linked to parent entities.

Relation Extraction Model Details

The second model in BEKhealth’s NLP pipeline is the Relation Extraction Model, which is responsible for identifying how entities connect to one another within unstructured text.

In this diagram, each arrow represents an individual relation. These relations provide rich contextual information about entities, such as associated dates, negations, anatomical locations, and many more. While the first Entity Extraction model provides the individual building blocks (entities), this second model extracts the contextual links that determine their meaning in a clinical setting. For example, relations can specify when an entity occurred, whether it was negated, what anatomical location it refers to, or how it is associated with other clinical concepts.

Medical Coding Model Details

The last four models in BEKhealth’s NLP pipeline are the Medical Coding Models which assign standardized medical codes to entities extracted from unstructured data. Coding is a crucial step because it aligns free-text information with universally recognized and standardized vocabularies. Each model is dedicated to a single clinical domain:
  • Medical Conditions: mapped to the ICD-10 and SNOMED vocabularies
  • Medications: mapped to the ATC and RxNorm vocabularies
  • Labs & Observations: mapped to the LOINC vocabulary
  • Procedures: mapped to the HCPCS vocabulary
Training each individual model exclusively on a single clinical domain allows for deep contextual understanding and optimal specificity that leads to more accurate and reliable results within the area of focus. 

When assigning codes to an entity, the models take into account any relations as well as textual context around the entity, ensuring robust semantic understanding.

Strategic Deployment for Maximum Impact

While NLP offers powerful capabilities for unlocking insight from unstructured clinical data, its real value is realized only when deployed thoughtfully within a broader pipeline. BEKhealth’s platform leverages NLP not as a standalone decision-maker, but as a high-recall secondary filter that contributes meaningfully and safely to the patient matching and evidence generation process. BEKhealth positions NLP as the second filter in the funnel, where its role is to expand and refine the candidate patient pool by surfacing additional clinical signals found in unstructured notes. This approach plays directly to NLP’s strengths: broad linguistic coverage, contextual interpretation, and the ability to identify subtle, implicit eligibility cues. At the same time, we mitigate its inherent uncertainties through strict confidence controls and layered decision logic. Key safeguards in BEKhealth’s NLP approach include:
  • Confidence scoring: Every NLP prediction is evaluated by a dedicated confidence calibration model. Only high-confidence outputs are used to influence patient eligibility for clinical research and evidence generation.
  • Selective exclusion: NLP-derived insights can lead to the exclusion of patients, but only when the system is highly confident that a patient fails to meet core criteria. This ensures that low-confidence predictions never result in either lost recruitment opportunities or inclusion in real-world datasets.
  • Enrichment of structured data: NLP enhances patient profiles by supplementing structured EHR fields with additional clinical context. This supports more complete downstream evaluation and prevents under-selection caused by data sparsity.
By applying NLP in a recall-favoring, confidence-controlled capacity, we gain the benefits of deep unstructured data processing while preserving the reliability and precision needed for clinical-grade decision-making and insights. This strategic integration ensures we identify more eligible patients without compromising match quality.

Funnel Step 3: LLM-Powered Filter

The last stage of the pipeline applies a Large Language Model (LLM)-powered filter to perform final verification of all matched patients from Step 2. This layer is designed to emulate the nuanced judgment of a human clinical expert, capable of interpreting complex eligibility criteria and reasoning across subtle contextual details that simpler models may miss. Because LLMs are computationally intensive and costly to operate at scale, BEKhealth deploys them selectively, only after earlier structured and NLP-based filters have reduced the candidate pool to a manageable level. This ensures that LLMs are reserved for deep evaluation of high-potential matches for clinical research and evidence generation, maximizing their value while maintaining system efficiency and speed.

Prompt Engineering and Criteria Encoding

Eligibility criteria are first translated by BEKhealth’s clinical team into questions that can be reliably interpreted by the LLM. The bulk of the work, however, lies in designing the engineered prompts that guide the model’s behavior. This prompt layer specifies how the LLM should reason, the format of the output, and the requirement that each prediction be tied to supporting evidence in the source document. Techniques such as structured templates, few-shot examples, and explicit reasoning instructions are used to reduce ambiguity, nearly eliminating hallucination and ensuring consistent, high-quality results.

Guardrails Against Hallucination and Logical Errors

To prevent hallucination, BEKhealth uses a combination of best-practice prompting techniques, structured outputs, and supervisory verification layers. All input and output between the LLMs are schema-constrained, ensuring predictions remain in a structured, machine-validated format. Business logic wraps around the process to catch logical inconsistencies, such as mutually exclusive criteria both being marked satisfied. Furthermore, every model prediction must cite the exact location in the source document that supports it, ensuring that outputs remain grounded in verifiable evidence.

Adjudication Through an Agentic LLM Approach

To reconcile predictions across multiple document segments or chunks. BEKhealth employs an adjudication stage. Here, a supervisor LLM reviews the outputs, rationales, and evidence from all chunks and synthesizes them into a single eligibility determination. This agentic approach allows the system to handle large patient records without sacrificing accuracy, ensuring that the final decision reflects the entirety of a patient’s documentation rather than fragmented pieces.

Efficiency Through Intelligent Orchestration

Given the high cost of LLM inference, BEKhealth employs intelligent batching and caching techniques to minimize redundant processing. Only patients who pass the structured and NLP stages reach the LLM layer, and repeated queries are avoided where possible.

Auditability and Transparency

Every LLM prediction is fully auditable. Trial coordinators, epidemiologists, and medical reviewers can trace each eligibility decision back to the exact document sections and rationales that supported it, providing a clear audit trail. This transparency transforms the LLM from a “black box” into an accountable system.

Summary

Key strengths of the LLM-powered filter include:
  • Nuanced interpretation: LLMs can evaluate complex criteria involving temporal logic, negation, compound conditions, and implicit reasoning.
  • Contextual reasoning: Structured and unstructured data can be synthesized into a unified assessment, resolving ambiguities and cross-referencing the patient records.
  • Extrapolative inference: In cases where documentation is sparse or phrased indirectly, LLMs can make clinically reasonable inferences while respecting strict eligibility criteria.
By design, this stage functions as a precision-focused gatekeeper. Its role is not to expand the patient pool but to confirm, with high confidence, that each individual meets the research inclusion and exclusion criteria. This adjudication-driven approach ensures that only rigorously vetted candidates reach Trial coordinators, researchers, epidemiologists, and medical reviewers, reinforcing the highest standard of clinical and operational trust.

The Human Layer

Even with a highly automated AI pipeline, BEKhealth maintains a human-in-the-loop framework to ensure reliability, adaptability, and trust. BEKhealth’s clinical and data science teams continually monitor model predictions and review identified patients. This oversight provides an essential safeguard against errors while reinforcing clinical-grade accuracy. Beyond validation, the human-in-the-loop process powers a cycle of continuous improvement. When weaknesses or inconsistencies are identified, BEKhealth staff annotate and tag errors. Over time, this structured feedback loop systematically strengthens the models and adapts them to the unique complexities of each client’s EHR environment.

Final Discussion

The BEKhealth platform is designed to balance four critical priorities: accuracy, performance, scalability, and cost. This is achieved through a multi-layered architecture that orchestrates a range of technologies in a way that plays to each one’s strengths while mitigating limitations.
  • Accuracy is driven by a structured progression of increasingly intelligent filtering steps;
  • Performance is optimized by distributing the computational load across the pipeline;
  • Scalability is achieved through high-throughput, parallelized processing across each stage of the pipeline; and
  • Cost is carefully managed by applying the most computationally expensive models only when their precision is truly needed.
By aligning each component of the pipeline to its optimal role, the BEKhealth platform delivers precise, efficient, and scalable patient matching and real-world datasets, while maintaining operational and economic efficiency at every layer.

Ready to accelerate recruitment with AI?

Whether you're an existing BEKplatform customer or are new to BEKhealth, let’s talk about how we work with our AI enrollment partners to streamline your workflow—from finding the right patients to enrolling them faster.