Commit Graph

1620 Commits

Author SHA1 Message Date
Katon Minhas afb6d5185d Merged in feature/lesser-table-caching-refactor-hybrid (pull request #847)
Feature/lesser table caching refactor hybrid

* chore: Remove unused duplicate main.py from shared pipeline

* fix: Correct crosswalk paths in aarete_derived.py

* chore: Remove unused documentation files from fieldExtraction

* docs: Add documentation files to documentation folder

* docs: Update README with uv setup, expanded project structure, and branching conventions

* docs: Add uv installation steps with Ubuntu/WSL emphasis

* Enable prompt caching for all remaining LLM calls

- Add _INSTRUCTION() functions for: EXHIBIT_HEADER, EXHIBIT_LINKAGE,
  EXHIBIT_TITLE_MATCH, DATE_FIX, DERIVED_TERM_DATE, CHECK_PROVIDER_NAME_MATCH,
  SPECIAL_CASE_ASSIGNMENT
- Update all invoke_claude() calls in saas and clover pipelines to use
  cache=True with corresponding _INSTRUCTION() functions
- Add new instructions to get_cacheable_instructions() for cache warming
- Update tests for new instruction functions

Functions now using caching:
- prompt_exhibit_level
- prompt_exhibit_lesser (EXHIBIT_LEVEL_LESSER_OF)
- prompt_fee_schedule_breakout
- prompt_grouper_breakout
- prompt_special_case_assignment
- prompt_exhibit_linkage
- prompt_exhibit_header
- prompt_smart_chunked (ONE_TO_ONE templates)
- prompt_date_fix
- prompt_derived_term_date
- prompt_exhibit_title_match
- provider_name_match_check

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Reorder

* feat: Add bcbs_promise client pipeline with OFFSET_TERM extraction

- Add new bcbs_promise client with HSC-based OFFSET_TERM field extraction
- Extract full paragraph text of offset/recoupment provisions from contracts
- Derive OFFSET_INDICATOR (Y/N) from OFFSET_TERM presence
- Fix reorder_columns to preserve extra columns not in COLUMN_ORDER
- Update QC/QA output path to outputs/qc_qa/

* fix: Update dev deps and test assertions for QC/QA output path

- Add pytest/pytest-mock to dev dependencies for mypy type checking
- Update test assertions to expect outputs/qc_qa instead of qa_qc_output

* style: Apply black formatting to prompt_templates.py

* Merge main, move scripts

* Archive some scripts

* update py version

* remove .py version file

* Remove ASCII characters

* Restore testbed code

* restore tracking

* Update testbed metrics

* Enable prompt caching for CODE_LAST_CHECK, FILL_BILL_TYPE, DUAL_LOB_CHECK, and GROUPER_BREAKOUT

- Add CODE_LAST_CHECK_INSTRUCTION() for service specificity classification
- Add FILL_BILL_TYPE_INSTRUCTION() for bill type code determination
- Add DUAL_LOB_CHECK_INSTRUCTION() for Medicare/Medicaid classification
- Update code_funcs.py to use caching for CODE_LAST_CHECK, FILL_BILL_TYPE, GROUPER_BREAKOUT
- Update postprocessing_funcs.py to use caching for DUAL_LOB_CHECK
- Add new instructions to get_cacheable_instructions() for cache warming
- Add unit tests for new instruction functions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix postprocessing_funcs to remove invalid columns

* Merge branch 'main' into feature/lesser-table-caching-refactor-hybrid

* Revert prompt caching changes from aed1b73c

* update formatting

* Update imports


Approved-by: Sha Brown
Approved-by: Praneel Panchigar
2026-01-26 16:52:55 +00:00
Praneel Panchigar dcec3f4b7a Merged in bugfix/preserve_lob_relationship_llm_values (pull request #846)
Bugfix/preserve lob relationship llm values

* Relationship values changes

* Fix: Preserve LLM-determined LOB relationship values

- Prevent fill_na_mapping from overwriting LLM-determined 'Inclusive' relationships
- Only set 'Exclusive' when relationship field is empty/NA (preserves LLM values)
- Default to 'Exclusive' when PROGRAM/PRODUCT is NA/blank (LLM bypassed cases)
- Condensed redundant conditional logic for better maintainability

* Changed LOB Relationship prompt to more strictly enforce an output format

* Merge remote-tracking branch 'origin/main' into bugfix/preserve_lob_relationship_llm_values


Approved-by: Katon Minhas
2026-01-23 21:53:07 +00:00
Praneel Panchigar ab31139168 Merged in bugfix/preserve_lob_relationship_llm_values (pull request #842)
Bugfix/preserve lob relationship llm values

* Relationship values changes

* Fix: Preserve LLM-determined LOB relationship values

- Prevent fill_na_mapping from overwriting LLM-determined 'Inclusive' relationships
- Only set 'Exclusive' when relationship field is empty/NA (preserves LLM values)
- Default to 'Exclusive' when PROGRAM/PRODUCT is NA/blank (LLM bypassed cases)
- Condensed redundant conditional logic for better maintainability

* Merged main into bugfix/preserve_lob_relationship_llm_values


Approved-by: Katon Minhas
2026-01-22 18:12:35 +00:00
Sha Brown 05a615e8b2 Merged in bugfix/claim_type_code (pull request #845)
Bugfix/claim type code

* Added retrieval question for hybrid smart chunking CLAIM_TYPE_CD

* Update on hybrid smart chunking retrival question

* Merged main into bugfix/claim_type_code


Approved-by: Katon Minhas
2026-01-22 16:39:02 +00:00
Katon Minhas 59e5fe4532 Merged in feature/postprocess-script (pull request #843)
Add postprocess script

* Add postprocess script


Approved-by: Siddhant Medar
2026-01-22 16:05:10 +00:00
VenkataKrishna Reddy Avula 96790f04ba Merged in restructure/facility_adjustments_group (pull request #836)
Restructure/facility adjustments group to main

* removed _PCT_RATE and _FEE_RATE in facility adjustment_breakout

* moved facility adjustments term to exhibit level

* added facility adjustmnet breakout

* Merged main into restructure/facility_adjustments_group

* Update breakout


Approved-by: Katon Minhas
2026-01-21 16:42:39 +00:00
Mayank Aamseek c62dafb7c1 Merged in bugfix/conversion-factor (pull request #841)
Bugfix/conversion factor

* fixed default value

* fixed conversion_factor prompt

* post processing error fixed

* fixed missing reimb primaries

* Merged main into bugfix/conversion-factor


Approved-by: Katon Minhas
2026-01-21 16:07:28 +00:00
Mayank Aamseek 7b05d6bfe2 Merged in bugfix/rate-escalator-name (pull request #838)
field name updated

* field name updated


Approved-by: Katon Minhas
2026-01-21 16:05:26 +00:00
Karan Desai 6679bf7f47 Merged in feature/pc-functionality (pull request #835)
bug fix for pc module

* bug fix for pc module


Approved-by: Katon Minhas
2026-01-12 21:29:53 +00:00
Mayank Aamseek 87f3d2f4f0 Merged in bugfix/mb-prompts (pull request #833)
Bugfix/mb prompts

* reimb primary prompt update

* Merge branch 'main' into bugfix/highmark-reimb-primary

* prompt reorganised

* Merged main into bugfix/mb-prompts

* mb prompt refinement

* Merge branch 'bugfix/mb-prompts' of https://bitbucket.org/aarete/doczy.ai into bugfix/mb-prompts

* Merged main into bugfix/mb-prompts

* fee schedule prompt simplified

* Merged in bugfix/methodology_breakout_reimb_pct_rate (pull request #831)

bugfix/methodology_breakout_reimb_pct_rate to bugfix/mb-prompts

* remove case rate from fill empty reimb pct rate

* Merged bugfix/mb-prompts into bugfix/methodology_breakout_reimb_pct_rate


Approved-by: Katon Minhas

* Merged main into bugfix/mb-prompts

* grouper breakout prompt changes

* Merged main into bugfix/mb-prompts

* Merged main into bugfix/mb-prompts

* Update reimb primary prompt


Approved-by: Katon Minhas
2026-01-12 18:18:42 +00:00
Karan Desai 72f633cad2 Merged in bugfix/reimb-primary (pull request #834)
Bugfix/reimb primary

* prompt update for reimb primary

* reimb primary prompt update to extract more info

* prompt update at to priotrize $ amounts

* prompt update for split tbales

* updated valid entries for reimbs

* addition to reimb primary prompt

* reimb primary pormpt update

* Merge remote-tracking branch 'origin/main' into bugfix/reimb-primary
merhing latest main in reimb-primary

* Merged main into bugfix/reimb-primary

* fix- PR comment


Approved-by: Katon Minhas
2026-01-09 22:40:45 +00:00
Faizan Mohiuddin 8c9060e425 Merged in feature/multithreading (pull request #828)
Feature/multithreading

* fixes

* Merge main into feature/multithreading

Resolved conflicts:
- Kept timing instrumentation in file_processing.py
- Kept new 3-step Exhibit-based approach for one-to-n processing
- Maintained parallelization improvements (20 workers)

Changes include:
- Timing utils integration for performance monitoring
- Increased max_workers from 5 to 20 across all components
- Parallelized code_breakout and grouper_breakout
- Fixed tin_npi_funcs function call parameters

* Fix max_workers error for empty documents

- Add check to skip parallel processing when no pages exist
- Use min(len(all_page_tasks), 20) to prevent max_workers=0
- Handles edge case of documents with no exhibits or pages

* Fix max_workers=0 errors in one_to_n_funcs

- Add checks before all ThreadPoolExecutor creations
- Prevents errors when processing empty lists:
  - carveout_and_special_case
  - breakout
  - special_case_breakout
  - filter_services_without_reimbursements
  - run_lob_relationship
- Ensures executor only created when there are items to process

* Reduce code processing parallelism to prevent API throttling

Lower max_workers from 20 to 10 for code_breakout and grouper_breakout
to prevent overwhelming Bedrock API with concurrent requests

* fixed

* Merged main into feature/multithreading

* Move documentation into folder

* Fix logging statements

* Merge branch 'main' into feature/multithreading

* Refactor for clarity

* Update previous exhibit passing logic

* properly simplify exhibits

* Merged main into feature/multithreading

* update conditional for None

* exhibit multithreading changed

* exhibit multithreading changed

* Merge remote-tracking branch 'origin/main' into feature/multithreading

* synced with main

* Parallelize dynamic assignment, refactor HSC field worker, add timing/exhibit unit tests, tidy imports/ignore helpers

* analyze_regression.py edited online with Bitbucket
* count_pages.py edited online with Bitbucket
* compare_regressed_with_baseline.py edited online with Bitbucket
* simple_testbed_compare.py edited online with Bitbucket
* run_testbed_metrics_regressed.py edited online with Bitbucket

Approved-by: Katon Minhas
2026-01-09 20:18:01 +00:00
Praneel Panchigar 69f23653a1 Merged in bugfix/dynamic_issues (pull request #832)
Bugfix/dynamic issues

* Add debug print statements for dynamic primary field discovery and 1:1 escalation tracking

* Add reimb_term to bill type CD determination context

- Updated fill_bill_type() to accept reimb_term parameter
- Modified FILL_BILL_TYPE prompt to include reimbursement term in context
- First attempt now uses: service term + reimbursement term
- Second attempt uses: service term + reimbursement term + exhibit text
- Updated extract_codes_from_service() to pass REIMB_TERM to fill_bill_type()

* Remove debug print statements from dynamic_funcs.py and file_processing.py

- Removed all DEBUG print statements for dynamic primary discovery
- Removed debug prints for field discovery status and 1:1 escalation evaluation
- Removed debug prints for exhibit level answers and final summaries
- Removed debug comment about one_to_one_fields creation
- Cleaned up all temporary debugging code

* Merge branch 'main' into bugfix/dynamic_issues

* Remove duplicate one_to_one_fields FieldSet initialization from process_file


Approved-by: Katon Minhas
2026-01-08 22:41:52 +00:00
VenkataKrishna Reddy Avula d97a31aa5b Merged in optimization/prov_info (pull request #829)
optimization_prov_info to main

* removed on signature page field which is unnecessary


Approved-by: Katon Minhas
2026-01-07 15:19:35 +00:00
VenkataKrishna Reddy Avula 874354dc44 Merged in bugfix/prov_info (pull request #826)
bugfix/prov_info to main

* added instruction to add missing info

* Merged main into bugfix/prov_info

* Prompt update


Approved-by: Katon Minhas
2026-01-06 17:40:02 +00:00
VenkataKrishna Reddy Avula a9b08388e3 Merged in bugfix/payer_name (pull request #827)
Bugfix/payer name to main

* added full context instruction for payer name

* removed print statement


Approved-by: Katon Minhas
2026-01-06 16:40:59 +00:00
Karan Desai 04a190d5b7 Merged in bugfix/hmk-issues (pull request #824)
Bugfix/hmk issues

* fix for missing AARETE_DERIVED_LOB

* fix for AARETE_DERIVED_SID

* bugfix in universal_json_load

* bugfix for normalize_state_field

*  reimb eff date assignmnet prompt update

* prompt update for missing reimb terms

* Merged main into bugfix/hmk-issues

* test case for universal_json_loads

* reveresed the prompt update for missing reimb

* prompt fix for reimb dates


Approved-by: Katon Minhas
2026-01-05 18:34:18 +00:00
VenkataKrishna Reddy Avula b0eed711fc Merged in bugfix/carveout (pull request #825)
bugfix/carveout to main

* removed specific service in base covered

* Merged main into bugfix/carveout

* Merged main into bugfix/carveout


Approved-by: Katon Minhas
2026-01-05 15:43:28 +00:00
Mayank Aamseek fd390e3907 Merged in bugfix/highmark-reimb-primary (pull request #823)
reimb primary prompt update

* reimb primary prompt update

* Merge branch 'main' into bugfix/highmark-reimb-primary

* Update reimb primary prompt


Approved-by: Katon Minhas
2026-01-05 15:41:09 +00:00
VenkataKrishna Reddy Avula 49e8964986 Merged in bugfix/provider_tin (pull request #822)
bugfix/provider_tin to main

* false positives case added to prompt


Approved-by: Katon Minhas
2026-01-05 14:15:08 +00:00
Katon Minhas 541a0f97e0 Merged in hotfix/highmark-issues (pull request #821)
Remove EXHIBIT_TEXT column (and all other invalid columns)

* Remove EXHIBIT_TEXT column (and all other invalid columns)
2025-12-29 20:36:22 +00:00
Karan Desai a8146cad11 Merged in bugfix/hmk-1-to-1 (pull request #820)
fix for redundantly populated  provider twice

* fix for redundantly populated  provider twice

* Merged main into bugfix/hmk-1-to-1


Approved-by: Katon Minhas
2025-12-26 20:44:04 +00:00
Praneel Panchigar 85f2c8cecc Merged in bugfix/bill_type_code_fixes (pull request #819)
Bugfix/bill type code fixes

* Fix LOB_PROGRAM_RELATIONSHIP extraction and preserve debugging code

- Add format requirements to LOB_RELATIONSHIP_INSTRUCTION for proper caching
- Strengthen LOB_RELATIONSHIP prompt with explicit pipe delimiter requirements
- Preserve all DEBUG blocks and print statements in dynamic_funcs.py and file_processing.py
- Update crosswalk mappings and gitignore
- Ensure format instructions are cached at API level to prevent missing pipe delimiters

* Merge main into bugfix/dynamic_issuefixes

Resolved merge conflicts in:
- fieldExtraction/src/investment/dynamic_funcs.py (merged debug print statements)
- fieldExtraction/src/investment/file_processing.py (merged debug statements and exhibit inheritance code)

All conflicts resolved successfully.

* Update FILL_BILL_TYPE prompt with place-of-service priority and optional exhibit_text

- Add optional exhibit_text parameter to FILL_BILL_TYPE function
- Update instructions to prioritize place-of-service over service-only terminology
- Add new examples: 'home dialysis' and 'dialysis' while keeping original examples
- Add conditional exhibit context section when exhibit_text is provided
- Maintains backward compatibility (exhibit_text defaults to None)

Ref: PLAN_BILL_TYPE_CD_IMPROVEMENTS.md

* Implement two-step bill type CD determination with exhibit text fallback

- Add EXHIBIT_TEXT to answer_dict in combine_one_to_n() for contextual analysis
- Update fill_bill_type() to use two-step approach:
  1. First attempt: service term only (no exhibit text)
  2. Second attempt: service term + exhibit text (only if first fails)
- Update extract_codes_from_service() to pass exhibit_text to fill_bill_type()
- Add debug print when full exhibit text context is used
- More efficient: only makes second LLM call when service term alone fails

Ref: PLAN_BILL_TYPE_CD_IMPROVEMENTS.md

* Remove debug print statement and merge main into bill_type_code_fixes

- Remove debug print statement from fill_bill_type() in code_funcs.py
- Merge latest changes from main branch
- Includes updates to prompt_templates.py (payer_name parameter)
- Includes updates to file_processing.py (provider info ordering)
- Includes updates to aarete_derived.py, crosswalk mappings, and tin_npi_funcs

* Remove remaining debug print statements from dynamic_funcs.py and file_processing.py


Approved-by: Katon Minhas
2025-12-26 18:24:57 +00:00
Praneel Panchigar b64e1fe4cc Merged in bugfix/derived_lob_changes (pull request #817)
Bugfix/derived lob changes

* Fix LOB_PROGRAM_RELATIONSHIP extraction and preserve debugging code

- Add format requirements to LOB_RELATIONSHIP_INSTRUCTION for proper caching
- Strengthen LOB_RELATIONSHIP prompt with explicit pipe delimiter requirements
- Preserve all DEBUG blocks and print statements in dynamic_funcs.py and file_processing.py
- Update crosswalk mappings and gitignore
- Ensure format instructions are cached at API level to prevent missing pipe delimiters

* Merge main into bugfix/dynamic_issuefixes

Resolved merge conflicts in:
- fieldExtraction/src/investment/dynamic_funcs.py (merged debug print statements)
- fieldExtraction/src/investment/file_processing.py (merged debug statements and exhibit inheritance code)

All conflicts resolved successfully.

* Fix AARETE_DERIVED_LOB to merge values from all crosswalks (PROGRAM and PRODUCT)

- Updated fill_na_mapping to always check both AARETE_DERIVED_PROGRAM and PRODUCT crosswalks
- Merges unique values from all sources (existing, PROGRAM, PRODUCT) instead of only filling when empty
- Ensures Duals is included when PRODUCT contains Molina Medicare Options Plus
- Deduplicates and sorts values before pipe-delimiting
- Each row processed individually for correct LOB assignment per reimbursement term

* Merged main into bugfix/derived_lob_changes


Approved-by: Katon Minhas
2025-12-22 19:40:31 +00:00
Sha Brown 77c845a82e Merged in bugfix/prov-info-issues (pull request #816)
Bugfix/prov info issues

* Initial commit

* Passed payer name to tin npi llm call to avoid assigning tin npi to payer

* Removed record that contains NO_IDENTIFIERS_FOUND from PROV_INFO_JSON

* Updated unit test for test_tin_npi_funcs

* Changed name check code back to original to be consistent

* Updated test_tin_npi_funcs.py to pass in payer_name in functions

* Add fix to unit test

* Updated output in unit tests

* Merged main into bugfix/prov-info-issues


Approved-by: Katon Minhas
2025-12-22 19:03:09 +00:00
Mayank Aamseek 7ffd62fd8e Merged in bugfix/highmark-methodology-breakout (pull request #815)
Bugfix/highmark methodology breakout

* fix reimb_term rows for dates

* reimb_primary prompt update

* prompt changes

* Merge remote-tracking branch 'origin/main' into bugfix/highmark-methodology-breakout

* prompt changes

* prompt updates

* Merge branch 'main' into bugfix/highmark-methodology-breakout

* prompt updates

* Prompt updates


Approved-by: Katon Minhas
2025-12-22 18:58:34 +00:00
VenkataKrishna Reddy Avula e8cb48643c Merged in bugfix/carveout_base (pull request #814)
bugfix/carveout_base to main

* updated base covered services


Approved-by: Katon Minhas
2025-12-18 16:51:56 +00:00
Sha Brown 46494274ff Merged in bugfix/one_to_one_and_prov_info (pull request #808)
Bugfix/one to one and prov info

* Add post-processing logic to update PROV_INFO_JSON if needed; Updated prompt to verify the number of digitis in TIN and NPI

* Added update_prov_info_with_group_name to postprocessing_funcs.py

* Updated FIRST_PAGE_PROVIDER_NAME_TEMPLATE to ask LLM to explain resoning before answering

* Updated logic to use LLM to check if provider name matches

* Use only Hybrid Smart Chunking to get provider group name

* Cleaned up code

* Removed commented out code

* Updated unit test

* Merged main into bugfix/one_to_one_and_prov_info

* Edited prompt to distinguish provider names and to enclose answer in pipes

* Updated test_tin_npi_funcs


Approved-by: Katon Minhas
2025-12-17 22:37:06 +00:00
Praneel Panchigar d3bfec0b6b Merged in bugfix/dynamic_issuefixes-clean (pull request #813)
Fix LOB_PROGRAM_RELATIONSHIP extraction and preserve debugging code

* Fix LOB_PROGRAM_RELATIONSHIP extraction and preserve debugging code

- Add format requirements to LOB_RELATIONSHIP_INSTRUCTION for proper caching
- Strengthen LOB_RELATIONSHIP prompt with explicit pipe delimiter requirements
- Preserve all DEBUG blocks and print statements in dynamic_funcs.py and file_processing.py
- Update crosswalk mappings and gitignore
- Ensure format instructions are cached at API level to prevent missing pipe delimiters

* Merge main into bugfix/dynamic_issuefixes-clean and remove all debug print statements

* Remove redundant one_to_one_fields initialization to match main


Approved-by: Katon Minhas
2025-12-17 20:42:13 +00:00
Praneel Panchigar f26b83bd0b Merged in feature/cross-exhibit-dynamic (pull request #789)
Feature/cross exhibit dynamic

* Merge branch 'feature/deprecate-haiku-3' into feature/1toN-Optimization

* fix over-filtering of lesser of

* Merged in bugfix/UT-methodology-breakout (pull request #794)

Bugfix/UT methodology breakout

* updated valid values for AARETE_DERIVED_REIMB_METHOD

* removed example reimbursements

* prompt update

* prompt update

* Merged feature/1toN-Optimization into bugfix/nv_issue_fixes

* add service term in mb prompts

* Merged feature/1toN-Optimization into bugfix/UT-methodology-breakout

* print statement removed

* Merge branch 'bugfix/UT-methodology-breakout' of https://bitbucket.org/aarete/doczy.ai into bugfix/UT-methodology-breakout

* primary prompt update

* remove duplicate prompt


Approved-by: Katon Minhas

* Merge branch 'main' into feature/1toN-Optimization

* Merge branch 'main' into feature/1toN-Optimization

* Update preprocessing to make the exhibit_chunk_mapping start at first page

* Merge remote-tracking branch 'origin/feature/1toN-Optimization' into cross-exhibit-dynamic

* Address merge request comments: refactor prompt templates and logging

- Make DYNAMIC_PRIMARY_TEXT LOB-specific instructions conditional (only show when field_name is LOB)
- Remove MEDICAID FEE SCHEDULE point from DYNAMIC_ASSIGNMENT (point #2)
- Generalize SERVICE_TERM context guidance to apply to all fields (LOB, PROGRAM, NETWORK, PRODUCT)
- Refactor proximity guidance to emphasize contextual connection over strict section boundaries
- Update point #1 to explicitly prevent inferring LOB from Programs alone
- Change exhibit inheritance logging from info to debug level

* Move function to one_to_n_funcs

* Merge row_funcs.py changes from feature/cross-exhibit-dynamic

* Merged feature/1toN-Optimization into feature/cross-exhibit-dynamic

* Merged in bugfix/UT-grouper-issues (pull request #796)

Bugfix/UT grouper issues

* updated valid values for AARETE_DERIVED_REIMB_METHOD

* removed example reimbursements

* prompt update

* prompt update

* Merged feature/1toN-Optimization into bugfix/nv_issue_fixes

* add service term in mb prompts

* Merged feature/1toN-Optimization into bugfix/UT-methodology-breakout

* print statement removed

* Merge branch 'bugfix/UT-methodology-breakout' of https://bitbucket.org/aarete/doczy.ai into bugfix/UT-methodology-breakout

* primary prompt update

* prompt update

* Merge remote-tracking branch 'origin/feature/1toN-Optimization' into bugfix/UT-grouper-issues

* removed temp changes

* removed temp changes

* Update reimb primary


Approved-by: Katon Minhas

* Merged in bugfix/validation_fixes (pull request #795)

bugfix/validation_fixes to feature/1toN-Optimization

* updated validation of clean claims reimbursement

* Merged feature/1toN-Optimization into bugfix/validation_fixes


Approved-by: Katon Minhas

* Merge branch 'feature/1toN-Optimization' into feature/cross-exhibit-dynamic

* Re-add dynamic codes and reimb-info

* Re-structure empty reimbursement prompt

* Fix lesser of check overfiltering

* Merged feature/1toN-Optimization into feature/cross-exhibit-dynamic

* Update LOB inference logic and prompt guidance

- Revert DYNAMIC_PRIMARY_TEXT to original template (remove LOB-specific conditional section)
- Add explicit guidance in DYNAMIC_ASSIGNMENT: presence of Medicaid programs does NOT imply LOB is Medicaid
- Update get_dynamic_one_to_one_fields to only check AARETE_DERIVED_LOB (not raw LOB) when skipping PROGRAM/PRODUCT/NETWORK

* Fix LOB_PROGRAM_RELATIONSHIP extraction: add pipe format instructions to LOB_RELATIONSHIP_INSTRUCTION

* Update Fidelis Essential Plan mappings in crosswalk_product_lob.json

- Add mappings for Essential Plan variants (Aliessa, EP-QHP, EP, Essential Plan)
- Essential Plan Aliessa and EP Aliessa map to Medicaid
- EP-QHP maps to Commercial
- EP and Essential Plan map to Medicaid|Commercial

* Remove debug logging statements from prompt_lob_relationship

* Merge main into feature/cross-exhibit-dynamic: resolved conflicts, removed debug statements, synced prompt_templates.py with main

* Sync non-exhibit-merge files with main before merge

* Remove test.py to match main


Approved-by: Katon Minhas
2025-12-17 19:15:49 +00:00
Karan Desai ca53ff8395 Merged in bugfix/cpt-codes (pull request #812)
Bugfix/cpt codes

* formatting fix for revenue_cd

* format fix for procedure_codes

* bugfix for revenue_codes

* working version from code main

* code formatting from main and code main

* removed dubug prints

* removed local file paths

* standardize state fields

* updated test scenerios

* minor fix

* Merge branch 'main' into bugfix/cpt-codes
merging main into cpt code fix

* checks for all fields

* reused is_empty functionality

* moved normalize_to_json_list to utils

* Merge branch 'main' into bugfix/cpt-codes
merging upto date main

* minor touches

* pytest fix


Approved-by: Katon Minhas
2025-12-17 19:05:09 +00:00
VenkataKrishna Reddy Avula f31c02517a Merged in bugfix/carveout_cd (pull request #811)
bugfix/carveout_cd to main

* added age constraint for payment carveout

* Merged main into bugfix/carveout_cd


Approved-by: Katon Minhas
2025-12-17 16:10:32 +00:00
Siddhant Medar c302c1023a Merged in bugfix/qc_qa_filetype (pull request #810)
Bugfix/qc qa filetype

* WIP: support multi-filetype

* Add graceful error handling to QC/QA standalone CLI

Wrap validation pipeline in try/except to ensure no partial results
are created/uploaded if the pipeline fails mid-execution.

* Add comprehensive QC/QA unit tests, improve coverage to 95%

- Add CLI integration tests for __main__.py (6 tests)
- Add pipeline validation tests for all validation steps (20+ tests)
- Test multi-filetype I/O (CSV, XLSX input/output)
- Test graceful error handling
- Coverage: 43% → 95%

* Merge remote-tracking branch 'origin/main' into bugfix/qc_qa_filetype


Approved-by: Katon Minhas
2025-12-16 20:56:55 +00:00
Katon Minhas 9b89b0a10a Merged main into bugfix/UT-reimbursement-dates 2025-12-15 21:00:27 +00:00
Katon Minhas 33241d5808 Pipeline 2025-12-15 12:52:53 -05:00
Mayank db92b42679 reimb terms based on dates 2025-12-15 15:11:35 +00:00
Praneel Panchigar 87a2b8b4ce Merged in issuefix/hmk-1-to-n (pull request #806)
Issuefix/hmk 1 to n

* Merge branch 'main' into feature/1toN-Optimization

* Merge branch 'main' into feature/1toN-Optimization

* Update preprocessing to make the exhibit_chunk_mapping start at first page

* Merge row_funcs.py changes from feature/cross-exhibit-dynamic

* Merged in bugfix/UT-grouper-issues (pull request #796)

Bugfix/UT grouper issues

* updated valid values for AARETE_DERIVED_REIMB_METHOD

* removed example reimbursements

* prompt update

* prompt update

* Merged feature/1toN-Optimization into bugfix/nv_issue_fixes

* add service term in mb prompts

* Merged feature/1toN-Optimization into bugfix/UT-methodology-breakout

* print statement removed

* Merge branch 'bugfix/UT-methodology-breakout' of https://bitbucket.org/aarete/doczy.ai into bugfix/UT-methodology-breakout

* primary prompt update

* prompt update

* Merge remote-tracking branch 'origin/feature/1toN-Optimization' into bugfix/UT-grouper-issues

* removed temp changes

* removed temp changes

* Update reimb primary


Approved-by: Katon Minhas

* Merged in bugfix/validation_fixes (pull request #795)

bugfix/validation_fixes to feature/1toN-Optimization

* updated validation of clean claims reimbursement

* Merged feature/1toN-Optimization into bugfix/validation_fixes


Approved-by: Katon Minhas

* Re-add dynamic codes and reimb-info

* Re-structure empty reimbursement prompt

* Fix lesser of check overfiltering

* Merged in bugfix/generic-methodology-breakout (pull request #797)

Bugfix/generic methodology breakout

* fee schedule fix

* carveout+special case prompt changed

* fee schedule changes

* prompt changes and column order


Approved-by: Katon Minhas

* pytest fix

* remove prints

* Update valid_carveouts.json to include level designations in PAYMENT_CARVEOUT definition and add adultBasic mapping for Highmark

* Fix REIMB_DATES extraction to capture only relevant date range per term

- Updated REIMB_DATES prompt to extract only the date range that applies to the specific reimbursement term
- Added proximity-based extraction: looks for dates in same section/table as the term
- Prevents cross-contamination from other contract sections
- Handles 'Same as Effective Date of Agreement' case
- Returns single date range instead of multiple comma-separated ranges

* Update prompt templates

* Update tracked files and add untracked_tests to gitignore

* Merge branch 'main' into issuefix/hmk-1-to-n

* complete merge

* complete merge

* Merge branch 'main' into issuefix/hmk-1-to-n

* Remove prints

* Update gitignore

* Revert BASE_COVERED_SERVICES and REIMB_DATES prompts to original definitions

- Revert BASE_COVERED_SERVICES definition to original concise version
- Revert REIMB_DATES prompt to original general description (specific assignment logic handled by dedicated template)
- Add DEBUG comment blocks around print statements in dynamic_funcs.py and file_processing.py for easy identification and toggling

* remove prints

* Merge branch 'main' into issuefix/hmk-1-to-n


Approved-by: Katon Minhas
2025-12-12 18:36:57 +00:00
Mayank Aamseek 042a429ffb Merged in bugfix/UT-special-cases (pull request #807)
Bugfix/UT special cases

* stoploss fix

* Merged main into bugfix/UT-special-cases

* added IPPS

* added Federal PPS

* added IRF PPS

* Merged main into bugfix/UT-special-cases


Approved-by: Katon Minhas
2025-12-12 16:56:36 +00:00
Mayank 06a889781f added IRF PPS 2025-12-12 15:21:35 +00:00
Mayank 5032968f9a added Federal PPS 2025-12-12 15:07:04 +00:00
Mayank 89165c36f7 added IPPS 2025-12-12 15:00:42 +00:00
Katon Minhas 57a2907bbd Update for confusing language 2025-12-11 17:18:37 -06:00
Katon Minhas a00ffd4b98 Update mappings 2025-12-11 17:15:23 -06:00
Katon Minhas 9e7f8840af Merged main into bugfix/UT-special-cases 2025-12-11 20:55:07 +00:00
VenkataKrishna Reddy Avula c91435d2f1 Merged in bugfix/reimb_method_grouper (pull request #805)
bugfix/reimb_method_grouper to main

* modified grouper reimb_method

* Merged main into bugfix/reimb_method_grouper


Approved-by: Katon Minhas
2025-12-11 20:54:47 +00:00
Sha Brown 3bf8860ca6 Merged in bugfix/prov_info (pull request #803)
Bugfix/prov info

* Added logic to extract provider name from first page

* Added prompt to extract provider name from first page

* Added prompts and provider name extraction using Hybrid Smart Chunking

* Cleaned up code

* Added additional logic to check if the provider name on tin/npi page matches provider name extracted from page 1.

* Added fix for IS_GROUP issue in provider info json

* Remove commented out code

* unit test fix

* uni test fix

* Merge branch 'main' into bugfix/prov_info

* Change to string_utils.is_empty

* Minor refactor


Approved-by: Katon Minhas
2025-12-11 20:53:21 +00:00
Mayank 93d3fa93e2 stoploss fix 2025-12-11 15:00:28 +00:00
Karan Desai 290a1e7315 Merged in issuefix/hmk-1-to-1 (pull request #804)
Issuefix/hmk 1 to 1

* prompt fix for auto renew ind

* filename tin regex update

* amendment  number prompt fix

* effective date prompt tunning

* Merge remote-tracking branch 'origin/main' into issuefix/hmk-1-to-1


Approved-by: Katon Minhas
2025-12-10 23:26:24 +00:00
Mayank Aamseek 1de74c9322 Merged in Optimization/reimb-primary (pull request #800)
Optimization/reimb primary

* Merged in bugfix/UT-methodology-breakout (pull request #794)

Bugfix/UT methodology breakout

* updated valid values for AARETE_DERIVED_REIMB_METHOD

* removed example reimbursements

* prompt update

* prompt update

* Merged feature/1toN-Optimization into bugfix/nv_issue_fixes

* add service term in mb prompts

* Merged feature/1toN-Optimization into bugfix/UT-methodology-breakout

* print statement removed

* Merge branch 'bugfix/UT-methodology-breakout' of https://bitbucket.org/aarete/doczy.ai into bugfix/UT-methodology-breakout

* primary prompt update

* remove duplicate prompt


Approved-by: Katon Minhas

* Merge branch 'main' into feature/1toN-Optimization

* Merge branch 'main' into feature/1toN-Optimization

* Update preprocessing to make the exhibit_chunk_mapping start at first page

* Merge row_funcs.py changes from feature/cross-exhibit-dynamic

* Merged in bugfix/UT-grouper-issues (pull request #796)

Bugfix/UT grouper issues

* updated valid values for AARETE_DERIVED_REIMB_METHOD

* removed example reimbursements

* prompt update

* prompt update

* Merged feature/1toN-Optimization into bugfix/nv_issue_fixes

* add service term in mb prompts

* Merged feature/1toN-Optimization into bugfix/UT-methodology-breakout

* print statement removed

* Merge branch 'bugfix/UT-methodology-breakout' of https://bitbucket.org/aarete/doczy.ai into bugfix/UT-methodology-breakout

* primary prompt update

* prompt update

* Merge remote-tracking branch 'origin/feature/1toN-Optimization' into bugfix/UT-grouper-issues

* removed temp changes

* removed temp changes

* Update reimb primary


Approved-by: Katon Minhas

* Merged in bugfix/validation_fixes (pull request #795)

bugfix/validation_fixes to feature/1toN-Optimization

* updated validation of clean claims reimbursement

* Merged feature/1toN-Optimization into bugfix/validation_fixes


Approved-by: Katon Minhas

* Re-add dynamic codes and reimb-info

* Re-structure empty reimbursement prompt

* Fix lesser of check overfiltering

* Merged in bugfix/generic-methodology-breakout (pull request #797)

Bugfix/generic methodology breakout

* fee schedule fix

* carveout+special case prompt changed

* fee schedule changes

* prompt changes and column order


Approved-by: Katon Minhas

* fix not_to_exceed distribution

* pytest fix

* remove prints

* Merge remote-tracking branch 'origin/feature/1toN-Optimization' into Optimization/reimb-primary

* prompt update for reimb primary

* Update mapping

* Update tests

* Update test

* row order fixed

* Merge remote-tracking branch 'origin/feature/1toN-Optimization' into Optimization/reimb-primary

* chargemaster fix

* Merge branch 'main' into Optimization/reimb-primary

* Complete merge

* Final updates


Approved-by: Katon Minhas
2025-12-10 22:24:44 +00:00
Katon Minhas 0e2622f156 Merged in feature/1toN-Optimization (pull request #799)
Feature/1toN Optimization

* Update config - remove Haiku 3

* Merged in optimization/trigger-cap (pull request #792)

Optimization/trigger cap

* trigger cap breakout added

* Merge remote-tracking branch 'origin/feature/1toN-Optimization' into optimization/trigger-cap

* carveout breakout added


Approved-by: Katon Minhas

* Merged in bugfix/utah_issue_fixes (pull request #791)

Bugfix/utah issue fixes to feature/1toN-Optimization

* updated valid values for AARETE_DERIVED_REIMB_METHOD

* removed example reimbursements

* removed reciprocatory agreements section reimbs

* Merged feature/1toN-Optimization into bugfix/utah_issue_fixes

* update reimb primary


Approved-by: Katon Minhas

* Update unit tests

* Update llm_utils

* Merge branch 'feature/deprecate-haiku-3' into feature/1toN-Optimization

* fix over-filtering of lesser of

* Merged in bugfix/UT-methodology-breakout (pull request #794)

Bugfix/UT methodology breakout

* updated valid values for AARETE_DERIVED_REIMB_METHOD

* removed example reimbursements

* prompt update

* prompt update

* Merged feature/1toN-Optimization into bugfix/nv_issue_fixes

* add service term in mb prompts

* Merged feature/1toN-Optimization into bugfix/UT-methodology-breakout

* print statement removed

* Merge branch 'bugfix/UT-methodology-breakout' of https://bitbucket.org/aarete/doczy.ai into bugfix/UT-methodology-breakout

* primary prompt update

* remove duplicate prompt


Approved-by: Katon Minhas

* Merge branch 'main' into feature/1toN-Optimization

* Merge branch 'main' into feature/1toN-Optimization

* Update preprocessing to make the exhibit_chunk_mapping start at first page

* Merge row_funcs.py changes from feature/cross-exhibit-dynamic

* Merged in bugfix/UT-grouper-issues (pull request #796)

Bugfix/UT grouper issues

* updated valid values for AARETE_DERIVED_REIMB_METHOD

* removed example reimbursements

* prompt update

* prompt update

* Merged feature/1toN-Optimization into bugfix/nv_issue_fixes

* add service term in mb prompts

* Merged feature/1toN-Optimization into bugfix/UT-methodology-breakout

* print statement removed

* Merge branch 'bugfix/UT-methodology-breakout' of https://bitbucket.org/aarete/doczy.ai into bugfix/UT-methodology-breakout

* primary prompt update

* prompt update

* Merge remote-tracking branch 'origin/feature/1toN-Optimization' into bugfix/UT-grouper-issues

* removed temp changes

* removed temp changes

* Update reimb primary


Approved-by: Katon Minhas

* Merged in bugfix/validation_fixes (pull request #795)

bugfix/validation_fixes to feature/1toN-Optimization

* updated validation of clean claims reimbursement

* Merged feature/1toN-Optimization into bugfix/validation_fixes


Approved-by: Katon Minhas

* Re-add dynamic codes and reimb-info

* Re-structure empty reimbursement prompt

* Fix lesser of check overfiltering

* Merged in bugfix/generic-methodology-breakout (pull request #797)

Bugfix/generic methodology breakout

* fee schedule fix

* carveout+special case prompt changed

* fee schedule changes

* prompt changes and column order


Approved-by: Katon Minhas

* pytest fix

* remove prints

* Update mapping

* Update tests

* Update test

* Address PR review comments: add logging, fix return types, fix variable propagation, and add tests

- Add warning log in code_funcs.py try/except block for grouper code parsing failures
- Add warning log in hybrid_smart_chunking_funcs.py except block for JSON parsing failures
- Add return type annotation to lesser_of_distribution function
- Fix first_reimbursement_page variable propagation issue by returning updated value
- Add comprehensive tests for simplify_exhibit, chunk_by_exhibit, and lesser_of_distribution functions

* Merged in bugfix/prov_info_json (pull request #802)

Bugfix/prov info json to feature/1toN-Optimization

* prov_info_json added

* remove print statements


Approved-by: Katon Minhas


Approved-by: Siddhant Medar
2025-12-10 20:01:52 +00:00