Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -341,7 +341,8 @@ def compute_ffrct(
|
|
| 341 |
}
|
| 342 |
|
| 343 |
# ---------- MSK (ER/Trauma) ----------
|
| 344 |
-
|
|
|
|
| 345 |
scans_per_day: float,
|
| 346 |
reading_time_min: float,
|
| 347 |
er_time_to_treatment_min: float,
|
|
@@ -379,11 +380,9 @@ def compute_msk(
|
|
| 379 |
</ul>
|
| 380 |
"""
|
| 381 |
|
| 382 |
-
|
| 383 |
-
|
| 384 |
-
{
|
| 385 |
"summary": f"For your ED with ~{int(scans_per_month):,} MSK scans/month, modeled net benefit is {usd(net_impact_month)} per month.",
|
| 386 |
-
# Financial card (only what matters; no NaNs)
|
| 387 |
"financial": {
|
| 388 |
"rows": [
|
| 389 |
("Incremental revenue (mo)", usd(incr_revenue_month)),
|
|
@@ -391,7 +390,6 @@ def compute_msk(
|
|
| 391 |
("Net impact (mo)", f"<b>{usd(net_impact_month)}</b>"),
|
| 392 |
]
|
| 393 |
},
|
| 394 |
-
# Clinical card
|
| 395 |
"clinical": {
|
| 396 |
"rows": [
|
| 397 |
("Errors reduced (est.)", f"{errors_reduced_per_month} /mo"),
|
|
@@ -400,7 +398,6 @@ def compute_msk(
|
|
| 400 |
],
|
| 401 |
"bars": [("Touch-time reduction", 0.30)],
|
| 402 |
},
|
| 403 |
-
# Operational card
|
| 404 |
"operational": {
|
| 405 |
"rows": [
|
| 406 |
("Radiologist hours saved / month", f"{total_time_saved_hours:.1f}"),
|
|
@@ -408,7 +405,6 @@ def compute_msk(
|
|
| 408 |
("Radiologist cost proxy savings (mo)", usd(radiologist_cost_savings)),
|
| 409 |
]
|
| 410 |
},
|
| 411 |
-
# Waterfall
|
| 412 |
"waterfall": [
|
| 413 |
("Incremental revenue", incr_revenue_month),
|
| 414 |
("Incremental costs", -incr_costs_month),
|
|
@@ -416,7 +412,6 @@ def compute_msk(
|
|
| 416 |
# If you later monetize clinical value, add:
|
| 417 |
# ("Clinical value", clinical_value_month),
|
| 418 |
],
|
| 419 |
-
# Annual metrics for Overall Impact (no NaNs)
|
| 420 |
"annual_card": {
|
| 421 |
"incr_rev": incr_revenue_month * 12.0,
|
| 422 |
"incr_costs": incr_costs_month * 12.0,
|
|
@@ -427,8 +422,7 @@ def compute_msk(
|
|
| 427 |
"payback": None, # hidden in Overall Impact
|
| 428 |
},
|
| 429 |
"evidence": evidence,
|
| 430 |
-
}
|
| 431 |
-
|
| 432 |
# ---------- Card / HTML builders ----------
|
| 433 |
def build_overall_card(title: str, summary_line: str, annual: dict):
|
| 434 |
"""Conditional Overall card: shows Financial + Clinical + Operational; hides ROI/Payback if N/A."""
|
|
|
|
| 341 |
}
|
| 342 |
|
| 343 |
# ---------- MSK (ER/Trauma) ----------
|
| 344 |
+
|
| 345 |
+
def compute_msk(
|
| 346 |
scans_per_day: float,
|
| 347 |
reading_time_min: float,
|
| 348 |
er_time_to_treatment_min: float,
|
|
|
|
| 380 |
</ul>
|
| 381 |
"""
|
| 382 |
|
| 383 |
+
# Summary line + section payloads
|
| 384 |
+
return {
|
|
|
|
| 385 |
"summary": f"For your ED with ~{int(scans_per_month):,} MSK scans/month, modeled net benefit is {usd(net_impact_month)} per month.",
|
|
|
|
| 386 |
"financial": {
|
| 387 |
"rows": [
|
| 388 |
("Incremental revenue (mo)", usd(incr_revenue_month)),
|
|
|
|
| 390 |
("Net impact (mo)", f"<b>{usd(net_impact_month)}</b>"),
|
| 391 |
]
|
| 392 |
},
|
|
|
|
| 393 |
"clinical": {
|
| 394 |
"rows": [
|
| 395 |
("Errors reduced (est.)", f"{errors_reduced_per_month} /mo"),
|
|
|
|
| 398 |
],
|
| 399 |
"bars": [("Touch-time reduction", 0.30)],
|
| 400 |
},
|
|
|
|
| 401 |
"operational": {
|
| 402 |
"rows": [
|
| 403 |
("Radiologist hours saved / month", f"{total_time_saved_hours:.1f}"),
|
|
|
|
| 405 |
("Radiologist cost proxy savings (mo)", usd(radiologist_cost_savings)),
|
| 406 |
]
|
| 407 |
},
|
|
|
|
| 408 |
"waterfall": [
|
| 409 |
("Incremental revenue", incr_revenue_month),
|
| 410 |
("Incremental costs", -incr_costs_month),
|
|
|
|
| 412 |
# If you later monetize clinical value, add:
|
| 413 |
# ("Clinical value", clinical_value_month),
|
| 414 |
],
|
|
|
|
| 415 |
"annual_card": {
|
| 416 |
"incr_rev": incr_revenue_month * 12.0,
|
| 417 |
"incr_costs": incr_costs_month * 12.0,
|
|
|
|
| 422 |
"payback": None, # hidden in Overall Impact
|
| 423 |
},
|
| 424 |
"evidence": evidence,
|
| 425 |
+
}
|
|
|
|
| 426 |
# ---------- Card / HTML builders ----------
|
| 427 |
def build_overall_card(title: str, summary_line: str, annual: dict):
|
| 428 |
"""Conditional Overall card: shows Financial + Clinical + Operational; hides ROI/Payback if N/A."""
|