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 of CDISC-aligned TLF shells, validated macros, and reference programs. 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 a curated library of validated macros and reference programs.
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 the indexed library of TLF shells, reference programs, and 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
- Reference programs: validated programs across multiple table types
- Macros in RAG: 45 validated, parameterized macros
- Dummy CDISC data: 4,311 rows across 6 domains (AE, LB, VS, DM, CM, EX)
- Integration tests: 42/42 passed (100%)
- Source data: synthetic and de-identified reference data only
🛠️ 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 the indexed shell library, and generate complete SAS code using validated reference 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...