Merged in bugfix/DAIP2-1913-lesser-of-indicator-issues (pull request #889)

Bugfix/DAIP2-1913 lesser of indicator issues

* contract title fixes

* Add instruction to strip hyphens from TIN and NPI

* prompt update

* Merge branch 'bugfix/auto-renewal-term' into bugfix/DAIP2-1699-issue-tracker-fixes-one-to-one-dates-prov-info

* removed print statements

* pipeline error fixed

* signed_ind logic changed

* signatory_ind logic updated

* prompt update

* prompt update

* pipeline error fixed

* Merge branch 'DEV' into bugfix/DAIP2-1699-issue-tracker-fixes-one-to-one-dates-prov-info

* Merge branch 'DEV' into bugfix/DAIP2-1699-issue-tracker-fixes-one-to-one-dates-prov-info

* requested changes applied

* test case added

* prompt update

* contract title prompt update

* prompt update

* Merge branch 'DEV' into DAIP2-1898-one-to-one-issues-filename-tin-auto-renewal-and-contract-title

* handle nested cases of lesser_of and greater_of

* Merge branch 'DEV' into bugfix/DAIP2-1913-lesser-of-indicator-issues

* pipeline error fixed


Approved-by: Siddhant Medar
This commit is contained in:
Mayank Aamseek
2026-02-24 15:35:34 +00:00
committed by Siddhant Medar
parent 14cb727967
commit ca800b0d7e
2 changed files with 6 additions and 1 deletions
@@ -760,6 +760,9 @@ def prompt_lesser_of_distribution(
instruction=prompt_templates.LESSER_OF_DISTRIBUTION_INSTRUCTION(),
usage_label="LESSER_OF_DISTRIBUTION",
)
logging.debug(
f"LLM raw output for lesser-of distribution on page {page_num} for service '{service_term}': {llm_answer_raw}"
)
# Check if LLM determined no lesser-of applies
if "N/A" in llm_answer_raw:
+3 -1
View File
@@ -694,7 +694,7 @@ DECISION LOGIC:
- Preserve original phrasing exactly — do not paraphrase, abbreviate, or alter wording
- Do not include service code or description in the output
- Deduplicate identical constraints
- Join multiple terms: "lesser of X, Y, or Z"
- Join multiple terms preserving meaning through nesting or other structures: e.g., "[the lesser of [the greater of A or B] and C]", "lesser of X, Y, or Z". Ensure brackets and nesting are used appropriately to maintain the original meaning.
Validation:
- The output string MUST contain METHODOLOGY value
@@ -704,6 +704,7 @@ DECISION LOGIC:
Examples:
- ["lesser of $100, billed charges, or 110% Medicare"]
- ["$30.00 not to exceed Provider's billed charges"]
- ["the lesser of [the greater of 100% of the State Medicaid fee schedule or Affinity's standard fee schedule] and billed charges"]
- ["N/A"]
Example — Intra-exhibit statement references another exhibit → N/A:
@@ -954,6 +955,7 @@ Analyze a given term from a Payer-Provider contract and extract key fields.
- Carefully extract **every individual reimbursement clause within the comparison**.
- For example: "Lesser of (i) 80% of billed charges, (ii) Medicare rate, or (iii) $400" should yield **three separate JSON dictionaries**.
- **Do not skip any clause**. Every item compared under "lesser of", "greater of", "equal to", or similar comparative logic must be represented as its own dictionary in the output list.
- If the comparative structure includes nested comparisons (e.g., "the lesser of [the greater of A or B] and C"), each one of A,B and C must be extracted as its own dictionary. LESSER_OF and GREATER_OF are determined only by the immediate parent comparison. So even if it is part of outer LESSER_OF comparison, LESSER_OF should be "N" if GREATER_OF is "Y". In the case of the above example, dictionaries A and B should have GREATER_OF as "Y" and LESSER_OF as "N". Dictionary C should have LESSER_OF as "Y" and GREATER_OF as "N".
- **IMPORTANT**: For each component, classify the `AARETE_DERIVED_REIMB_METHOD` based on the INDIVIDUAL component, not the overall structure.
- If the methodology includes **additional reimbursement terms** beyond the "lesser of" structure (e.g., per diem charges, or carve-out payments):
- **These must also be extracted as separate JSON dictionaries** in the same list.