46 lines
1.3 KiB
Python
46 lines
1.3 KiB
Python
import os
|
|
|
|
import utils
|
|
import preprocess
|
|
import table_funcs
|
|
|
|
|
|
def contains_reimbursement(text_dict, page):
|
|
return (
|
|
"%" in text_dict[page]
|
|
or "$" in text_dict[page]
|
|
or "percent" in text_dict[page].lower()
|
|
)
|
|
|
|
|
|
directory_path = (
|
|
"C:\\Users\\kminhas\\Documents\\Doczy\\doczy.ai\\data\\centene_healthnet"
|
|
)
|
|
# input_dict = utils.read_input(path=folder_path)
|
|
all_files = {}
|
|
reimbursement_count = 0
|
|
total_count = 0
|
|
# Walk through all directories and files in the directory
|
|
for root, dirs, files in os.walk(directory_path):
|
|
for file in files:
|
|
if file.endswith(".txt"):
|
|
# Construct full file path
|
|
file_path = os.path.join(root, file)
|
|
print(file_path)
|
|
try:
|
|
with open(file_path, "r", encoding="utf-8") as file:
|
|
contract_text = file.read()
|
|
if (
|
|
"%" in contract_text
|
|
or "$" in contract_text
|
|
or "percent" in contract_text.lower()
|
|
):
|
|
reimbursement_count += 1
|
|
total_count += 1
|
|
except:
|
|
continue
|
|
|
|
print(
|
|
f"For Centene HealthNet, {reimbursement_count}/{total_count} files contain potential reimbursement terms."
|
|
)
|