Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -58,6 +58,7 @@ if 'data' not in pn.state.cache.keys():
|
|
| 58 |
df['ASC-H'] = df['ASC-H']*100
|
| 59 |
df = df.rename(columns={'index': 'people'})
|
| 60 |
df = df.rename(columns={'HPV/ASC-US': 'hrHPV/ASC-US rate (%)'})
|
|
|
|
| 61 |
#df.at[0, 'Number'] = 151
|
| 62 |
df.iat[0, 5] = 2.25
|
| 63 |
df = df[~((df['people'].str.contains('ytolog')) & (df['Number'] < 1000))]
|
|
@@ -456,12 +457,40 @@ def labres(column_changer):
|
|
| 456 |
elif (hrhpv_ascus < 20) or (hrhpv_ascus > 70):
|
| 457 |
lab_comment = f"Latest laboratory result value is {hrhpv_ascus:.2f}%, performance follow up and global laboratory practice revision is advised."
|
| 458 |
lab_comment_2 = ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 459 |
|
| 460 |
lab_comment_6 = lab_comment_6 if 'lab_comment_6' in locals() else []
|
| 461 |
return pn.pane.Markdown(f""" ## {column_changer}:
|
| 462 |
{descript} {lab_comment} {lab_comment_2}
|
| 463 |
{lab_comment_3} {lab_comment_4} {lab_comment_5} {lab_comment_6}
|
| 464 |
""", sizing_mode ='stretch_both', styles = {'font-size':fpx})
|
|
|
|
| 465 |
inter_labres = pn.bind(labres, column_changer)
|
| 466 |
|
| 467 |
|
|
|
|
| 58 |
df['ASC-H'] = df['ASC-H']*100
|
| 59 |
df = df.rename(columns={'index': 'people'})
|
| 60 |
df = df.rename(columns={'HPV/ASC-US': 'hrHPV/ASC-US rate (%)'})
|
| 61 |
+
df = df.rename(columns={'HPV/population': 'hrHPV Prevalence (%)'})
|
| 62 |
#df.at[0, 'Number'] = 151
|
| 63 |
df.iat[0, 5] = 2.25
|
| 64 |
df = df[~((df['people'].str.contains('ytolog')) & (df['Number'] < 1000))]
|
|
|
|
| 457 |
elif (hrhpv_ascus < 20) or (hrhpv_ascus > 70):
|
| 458 |
lab_comment = f"Latest laboratory result value is {hrhpv_ascus:.2f}%, performance follow up and global laboratory practice revision is advised."
|
| 459 |
lab_comment_2 = ""
|
| 460 |
+
|
| 461 |
+
#HPV Prevalence (%)
|
| 462 |
+
#hrHPV/ASC-US ratio (%)
|
| 463 |
+
elif column_changer == col_options[5]:
|
| 464 |
+
abs_results = df[df['people'] == 'KGYC']
|
| 465 |
+
hrhpv_ascus = abs_results['hrHPV Prevalence (%)'].iloc[len(abs_results)-1]
|
| 466 |
+
|
| 467 |
+
descript = "**Description:** *The hrHPV/ASC-US rate represents the high-risk HPV positive ASC-US cases among all ASC-US diagnoses. The literature reference value is 36,6%, a rate < 30% and > 60% could indicate problems with laboratory protocol or changes in population risk factors.*<br><br>"
|
| 468 |
+
|
| 469 |
+
if 30 < hrhpv_ascus < 60:
|
| 470 |
+
lab_comment = f"Latest record of laboratory result is within laboratory goal zone {hrhpv_ascus:.2f}%. "
|
| 471 |
+
lab_comment_2 =""
|
| 472 |
+
elif 20 < hrhpv_ascus < 30:
|
| 473 |
+
lab_comment = f"Latest record of laboratory result is in laboratory borderline zone. {hrhpv_ascus:.2f}%."
|
| 474 |
+
if (abs_results[column_changer].iloc[len(abs_results)-1] < abs_results[column_changer].iloc[len(abs_results)-2]):
|
| 475 |
+
lab_comment_2 = f"A decreasing trend can be observed since last year, a lower than 30% rate could indicate problems with laboratory protocol or changes in population risk factors."
|
| 476 |
+
else:
|
| 477 |
+
lab_comment_2 =""
|
| 478 |
+
elif 60 < hrhpv_ascus < 70:
|
| 479 |
+
lab_comment = f"Latest record of laboratory result is in laboratory borderline zone {hrhpv_ascus:.2f}%."
|
| 480 |
+
if (abs_results[column_changer].iloc[len(abs_results)-1] > abs_results[column_changer].iloc[len(abs_results)-2]):
|
| 481 |
+
lab_comment_2 = f"An increasing trend can be observed since last year, a higher than 60% rate could indicate problems with laboratory protocol or changes in population risk factors."
|
| 482 |
+
else:
|
| 483 |
+
lab_comment_2 =""
|
| 484 |
+
elif (hrhpv_ascus < 20) or (hrhpv_ascus > 70):
|
| 485 |
+
lab_comment = f"Latest laboratory result value is {hrhpv_ascus:.2f}%, performance follow up and global laboratory practice revision is advised."
|
| 486 |
+
lab_comment_2 = ""
|
| 487 |
|
| 488 |
lab_comment_6 = lab_comment_6 if 'lab_comment_6' in locals() else []
|
| 489 |
return pn.pane.Markdown(f""" ## {column_changer}:
|
| 490 |
{descript} {lab_comment} {lab_comment_2}
|
| 491 |
{lab_comment_3} {lab_comment_4} {lab_comment_5} {lab_comment_6}
|
| 492 |
""", sizing_mode ='stretch_both', styles = {'font-size':fpx})
|
| 493 |
+
|
| 494 |
inter_labres = pn.bind(labres, column_changer)
|
| 495 |
|
| 496 |
|