Spaces:
Sleeping
Sleeping
add patient data at the end
Browse files- core/hbv_assessment.py +18 -16
core/hbv_assessment.py
CHANGED
|
@@ -255,22 +255,6 @@ def assess_hbv_eligibility(patient_data: Dict[str, Any]) -> Dict[str, Any]:
|
|
| 255 |
|
| 256 |
# Create prompt for LLM to analyze patient against guidelines
|
| 257 |
analysis_prompt = f"""You are an HBV treatment eligibility assessment system. Analyze the patient data against the SASLT 2021 guidelines.
|
| 258 |
-
PATIENT DATA:
|
| 259 |
-
- Sex: {sex}
|
| 260 |
-
- Age: {age} years
|
| 261 |
-
- Pregnancy Status: {pregnancy_status}
|
| 262 |
-
- HBsAg Status: {hbsag_status}
|
| 263 |
-
- HBsAg Duration: {duration_hbsag} months
|
| 264 |
-
- HBV DNA Level: {hbv_dna:,.0f} IU/mL
|
| 265 |
-
- HBeAg Status: {hbeag_status}
|
| 266 |
-
- ALT Level: {alt_level}
|
| 267 |
-
- Fibrosis Stage: {fibrosis_stage}
|
| 268 |
-
- Necroinflammatory Activity: {necroinflammatory}
|
| 269 |
-
- Extrahepatic Manifestations: {extrahepatic}
|
| 270 |
-
- Immunosuppression: {immunosuppression}
|
| 271 |
-
- Coinfections: {', '.join(coinfections) if coinfections else 'None'}
|
| 272 |
-
- Family History (Cirrhosis/HCC): {family_history}
|
| 273 |
-
- Other Comorbidities: {', '.join(comorbidities) if comorbidities else 'None'}
|
| 274 |
|
| 275 |
|
| 276 |
SASLT 2021 GUIDELINES (Retrieved Context):
|
|
@@ -365,6 +349,24 @@ CRITICAL REQUIREMENTS:
|
|
| 365 |
4. Use ONLY the 5 sections listed above.
|
| 366 |
5. Cite exact page at end of each bullet: [SASLT 2021, Page X].
|
| 367 |
6. Return ONLY valid JSON, no markdown, no extra text.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 368 |
"""
|
| 369 |
|
| 370 |
|
|
|
|
| 255 |
|
| 256 |
# Create prompt for LLM to analyze patient against guidelines
|
| 257 |
analysis_prompt = f"""You are an HBV treatment eligibility assessment system. Analyze the patient data against the SASLT 2021 guidelines.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 258 |
|
| 259 |
|
| 260 |
SASLT 2021 GUIDELINES (Retrieved Context):
|
|
|
|
| 349 |
4. Use ONLY the 5 sections listed above.
|
| 350 |
5. Cite exact page at end of each bullet: [SASLT 2021, Page X].
|
| 351 |
6. Return ONLY valid JSON, no markdown, no extra text.
|
| 352 |
+
|
| 353 |
+
PATIENT DATA:
|
| 354 |
+
- Sex: {sex}
|
| 355 |
+
- Age: {age} years
|
| 356 |
+
- Pregnancy Status: {pregnancy_status}
|
| 357 |
+
- HBsAg Status: {hbsag_status}
|
| 358 |
+
- HBsAg Duration: {duration_hbsag} months
|
| 359 |
+
- HBV DNA Level: {hbv_dna:,.0f} IU/mL
|
| 360 |
+
- HBeAg Status: {hbeag_status}
|
| 361 |
+
- ALT Level: {alt_level}
|
| 362 |
+
- Fibrosis Stage: {fibrosis_stage}
|
| 363 |
+
- Necroinflammatory Activity: {necroinflammatory}
|
| 364 |
+
- Extrahepatic Manifestations: {extrahepatic}
|
| 365 |
+
- Immunosuppression: {immunosuppression}
|
| 366 |
+
- Coinfections: {', '.join(coinfections) if coinfections else 'None'}
|
| 367 |
+
- Family History (Cirrhosis/HCC): {family_history}
|
| 368 |
+
- Other Comorbidities: {', '.join(comorbidities) if comorbidities else 'None'}
|
| 369 |
+
|
| 370 |
"""
|
| 371 |
|
| 372 |
|