Commit Graph

25 Commits

Author SHA1 Message Date
Katon Minhas 23af15306b Merged in feature/new-model-testing (pull request #741)
Feature/new model testing

* rename and set up

* Setup

* Get dynamic primary crosswalked answers

* Generate stats for one file

* Update dynamic primary evaluation

* Multithreading

* Set up reimbursement primary evaluation

* UPdate output report generation

* Update TN calculation

* update poetry lock

* reorder reimb primary

* evaluate 3 models

* Configure 4.5

* switch to debug logging

* update type checking

* Fix mypy

* Resolve mypy

* Merged main into feature/new-model-testing


Approved-by: Karan Desai
2025-10-22 16:46:28 +00:00
Alex Galarce 39a07f63c9 Merged in bugfix/dynamic-primary-and-pyproject (pull request #683)
pyproject requirements, prep for logging fixes

* remove chroma

* update project name to "doczy-field-extraction" in pyproject.toml

* update lock file

* replace print statements with logging for better traceability in process_file function

* replace print statements with logging for improved error tracking and information logging

* replace print statements with logging for improved error handling and traceability

* replace print statements with logging for improved error handling in llm_utils and string_utils

* remove unused table_utils module; supplanted by table_funcs and unreferenced

* replace capsys with caplog in test_invalid_input_type for improved logging of invalid input


Approved-by: Katon Minhas
2025-08-27 16:37:48 +00:00
VenkataKrishna Reddy Avula 0d6bdf9539 Merged in bugfix/effective_date_fix (pull request #504)
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
2025-05-07 18:21:09 +00:00
Rahul Ailaboina d6abe44a69 Merged in feature/postprocess-Cleanup (pull request #464)
Feature/postprocess Cleanup

* Added aarete derived

* removed the dev file
* reverted
* Merge branch 'main' into feature/postprocess-Cleanup

* Update poetry lock

* Update poetry and pyproject

* Update poetry

* Update field path

* Update test_date_postprocess

* Update tests

* Merged main into feature/postprocess-Cleanup

* Update test

* Update test

* addedfield_json_path

* minor changes

* removed

* Updated

* minor change

* added llm invoke

* removed unnecessary imports

* add

* self added

* removed comments

* Merged main into feature/postprocess-Cleanup

* Merged main into feature/postprocess-Cleanup


Approved-by: Katon Minhas
2025-04-08 20:14:49 +00:00
Katon Minhas 664397d713 Merged in feature/proc-desc (pull request #400)
feature/proc desc

* Update crosswalks - individual code level

* add embeddings

* Update embeddings

* Proc mappings

* code description mapping for PROC codes

* Code map bug fixes

* docstrings

* Initialize Rev and Diag descriptions

* Add 0 to front for rev codes

* Comments

* Merged main into feature/proc-desc

* Comments

* Separate grouper and diag codes

* add grouper version

* Bugfix"

* Add admit type code

* add proc mod description

* Add bill type pos mapping

* Merged main into feature/proc-desc

* Uncomment test code

* Bugfix

* Remove test.py

* list bugfix

* Merged main into feature/proc-desc

* concurrency


Approved-by: Alex Galarce
2025-02-20 04:10:33 +00:00
VenkataKrishna Reddy Avula a5f54a2a48 Merged in feature/daip2-17 (pull request #362)
Feature/daip2- 17 - Aarete derived field values and crosswalk mapping

* fix pipeline error

* fix pipeline error

* fix pipeline error

* fix pipeline error

* fix pipeline error

* Update fieldSet unit test

* Update test_from_values

* Fix circular import

* Added NLTK

* Add NLTK to path

* Update gitignore

* 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

* aarete derived AC fields mapping

* chnages reverted

* AC Croasswalk Mapping

* Merge branch 'main' into feature/daip2-17

* Update poetry.lock

* Add init for crosswalk

* Complete paths


Approved-by: Alex Galarce
2025-01-27 21:27:15 +00:00
Katon Minhas 063c95d6ac Merged in feature/dynamic_and_generalized_branch (pull request #361)
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
2025-01-27 19:39:23 +00:00
Alex Galarce d345dd0ed3 Merged in feature/integrate-standard-and-complex (pull request #356)
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
2025-01-24 22:46:59 +00:00
Siddhant Medar 04d268a2f8 Merged in task/unit-tests-investment-and-client (pull request #354)
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
2025-01-17 17:15:32 +00:00
Siddhant Medar ab71bd8dae Merged in task/unit-tests-investment-and-client (pull request #346)
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


Approved-by: Alex Galarce
2025-01-09 17:59:28 +00:00
Alex Galarce 53b38ea15c Merged in refactor/split-investment-and-client (pull request #347)
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
2025-01-08 21:59:47 +00:00
Alex Galarce 3740588efa Merged in refactor/daip-2-9-code-refactor (pull request #339)
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
2025-01-06 15:39:29 +00:00
Alex Galarce ad19bfc808 Merged in hotfit/move-openpyxl (pull request #334)
move openpyxl from dev dependencies to general dependencies bc we use it for qaqc now

* move openpyxl from dev dependencies to general dependencies bc we use it for qaqc now


Approved-by: Katon Minhas
2024-12-16 20:57:35 +00:00
Katon Minhas d62e477436 Merged in bugfix/termGroupHotfix (pull request #324)
Bugfix/termGroupHotfix

* Minor term group fix

* Added xlsb to gitignore, updated apply_cnc_hotfix for Filename prefix, added xlsb read functionality to utils

* Date bugfix

* Fixed effective date bug

* Effective date bug fixes

* Fix agreement name field name bug

* Further bug fixes

* update poetry for pyxlsb

* Write to excel after each file is completed

* Fix for restarts


Approved-by: Alex Galarce
2024-12-09 21:40:53 +00:00
Katon Minhas aa706cbcca Merged in feature/hotfix_stitch (pull request #315)
Feature/hotfix stitch

* Add hotfix scripts

* Merged main into feature/hotfix_stitch

* Moved stitching scripts to scripts folder

* Update for 2

* Fixed flat fee issue

* Fix payer name issue

* All hotfix updates

* Merged main into feature/hotfix_stitch

* Add rapidfuzz


Approved-by: Alex Galarce
2024-12-03 17:18:11 +00:00
Alex Galarce eb7a67c8d4 Merged in refactor/tidy-config (pull request #278)
Refactor/tidy config

* remove commented lines, always instantiate S3 client even if local

* add isort to dev requirements

* sort and prune dependencies

* remove commented line

* remove unreferenced config settings

* remove unreferenced input arguments

* black formatting

* Merge remote-tracking branch 'origin/main' into refactor/tidy-config


Approved-by: Michael McGuinness
Approved-by: Katon Minhas
2024-11-21 17:46:43 +00:00
Faizan Mohiuddin 1d42990fac Merged in feature/add-runtime-tracking (pull request #272)
Feature/add runtime tracking

* added return true

* added fixes and other features

* added fixes and other features

* added fixes and other features

* added fixes and other features

* added fixes and other features

* added fixes and other features

* test

* test

* test

* test

* test

* test

* added

* added

* added potential fix

* added potential fix

* functions

* added potential fix

*  fixes

* Merged main into feature/add-runtime-tracking

* moved streamlit dashabord to streamlit folder

* Merge branch 'feature/add-runtime-tracking' of https://bitbucket.org/aarete/doczy.ai into feature/add-runtime-tracking

* remove src/valid.py to keep src empty

* add psutil to requirements


Approved-by: Michael McGuinness
2024-11-21 15:19:53 +00:00
Alex Galarce 0396418b9f Merged in feature/costlog (pull request #264)
Add cost logging

* add inspect logging

* change comment

* add simple token estimation

* rudimentary costlog

* compute cost

* float formatting

* put costlog to s3

* float formatting attempt 2

* fix formatting, remove a couple prints

* add missing comma

* add filename

* make costlog a .csv instead of a .log

* use csv library instead of from-scratch csv writing

* switch to import math, add test

* pyproject.toml Added src to pythonpath
* Merged main into feature/costlog

* add jupyter to requirements, add test path to pyproject.toml

* Merge remote-tracking branch 'refs/remotes/origin/feature/costlog' into feature/costlog

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

* merge in main

* add TODOs

* Merged main into feature/costlog

* Merged main into feature/costlog


Approved-by: Michael McGuinness
Approved-by: Katon Minhas
2024-11-14 22:36:09 +00:00
Michael McGuinness 5928ee0116 Merged in feature/add-dotenv (pull request #266)
Feature/add dotenv

* transferred sensitive information to .env file from src/config.py

* replace model IDs, AWS account info

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

* add explanatory comment

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

* remove tests that were just for local


Approved-by: Katon Minhas
2024-11-14 16:35:33 +00:00
Alex Galarce 001c2e45b5 Merged in hotfix/plan_state (pull request #267)
plan state hotfix

* updated state_check function

* added a wrapper function apply_state_check_to_df function to enable state_check function to work with dataframe and also wrote unit tests for both the functions.

* Merged main into hotfix/plan_state

* append extra column with new health plan state corrected

* Merge remote-tracking branch 'refs/remotes/origin/hotfix/plan_state' into hotfix/plan_state

* fix tests

* move apply_state_check_to_df() to cnc_hotfix.py

* move all functionality out of utils and into cnc_hotfix.py

* Merge remote-tracking branch 'origin/main' into hotfix/plan_state

* remove duplicated pythonpath in pyproject.toml

* format cnc_hotfix.py

* changed to use valid.STATE_MAP to not duplicate functionality


Approved-by: Katon Minhas
2024-11-13 20:12:40 +00:00
Karan Desai 1098be5cf5 Merged in feature_ac_chunking_clean (pull request #265)
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
2024-11-13 17:08:19 +00:00
Michael McGuinness ee3e3eb538 Merged in feature/mergeIntoMain (pull request #249)
Merge Prep

* mergePRep


Approved-by: Katon Minhas
2024-10-28 23:39:36 +00:00
Michael McGuinness acef40ee19 Merged in festure/removefieldExtraction (pull request #247)
Remove Field Extraction

* rmfieldExtraction


Approved-by: Katon Minhas
2024-10-28 22:15:57 +00:00
Michael McGuinness 7cb0b485ad Merged in feature/unittestframe (pull request #240)
Unit Testing Framework

* emptyframe

* fixstatic

* save

* exampletest

* rmreqs

* rmUto


Approved-by: Alex Galarce
2024-10-22 13:45:53 +00:00
Michael McGuinness 815fa7f0bc Merged in feature/poetry (pull request #238)
Draft: Adding Poetry

* addpoetry

* pipes

* mypy

* streamlit

* searchforchange


Approved-by: Alex Galarce
2024-10-15 16:20:27 +00:00