moazx commited on
Commit
70b9c9d
·
1 Parent(s): 757414a

Fix HBV Assessment Response

Browse files
Files changed (1) hide show
  1. 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
- - Start with a section title: "Eligibility and Rationale:" followed by bullets.
281
- - Then sections in this order, each as a header line and bulleted items below (all within the same string, separated by \\n):
282
- - "Criteria Met/Not Met:"
283
- - "First-line Treatment Options:"
284
- - "Monitoring and Follow-up:"
285
- - "Special Considerations:"
286
- - "Additional Notes:"
287
- - "References:"
 
 
288
 
289
  BULLETING AND CITATIONS RULES:
290
- - Put citations at the end of each bullet, not after every clause, using "[SASLT 2021, Page X]".
291
- - Include evidence grade in the bullet when available (e.g., "(Grade A)") if present in the guideline text.
292
- - Only cite pages present in the provided context (6–10). Cite the page that actually contains the information.
293
 
294
  STRICT ACCURACY AND CONSISTENCY RULES:
295
- - Do NOT contradict yourself. Ensure eligibility conclusion and rationale are consistent with all bullets.
296
  - Use ONLY the provided SASLT 2021 content; do NOT add external knowledge.
297
- - Numeric thresholds and wording must match the guideline text exactly when quoted or summarized.
298
- - If info is not present in the provided pages, do not state it or cite it.
 
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 STYLE (illustrative only; adapt to patient data):
308
- - Eligibility and Rationale:\n- Eligible due to HBV DNA > 2,000 IU/mL with ALT > ULN and/or moderate fibrosis (Grade A) [SASLT 2021, Page 6]\n- Cirrhosis with any detectable HBV DNA warrants treatment regardless of ALT (Grade A) [SASLT 2021, Page 6]
309
- - Criteria Met/Not Met:\n- HBV DNA level criterion: met (> 2,000 IU/mL) [SASLT 2021, Page 6]\n- ALT criterion: met (> ULN) [SASLT 2021, Page 6]\n- HBeAg-positive >30 years with high DNA and normal ALT (if applicable): met/not met (Grade D) [SASLT 2021, Page 6]
310
- - First-line Treatment Options:\n- Start monotherapy with ETV, TDF, or TAF (Grade A) [SASLT 2021, Page 8]
311
- - Monitoring and Follow-up:\n- If untreated, monitor per HBeAg status and DNA thresholds as specified [SASLT 2021, Pages 67]
312
- - Special Considerations:\n- If coinfected with HCV and meeting HBV criteria, treat concurrently or before DAAs (Grade A) [SASLT 2021, Page 8]\n- If immunocompromised, initiate prophylaxis before immunosuppression (Grade A) [SASLT 2021, Page 9]\n- Pregnancy-specific actions per DNA threshold and timing (if applicable) [SASLT 2021, Page 10]
313
- - References:\n- List all cited pages in ascending order with brief topic labels
314
-
315
- IMPORTANT:
316
- 1. Base your assessment ONLY on the SASLT 2021 guidelines provided.
317
- 2. Make recommendations concise, bulleted, and free of contradictions.
318
- 3. Put a proper citation at the end of each bullet using the exact page that contains the information.
319
- 4. End with a "References:" section listing the pages cited in ascending order with short topic labels.
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