From 1912fc7b3070bf86a2870e48c9a2b098ad38aa59 Mon Sep 17 00:00:00 2001 From: Sha Brown Date: Fri, 6 Mar 2026 20:57:53 +0000 Subject: [PATCH] Merged in bugfix/reimb_primary_issues (pull request #900) Bugfix/reimb primary issues * Update lesser of distribution prompt to preserve reimb term langauge * Added prompt change to extract correct service when there are multiple sub-rates; Updated validate reimb term to prevent filtering out erm with valid rate * Make reimb primary prompt change * Revert "Make reimb primary prompt change" This reverts commit 55f7d73b9cb523097c96ea50b6614c1db53b46d2. Approved-by: Katon Minhas --- src/prompts/prompt_templates.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/prompts/prompt_templates.py b/src/prompts/prompt_templates.py index 6ef8c92..6d517cb 100644 --- a/src/prompts/prompt_templates.py +++ b/src/prompts/prompt_templates.py @@ -592,6 +592,7 @@ REIMB_TERM: Describes the method by which the price of the Service is calculated - Extract ONE entry per RATE STATEMENT in the contract. A rate statement includes percentages, dollar amounts, weight-based calculations (e.g., DRG weight), or other reimbursement methodologies. - GROUPING RULE: If multiple services are explicitly listed together (e.g., "Reference Lab and DME") AND share the same rate statement, extract as ONE entry preserving the exact combined SERVICE_TERM. Do not split them. - SEPARATION RULE: If services appear in separate sentences or have different reimbursement methods, extract as separate entries. +- ENUMERATED SUB-CASES: When a paragraph introduces a service category and then lists sub-cases (i, ii, iii or a, b, c or 1, 2, 3) with different rates, extract each sub-case as a separate entry. For SERVICE_TERM, use the overall service description with only a brief sub-case label (e.g., "primary procedure", "second and subsequent procedures") — do NOT include billing logic, conditional clauses, or payment-determination language in the SERVICE_TERM. For REIMB_TERM, extract only the payment method (rate, percentage, dollar amount) — do NOT include the conditional clause that precedes it. - Examples: • "Lab and Imaging Services: 110% of Medicare" → ONE entry with SERVICE_TERM "Lab and Imaging Services" • "Emergency Services: $500 per visit" → ONE separate entry @@ -702,7 +703,11 @@ DECISION LOGIC: - The output string MUST contain METHODOLOGY value - If METHODOLOGY is a simple rate (e.g., "$30.00") and is missing from the final string, prepend it - If METHODOLOGY is a complex formula (e.g., "80% of State Medicaid fee schedule", "the lesser of (i) X or (ii) Y"), verify it appears as the base of the output - + - The output MUST contain the FULL original METHODOLOGY — every rate, tier, and condition. + The lesser-of constraint wraps METHODOLOGY as an outer ceiling; it never replaces or summarizes it. + Before returning, verify METHODOLOGY appears intact. If any part is missing, re-nest: + "the lesser of [full METHODOLOGY] or [constraint ceiling]" + Examples: - ["lesser of $100, billed charges, or 110% Medicare"] - ["$30.00 not to exceed Provider's billed charges"] @@ -2093,6 +2098,8 @@ Valid payment methods: - Calculation formulas with defined components (e.g., "base rate multiplied by DRG weight plus adjustments") - Special types: OUTLIER, STOP_LOSS, SEQUESTRATION, DISCOUNT, PREMIUM, RATE_ESCALATOR, FACILITY_ADJUSTMENT +Note: A REIMBURSEMENT TERM is valid as long as it contains a concrete rate or payment method, even if it also includes surrounding descriptive or billing-scenario language. Focus on whether a specific rate is present, not on the framing around it. + Invalid - return NO if REIMBURSEMENT TERM is: - Empty reimbursements: structure of a payment method but actual rate/percentage is not stated or references another location (e.g., "paid at rates in the next section", "the percentage listed below", "per the attached schedule", "as set forth in Exhibit A"). Note: formulas that define calculation methodology (e.g., "base rate multiplied by DRG weight") ARE valid even if specific dollar amounts aren't stated. Also valid: a percentage tied to a specific CPT/HCPCS code (e.g., "100% of S5125-U3") — the percentage IS the concrete rate. - Vague or undefined amounts: uses non-specific language like "appropriate amount", "applicable rate", "as determined", "reasonable charges", "customary charges" without a concrete percentage or dollar figure. A fee schedule reference is only valid if paired with a specific percentage (e.g., "100% of fee schedule" is valid; "appropriate amount under fee schedule" is NOT valid).