casemaker_demo / utils_report_parser.py
ljyflores
Turn reports into table, remove header, use logic to use organ of previous sentence
2b98370
raw
history blame
414 Bytes
def get_section_from_report(report: str, section: str):
section_lower = section.lower()
findings_start_idx = report.lower().find(f"{section_lower}:")
if findings_start_idx > -1:
findings_start_idx = report.lower().find(f"{section_lower}:") + len(
f"{section_lower}:"
)
findings = report[findings_start_idx:]
else:
findings = report
return findings