Spaces:
Paused
Paused
Andrew Lanouette Claude Sonnet 4.6 commited on
Commit ·
d828ce8
1
Parent(s): 823ba41
Rebrand to #6366F1/#63B1F2 palette; gradient on tabs only; white FDA form background
Browse files- All brand colors updated to #6366F1 (indigo) and #63B1F2 (sky blue)
- Logo shield: #6366F1 body, #63B1F2 ring, #a8d8f9 cross
- Panel borders: #6366F1 (replaces gold)
- Section chips, profile heading, triage labels: #6366F1
- App container background: white; gradient (130deg #63B1F2->white) on tabs only
- Tab 4 Doctor's View: explicit white background
- FDA form .fda3500b: background:#fff to stay white within gradient tab area
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
app.py
CHANGED
|
@@ -606,9 +606,9 @@ def format_profile(case: Dict) -> str:
|
|
| 606 |
]
|
| 607 |
rows_html = "".join(row(lbl, val) for lbl, val in fields)
|
| 608 |
return (
|
| 609 |
-
'<div style="background:#
|
| 610 |
'padding:16px 20px;font-family:sans-serif;">'
|
| 611 |
-
'<div style="font-weight:700;font-size:14px;color:#
|
| 612 |
'letter-spacing:0.3px;">SentinelRx Patient Profile</div>'
|
| 613 |
'<div style="display:grid;grid-template-columns:140px 1fr;column-gap:12px;">'
|
| 614 |
+ rows_html +
|
|
@@ -956,7 +956,7 @@ def build_fda_3500b_html(case: Dict, severity: Dict) -> str:
|
|
| 956 |
|
| 957 |
css = """<style>
|
| 958 |
.fda3500b{font-family:Arial,sans-serif;font-size:13px;max-width:860px;
|
| 959 |
-
border:2px solid #003087;border-radius:4px;overflow:hidden;line-height:1.5;}
|
| 960 |
.fda-mock-banner{background:#eef2f7;border-bottom:1px solid #b0bfcf;padding:4px 14px;
|
| 961 |
text-align:right;font-weight:normal;font-size:11px;color:#444;}
|
| 962 |
.fda-hdr{background:#2471a3;color:#fff;padding:10px 14px;display:flex;align-items:center;gap:14px;}
|
|
@@ -1155,12 +1155,12 @@ def triage_markdown(triage: Dict) -> str:
|
|
| 1155 |
|
| 1156 |
return f"""
|
| 1157 |
<div style="font-family:sans-serif;padding:4px 2px;line-height:1.7;">
|
| 1158 |
-
<div style="font-size:16px;font-weight:800;color:#
|
| 1159 |
SentinelRx Triage Agent
|
| 1160 |
</div>
|
| 1161 |
|
| 1162 |
<div style="margin-bottom:14px;">
|
| 1163 |
-
<span style="font-size:12px;font-weight:700;color:#
|
| 1164 |
letter-spacing:0.5px;">Priority</span><br>
|
| 1165 |
<span style="display:inline-block;margin-top:4px;background:{badge_color};color:#fff;
|
| 1166 |
font-weight:700;font-size:13px;padding:4px 16px;border-radius:20px;">
|
|
@@ -1169,19 +1169,19 @@ def triage_markdown(triage: Dict) -> str:
|
|
| 1169 |
</div>
|
| 1170 |
|
| 1171 |
<div style="margin-bottom:14px;">
|
| 1172 |
-
<div style="font-size:12px;font-weight:700;color:#
|
| 1173 |
letter-spacing:0.5px;margin-bottom:4px;">Recommended Next Step</div>
|
| 1174 |
<div style="font-size:13px;color:#222;">{triage['next_step']}</div>
|
| 1175 |
</div>
|
| 1176 |
|
| 1177 |
<div style="margin-bottom:14px;">
|
| 1178 |
-
<div style="font-size:12px;font-weight:700;color:#
|
| 1179 |
letter-spacing:0.5px;margin-bottom:4px;">Agent Explanation</div>
|
| 1180 |
<div style="font-size:13px;color:#222;">{triage['explanation']}</div>
|
| 1181 |
</div>
|
| 1182 |
|
| 1183 |
<div>
|
| 1184 |
-
<div style="font-size:12px;font-weight:700;color:#
|
| 1185 |
letter-spacing:0.5px;margin-bottom:4px;">Missing Information Checklist</div>
|
| 1186 |
<ul style="margin:0;padding-left:18px;font-size:13px;color:#444;">
|
| 1187 |
{missing_items}
|
|
@@ -1232,8 +1232,11 @@ _first_case = list(DEMO_CASES.keys())[0]
|
|
| 1232 |
|
| 1233 |
CUSTOM_CSS = """
|
| 1234 |
.gradio-container {
|
| 1235 |
-
background:
|
| 1236 |
-
|
|
|
|
|
|
|
|
|
|
| 1237 |
}
|
| 1238 |
#testimony_box,
|
| 1239 |
#profile_panel,
|
|
@@ -1243,10 +1246,13 @@ CUSTOM_CSS = """
|
|
| 1243 |
#severity_panel,
|
| 1244 |
#extraction_table,
|
| 1245 |
#triage_panel {
|
| 1246 |
-
border: 2px solid #
|
| 1247 |
border-radius: 10px !important;
|
| 1248 |
overflow: hidden;
|
| 1249 |
}
|
|
|
|
|
|
|
|
|
|
| 1250 |
"""
|
| 1251 |
|
| 1252 |
with gr.Blocks(title="SentinelRx — ADR Intelligence", theme=gr.themes.Soft(),
|
|
@@ -1256,25 +1262,25 @@ with gr.Blocks(title="SentinelRx — ADR Intelligence", theme=gr.themes.Soft(),
|
|
| 1256 |
<div style="display:flex;align-items:center;gap:16px;padding:12px 0 8px;">
|
| 1257 |
<svg width="52" height="52" viewBox="0 0 52 52" xmlns="http://www.w3.org/2000/svg">
|
| 1258 |
<path d="M26 2 L46 10 L46 28 C46 39 36 47 26 50 C16 47 6 39 6 28 L6 10 Z"
|
| 1259 |
-
fill="#
|
| 1260 |
<text x="26" y="34" text-anchor="middle" font-family="Georgia,serif"
|
| 1261 |
font-size="20" font-weight="700" fill="#ffffff" letter-spacing="-1">Rx</text>
|
| 1262 |
-
<rect x="24" y="11" width="4" height="10" rx="1" fill="#
|
| 1263 |
-
<rect x="20" y="14" width="12" height="4" rx="1" fill="#
|
| 1264 |
</svg>
|
| 1265 |
<div>
|
| 1266 |
-
<div style="font-size:26px;font-weight:800;color:#
|
| 1267 |
font-family:sans-serif;letter-spacing:-0.3px;">
|
| 1268 |
SentinelRx - ADR Intelligence Prototype
|
| 1269 |
</div>
|
| 1270 |
-
<div style="font-size:13px;color:#
|
| 1271 |
AI-assisted adverse drug reaction detection and FDA MedWatch reporting.
|
| 1272 |
</div>
|
| 1273 |
</div>
|
| 1274 |
</div>
|
| 1275 |
""")
|
| 1276 |
|
| 1277 |
-
main_tabs = gr.Tabs()
|
| 1278 |
|
| 1279 |
with main_tabs:
|
| 1280 |
|
|
@@ -1290,7 +1296,7 @@ with gr.Blocks(title="SentinelRx — ADR Intelligence", theme=gr.themes.Soft(),
|
|
| 1290 |
label="Select Patient",
|
| 1291 |
)
|
| 1292 |
|
| 1293 |
-
gr.HTML('<div style="display:inline-block;background:#
|
| 1294 |
'font-size:11px;font-weight:700;padding:3px 12px;border-radius:20px;'
|
| 1295 |
'letter-spacing:0.5px;margin-bottom:4px;">PATIENT TESTIMONY</div>')
|
| 1296 |
testimony_box = gr.Textbox(
|
|
@@ -1301,7 +1307,7 @@ with gr.Blocks(title="SentinelRx — ADR Intelligence", theme=gr.themes.Soft(),
|
|
| 1301 |
elem_id="testimony_box",
|
| 1302 |
)
|
| 1303 |
|
| 1304 |
-
gr.HTML('<div style="display:inline-block;background:#
|
| 1305 |
'font-size:11px;font-weight:700;padding:3px 12px;border-radius:20px;'
|
| 1306 |
'letter-spacing:0.5px;margin:8px 0 4px;">PATIENT PROFILE & BIOMETRICS</div>')
|
| 1307 |
with gr.Row():
|
|
@@ -1310,7 +1316,7 @@ with gr.Blocks(title="SentinelRx — ADR Intelligence", theme=gr.themes.Soft(),
|
|
| 1310 |
biometric_html = gr.HTML(format_biometrics(DEMO_CASES[_first_case]),
|
| 1311 |
elem_id="biometric_panel")
|
| 1312 |
|
| 1313 |
-
gr.HTML('<div style="display:inline-block;background:#
|
| 1314 |
'font-size:11px;font-weight:700;padding:3px 12px;border-radius:20px;'
|
| 1315 |
'letter-spacing:0.5px;margin:8px 0 4px;">MEDICATIONS</div>')
|
| 1316 |
meds_md = gr.Markdown(format_medications(DEMO_CASES[_first_case]),
|
|
@@ -1339,7 +1345,7 @@ with gr.Blocks(title="SentinelRx — ADR Intelligence", theme=gr.themes.Soft(),
|
|
| 1339 |
send_btn = gr.Button("📋 Send to Doctor", variant="secondary", size="lg")
|
| 1340 |
|
| 1341 |
# ---------------------------------------------------------------- Tab 4
|
| 1342 |
-
with gr.Tab("4. Doctor's View", id=3):
|
| 1343 |
gr.Markdown(
|
| 1344 |
"Pre-filled FDA MedWatch Form 3500B. "
|
| 1345 |
"Click **Submit to MedWatch** to simulate report submission."
|
|
|
|
| 606 |
]
|
| 607 |
rows_html = "".join(row(lbl, val) for lbl, val in fields)
|
| 608 |
return (
|
| 609 |
+
'<div style="background:#f0f4fe;border:1px solid #c5c6fb;border-radius:10px;'
|
| 610 |
'padding:16px 20px;font-family:sans-serif;">'
|
| 611 |
+
'<div style="font-weight:700;font-size:14px;color:#6366F1;margin-bottom:12px;'
|
| 612 |
'letter-spacing:0.3px;">SentinelRx Patient Profile</div>'
|
| 613 |
'<div style="display:grid;grid-template-columns:140px 1fr;column-gap:12px;">'
|
| 614 |
+ rows_html +
|
|
|
|
| 956 |
|
| 957 |
css = """<style>
|
| 958 |
.fda3500b{font-family:Arial,sans-serif;font-size:13px;max-width:860px;
|
| 959 |
+
border:2px solid #003087;border-radius:4px;overflow:hidden;line-height:1.5;background:#fff;}
|
| 960 |
.fda-mock-banner{background:#eef2f7;border-bottom:1px solid #b0bfcf;padding:4px 14px;
|
| 961 |
text-align:right;font-weight:normal;font-size:11px;color:#444;}
|
| 962 |
.fda-hdr{background:#2471a3;color:#fff;padding:10px 14px;display:flex;align-items:center;gap:14px;}
|
|
|
|
| 1155 |
|
| 1156 |
return f"""
|
| 1157 |
<div style="font-family:sans-serif;padding:4px 2px;line-height:1.7;">
|
| 1158 |
+
<div style="font-size:16px;font-weight:800;color:#6366F1;margin-bottom:14px;">
|
| 1159 |
SentinelRx Triage Agent
|
| 1160 |
</div>
|
| 1161 |
|
| 1162 |
<div style="margin-bottom:14px;">
|
| 1163 |
+
<span style="font-size:12px;font-weight:700;color:#6366F1;text-transform:uppercase;
|
| 1164 |
letter-spacing:0.5px;">Priority</span><br>
|
| 1165 |
<span style="display:inline-block;margin-top:4px;background:{badge_color};color:#fff;
|
| 1166 |
font-weight:700;font-size:13px;padding:4px 16px;border-radius:20px;">
|
|
|
|
| 1169 |
</div>
|
| 1170 |
|
| 1171 |
<div style="margin-bottom:14px;">
|
| 1172 |
+
<div style="font-size:12px;font-weight:700;color:#6366F1;text-transform:uppercase;
|
| 1173 |
letter-spacing:0.5px;margin-bottom:4px;">Recommended Next Step</div>
|
| 1174 |
<div style="font-size:13px;color:#222;">{triage['next_step']}</div>
|
| 1175 |
</div>
|
| 1176 |
|
| 1177 |
<div style="margin-bottom:14px;">
|
| 1178 |
+
<div style="font-size:12px;font-weight:700;color:#6366F1;text-transform:uppercase;
|
| 1179 |
letter-spacing:0.5px;margin-bottom:4px;">Agent Explanation</div>
|
| 1180 |
<div style="font-size:13px;color:#222;">{triage['explanation']}</div>
|
| 1181 |
</div>
|
| 1182 |
|
| 1183 |
<div>
|
| 1184 |
+
<div style="font-size:12px;font-weight:700;color:#6366F1;text-transform:uppercase;
|
| 1185 |
letter-spacing:0.5px;margin-bottom:4px;">Missing Information Checklist</div>
|
| 1186 |
<ul style="margin:0;padding-left:18px;font-size:13px;color:#444;">
|
| 1187 |
{missing_items}
|
|
|
|
| 1232 |
|
| 1233 |
CUSTOM_CSS = """
|
| 1234 |
.gradio-container {
|
| 1235 |
+
background: #ffffff !important;
|
| 1236 |
+
}
|
| 1237 |
+
#main_tabs_container {
|
| 1238 |
+
background: linear-gradient(130deg, #63B1F2 0%, #ffffff 70%) !important;
|
| 1239 |
+
border-radius: 8px;
|
| 1240 |
}
|
| 1241 |
#testimony_box,
|
| 1242 |
#profile_panel,
|
|
|
|
| 1246 |
#severity_panel,
|
| 1247 |
#extraction_table,
|
| 1248 |
#triage_panel {
|
| 1249 |
+
border: 2px solid #6366F1 !important;
|
| 1250 |
border-radius: 10px !important;
|
| 1251 |
overflow: hidden;
|
| 1252 |
}
|
| 1253 |
+
#doctors_view_tab {
|
| 1254 |
+
background: #ffffff !important;
|
| 1255 |
+
}
|
| 1256 |
"""
|
| 1257 |
|
| 1258 |
with gr.Blocks(title="SentinelRx — ADR Intelligence", theme=gr.themes.Soft(),
|
|
|
|
| 1262 |
<div style="display:flex;align-items:center;gap:16px;padding:12px 0 8px;">
|
| 1263 |
<svg width="52" height="52" viewBox="0 0 52 52" xmlns="http://www.w3.org/2000/svg">
|
| 1264 |
<path d="M26 2 L46 10 L46 28 C46 39 36 47 26 50 C16 47 6 39 6 28 L6 10 Z"
|
| 1265 |
+
fill="#6366F1" stroke="#63B1F2" stroke-width="2.5"/>
|
| 1266 |
<text x="26" y="34" text-anchor="middle" font-family="Georgia,serif"
|
| 1267 |
font-size="20" font-weight="700" fill="#ffffff" letter-spacing="-1">Rx</text>
|
| 1268 |
+
<rect x="24" y="11" width="4" height="10" rx="1" fill="#a8d8f9" opacity="0.9"/>
|
| 1269 |
+
<rect x="20" y="14" width="12" height="4" rx="1" fill="#a8d8f9" opacity="0.9"/>
|
| 1270 |
</svg>
|
| 1271 |
<div>
|
| 1272 |
+
<div style="font-size:26px;font-weight:800;color:#6366F1;line-height:1.1;
|
| 1273 |
font-family:sans-serif;letter-spacing:-0.3px;">
|
| 1274 |
SentinelRx - ADR Intelligence Prototype
|
| 1275 |
</div>
|
| 1276 |
+
<div style="font-size:13px;color:#63B1F2;margin-top:3px;font-style:italic;font-family:sans-serif;">
|
| 1277 |
AI-assisted adverse drug reaction detection and FDA MedWatch reporting.
|
| 1278 |
</div>
|
| 1279 |
</div>
|
| 1280 |
</div>
|
| 1281 |
""")
|
| 1282 |
|
| 1283 |
+
main_tabs = gr.Tabs(elem_id="main_tabs_container")
|
| 1284 |
|
| 1285 |
with main_tabs:
|
| 1286 |
|
|
|
|
| 1296 |
label="Select Patient",
|
| 1297 |
)
|
| 1298 |
|
| 1299 |
+
gr.HTML('<div style="display:inline-block;background:#6366F1;color:#fff;'
|
| 1300 |
'font-size:11px;font-weight:700;padding:3px 12px;border-radius:20px;'
|
| 1301 |
'letter-spacing:0.5px;margin-bottom:4px;">PATIENT TESTIMONY</div>')
|
| 1302 |
testimony_box = gr.Textbox(
|
|
|
|
| 1307 |
elem_id="testimony_box",
|
| 1308 |
)
|
| 1309 |
|
| 1310 |
+
gr.HTML('<div style="display:inline-block;background:#6366F1;color:#fff;'
|
| 1311 |
'font-size:11px;font-weight:700;padding:3px 12px;border-radius:20px;'
|
| 1312 |
'letter-spacing:0.5px;margin:8px 0 4px;">PATIENT PROFILE & BIOMETRICS</div>')
|
| 1313 |
with gr.Row():
|
|
|
|
| 1316 |
biometric_html = gr.HTML(format_biometrics(DEMO_CASES[_first_case]),
|
| 1317 |
elem_id="biometric_panel")
|
| 1318 |
|
| 1319 |
+
gr.HTML('<div style="display:inline-block;background:#6366F1;color:#fff;'
|
| 1320 |
'font-size:11px;font-weight:700;padding:3px 12px;border-radius:20px;'
|
| 1321 |
'letter-spacing:0.5px;margin:8px 0 4px;">MEDICATIONS</div>')
|
| 1322 |
meds_md = gr.Markdown(format_medications(DEMO_CASES[_first_case]),
|
|
|
|
| 1345 |
send_btn = gr.Button("📋 Send to Doctor", variant="secondary", size="lg")
|
| 1346 |
|
| 1347 |
# ---------------------------------------------------------------- Tab 4
|
| 1348 |
+
with gr.Tab("4. Doctor's View", id=3, elem_id="doctors_view_tab"):
|
| 1349 |
gr.Markdown(
|
| 1350 |
"Pre-filled FDA MedWatch Form 3500B. "
|
| 1351 |
"Click **Submit to MedWatch** to simulate report submission."
|