diff --git a/etl/pdfReader/sitenotes.py b/etl/pdfReader/sitenotes.py index 672c9b5..902e09d 100644 --- a/etl/pdfReader/sitenotes.py +++ b/etl/pdfReader/sitenotes.py @@ -77,8 +77,9 @@ class ConditionReport(SiteNotesExtractor): self.setup() def setup(self): - self.get_section_0() self.get_section_1() + self.get_section_2() + self.get_section_0() def get_section_0(self): print("Please complete") @@ -88,7 +89,8 @@ class ConditionReport(SiteNotesExtractor): inspection_and_project = self.get_inspection_and_project() the_property = self.get_the_property() main_elevation = self.get_main_elevation() - print(main_elevation) + elevations = self.get_all_elevations() + return assessor_details, inspection_and_project, the_property, main_elevation, elevations def get_assessor_details(self): data = self.get_data_between("1.1 Assessor details","1.2 Inspection & Project") @@ -127,11 +129,40 @@ class ConditionReport(SiteNotesExtractor): return MainElevation( elevation_info=elevation ) + + + def get_all_elevations(self): + elevations = [] + i = 1 + while(f"Elevation {i}" in self.raw_data): + i += 1 + no_of_elevation = i-1 + print(f"There are {no_of_elevation} elevation") + for i in range(no_of_elevation): + data = self.get_data_between(f"Elevation {i+1}", "2. Access & Elevations") + elevations.append(ElevationInfo( + elevation_type=self.get_next_value(data, "Elevation type"), + cavity_wall_depth=self.get_next_value(data, "Cavity wall depth (in mm)"), + is_insulation_present=True if self.get_next_value(data, "Is insulation present?").lower() == "yes" else False, + insulation_type= self.get_next_value(data, "Insulation type"), + )) + return Elevation( + info=elevations, + protected_conservatory_or_aonb=self.get_next_value(data, "the Significance Survey below is required."), + material_type=self.get_next_value(data, "Material Type"), + are_there_any_visible_signs_of_existing_wall_insulation=self.get_next_value(data, "Are there any visible signs of existing wall insulation?"), + does_the_existing_ground_level_on_any_elevation_bridge_the_dpc=True if self.get_next_value(data, "DPC?").lower() == "yes" else False, + ) + def get_section_2(self): + self.get_property_access() + def get_property_access(self): + pprint(self.raw_data) + pass class QuidosSiteNotesExtractor(SiteNotesExtractor):