🧬 ClinAssist

v2.0 💰 Pricing API Docs
🌟 Get SAS Code
More ▾

ClinAssist

turns a TLF shell into submission-ready SAS code
🔒 Sanitized in your browser 🛡 No compound codes sent to the LLM 🏭 CDISC SDTM / ADaM aware 📄 GAMP 5 Category 3 audit header
1 Paste shell
2 Study context
3 Generated code
Paste the shell (table/listing/figure mock-up) from your SAP or TFLs spec below. Include the table number, title, treatment arms, and any column / row structure the output should follow.
📎 Upload PDF / RTF / DOCX  or  📷 Paste screenshot (Ctrl+V)
Try an example:

Ask a question to retrieve SAS code from your clinical library...

Loading gap analysis...
Loading macros...

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 query "AE summary table"
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.

SHELL TEXT
TREATMENT ARMS (Variable Mapper)
DEFAULT POPULATION
SCENARIOS (up to 6)
🧪 Configure scenarios on the left and click Run All Scenarios
VISUAL SHELL BUILDER
Table Number
TLF Type
Table Title
TREATMENT COLUMNS
ROW PARAMETERS
FOOTNOTES
SHELL PREVIEW
Live preview updates as you build
STUDY CONFIGURATION
Study ID
Study Label
DEFAULT POPULATION
TREATMENT ARMS (TRTA Mapping)
PATHS (optional)
IMPORT STUDY VARIABLES
Paste CSV output from proc contents data=ADSL out=meta noprint; then proc export data=meta outfile="..." dbms=csv replace;
COMPOUND BLOCKLIST
One drug / compound / molecule name per line. Each will be stripped from any shell text before it is sent to the LLM. Word-boundary, case-insensitive.
SAVED STUDIES
SAP UPLOAD
Upload SAP PDF or paste SAP text to extract full TLF list
GENERATION HISTORY
USAGE DASHBOARD
Total Generations
Today
Unique IPs Today
Pro Generations
TODAY BY ENDPOINT
RAG KNOWLEDGE BASE
EMBEDDING COVERAGE
BENCHMARK (20 queries)
Precision@1: 90%
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)
💰 Pricing Page
FILTER BY TYPE
TEMPLATE LIBRARY
✅ REVIEW WORKSPACE
Run scenarios first, then come here to review and approve outputs.
Select a domain to browse variables
DomainVariableLabel TypeCoreCodelistDescription
Select a domain above to view variables

Describe a task above to generate clinical code...