ClinAssist
turns a TLF shell into submission-ready SAS codeAsk a question to retrieve SAS code from your clinical library...
Select CDISC Domain to Validate
What is ClinAssist?
ClinAssist is an AI-powered clinical SAS programming assistant built on a RAG (Retrieval-Augmented Generation) knowledge base extracted from real FDA submission programs, TLF shells, and validated macros. It helps you find, understand, and reuse SAS code faster — without searching folders manually.
Smart Code Search
Ask in plain English and get relevant SAS macro code pulled directly from your library of 58 programs and 45 macros.
Gap Detection
Automatically identifies which table types in your TLF shells lack a corresponding macro — so you know exactly what to build next.
Macro Library
Browse all 45 validated macros with descriptions, input datasets, parameters, and usage context from real study programs.
CDISC Validator
Upload dummy data and check that your domain has all required CDISC SDTM/ADaM variables before submission.
🔍 Query Tab — How to Use
Type a clinical SAS question and press Search. The RAG engine searches 307 TLF shell entries, 58 programs, and 45 macros to return the most relevant code and context.
Example queries that work well:
- AE summary table SAS code — Returns %ae_summ macro with parameters
- lab shift table macro inputs — Returns %lb_shift with ADLB variables needed
- vital signs by visit change from baseline — Returns %vs_summ
- disposition table ADSL SAFFL — Returns %disp macro
- Show me the %headfoot macro code — View macro source
- drug related TEAEs by SOC and PT — Returns %ae_socpt
Tips:
- Click any Quick Macro tag in the sidebar to pre-fill a query
- Include domain names (ADAE, ADLB, ADVS) for more targeted results
- Ask for parameters or inputs to get usage details
🚧 Gap Analysis Tab
Shows which TLF table types from your shell library have no matching macro (gaps) vs which are fully covered. Use this to prioritize macro development for your study.
- Red cards = Gaps — table type exists in shells but no macro found
- Green cards = Covered — macro exists with confidence score and match quality
- Current status: 92.3% covered, 1 gap (unknown table type)
📦 Macro Library Tab
Browse all 45 macros in your RAG database. Click any macro card to view:
- Full macro description and purpose
- Required input datasets and variables (ADAE, ADLB, ADVS, etc.)
- Macro parameters with descriptions
- Which study programs use this macro
- Source code (for built macros)
Macro categories available:
- Safety: %ae_summ, %ae_socpt, %ae_severity, %ae_related, %ecg_summ
- Lab: %lb_chem, %lb_shift
- Vitals: %vs_summ
- Efficacy: %efficacy, %rating_scale
- Utilities: %headfoot, %rpt, %calltf, %get_header, %get_freq, %t_listing
- Conmed: %cm_summ
- Disposition: %disp
✅ Validate Tab
Checks that your dummy/test CDISC dataset has all required variables for the selected domain. Useful before running TLF programs to catch missing columns early.
Domains supported:
- SDTM: AE, LB, VS, DM, CM, EX
- ADaM: ADSL, ADAE
The validator checks against CDISC SDTMIG/ADaMIG required variable lists. It reports which variables are present, which are missing, and gives a pass/fail result.
📊 Knowledge Base Stats
- TLF Shells parsed: 4 shells → 307 table entries across 13 table types
- SAS Programs: 58 programs from 2 complete FDA studies (3831-A305, ALK8700-A302)
- Macros in RAG: 45 macros (33 from study + 12 newly built)
- Dummy CDISC data: 4,311 rows across 6 domains (AE, LB, VS, DM, CM, EX)
- Integration tests: 42/42 passed (100%)
- Source studies: Alkermes data (corporate info stripped for privacy)
🛠️ CLI Access (VPS)
ClinAssist also has a full command-line interface on the VPS:
python3 /root/clinicalai/clinassist.py gaps
python3 /root/clinicalai/clinassist.py status
python3 /root/clinicalai/clinassist.py validate AE
python3 /root/clinicalai/clinassist.py pipeline
⚙ Shell → Code Generator
Paste any TLF shell text below. ClinAssist will parse it, match against 705 real pharma shells, and generate complete SAS code using real validated programs and dataset schemas.
proc contents data=ADSL out=meta noprint;
then proc export data=meta outfile="..." dbms=csv replace;
Precision@3: 95%
Types tested: demographics, ae, ae_socpt, lab, lab_shift,
vitals, ecg, efficacy, conmed, listing, exposure
Method: text-embedding-3-small (1536-dim)
| Domain | Variable | Label | Type | Core | Codelist | Description |
|---|---|---|---|---|---|---|
| Select a domain above to view variables | ||||||
Describe a task above to generate clinical code...