Feature/claude4 duplicate and missing rows
* Enhance crosswalk functionality with flatten_to_strings helper and improve value handling in apply_crosswalk
* Improve apply_crosswalk function to return original value as fallback when no mapping is found
* Enhance apply_crosswalk function to handle empty values and improve defensive programming tests
* Enhance reimbursement method prompt to include charge master limitations and improve mapping rules
* Merge remote-tracking branch 'origin/main' into feature/claude4-duplicate-and-missing-rows
* Refine CHECK_REDUNDANT_LESSER prompt for clarity and detail in evaluating redundancy of exhibit constraints
* Enable logging of LLM response for redundancy check in is_exhibit_lesser_of_redundant function
* Merge remote-tracking branch 'origin/main' into feature/claude4-duplicate-and-missing-rows
* rework prompt for exhibit-wide lesser of
* Refine reimbursement methodology guidelines by clarifying invalid entries and examples for risk-sharing
* Enhance exhibit linking logic to treat pages with substantial tables as separate exhibits and update function signature to include text_dict.
Approved-by: Katon Minhas
Sonnet 4 and model aliasing
* Add EXHIBIT_HEADER_MARKERS for improved document header recognition in table handling
* Refactor EXHIBIT_HEADER_MARKERS definition for improved clarity and organization
* remove unused page span tracking code; add unit tests for new functionality
* remove debugging logs from combine_continuous_tables function
* Refactor logging setup and update test file configuration in investment field testing notebook
* Merge remote-tracking branch 'origin/main' into feature/further-phase-1-and-2-fixes
* Merge remote-tracking branch 'origin/main' into feature/further-phase-1-and-2-fixes
* Refactor model ID handling and add support for model aliases in llm_utils
* Update model IDs to use alias in LLM invocation functions in one_to_n_funcs
* change pre-and-post-processing to new model alias method
* Update model ID references to use 'sonnet_latest' in LLM invocation functions
* Update LLM invocation functions to use 'sonnet_latest' model ID
* Update LLM invocation functions to use 'sonnet_latest' and 'haiku_latest' model IDs
* update invoke_claude function docstring
* Fix caller frame to address mypy error
Approved-by: Katon Minhas
Bugfix/dynamic primary issues
* Merge branch 'main' into bugfix/dynamic-primary-issues
* Merged main into bugfix/dynamic-primary-issues
* Crosswalk updates
* Merge branch 'main' into bugfix/dynamic-primary-issues
* dont include section information in Exhibit Header
* Add Molina Health Benefit Exchange to Product-LOB mapping
* PPO-POS separate mapping
* Prevent inference of LOB from Program or Product
* Add SoonerSelect
* Update mapping rules to allow for direct values
* update prompts
* Prep for run
* Merged main into bugfix/dynamic-primary-issues
* Update unit tests
* Update Moda Product mappings
* Remove Care1st as Product for Centene
* testing
* Mapping update
* Mapping updates
* prep for merge
* Merged main into bugfix/dynamic-primary-issues
* Merged main into bugfix/dynamic-primary-issues
* docstrings and formatting
* Get group provider for > 1
* Merged main into bugfix/dynamic-primary-issues
Approved-by: Alex Galarce
Feature/exhibit linking
* Initialize new exhibit header prompt
* Save
* Merge branch 'main' into feature/exhibit-linking
* update prompt
* cleanup return type
* remove test
* Test fixes
* Fix test
* Add tests
* Merge branch 'main' into feature/exhibit-linking
* Merge branch 'main' into feature/exhibit-linking
* Remove test notebooks
* Delete test notebook
* Save
* Merge branch 'main' into feature/exhibit-linking
* try except for exhbit page finding
* Prep for merge
* update test
* Remove test
* Merge branch 'main' into feature/exhibit-linking
* update unit test
* Fix unit test
* replace try except
* Update page sort
* Add docstring
Approved-by: Alex Galarce
Feature/further reimb primary improvements
* Refactor identify_reimbursement_exhibits to return both EXPLICIT and IMPLICIT values
* Moving from # Debugging lines to `logger`
* Enhance "lesser of" and exception language instructions in reimbursement terms
* clarify unclear print/logging statements
* Replace debugging print statements with logging in get_reimbursement_primary function
* Add logging for page processing in run_one_to_n_prompts function
Approved-by: Katon Minhas
Don't consider table-subpages each individually for reimbursement exhibit identification
* Refine EXHIBIT_CHECK prompt
* test: rework `get_exhibit_pages` for table subpages
* Fix indentation
* Experimental table de-chunking
* Increase max_tokens for Claude model in exhibit page processing
* fix get_pages_to_process docstring
* refactor: improved docstring for get_exhibit_pages
* move `get_pages_to_process` to `preprocess.py`
* test: add unit tests for get_pages_to_process function
* Comment out debugging lines
* Changed prompt that was breading universal_json_load parsing
* fix: handle "no results" case in get_reimbursement_primary function
* fixed docstring
Approved-by: Katon Minhas
DRAFT: Bugfix/effective date fix
* Merged in bugfix/extra-fields (pull request #500)
Do not run Exhibit level prompt if there are no exhibit level fields
* Do not run Exhibit level prompt if there are no exhibit level fields
* Update dynamic test
* Remove test from one-to-n test module
* Update test
* Fix unit test
Approved-by: Alex Galarce
* Merged in bugfix/tin-npi-prompt-fixes (pull request #499)
Bugfix/tin npi prompt fixes
* Change delimiter for other provider information from comma to pipe
* filter out invalid providers
* Update extraction and formatting instructions for provider entities in TIN_NPI_TEMPLATE
* Merged main into bugfix/tin-npi-small-bugfixes
* Refactor deduplication logic to use string_utils for checking empty provider fields
* Merge branch 'bugfix/tin-npi-small-bugfixes' of https://bitbucket.org/aarete/doczy.ai into bugfix/tin-npi-small-bugfixes
* Update deduplication logic to exclude providers with 'UNKNOWN' TIN, NPI, or NAME
* Merge remote-tracking branch 'origin/main' into bugfix/tin-npi-small-bugfixes
* Fix deduplication logic to not drop subsequent names
* Fix formatting of provider names in deduplication logic
* add payer name filtering
* reorder execution order to allow to find payer_name first
* Add handling for previously unfound group providers in identify_group_provider function
* Merge remote-trackin…
* Merged in feature/update-testbed-script (pull request #501)
Feature/update testbed script
* Update preprocessing
* Update preprocessing
* remove quit
* Update date for filename
* Merged main into feature/update-testbed-script
Approved-by: Alex Galarce
* Merged in bugfix/smart-chunks (pull request #503)
missing of text in chunks fixed
* missing of text in chunks fixed
Approved-by: Katon Minhas
* Merged in feature/rework-reimb-tin-npi (pull request #502)
Feature/rework reimb tin npi
* use LLM for reimb_[tin/npi/name]
* Merge remote-tracking branch 'origin/main' into feature/rework-reimb-tin-npi
* Merge remote-tracking branch 'origin/main' into feature/rework-reimb-tin-npi
* deduplicate tin/name/npi before adding to prompt
* Pull out prompt and llm_response in methodology_breakout_single_row for easier debugging
* Refactor reimbursement_tin_npi to handle multiple providers and update valid TIN, NPI, and NAME fields accordingly
* Reorder REIMB_PROV_NAME field in investment_prompts.json
* Update REIMB_PROV_NAME prompt to specify valid values for provider names
* Remove valid_values constraint from prov_name to raise accuracy
* Remove debugging print statements from reimbursement_tin_npi and related functions
* Remove debugging print statements from run_provider_info_fields function
* Merge remote-tracking branch 'origin/main' into feature/rework-reimb-tin-npi
* Remove debugging print statem…
* Merged in feature/preformat-single-quotes-input (pull request #506)
Replace double quotes with single quotes in context strings for parsability
* Replace double quotes with single quotes in context strings for parsability
* Merged main into feature/preformat-single-quotes-input
Approved-by: Katon Minhas
* updated sig pages fnxn
* Merge branch 'main' into bugfix/effective_date_fix
* poetry add pymupdf
* created vision funcs
* Merged main into bugfix/effective_date_fix
* fixed pipeline issue
* updated string_utils_test
* updated test values
* updated extract signature page fxn
* updated test values
* updated test values
* Merged main into bugfix/effective_date_fix
* Prompt template in all-caps
* remove debugging prints
* Merged main into bugfix/effective_date_fix
* Change vision to False by default
* Change vision to False by default
* fix tests
* fix tests
Approved-by: Katon Minhas
Bugfix/exhibit header detection
* set up testing
* Increased context length, changed prompt to investment_prompts from preprocessing_prompts
* extracting the header
* minor changes
* Merged main into bugfix/exhibit-header-detection
* cleanup prints and tests
Approved-by: Alex Galarce
Field/initialize patient age
* Update split_text so that it works on single-page contracts (discovered when testing)
* Add PATIENT_AGE_RANGE intermediate column
* Remove PATIENT_AGE_RANGE in postprocessing
* Dont convert columns to int type
* Add unit tests
* Remove test
* Update unit test
* Update unit test
* Update unit test
* Update unit test
Approved-by: Alex Galarce
Hotfix/file errors
* Set up test file
* Fix regex pattern in json.loads
* bug fix No valid JSON object found in the input string
* bug fixes
* moved try statement to parse fn
* invalid literal for int() with base 10 error fixed
* remove test
* remove excess print statements
* Raise error
* Remove todo
* Remove print statement
Approved-by: Katon Minhas
feature/dynamic and generalized branch
* included txt files for nltk_data
* move nltk_data to src
* Fix last upload count
* Last upload count bugfix
* Fixed B processing
* Remove client-specific postprocessing
* split consolidate_output
* Run by file
* Fix output
* Reconfigure smart_chunk fields
* Add Full Context
* Fix merge conflicts
* Regex, Smart-Chunked, and Full working - not adding smart-chunked-->full when necessary
* Modernized run_full_context_fields()
* Switched set to list in field_context
* Move fields from smart_chunked to full_context as part of 'field_context' function
* Working version with placeholders
* Update poetry and pyproject
* Update s3 output
* Remove deprecated unit test
* Updated error messages
* Updated smart chunk ac name to one to one
* Update dependencies - end-to-end test for write s3 functional
* Add basic multithreading
* Send individual output to s3/local
Approved-by: Alex Galarce
Feature/integrate standard and complex
* last edits to merge_tables_draft_v2 before moving to table_funcs
* migrate to table_utils.py
* fix typehint that caused mypy error
* fix mypy errors
* black and isort
* fix error with multi-table pages
* update poetry.lock
* add tests, fix bug when table start marker or table end marker is missing
* added more tests
* tests for get_str_dictionaries_from_text()
* fix edge case in get_str_dictionaries_from_text
* fix mypy error
* more tests
* add tests, add handling for invalid dictionaries
* add tests
* add tests for insert_column_headers()
* update requirements
* add new simple/complex logic to preprocess.py
* remove files used solely for testing
* split pages into sub-pages by tables
* add table split on end marker. Also add tests
* add docstrings, change control flow
* remove unused tests, add TODO for new tests
* get in prompt changes and intermediate decisions
* TODO for future enhancement for get_exhibit_pages
Approved-by: Katon Minhas
Task/unit tests investment and client
* move io_utils.py
* add __init__.py
* refactor: move string_funcs and update import paths to use utils namespace
* rename string_funcs to string_utils
* move and rename table_utils.py
* refactor: rename claude_funcs to llm_utils in multiple files
* update unit tests
* added unit tests for src/string_utils.py
* added unit tests for src/table_utils.py
* added unit tests for src/llm_utils.py
* added unit tests for src/io_utils.py
* Merge branch 'main' into task/unit-tests-investment-and-client; TODO: fix unit tests
* Unit tests to fix
* fix unit tests
* fix invalid references
* add unit tests for preprocessing_funcs.py
* move pytest-mock to test dependencies
* Merge remote-tracking branch 'origin/main' into task/unit-tests-investment-and-client
* add tests/string_utils_test.py
* removed filename parameters for a few functions
* save postprocessing_funcs_test midway
* save postprocessing_funcs_test
* postprocessing_funcs unit tests complete
* Merge branch 'main' into task/unit-tests-investment-and-client
Approved-by: Katon Minhas
feature/simplify b field chunking
* Add chunk_by_exhibit function and unit tests
* Refactor preprocess
* Updated to run BU primary on entire Exhibit
* Makes BU secondary compatible with exhibit chunk mapping
* Added unit tests for get_exhibit_chunk
* Trimmed TD funcs
* Downstream changes to run_top_down
* Removed conditional funcs
* Merged main into feature/simplify-b-field-chunking
* removed conditional funcs import
* Merged main into feature/simplify-b-field-chunking
* Fixed run_bottom_up_primary arguments
* Fixed TD primary input
* Fixed grouped keyword mappings
* Remove filename tracking until postprocessing
* Removed postprocessing for client columns
* Removed col-based postprocessing
* Merged main into feature/simplify-b-field-chunking
* Fixed NoneType
* Add docstrings
* Updated unit tests for removal of 'Filename'
* Updated comments
Approved-by: Alex Galarce
Refactor/split investment and client
* refactor: clean up tests
* Renamed tests/qcqa to tests/qa_qc for consistency
* comment out faulty test - see docstring note at top
* split to client/investment
* add __init__.py to investment and client to avoid mypy confusion
* fix imports
* update imports for consistency across investment module
* move back to one config
* try changing import to relative
* add init.py to src
* try relative import
* try one more sys.path.append
* fix path for client main
* fix imports in file_processing
* make prompts common
* move keywords out to `src`
* move smart_chunking_funcs to `src`
* fix mypy error
* start moving to explicit imports
* remove old keywords and fix imports for keywords and prompts
* change all imports to full paths
* fix unit tests
* add readme for new way of running things
* isort after all that import work
* remove unused sys.path.append from some tests
Approved-by: Katon Minhas
Refactor/daip2-9 code refactor
* add missing import
* refactor ac_smart_chunking.py
* update tests
* removed old and unused imports
* removed outdated import
* forgot to import re
* refactor bottom up funcs
* remove unused imports from file_processing.py
* refactor dict_operations.py
* remove unused import from conditional_funcs.py
* replace top_down_funcs with one_to_n_funcs and remove top_down_funcs.py
* remove duplicate import from one_to_n_funcs.py
* refactor all utils.py imports
* refactor error handling by removing last code in utils and integrating InvalidDateException into postprocessing_funcs
* refactor import in claude_funcs.py to use string_funcs directly and (hopefully) resolve circular import
* refactor regex_funcs.py to use postprocessing_funcs for add_hyphen_if_needed calls
* refactor hotfix_helper_funcs.py to use postprocessing_funcs for add_hyphen_if_needed calls
* refactor postprocess.py to remove unused imports
* add numpy import to string_funcs
* fix tests after utils refactor
* move adhoc from tests to scripts
* remove unused imports
* remove scripts from mypy checking
* isort
* Merged main into refactor/daip-2-9-code-refactor
Approved-by: Katon Minhas
New Prompt Method (starting with contract effective date)
* add todos for Siddhant
* moved effective date prompts to prompts.py and added docstring and type hints
* moved effective date prompts to prompts.py and added docstring and type hints
* fixed conflict
Co-authored-by: Alex Galarce <agalarce@aarete.com>
* modified contract effective date logic in existing smart chunking
* Merged main into chore/contract_effective_date
* updated extract_text_from_delimiters function and unit tests for it
* Merge remote-tracking branch 'origin/main' into chore/contract_effective_date
* added comments to preprocessing_funcs
* preprocessing_funcs.py edited online with Bitbucket
* utils.py edited online with Bitbucket
* add debug line
* add NA handling into fix_date_formatting()
* add debug print statements
* worked on review comments
* fixed date checking
* fixed date checking and added unit tests
* Merged main into chore/contract_effective_date
* added logic to handle case when smart chunking returns empty context for effective date
* added comments to file_processing.py
* optimized imports and removed a TODO
* Merged main into chore/contract_effective_date
* made prompt changes for effective date
* keywords.py edited online with Bitbucket
* Removed excess print statements
Approved-by: Katon Minhas
DRAFT: Bugfix/all cnc hotfixes
* Pipeline fix - health plan state
* Update for prompt vs non-prompt fixes
* Revert utils.find_regex_matches()
* Remove prints
* Non-prompt run
* Health Plan State, IRS, NPI, LOB, Lesser, Prov 2, Default, Rate Standard, Contract Effective Date, Term Group
* Merged in bugfix/agreement_name (pull request #294)
contract title fixed
* contract title fixed
* Merged bugfix/all_cnc_hotfixes into bugfix/agreement_name
Approved-by: Katon Minhas
* All hotfixes added
* Fixed utils
* fix for clean_contract_effective_date
* Merged in default-fix (pull request #296)
moved default funcs to the top, dropped intermediate columns
* moved default funcs to the top, dropped intermediate columns
Approved-by: Katon Minhas
* quick fix to dropping extra columns
* Merged in bugfix/effective_date_meridian (pull request #297)
fixed effective date for meridian contracts
* fixed effective date for meridian contracts
Approved-by: Katon Minhas
* Default rate and Lesser fix
* Merged in hotfix/irs_npi_updated (pull request #298)
updated irs and npi hotfix funcs
* updated irs and npi hotfix funcs
* Merged bugfix/all_cnc_hotfixes into hotfix/irs_npi_updated
Approved-by: Katon Minhas
* non-functional commit - default only
* debug commit - premerge
* Batch 1 Dup File Reconciliation
* Default rate fix
* Full CNC 1A Run Config
* Standard column refactor
* Working stitching for 1A
* Merged in Alex-Galarce/cnc_hotfix_effective_date_utilspy-edited-1732659983687 (pull request #301)
Remove "license" from effective date smart chunking
* Remove "license" from effective date smart chunking
* Merged bugfix/all_cnc_hotfixes into Alex-Galarce/cnc_hotfix_effective_date_utilspy-edited-1732659983687
Approved-by: Katon Minhas
* Merged in hotfix/irs_batch2_feedback (pull request #300)
IRS fix for feedback on batch2
* IRS fix for feedback on batch2
* Merged bugfix/all_cnc_hotfixes into hotfix/irs_batch2_feedback
Approved-by: Katon Minhas
* Merged main into bugfix/all_cnc_hotfixes
Approved-by: Katon Minhas
Initial top sheet conditional commit
* Initial top sheet conditional commit
* Merged main into feature/topSheetConditional
* preprocessing_funcs.py edited online with Bitbucket
* Updated quick review docstring
Approved-by: Alex Galarce
update inputs for smart chunking
* update inputs for smart chunking
* updated test case inputs
* updated test case inputs
* Add keywords back to argument for ac smart chunking
* Test case fix
Approved-by: Katon Minhas
Update for full-context AC chunks to return exact contract_text instead of concatenated text_dict pages
* Update for full-context AC chunks to return exact contract_text instead of concatenated text_dict pages
* Updated test cases
* Updated case 1
* Merged main into bugfix/full_context_check
Approved-by: Alex Galarce
Bugfix/clean full context in smart chunking
* move full context bugfix to clean branch
* took out commented code
* black formating
* Add explanatory comments to file_processing.py
Approved-by: Alex Galarce
grouped keywords and IRS regex chunking
* abandon old branch and rebuild
* removed print for field names, prompts
* pushing as part of leftovers
* IRS regex chunking
* Merged in feature/chunk_term_clean (pull request #262)
chunk_log_added
* chunk_log_added
* Merge remote-tracking branch 'remotes/origin/feature_ac_chunking_clean' into feature/chunk_term_clean
Approved-by: Alex Galarce
* added function for regex based IRS chunking
* shifted regex_match_chunk function to utils
* added helper functions for regex based chunking
* replaced tin_regex function to ac_funcs
* removed prompt for irs_others
* added regex chunking for irs
* removed irs group from smart chunking
* testing functionality for regex based irs fields
* updated return N/A condition
* Merged main into feature_ac_chunking_clean
* file_processing.py edited online with Bitbucket
* added back conditional prompts
* minor fixed for PR
* remove install types
* mering clean branch
* with passed test casses
* added flag for regex based tin execution
Approved-by: Michael McGuinness