Commit Graph

1666 Commits

Author SHA1 Message Date
ppanchigar a7a32b9092 fix: complete Phase 3 - replace remaining universal_json_load calls in code_funcs.py
- Line 498: Changed from universal_json_load to use _parser from FILL_BILL_TYPE tuple
- Line 856: Updated GROUPER_BREAKOUT call to unpack tuple and use grouper_parser
- Removed unused GROUPER_QUESTIONS variable (fields now in INSTRUCTION function for caching)
- All universal_json_load calls in code_funcs.py have been replaced
- Phase 3 is now 100% complete
2026-02-03 11:01:47 -06:00
ppanchigar 2e307347fd refactor: update investment_prompts.json to use JSON format instead of pipes
- Updated EFFECTIVE_DT field: Replaced all pipe format examples (|date|) with JSON dictionary format
  - Changed examples from 'return |3-1  , , 03|' to 'return "3-1  , , 03"'
  - Updated final answer format from 'ENCLOSED in |pipes|' to JSON dict: {"EFFECTIVE_DT": "date"}
- Updated PROVIDER_NAME field: Replaced pipe-separated format with JSON list format
  - Changed from 'separated by |' to JSON list: ["Provider A", "Provider B"]
  - Updated to return JSON dict: {"PROVIDER_NAME": [...]} or {"PROVIDER_NAME": "single"}
- All pipe references removed from investment_prompts.json
- Updated PRD to document this change in Phase 2 checklist
- JSON file validated and syntax confirmed correct
2026-02-03 10:53:58 -06:00
ppanchigar 9e3fe81fe5 docs: update PRD with actual implementation progress
- Updated progress table: Phase 3 is 95% complete, Phase 4 is 60% complete
- Marked all prompt_calls.py files as complete (saas, clover, bcbs_promise)
- Marked tin_npi_funcs.py, hybrid_smart_chunking_funcs.py, postprocessing_funcs.py, crosswalk_utils.py, dynamic_funcs.py as complete
- Noted 2 remaining universal_json_load calls in code_funcs.py (lines 498, 856)
- Documented aarete_derived.py dual-format support (intentional backward compatibility)
- Added comprehensive implementation status summary section
- Updated Phase 3 and Phase 4 checklists with actual completion status
- Added statistics: 26 files modified, ~350 lines net reduction, 20+ commits
2026-02-03 10:32:58 -06:00
Venkat df103579b7 updated postprocessing funcs 2026-02-03 15:06:41 +00:00
Venkat 0d9f9314e9 updated tin npi funcs and page funcs 2026-02-03 14:55:05 +00:00
Venkat 8399dbdf1f updated crosswalk reverse mapping 2026-02-03 14:16:56 +00:00
Venkat 18c094568b fixed clean provider info 2026-02-03 14:01:17 +00:00
Venkat 2aa68f75b9 black format 2026-02-03 13:41:09 +00:00
Katon Minhas e8e8f1ba5a Strip out dynamic postprocessing 2026-02-03 01:38:49 -05:00
Katon Minhas 03fda6013b Resolve split reimb dates 2026-02-03 01:24:58 -05:00
Katon Minhas ef70ddf3be Resolve Lesser of Check issue 2026-02-03 01:10:41 -05:00
Katon Minhas 4701f7039a Fix carveout code error 2026-02-03 00:34:53 -05:00
Katon Minhas b5b19d81a0 Update reimbursement cleaning parser 2026-02-03 00:21:10 -05:00
Katon Minhas bb96edb7c5 Clean crosswalk function 2026-02-03 00:08:36 -05:00
Katon Minhas 4af0e26990 Update AARETE_DERIVED_PRODUCT processing 2026-02-03 00:07:12 -05:00
Katon Minhas cdce35739b Update fill_na_mapping 2026-02-02 23:44:27 -05:00
Katon Minhas 62605981c1 resolve hsc issue 2026-02-02 22:23:23 -05:00
Katon Minhas 9b30c5f282 Resolve circular import of prompt_hsc_single_field 2026-02-02 21:57:22 -05:00
Katon Minhas bb440acd7e Correct reference 2026-02-02 21:54:50 -05:00
Katon Minhas 6c3f3f6f96 Update code_funcs.py 2026-02-02 21:47:30 -05:00
Katon Minhas 309fa49ac6 Update codes 2026-02-02 21:36:25 -05:00
Katon Minhas e538af4076 UPdate logging levels 2026-02-02 21:28:32 -05:00
Katon Minhas 28afc7fedf Minor refactor 2026-02-02 21:24:20 -05:00
Katon Minhas 3e9d7b08b7 Remove excess print 2026-02-02 20:53:45 -05:00
Katon Minhas dba611469d Update prompt_calls 2026-02-02 20:53:23 -05:00
ppanchigar cbff139ce9 docs: update PRD with tuple-returning architecture and progress
- Updated section 4.1.2 with actual implementation details
- All 35 prompt templates now return (prompt, parser) tuples
- Added implementation progress table showing Phase 1 & 2 complete
- Documented benefits of tuple-returning approach
- Listed all updated functions and their parser types
- Updated work items checklist to reflect completed phases
- Added commit references: 98554afc (architecture), 5d1024e (templates)
- Marked Phase 3 as next step: update prompt_calls.py files
2026-02-02 17:16:56 -06:00
ppanchigar 98554afc05 refactor: update all prompt templates to return (prompt, parser) tuples
- Updated 24 prompt template functions to return (prompt_string, parser_function) tuples
- Added type hints: Tuple[str, Callable[[str], dict/list]]
- Changed return pattern from 'return f"""..."""' to 'prompt = f"""..."""' followed by 'return (prompt, parser)'
- Added parser functions: _json_dict_parser and _json_list_parser
- Updated docstrings to include Returns section explaining the tuple structure
- Functions updated include: LESSER_OF_CHECK, EXHIBIT_TITLE_MATCH, OUTLIER_BREAKOUT, CODE_EXPLICIT, CODE_CATEGORY, CODE_IMPLICIT_SPECIAL, CODE_IMPLICIT, CODE_LAST_CHECK, FILL_BILL_TYPE, ONE_TO_ONE_SINGLE_FIELD_TEMPLATE, TIN_NPI_TEMPLATE, CHECK_PROVIDER_NAME_MATCH_PROMPT, EXTRACT_AMENDMENT_NUM_FROM_FILENAME, EXHIBIT_HEADER, EXHIBIT_LINKAGE, DATE_FIX_PROMPT, EFFECTIVE_DATE_FIX_PROMPT, SPLIT_REIMB_DATES, DERIVED_TERM_DATE_PROMPT, and all breakout functions
- All changes verified with linter and Python compilation
- No syntax errors or linter issues
2026-02-02 17:12:10 -06:00
ppanchigar f633922381 feat: Add JSON parsers infrastructure (Phase 1)
- Create json_utils.py with parse_json_dict() and parse_json_list() functions
- Add comprehensive unit tests (49 tests, all passing)
- Add deprecation warnings to string_utils.py for pipe-delimited parsing
- Follows PRD Phase 1: Parser Infrastructure

This is the first step in replacing pipe-delimited LLM output format with
structured JSON format as per PRD_STANDARDIZE_LIST_FORMATS.md
2026-02-02 16:44:29 -06:00
ppanchigar 5d1024e9dc prompt changes 2026-02-02 16:25:45 -06:00
Katon Minhas 791558808a Merged main into DEV 2026-02-02 20:52:22 +00:00
Sha Brown 6efb281d4b Merged in bugfix/release_dockerfile (pull request #862)
Updated dockerfile to use uv instead of poetry

* Updated dockerfile to use uv instead of poetry


Approved-by: Katon Minhas
2026-02-02 20:48:22 +00:00
Katon Minhas b87766c1be Merge branch 'main' into DEV 2026-02-02 13:29:17 -05:00
Katon Minhas 02d10e711e Merged in hotfix/revert-standardize-list-formats (pull request #861)
Revert "Merged in feature/standardize-list-formats (pull request #844)"

* Revert "Merged in feature/standardize-list-formats (pull request #844)"

This reverts commit faf707265d.
2026-02-02 18:27:37 +00:00
VenkataKrishna Reddy Avula 0efb0e5369 Merged in feature/DAIP2-1529-capture-letters-in-amendment-num (pull request #860)
Feature/DAIP2-1529 capture letters in amendment num

* updated CONTRACT_AMENDMENT_NUM Prompt

* updated EXTRACT_AMENDMENT_NUM_FROM_FILENAME_INSTRUCTION

* updated prompt

* commented amendment number fields from numeric fields

* Merged main into feature/DAIP2-1529-capture-letters-in-amendment-num


Approved-by: Katon Minhas
2026-02-02 14:07:46 +00:00
VenkataKrishna Reddy Avula faf707265d Merged in feature/standardize-list-formats (pull request #844)
Feature/standardize list formats

* updated unit test for code funcs

* pipeline fixes

* Merge branch 'main' into feature/standardize-list-formats

* black format

* removed duplicates

* Merge remote-tracking branch 'origin/main' into feature/standardize-list-formats

* updated prov other tin npi names to list

* prompt calls code made common for cleints and saas

* final format fixes

* removed pipes

* crosswalk fixes

* Merged main into feature/standardize-list-formats

* dubug dynamic fields

* dynamic format fixes

* dyanmic fields fixes

* removed pipes from the whole code

* fixed provider TIN NPI Name format issues

* bill code issue fix

* pipeline error fixes

* Merge branch 'feature/standardize-list-formats' of https://bitbucket.org/aarete/doczy.ai into feature/standardize-list-formats

* Merged main into feature/standardize-list-formats

* Black format

* pipeline errors fixed

* pipeline fixes page funcs and tinnpi funcs

* qa_qc_utils fix


Approved-by: Katon Minhas
2026-02-02 13:59:44 +00:00
Sha Brown 1bc9e6aaf3 Merged in bugfix/generic_dynamic_jan26 (pull request #859)
Bugfix/generic dynamic jan26

* Refactor: Extract dynamic primary metrics logic to separate module

- Created src/testbed/dynamic_primary_metrics.py with all dynamic primary field analysis logic
- Moved tally-based analysis functions to new module for better modularity
- Updated testbed_utils.py to import and use functions from dynamic_primary_metrics
- Simplified testbed_metrics_dynamic_only.py to use new module
- Removed unused analyze_dynamic_primary_fields function (400+ lines)
- Added field filtering in match_rows to handle missing columns gracefully
- Minimal changes to testbed_utils.py (~100 lines vs 845 before)

* feat: Add debug print blocks and prompt changes for dynamic primary fields in 1:1 processing

This commit adds prompt changes for when we pass dynamic primary to 1:1  and comprehensive debug logging for dynamic primary fields when they are escalated to 1:1 processing via Hybrid Smart Chunking (HSC) or Full Context methods.

Changes:
- Added debug print blocks in hybrid_smart_chunking_funcs.py to log:
  * Retrieval question, context chunks, and final prompt for HSC processing
  * Raw LLM output (reasoning + answer) for dynamic primary fields
- Added debug print blocks in prompt_calls.py to log:
  * Contract context, final prompt for Full Context processing
  * Raw LLM output (reasoning + answer) for dynamic primary fields
- Added FULL_CONTEXT_DYNAMIC_PRIMARY_INSTRUCTION() to prompt_templates.py:
  * Provides specific guidance for dynamic primary fields in full context
  * Emphasizes extracting values only if they refer to entire contract
  * Includes pipe-delimited formatting instructions
- Updated dynamic_fun…
* Ran black, for formatting

* Refine dynamic primary field prompts and add Duals auto-detection

- Enhanced DYNAMIC_ASSIGNMENT_INSTRUCTION with structural boundary rules
- Added exhibit header and subsection context hierarchy for LOB assignment
- Implemented Duals auto-detection in dynamic_primary discovery (Medicare+Medicaid -> Duals)
- Added Duals value formatting instruction to prevent oversimplification
- Commented out DUAL_LOB_CHECK for performance testing
- Removed verbose debug print blocks from HSC and Full Context processing
- Added focused debug print for dynamic assignment raw LLM output

* Remove debug print blocks from pipeline files

- Removed all debug print blocks from file_processing.py (8 blocks)
- Removed all debug print blocks from dynamic_funcs.py (8 blocks)
- Removed debug print block from prompt_calls.py (dynamic assignment)
- DUAL_LOB_CHECK remains commented as requested
- Total: 188 lines of debug code removed

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

* Ran black for CI

* Remove update_lob_for_duals

* Merge branch 'DEV' into bugfix/generic_dynamic_jan26


Approved-by: Katon Minhas
2026-01-30 23:43:48 +00:00
Sha Brown 89515ca5cc Merged in bugfix/row_count (pull request #858)
Bugfix/row count

* Updated lesser of statements filter; Updated lesser of prompt related to GLOBAL and STANDALONE

* Updated validate reimbursement prompt

* Update lesser of check prompt related to GLOBAL assignment

* Restructured VALIDATE_REIMBURSEMENTS_PROMPT

* Updated reimbursement primary; validate reimbursement prompt

* Updated reimb primary prompt and validate reimb prompt

* Code cleaned up. Updated unittest cases

* Updated validate reimbursement prompt

* Added logging

* Update on validate reimbursement prompt; Code clean up

* Fix Black version conflict in dependencies

* Add Black back to dependencies

* Apply black formatting and update uv.lock

* Resolve conflict

* Merge branch 'DEV' into bugfix/row_count


Approved-by: Katon Minhas
2026-01-30 23:28:48 +00:00
Faizan Mohiuddin 90bed0d5f6 Merged in feature/update-caching (pull request #856)
Feature/update caching

* 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

* Apply black formatting to 11 files

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

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

* Fix import paths in testbed files

* Merge main into feature/update-caching

* Add SPLIT_REIMB_DATES_INSTRUCTION for prompt caching

* Merged main into feature/update-caching

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

* Merge branch 'feature/update-caching' of https://bitbucket.org/aarete/doczy.ai into feature/update-caching

* Add CODE_* instruction functions for prompt caching

* Merged main into feature/update-caching

* Merged main into feature/update-caching

* Maximize prompt caching by moving static content to instructions

- Refactored 12+ prompt functions to move static rules/examples to _INSTRUCTION()
- VALIDATE_REIMBURSEMENTS: Moved 45+ lines of validation rules to instruction
- DATE_FIX: Moved conversion rules and examples to instruction
- EXHIBIT_LEVEL, EXHIBIT_TITLE_MATCH, EXHIBIT_HEADER, EXHIBIT_LINKAGE: Moved rules
- FEE_SCHEDULE_BREAKOUT, GROUPER_BREAKOUT: Moved extraction rules
- CHECK_PROVIDER_NAME_MATCH: Moved matching rules to instruction
- LOB_RELATIONSHIP: Consolidated split instructions
- DERIVED_TERM_DATE: Moved calculation logic to instruction
- DYNAMIC_PRIMARY: Created separate HEADER and TEXT instructions
- Created new REIMB_DATES_ASSIGNMENT_INSTRUCTION with all date rules
- Updated get_cacheable_instructions() with new instruction functions
- Updated all callers in saas, clover, bcbs_promise pipelines

This enables ~90% cost savings via Claude API prompt caching by ensuring
static instruction text is cached and only dynamic content varies.

* Remove Dynamic Primary Header

* Standardize prompt caching across all LLM prompts for ~90% cost savings

Move static content to _INSTRUCTION() functions for caching:
- METHODOLOGY_BREAKOUT: 8 field definitions with resolved valid_values
- FEE_SCHEDULE_BREAKOUT: 3 field definitions
- GROUPER_BREAKOUT: 11 field definitions
- OUTLIER_BREAKOUT: 8 field definitions
- CODE_EXPLICIT: 8 field definitions
- EXHIBIT_HEADER: static header markers list
- CARVEOUT_CHECK: carveout and special case definitions
- SPECIAL_CASE_ASSIGNMENT: task rules and output format

Update callers to use cache=True, instruction, and usage_label params.

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

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

* Apply black formatting to prompt_templates.py

* Update unit tests for prompt caching changes

- Fix function signatures in tests (METHODOLOGY_BREAKOUT, FEE_SCHEDULE_BREAKOUT, GROUPER_BREAKOUT, CODE_EXPLICIT)
- Add tests for CARVEOUT_CHECK and EXHIBIT_HEADER prompts
- Add TestInstructionFieldContent class to verify instruction functions contain field definitions
- Add tests for CARVEOUT_CHECK_INSTRUCTION and CODE_EXPLICIT_INSTRUCTION

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

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

* Refactor instructions to load fields from investment_prompts.json and Constants

Address PR review feedback:
- Add _get_constants() helper for lazy Constants instantiation
- Add _get_fields_text() helper to load fields from investment_prompts.json
- METHODOLOGY_BREAKOUT_INSTRUCTION: Load fields via FieldSet
- FEE_SCHEDULE_BREAKOUT_INSTRUCTION: Load fields via FieldSet
- GROUPER_BREAKOUT_INSTRUCTION: Load fields via FieldSet
- OUTLIER_BREAKOUT_INSTRUCTION: Load fields via FieldSet
- EXHIBIT_HEADER_INSTRUCTION: Load markers from Constants.EXHIBIT_HEADER_MARKERS
- CARVEOUT_CHECK_INSTRUCTION: Load carveouts from Constants.VALID_CARVEOUTS,
  special cases from investment_prompts.json
- CODE_EXPLICIT_INSTRUCTION: Keep hardcoded (no code_explicit field_type in JSON)

Update tests to match actual field names from investment_prompts.json.

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

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

* Merge main into feature/update-caching

* Remove deprecated dynamic_primary_header

* Update CODE_EXPLICIT_INSTRUCTION to load fields from investment_prompts.json

Use field_type=code_primary_breakout to load code fields dynamically.

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

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

* Merged main into feature/update-caching

* Merge main into feature/update-caching

* Merge branch 'feature/update-caching' of https://bitbucket.org/aarete/doczy.ai into feature/update-caching


Approved-by: Katon Minhas
2026-01-30 23:23:37 +00:00
VenkataKrishna Reddy Avula ff8ec57ed0 Merged in bugfix/daip2-1440-contract-amendment-num (pull request #849)
Bugfix/daip2 1440 contract amendment num to main

* update full context additional instruction for amendment num

* uv formatting done

* remove print statements

* Merged main into bugfix/daip2-1440-contract-amendment-num

* added filename amendment num

* updated pipelines and removed print statements

* Merged main into bugfix/daip2-1440-contract-amendment-num

* code moved to hybrid smart chunking

* Merged main into bugfix/daip2-1440-contract-amendment-num

* Merged main into bugfix/daip2-1440-contract-amendment-num

* removed categorical values from amendment number


Approved-by: Katon Minhas
2026-01-30 14:33:58 +00:00
Siddhant Medar a5c743f37f Merged in feature/chc-client (pull request #857)
Feature/chc client

* Add CHC client pipeline with Claims Coding/Editing Determinations extraction

- Add CHC client to pipelines with regex-based extraction
- Create extraction/claims_coding_funcs.py for section extraction
- Add chc_prompts.json with non_prompt field type
- Add CHC_PROMPTS_PATH to config
- Add tests for extraction function (11 test cases)

* Add black[jupyter] for code formatting

* Format testing notebook with black

* Remove unused prompt field from chc_prompts.json

* Merged main into feature/chc-client


Approved-by: Katon Minhas
2026-01-29 21:36:08 +00:00
Mayank Aamseek 4d6e08577c Merged in bugfix/provider-name-and-tin (pull request #855)
extract correct provider name to match all TINs

* extract correct provider name to match all TINs

* Merged main into bugfix/provider-name-and-tin


Approved-by: Katon Minhas
2026-01-29 16:25:05 +00:00
Siddhant Medar f412754167 Merged in feature/generic-parent-child (pull request #852)
Feature/generic parent child

* Refactor parent_child module with generic hierarchy lineage

- Add generic_hierarchy_lineage.py for core parent-child mapping
- Add generic_hierarchy_lineage_qc.py for QC validation engine
- Add bcbs_generic_hierarchy_lineage.py for BCBS-specific processing
- Add column_mapper.py for automatic column detection
- Rename parent_child_preprocessing.py to generic_hierarchy_lineage_preprocessing.py
- Remove old parent_child_mapping.py (replaced by generic_hierarchy_lineage.py)
- Fix import paths from src.generic_hierarchy_lineage to src.parent_child
- Replace hardcoded BCBS xwalk path with configurable parameter
- Remove global warning suppression

* Fix code review issues in parent_child module

- Fix import paths from src.generic_hierarchy_lineage to src.parent_child
- Replace hardcoded BCBS crosswalk path with configurable xwalk_path param
- Remove global warnings.filterwarnings('ignore') suppressions
- Change bare except clauses to except Exception with logging
- Add explicit client= CLI argument with backward compatible fallback
- Convert print statements to logging in bcbs_generic_hierarchy_lineage.py

* Add tests for parent_child module and fix JSON path resolution

- Add 55 unit tests covering grouping keys, parent identification,
  child ranking, and QC utilities
- Use pathlib to resolve JSON config paths relative to module location,
  allowing tests to run from any directory

* WIP: Refactor parent_child module structure

* Extract constants to centralized location for parent_child module

- Create src/constants/parent_child/ with generic.py and bcbs.py
- Update pipeline.py to use centralized constants (ASSIGNMENT_NO_PARENT, tier values, grouping key config)
- Update bcbsnc/mapping.py to use BCBS-specific constants
- Update imports in __main__.py and bcbsnc/__init__.py
- Pass client parameter from runner.py and saas/main.py

* Fix code formatting in parent_child module

* Merge remote-tracking branch 'origin/main' into feature/generic-parent-child

* Fix client detection and output path in parent_child module

* Fix typo in numeric_mappings.json filename and update logging

* Add type hints to parent_child module

* Merged main into feature/generic-parent-child


Approved-by: Katon Minhas
2026-01-28 20:18:11 +00:00
Mayank Aamseek 9e2de58ee4 Merged in bugfix/add-greater_of-in-breakout (pull request #853)
added greater_of_ind in methodology breakout

* added greater_of_ind in methodology breakout

* Merged main into bugfix/add-greater_of-in-breakout


Approved-by: Katon Minhas
2026-01-28 16:40:26 +00:00
Katon Minhas ff01deddf0 Merged in feature/remove-bcbs-main (pull request #854)
Remove main

* Remove main


Approved-by: Siddhant Medar
2026-01-28 15:36:02 +00:00
Katon Minhas 55533d5a24 Merged in feature/remove-global-lesser-process (pull request #851)
Feature/remove global lesser process

* Deprecate GLOBAL_LESSER_OF

* remove deprecated

* Remove deprecated

* Merged main into feature/remove-global-lesser-process

* Black formatter

* remove deprecated

* Remove check redundant lesser

* Remove prompt_smart_chunked

* Black format

* Update logging


Approved-by: Sha Brown
2026-01-27 18:37:38 +00:00
Mayank Aamseek 929ff4abf8 Merged in bugfix/handwritten-npi-list-updated (pull request #850)
fix ocr issue in list of NPIs

* fix ocr issue in list od NPIs

* pipeline error fixed


Approved-by: Katon Minhas
2026-01-27 17:28:46 +00:00
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