Skip to main content
Advertisement
Browse Subject Areas
?

Click through the PLOS taxonomy to find articles in your field.

For more information about PLOS Subject Areas, click here.

< Back to Article

Table 1.

Comparison of representative systems for eligibility criteria interpretation and patient–trial matching.

More »

Table 1 Expand

Fig 1.

The overall framework of EC2Seq2Sql.

The workflow starts from clinical trial eligibility criteria collected from ClinicalTrials.gov (input), then parses the free-text criteria into lightweight structured patterns using a BART-based semantic parser, and finally converts the structured patterns into executable SQL through an LLM-based agent to retrieve eligible patients from the EHR database (output). The three main stages are (1) eligibility criteria acquisition, (2) eligibility criteria parsing, and (3) patient matching, which are connected by directional arrows to indicate the processing order. Each stage produces intermediate outputs (retrieved trials, structured patterns, SQL queries) that serve as inputs to the subsequent stage.

More »

Fig 1 Expand

Table 2.

Definitions of the seven clinical domains used in this study.

More »

Table 2 Expand

Fig 2.

SQL generation process.

This figure details the workflow that transforms the structured eligibility patterns into an executable SQL query. The input is the lightweight, seven-domain structured representation produced in the previous stage. First, the front-end sends the structured input to the FastAPI service, which forwards it to the LangChain-based workflow. LangChain constructs a prompt that combines a system prompt (task description and database context) and a human prompt (explicit inclusion/exclusion conditions). Guided by this hierarchical prompt, the GPT-4 model generates a syntactically correct and schema-aligned SQL statement. The final output is an SQL query that can be executed on the hospital EHR database to return the list of patients matching the criteria.

More »

Fig 2 Expand

Fig 3.

Distribution of the seven conceptual domains.

This figure shows how EC elements are mapped to the seven domains (condition, procedure, observation, laboratory, drug, age, gender). It motivates using this schema in the EC2Seq2Sql pipeline.

More »

Fig 3 Expand

Fig 4.

Sentence-length distribution of EC texts.

This figure summarizes token lengths of EC sentences in the dataset, indicating the presence of both short rules and long, nested clauses that require transformer-based parsing.

More »

Fig 4 Expand

Table 3.

BART-large-CNN hyperparameters.

More »

Table 3 Expand

Table 4.

Performance comparison of different sequence models on the dataset.

More »

Table 4 Expand

Fig 5.

Interface for BART-based EC parsing.

Users input free-text eligibility criteria, and the system returns the corresponding lightweight structured pattern, which is then fed to the SQL generation stage.

More »

Fig 5 Expand

Fig 6.

Example of executing an auto-generated SQL for patient retrieval.

The SQL produced from the structured eligibility patterns is run on the de-identified hospital EHR to return patients who satisfy the trial criteria; the figure shows this end-to-end result display.

More »

Fig 6 Expand

Fig 7.

Radar visualization of multi-metric ablation results.

The full system encloses the largest area across all five metrics. Removing structured patterns mainly harms EM/EX despite similar text-level scores; removing agent prompting causes the most severe SQL degradation; dropping the seven-domain constraint preserves SQL accuracy but reduces clinical matching on the real-world cohort.

More »

Fig 7 Expand

Table 5.

Ablation study on the benchmark dataset and the real-world EHR cohort.

More »

Table 5 Expand

Table 6.

Common error types and representative examples in the EC2Seq2Sql framework.

More »

Table 6 Expand