Merged in bugfix/molina_nv_prov_info_issues (pull request #728)
Bugfix/molina nv prov info issues to main * updated tin and npi pattern * updated relevant pages search Approved-by: Katon Minhas
This commit is contained in:
committed by
Katon Minhas
parent
ebc7960dbd
commit
cb6c58f8f3
@@ -4,10 +4,13 @@ BACKTICK_PATTERN = r"`([^`]+)`"
|
||||
TRIPLE_BACKTICK_PATTERN = r"```([^`]+)```"
|
||||
|
||||
# TIN and NPI Regex Patterns
|
||||
TIN_PATTERN = (
|
||||
r"\b\d{9}\b|\b\d{2}[-.]\d{7}\b|\b\d{3}[-.]\d{2}[-.]\d{4}\b|\b\d{2}-\d{4}-\d{3}\b"
|
||||
)
|
||||
NPI_PATTERN = r"\b\d{10}\b"
|
||||
# TIN_PATTERN = (
|
||||
# r"\b\d{9}\b|\b\d{2}[-.]\d{7}\b|\b\d{3}[-.]\d{2}[-.]\d{4}\b|\b\d{2}-\d{4}-\d{3}\b"
|
||||
# )
|
||||
# NPI_PATTERN = r"\b\d{10}\b"
|
||||
TIN_PATTERN = r"\b(?:\d[\s\-.]*){9}\b"
|
||||
NPI_PATTERN = r"\b(?:\d\s*){10}\b"
|
||||
|
||||
|
||||
# OCR-Correctable Patterns
|
||||
# Handles common OCR misinterpretations where letters are mistaken for digits.
|
||||
|
||||
@@ -682,10 +682,12 @@ def run_provider_info_fields(
|
||||
page_num
|
||||
for page_num, page_text in text_dict.items()
|
||||
if any(
|
||||
tin.replace("-", "") in page_text.replace("-", "") for tin in all_tins
|
||||
re.sub(r"[\s-]", "", tin) in re.sub(r"[\s-]", "", page_text)
|
||||
for tin in all_tins
|
||||
)
|
||||
or any(
|
||||
npi.replace("-", "") in page_text.replace("-", "") for npi in all_npis
|
||||
re.sub(r"[\s-]", "", npi) in re.sub(r"[\s-]", "", page_text)
|
||||
for npi in all_npis
|
||||
)
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user