Model HQ

From Patient Chart to Trial Match: Automate Clinical Trial Screening with One Upload

Transform patient document screening with AI-powered eligibility assessment

Imagine sorting through hundreds of patient charts to identify those who might qualify for a specific clinical trial. Now imagine doing it in seconds—with zero manual review and with no sensitive data leaving your machine or private data center. That's the power of this Model HQ Clinical Trial Recruiting Agent.

Designed to reduce screening friction, improve accuracy, and ensure no eligible patient slips through the cracks.

And it's not just for clinical trials…

This pattern can be adapted across regulated industries where document-based decision-making is critical, such as:

Medical eligibility screening

(e.g., surgery clearance, insurance validation)

Regulatory intake

for safety or compliance

Legal discovery

(e.g., identifying parties, dates, and claims from large files)

Insurance

Fraud detection or claim qualification

One document → One workflow → One eligibility decision.

This agent doesn't just help recruiters — it ensures no candidate is overlooked due to inconsistencies or hidden data in unstructured files. It's fast, consistent, and auditable.

Upload. Analyze. Screen.

With this Clinical Trial Recruiting Agent, all you need is a patient document (e.g., intake form, EMR export, or referral note). Here's how it works:

  1. 1
    Upload Patient Document: Upload any text-based patient file (PDF, DOCX, TXT). The agent automatically parses and prepares the content for AI-powered review.
  2. 2
    Run Eligibility Questions (RAG + Boolean): The agent applies a series of retrieval-augmented queries to extract trial-relevant data points, including diabetes history, patient age, pregnancy status, dialysis treatment, allergies, and cognitive conditions.
  3. 3
    Eligibility Decision: A Boolean logic step evaluates the presence and explanation of diabetes references. Output can be fed into a CRM, database, or downstream agent to trigger next steps.

Step-by-Step Guide to Building the Clinical Trial Recruiting Tool

Select or enter the following Service, Instruction and Context to re-create this tool yourself.

Provided Files:

We are using an example of a clinical trial available as public information in https://clinicaltrials.gov/study/NCT04959552?cond=diabetes&page=2&rank=14. We have no association with anyone who is running this trial and are using this as only example purposes so you can see some sample inclusion and exclusion criteria.

We also downloaded some sample publicly available medical files which can be accessed here. Although these files were from public sources, please note that these files may contain explicit and sensitive medical content and user discretion is advised. We are providing these files for testing purposes only.

Preparing to build:

Select Agents > Build New > Start Building then complete the Process Name.

We named it Clinical Trial Recruiting Tool (but since this may already be a template in your version of Model HQ, please feel free to give it a different name).

Press >

Defining Inputs to Agent Process:

You will then be asked to Define Inputs to Agent Process. This is the step where we will specify how the agent will receive its input to start taking action. The pre-set input is Main-Input (which is the standard chat style text input), but in this use case, we will be asking the Agent to review a patient file.

DE-SELECT the Main Input

  1. To add Files as the input type, click '+' and select 'Document File Input – any file type' as Input Type and in Description, type in: 'Upload Patient Medical File or Description'
  2. To indicate that this step is complete, it is important to click > then 'Save + Exit'.
  3. You will now enter the Agent building screen and you can start your build per instructions below.

Agent Building Steps

Here is a detailed, step-by-step guide to build the Clinical Trial Recruiting Tool in Model HQ's Agent Builder (Note: this pre-built tool is also available as part of Model HQ set of templates). Each step includes the: Service (what the node does), Instruction (the question or task), Context (the document or variable used)

1
Row 1: Parse the Patient Document

Service:
parse_document
Instruction:
Patient Files
Context:
User-Document

Purpose: Prepares and parses the uploaded patient document for semantic querying in later steps. (This indicates that the user will upload the document to run this agent process.)

At the end of each row when building the Agent Process, press '+' to add the next row, until you reach the final step to End.

2
Row 2: RAG Answer – Diabetes Mention

Service:
rag_answer
Instruction:
whether the patient has diabetes now or in the past
Context:
Patient_Files

Purpose: Checks the document for any mention of diabetes (past or present).

3
Row 3: Boolean Check – Diabetes Confirmation

Service:
boolean
Instruction:
in {{rag_answer_2}} does the text state the patient has diabetes
Context:
doc_extract_1

Purpose: Verifies if the document actually confirms diabetes using the output from the previous RAG answer.

4
Row 4: RAG Answer – Patient Age

Service:
rag_answer
Instruction:
how old is the patient
Context:
Patient_Files

Purpose: Extracts the patient's age for trial eligibility filtering.

5
Row 5: RAG Answer – Pregnancy Status

Service:
rag_answer
Instruction:
is the patient pregnant or attempting to be pregnant
Context:
Patient_Files

Purpose: Determines reproductive status (a key trial exclusion criterion).

6
Row 6: RAG Answer – Dialysis Status

Service:
rag_answer
Instruction:
is the patient on dialysis
Context:
Patient_Files

Purpose: Identifies patients with advanced renal impairment.

7
Row 7: RAG Answer – Allergy to Medical-Grade Adhesive

Service:
rag_answer
Instruction:
does the text mention if the patient is allergic to medical grade adhesive
Context:
Patient_Files

Purpose: Screens for skin-related contraindications for the study.

8
Row 8: RAG Answer – Allergy to Isopropyl Alcohol

Service:
rag_answer
Instruction:
does the text mention if the patient is allergic to isopropyl alcohol
Context:
Patient_Files

Purpose: Further screens for known chemical sensitivities for the study.

9
Row 9: RAG Answer – Mental/Cognitive Limitations

Service:
rag_answer
Instruction:
does the text mention if the patient suffers from any mental conditions that would deter him or her from following instructions or protocols
Context:
Patient_Files

Purpose: Checks cognitive readiness and consent capacity.

10
Row 10: End Node

Service:
END
Instruction:
End of process.
Context:
None

Purpose: Marks completion of the workflow.

Final Notes:

  • Be sure to upload a document (e.g., PDF, DOCX) to User-Document before running this agent – try one of the sample files provided.
  • This workflow is extensible — you can add inclusion/exclusion filters or eligibility tags in later nodes and also run this in batches for production.

Expand This Pattern

You can easily adapt this flow to:

Pre-screen based on inclusion/exclusion criteria
Analyze investigator site files
Validate adherence risks
Recommend alternative trials or study arms

Need Help?

If you encounter any issues while setting up clinical trial screening, feel free to contact our support team at support@aibloks.com