From 28c6cd588e69795d16703d627b27ffbd116cb1e0 Mon Sep 17 00:00:00 2001 From: Mayank Aamseek Date: Mon, 7 Jul 2025 13:14:20 +0000 Subject: [PATCH] Merged in bugfix/methodology-breakout-issues (pull request #599) Bugfix/methodology breakout issues * restored old prompt * updated claim type cd prompt * claim_type exhibit level added * Merge branch 'bugfix/claim_type_1_to_1' of https://bitbucket.org/aarete/doczy.ai into bugfix/claim_type_1_to_1 * field type updated * Merge remote-tracking branch 'origin/main' into bugfix/claim_type_1_to_1 * fixed location of updating field_type to full_context * updated ancillary examples * removed print statements * Merge branch 'bugfix/claim_type_1_to_1' of https://bitbucket.org/aarete/doczy.ai into bugfix/claim_type_1_to_1 * prompt updated to avoid N/A * Merge remote-tracking branch 'origin/main' into bugfix/claim_type_1_to_1 * prompt changed to handle multiple matches * prompt updated * Merge remote-tracking branch 'origin/main' into bugfix/claim_type_1_to_1 * print statements added for testing * test notebook added * Merge remote-tracking branch 'origin/main' into bugfix/methodology-breakout-issues * multiple fee schedule in one term fixed * print statements removed * print statements removed * print statements removed Approved-by: Alex Galarce --- fieldExtraction/src/investment/one_to_n_funcs.py | 2 +- fieldExtraction/src/prompts/investment_prompts.json | 2 +- fieldExtraction/src/prompts/investment_prompts.py | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/fieldExtraction/src/investment/one_to_n_funcs.py b/fieldExtraction/src/investment/one_to_n_funcs.py index 28b98cb..2938fcd 100644 --- a/fieldExtraction/src/investment/one_to_n_funcs.py +++ b/fieldExtraction/src/investment/one_to_n_funcs.py @@ -294,7 +294,7 @@ def methodology_breakout_single_row( llm_utils.invoke_claude( fee_schedule_prompt_template( contract_reimbursement_method, - methodology_breakout_dict.get("REIMB_PCT_RATE"), + methodology_breakout_dict.get("FEE_SCHEDULE"), fs_breakout_questions, ), config.MODEL_ID_CLAUDE35_SONNET, diff --git a/fieldExtraction/src/prompts/investment_prompts.json b/fieldExtraction/src/prompts/investment_prompts.json index bea9904..b3b09a6 100644 --- a/fieldExtraction/src/prompts/investment_prompts.json +++ b/fieldExtraction/src/prompts/investment_prompts.json @@ -84,7 +84,7 @@ { "field_name": "FEE_SCHEDULE", "relationship": "one_to_n", - "field_type": "fee_schedule_breakout", + "field_type": "methodology_breakout", "prompt": "Write the full name of the Fee Schedule here. Include the secondary part of the fee schedule such as clinical lab, outpatient imaging, DMEPOS, encounter, surgeon, clinical diagnostic lab, parenteral and enteral nutrition (PEN), ASC, Part B Drug, Behavioral health, obstetrical, dental, transportation, etc. CHIP and STAR are not fee schedules. Only use exact text from the methodology." }, { diff --git a/fieldExtraction/src/prompts/investment_prompts.py b/fieldExtraction/src/prompts/investment_prompts.py index 4655728..043e8e4 100644 --- a/fieldExtraction/src/prompts/investment_prompts.py +++ b/fieldExtraction/src/prompts/investment_prompts.py @@ -611,14 +611,13 @@ Methodology: {methodology.replace('"', "'")} Please explain your reasoning as you work through the document. After your explanation, include the heading "FINAL REIMBURSEMENT METHODOLOGY:" followed by a properly formatted JSON list with your final output. """ -def FEE_SCHEDULE_BREAKOUT(methodology, pct_rate, questions): +def FEE_SCHEDULE_BREAKOUT(methodology, fee_schedule, questions): return f"""Analyze a given reimbursement methodology from a Payer-Provider contract: Here is the text to analyze and respond to: -Rate of Interest: '{pct_rate} of Fee Schedule' Methodology: {methodology.replace('"', "'")} -Use the text in the methodology to populate a JSON dictionary with the following fields, specifically for the rate of interest: +Use the text in the methodology to populate a JSON dictionary with the following fields, specifically for {fee_schedule} Fee Schedule: {questions}