Spaces:
Running
Running
Fix HBV Assessment Response
Browse files- core/hbv_assessment.py +31 -29
core/hbv_assessment.py
CHANGED
|
@@ -276,26 +276,29 @@ IMPORTANT JSON FORMATTING:
|
|
| 276 |
- You MUST use "\\n" to indicate line breaks inside the "recommendations" string and format the content as clear bullet lists prefixed with "- ".
|
| 277 |
- Do NOT include literal newline characters. Use \\n for every new bullet or line.
|
| 278 |
|
| 279 |
-
STRUCTURE AND CONTENT OF "recommendations":
|
| 280 |
-
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
|
|
|
|
|
|
| 288 |
|
| 289 |
BULLETING AND CITATIONS RULES:
|
| 290 |
-
- Put citations at the end of each bullet
|
| 291 |
-
- Include evidence grade
|
| 292 |
-
- Only cite pages
|
| 293 |
|
| 294 |
STRICT ACCURACY AND CONSISTENCY RULES:
|
| 295 |
-
- Do NOT contradict yourself. Ensure eligibility conclusion
|
| 296 |
- Use ONLY the provided SASLT 2021 content; do NOT add external knowledge.
|
| 297 |
-
- Numeric thresholds
|
| 298 |
-
- If info is not
|
|
|
|
| 299 |
|
| 300 |
PAGE-TO-TOPIC MAPPING GUIDANCE (for correct citations):
|
| 301 |
- Page 6: Initiation of treatment, management algorithm, start of monitoring of untreated patients.
|
|
@@ -304,20 +307,19 @@ PAGE-TO-TOPIC MAPPING GUIDANCE (for correct citations):
|
|
| 304 |
- Page 9: Special populations (HBV-HCV, HBV-HDV, HBV-HIV, immunocompromised).
|
| 305 |
- Page 10: Pregnancy-related recommendations (late pregnancy prophylaxis, breastfeeding, switching).
|
| 306 |
|
| 307 |
-
EXAMPLE OUTPUT
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
5. Return ONLY the JSON object, no additional text.
|
| 321 |
"""
|
| 322 |
|
| 323 |
|
|
|
|
| 276 |
- You MUST use "\\n" to indicate line breaks inside the "recommendations" string and format the content as clear bullet lists prefixed with "- ".
|
| 277 |
- Do NOT include literal newline characters. Use \\n for every new bullet or line.
|
| 278 |
|
| 279 |
+
STRUCTURE AND CONTENT OF "recommendations" (CONCISE & ORGANIZED):
|
| 280 |
+
- Use ONLY these sections in this exact order, each as a header followed by 1-3 concise bullets:
|
| 281 |
+
1. "Eligibility and Rationale:" (1-2 bullets max)
|
| 282 |
+
2. "Treatment Recommendations:" (1-3 bullets: first-line drugs if eligible, or "Not applicable" if not eligible)
|
| 283 |
+
3. "Monitoring and Follow-up:" (1-2 bullets)
|
| 284 |
+
4. "Special Considerations:" (0-2 bullets, ONLY if applicable to this patient)
|
| 285 |
+
5. "References:" (1 line listing pages cited)
|
| 286 |
+
|
| 287 |
+
- OMIT "Additional Notes" and any other sections.
|
| 288 |
+
- Keep each bullet to ONE sentence (max 25 words per bullet).
|
| 289 |
+
- Total output: aim for 8-12 bullets maximum across all sections.
|
| 290 |
|
| 291 |
BULLETING AND CITATIONS RULES:
|
| 292 |
+
- Put citations at the end of each bullet using "[SASLT 2021, Page X]".
|
| 293 |
+
- Include evidence grade when available (e.g., "(Grade A)").
|
| 294 |
+
- Only cite pages 6–10 that actually contain the information.
|
| 295 |
|
| 296 |
STRICT ACCURACY AND CONSISTENCY RULES:
|
| 297 |
+
- Do NOT contradict yourself. Ensure eligibility conclusion matches all bullets.
|
| 298 |
- Use ONLY the provided SASLT 2021 content; do NOT add external knowledge.
|
| 299 |
+
- Numeric thresholds must match the guideline text exactly.
|
| 300 |
+
- If info is not in the provided pages, do not state it or cite it.
|
| 301 |
+
- BREVITY: Each bullet = 1 sentence, max 25 words. Total = 8-12 bullets max.
|
| 302 |
|
| 303 |
PAGE-TO-TOPIC MAPPING GUIDANCE (for correct citations):
|
| 304 |
- Page 6: Initiation of treatment, management algorithm, start of monitoring of untreated patients.
|
|
|
|
| 307 |
- Page 9: Special populations (HBV-HCV, HBV-HDV, HBV-HIV, immunocompromised).
|
| 308 |
- Page 10: Pregnancy-related recommendations (late pregnancy prophylaxis, breastfeeding, switching).
|
| 309 |
|
| 310 |
+
EXAMPLE OUTPUT (ELIGIBLE PATIENT):
|
| 311 |
+
Eligibility and Rationale:\n- Eligible: HBV DNA > 2,000 IU/mL, ALT > ULN, moderate fibrosis (Grade A) [SASLT 2021, Page 6]\nTreatment Recommendations:\n- Start monotherapy with ETV, TDF, or TAF (Grade A) [SASLT 2021, Page 8]\nMonitoring and Follow-up:\n- Monitor treatment response per SASLT protocol [SASLT 2021, Page 7]\nSpecial Considerations:\n- HBV-HIV coinfection: use TDF- or TAF-based ART (Grade A) [SASLT 2021, Page 9]\nReferences:\n- Pages 6, 7, 8, 9: Treatment criteria, drugs, monitoring, HIV coinfection
|
| 312 |
+
|
| 313 |
+
EXAMPLE OUTPUT (NOT ELIGIBLE PATIENT):
|
| 314 |
+
Eligibility and Rationale:\n- Not eligible: HBV DNA < 2,000 IU/mL, ALT ≤ ULN, no significant fibrosis [SASLT 2021, Page 6]\nTreatment Recommendations:\n- Treatment not indicated at this time [SASLT 2021, Page 6]\nMonitoring and Follow-up:\n- Monitor every 6-12 months (HBeAg-negative, HBV DNA < 2,000 IU/mL) (Grade B) [SASLT 2021, Page 7]\nReferences:\n- Pages 6, 7: Treatment criteria, monitoring protocols
|
| 315 |
+
|
| 316 |
+
CRITICAL REQUIREMENTS:
|
| 317 |
+
1. Base assessment ONLY on SASLT 2021 guidelines provided.
|
| 318 |
+
2. Keep output SHORT: 8-12 bullets total, 1 sentence per bullet (max 25 words).
|
| 319 |
+
3. Use ONLY the 5 sections listed above (omit "Additional Notes" and "Criteria Met/Not Met").
|
| 320 |
+
4. Cite exact page at end of each bullet: [SASLT 2021, Page X].
|
| 321 |
+
5. End with "References:" listing pages in ascending order.
|
| 322 |
+
6. Return ONLY valid JSON, no markdown, no extra text.
|
|
|
|
| 323 |
"""
|
| 324 |
|
| 325 |
|