This commit is contained in:
Michael McGuinness
2024-09-27 14:45:35 +01:00
parent 27308f7d1b
commit a11fe060e6
30 changed files with 195 additions and 2948 deletions
+34
View File
@@ -0,0 +1,34 @@
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.")