This codes here is that I read the file configurations first then thereafter I need to pass directory into the method known as the ednotes_extractor.get_ednotes()
from preprocessing import ednotes_extractor
csf_config_txt = open("..\CFS_Config.txt", "r")
file_list = []
root_dir = ""
edn_txt = ""
pcr_txt = ""
for line in csf_config_txt:
file_list.append(line)
if "Folder Path = " in file_list[0]:
root_dir = str(file_list[0])
root_dir = root_dir.replace("Folder Path = ", "")
root_dir = root_dir.replace("\n", "")
if "ED Notes = " in file_list[1]:
root_dir = str(file_list[1])
root_dir = root_dir.replace("ED Notes = ", "")
root_dir = root_dir.replace("\n", "")
if "Patient Care Record = " in file_list[2]:
root_dir = str(file_list[2])
root_dir = root_dir.replace("Patient Care Record = ", "")
root_dir = root_dir.replace("\n", "")
print(file_list[2])
def convert_txt(choices):
if(choices == 1):
#I would like to pass a directory in this method called theednotes_extractor
ednotes_extractor.get_ednotes(str2=file_list[1])
elif(choices==2):
print("Hi")