Spaces:
Sleeping
A newer version of the Gradio SDK is available: 6.26.0
title: Thyroid Initial Visit
emoji: π¦
colorFrom: pink
colorTo: indigo
sdk: gradio
sdk_version: 5.5.0
python_version: '3.11'
app_file: app.py
pinned: false
license: mit
Thyroid Initial-Visit Note Generator
4-section structured note for thyroid initial visit at endocrine / family-medicine outpatient, generated from form input. Phenotype-driven order selection (hyperthyroid / hypothyroid / goiter-nodule / abnormal-lab). Built-in ACR TI-RADS calculator on Tab 2.
Output structure
- π¨ Red flags (conditional β only shown when triggered: thyroid storm, myxedema coma, airway compromise, suspicious malignancy on exam, sight-threatening Graves orbitopathy)
- History + ROS narrative (phenotype-aware, includes meds/exposures and women-specific data)
- Physical examination findings
- Initial workup plan: A) checklist of suggested orders B) one-line narrative for HIS paste C) patient instructions D) brief differential and assessment thinking
Phenotype-driven Section 4 orders:
- Hyper β TSH, FT4, T3, TRAb, CBC, AST/ALT/bili (baseline before ATD), ECG
- Hypo β TSH, FT4, anti-TPO, Β± anti-Tg, lipid, CBC, Na/Cr
- Goiter/nodule β US, cervical LN US, Β± thyroid scan if TSH suppressed
- Abnormal lab β repeat in 4-6 weeks + conditional antibodies
Tab 2: ACR TI-RADS calculator
Pure local calculation (no API call). Inputs: composition / echogenicity / shape / margin / echogenic foci (multi-select, additive) + nodule size. Outputs TR1-5 category + size-based FNA / follow-up recommendation per ACR TI-RADS 2017.
Setup
Required Space secrets (Settings β Variables and secrets):
ANTHROPIC_API_KEYβ Claude API keyGDRIVE_CLIENT_IDβ Google OAuth client ID (desktop type)GDRIVE_CLIENT_SECRETβ Google OAuth client secretGDRIVE_REFRESH_TOKENβ obtained viapython get_refresh_token.pylocally
Optional:
THYROID_PASSWORDβ Gradio basic-auth password (username:doctor)GDRIVE_FOLDER_NAMEβ defaultThyroid Initial VisitsTHYROID_MODELβ defaultclaude-sonnet-4-6
Without the three GDRIVE_* secrets, GDrive sync is disabled; manual .md download still works.
Local run
pip install -r requirements.txt
export ANTHROPIC_API_KEY=sk-ant-...
python app.py
Not for clinical use without physician verification.