Model HQ
DocumentationFrom 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:
(e.g., surgery clearance, insurance validation)
for safety or compliance
(e.g., identifying parties, dates, and claims from large files)
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:
- 1Upload Patient Document: Upload any text-based patient file (PDF, DOCX, TXT). The agent automatically parses and prepares the content for AI-powered review.
- 2Run 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.
- 3Eligibility 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
- 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'
- To indicate that this step is complete, it is important to click > then 'Save + Exit'.
- 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)
1Row 1: Parse the Patient Document
parse_document
Patient Files
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.
2Row 2: RAG Answer – Diabetes Mention
rag_answer
whether the patient has diabetes now or in the past
Patient_Files
Purpose: Checks the document for any mention of diabetes (past or present).
3Row 3: Boolean Check – Diabetes Confirmation
boolean
in {{rag_answer_2}} does the text state the patient has diabetes
doc_extract_1
Purpose: Verifies if the document actually confirms diabetes using the output from the previous RAG answer.
4Row 4: RAG Answer – Patient Age
rag_answer
how old is the patient
Patient_Files
Purpose: Extracts the patient's age for trial eligibility filtering.
5Row 5: RAG Answer – Pregnancy Status
rag_answer
is the patient pregnant or attempting to be pregnant
Patient_Files
Purpose: Determines reproductive status (a key trial exclusion criterion).
6Row 6: RAG Answer – Dialysis Status
rag_answer
is the patient on dialysis
Patient_Files
Purpose: Identifies patients with advanced renal impairment.
7Row 7: RAG Answer – Allergy to Medical-Grade Adhesive
rag_answer
does the text mention if the patient is allergic to medical grade adhesive
Patient_Files
Purpose: Screens for skin-related contraindications for the study.
8Row 8: RAG Answer – Allergy to Isopropyl Alcohol
rag_answer
does the text mention if the patient is allergic to isopropyl alcohol
Patient_Files
Purpose: Further screens for known chemical sensitivities for the study.
9Row 9: RAG Answer – Mental/Cognitive Limitations
rag_answer
does the text mention if the patient suffers from any mental conditions that would deter him or her from following instructions or protocols
Patient_Files
Purpose: Checks cognitive readiness and consent capacity.
10Row 10: End Node
END
End of process.
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:
Need Help?
If you encounter any issues while setting up clinical trial screening, feel free to contact our support team at support@aibloks.com