Merged in bugfix/uom (pull request #661)

Bugfix/uom

* Add "Per Procedure" to valid unit of measure list

* Enhance unit of measure prompt for clarity and specificity in reimbursement methodologies

* Refine unit of measure prompt to ensure defaulting to 'Per Unit' regardless of procedure codes for flat rate methodologies

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

* Merged main into bugfix/uom

* Enhance logic for setting UNIT_OF_MEASURE to 'Per Unit' for Flat Rate reimbursement, handling all edge cases including NaN and empty strings.

* Enhance is_empty function to handle additional empty value cases for pd.Series and strings

* Enhance test cases for is_empty function to cover additional whitespace and null-like values

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

* Enhance type checking for is_empty function with overloads for str, list, and pd.Series

* Overload fix

* Merged main into bugfix/uom


Approved-by: Katon Minhas
This commit is contained in:
Alex Galarce
2025-08-13 14:51:46 +00:00
parent 7f5e8125e4
commit b2a0dc4b60
5 changed files with 80 additions and 21 deletions
+20 -5
View File
@@ -5,11 +5,15 @@ import pytest
import src.utils as utils
import src.utils.llm_utils as llm_utils
from constants.delimiters import Delimiter
from src.utils.string_utils import (contains_reimbursement,
count_reimbursements_in_exhibit,
extract_signature_page,
extract_text_from_delimiters, is_empty,
json_parsing_search, page_key_sort)
from src.utils.string_utils import (
contains_reimbursement,
count_reimbursements_in_exhibit,
extract_signature_page,
extract_text_from_delimiters,
is_empty,
json_parsing_search,
page_key_sort,
)
class TestStringUtils:
@@ -168,6 +172,17 @@ class TestStringUtils:
(pd.NA, True),
("This is not empty.", False),
(42, False),
(" ", True), # Whitespace-only string
("\t", True), # Tab character
("\n", True), # Newline character
("n/a", True), # Lowercase N/A
("na", True), # Lowercase NA
("NULL", True), # Uppercase NULL
("NONE", True), # Uppercase NONE
("None", True), # Mixed case None (already in empty_values)
("UNKNOWN", False), # Should NOT be empty
("unknown", False), # Should NOT be empty
(" N/A ", True), # N/A with whitespace
],
)
def test_is_empty(self, value, expected):