epb_view_models 2.2.15 → 2.2.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/api/schemas/data/orchestrate.json +4 -0
- data/api/schemas/xml/RdSAP-Schema-S-18.0/RdSAP/ExternalDefinitions.xml +1456 -0
- data/api/schemas/xml/RdSAP-Schema-S-18.0/RdSAP/ExternalDefinitions.xsd +236 -0
- data/api/schemas/xml/RdSAP-Schema-S-18.0/RdSAP/Templates/AssessorManagement.xsd +213 -0
- data/api/schemas/xml/RdSAP-Schema-S-18.0/RdSAP/Templates/EPC-Certificate.xsd +400 -0
- data/api/schemas/xml/RdSAP-Schema-S-18.0/RdSAP/Templates/EPC-CollectedData.xsd +966 -0
- data/api/schemas/xml/RdSAP-Schema-S-18.0/RdSAP/Templates/ExceptionList.xsd +18 -0
- data/api/schemas/xml/RdSAP-Schema-S-18.0/RdSAP/Templates/Property.xsd +66 -0
- data/api/schemas/xml/RdSAP-Schema-S-18.0/RdSAP/Templates/RdSAP-Report.xsd +175 -0
- data/api/schemas/xml/RdSAP-Schema-S-18.0/RdSAP/Templates/ReportList.xsd +26 -0
- data/api/schemas/xml/RdSAP-Schema-S-18.0/RdSAP/UDT/EPC-Domains.xsd +853 -0
- data/api/schemas/xml/RdSAP-Schema-S-18.0/RdSAP/UDT/SAP-Domains.xsd +2551 -0
- data/lib/epb_view_models.rb +1 -1
- data/lib/view_model/factory.rb +1 -0
- data/lib/view_model/rd_sap_schema_s_180/common_schema.rb +541 -0
- data/lib/view_model/rd_sap_schema_s_190/common_schema.rb +44 -44
- data/lib/view_model/rd_sap_schema_s_210/common_schema.rb +37 -36
- data/lib/view_model/rd_sap_wrapper.rb +2 -0
- data/lib/view_model/sap_schema_s_1900/common_schema.rb +6 -10
- metadata +13 -1
data/lib/epb_view_models.rb
CHANGED
data/lib/view_model/factory.rb
CHANGED
|
@@ -0,0 +1,541 @@
|
|
|
1
|
+
module ViewModel
|
|
2
|
+
module RdSapSchemaS180
|
|
3
|
+
class CommonSchema < ViewModel::DomesticEpcViewModel
|
|
4
|
+
def assessment_id
|
|
5
|
+
xpath(%w[RRN])
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def address_line1
|
|
9
|
+
xpath(%w[Property Address Address-Line-1])
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def address_line2
|
|
13
|
+
xpath(%w[Property Address Address-Line-2]).to_s
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def address_line3
|
|
17
|
+
xpath(%w[Property Address Address-Line-3]).to_s
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def address_line4
|
|
21
|
+
xpath(%w[Property Address Address-Line-4]).to_s
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def town
|
|
25
|
+
xpath(%w[Property Address Post-Town])
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def postcode
|
|
29
|
+
xpath(%w[Property Address Postcode])
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def scheme_assessor_id
|
|
33
|
+
xpath(%w[Membership-Number]) or xpath(%w[Certificate-Number])
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def assessor_name
|
|
37
|
+
xpath(%w[Energy-Assessor Name])
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def assessor_email
|
|
41
|
+
xpath(%w[Energy-Assessor E-Mail])
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def assessor_telephone
|
|
45
|
+
xpath(%w[Energy-Assessor Telephone])
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def date_of_assessment
|
|
49
|
+
xpath(%w[Inspection-Date])
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def date_of_registration
|
|
53
|
+
xpath(%w[Registration-Date])
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def date_of_completion
|
|
57
|
+
xpath(%w[Completion-Date])
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def address_id
|
|
61
|
+
"LPRN-#{xpath(%w[UPRN])}"
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def date_of_expiry
|
|
65
|
+
expires_at = (Date.parse(date_of_registration) - 1) >> 12 * 10
|
|
66
|
+
|
|
67
|
+
expires_at.to_s
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def property_summary
|
|
71
|
+
@xml_doc.search("Energy-Assessment Property-Summary").children.select(
|
|
72
|
+
&:element?
|
|
73
|
+
).map { |node|
|
|
74
|
+
next if xpath(%w[Energy-Efficiency-Rating], node).nil?
|
|
75
|
+
|
|
76
|
+
{
|
|
77
|
+
energy_efficiency_rating:
|
|
78
|
+
xpath(%w[Energy-Efficiency-Rating], node).to_i,
|
|
79
|
+
environmental_efficiency_rating:
|
|
80
|
+
xpath(%w[Environmental-Efficiency-Rating], node).to_i,
|
|
81
|
+
name: node.name.underscore,
|
|
82
|
+
description: xpath(%w[Description], node),
|
|
83
|
+
}
|
|
84
|
+
}.compact
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
def related_party_disclosure_text
|
|
88
|
+
xpath(%w[Related-Party-Disclosure-Text])
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
def related_party_disclosure_number
|
|
92
|
+
disclosure_number = xpath(%w[Related-Party-Disclosure-Number])
|
|
93
|
+
disclosure_number.nil? ? nil : disclosure_number.to_i
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
def improvements
|
|
97
|
+
@xml_doc
|
|
98
|
+
.search("Suggested-Improvements Improvement")
|
|
99
|
+
.map do |node|
|
|
100
|
+
{
|
|
101
|
+
energy_performance_rating_improvement:
|
|
102
|
+
xpath(%w[Energy-Performance-Rating], node).to_i,
|
|
103
|
+
environmental_impact_rating_improvement:
|
|
104
|
+
xpath(%w[Environmental-Impact-Rating], node).to_i,
|
|
105
|
+
green_deal_category_code: xpath(%w[Green-Deal-Category], node),
|
|
106
|
+
improvement_category: xpath(%w[Improvement-Category], node),
|
|
107
|
+
improvement_code:
|
|
108
|
+
xpath(%w[Improvement-Details Improvement-Number], node),
|
|
109
|
+
improvement_description: xpath(%w[Improvement-Description], node),
|
|
110
|
+
improvement_title: improvement_title(node),
|
|
111
|
+
improvement_type: xpath(%w[Improvement-Type], node),
|
|
112
|
+
indicative_cost: xpath(%w[Indicative-Cost], node),
|
|
113
|
+
sequence: xpath(%w[Sequence], node).to_i,
|
|
114
|
+
typical_saving: xpath(%w[Typical-Saving], node),
|
|
115
|
+
}
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
def recommendations_for_report
|
|
120
|
+
@xml_doc
|
|
121
|
+
.search("Suggested-Improvements Improvement")
|
|
122
|
+
.map do |node|
|
|
123
|
+
{
|
|
124
|
+
sequence: xpath(%w[Sequence], node).to_i,
|
|
125
|
+
improvement_summary: xpath(%w[Improvement-Summary], node),
|
|
126
|
+
improvement_description: xpath(%w[Improvement-Description], node),
|
|
127
|
+
improvement_code:
|
|
128
|
+
xpath(%w[Improvement-Details Improvement-Number], node),
|
|
129
|
+
indicative_cost: xpath(%w[Indicative-Cost], node),
|
|
130
|
+
}
|
|
131
|
+
end
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
def hot_water_cost_potential
|
|
135
|
+
xpath(%w[Hot-Water-Cost-Potential])
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
def heating_cost_potential
|
|
139
|
+
xpath(%w[Heating-Cost-Potential])
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
def lighting_cost_potential
|
|
143
|
+
xpath(%w[Lighting-Cost-Potential])
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
def hot_water_cost_current
|
|
147
|
+
xpath(%w[Hot-Water-Cost-Current])
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
def heating_cost_current
|
|
151
|
+
xpath(%w[Heating-Cost-Current])
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
def lighting_cost_current
|
|
155
|
+
xpath(%w[Lighting-Cost-Current])
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
def potential_carbon_emission
|
|
159
|
+
xpath(%w[CO2-Emissions-Potential])
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
def current_carbon_emission
|
|
163
|
+
xpath(%w[CO2-Emissions-Current])
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
def potential_energy_rating
|
|
167
|
+
xpath(%w[Energy-Rating-Potential])&.to_i
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
def current_energy_rating
|
|
171
|
+
xpath(%w[Energy-Rating-Current])&.to_i
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
def estimated_energy_cost; end
|
|
175
|
+
|
|
176
|
+
def total_floor_area
|
|
177
|
+
xpath(%w[Property-Summary Total-Floor-Area])
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
def dwelling_type
|
|
181
|
+
xpath(%w[Dwelling-Type])
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
def potential_energy_saving; end
|
|
185
|
+
|
|
186
|
+
def property_age_band
|
|
187
|
+
xpath(%w[Construction-Age-Band])
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
def tenure
|
|
191
|
+
xpath(%w[Tenure])
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
def transaction_type
|
|
195
|
+
xpath(%w[Transaction-Type])
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
def current_space_heating_demand
|
|
199
|
+
xpath(%w[Space-Heating-Existing-Dwelling])
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
def current_water_heating_demand
|
|
203
|
+
xpath(%w[Water-Heating])
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
def impact_of_cavity_insulation
|
|
207
|
+
if xpath(%w[Impact-Of-Cavity-Insulation])
|
|
208
|
+
xpath(%w[Impact-Of-Cavity-Insulation])&.to_i
|
|
209
|
+
end
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
def impact_of_loft_insulation
|
|
213
|
+
if xpath(%w[Impact-Of-Loft-Insulation])
|
|
214
|
+
xpath(%w[Impact-Of-Loft-Insulation])&.to_i
|
|
215
|
+
end
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
def impact_of_solid_wall_insulation
|
|
219
|
+
if xpath(%w[Impact-Of-Solid-Wall-Insulation])
|
|
220
|
+
xpath(%w[Impact-Of-Solid-Wall-Insulation])&.to_i
|
|
221
|
+
end
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
def habitable_room_count
|
|
225
|
+
xpath(%w[Habitable-Room-Count])&.to_i
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
def energy_rating_current
|
|
229
|
+
xpath(%w[Energy-Rating-Current])&.to_i
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
def energy_rating_potential
|
|
233
|
+
xpath(%w[Energy-Rating-Potential])&.to_i
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
def environmental_impact_current
|
|
237
|
+
xpath(%w[Environmental-Impact-Current])&.to_i
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
def environmental_impact_potential
|
|
241
|
+
xpath(%w[Environmental-Impact-Potential])&.to_i
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
def primary_energy_use
|
|
245
|
+
xpath(%w[Energy-Consumption-Current])&.to_f
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
def energy_consumption_potential
|
|
249
|
+
xpath(%w[Energy-Consumption-Potential])&.to_f
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
def all_roof_descriptions
|
|
253
|
+
@xml_doc.search("Roof/Description").map(&:content)
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
def all_roof_energy_efficiency_rating
|
|
257
|
+
@xml_doc.search("Roof/Energy-Efficiency-Rating").map(&:content)
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
def all_roof_env_energy_efficiency_rating
|
|
261
|
+
@xml_doc.search("Roof/Environmental-Efficiency-Rating").map(&:content)
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
def all_window_descriptions
|
|
265
|
+
@xml_doc.search("Window/Description").map(&:content)
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
def all_main_heating_descriptions
|
|
269
|
+
@xml_doc.search("Main-Heating/Description").map(&:content)
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
def all_main_heating_controls_descriptions
|
|
273
|
+
@xml_doc.search("Main-Heating-Controls/Description").map(&:content)
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
def all_main_heating_energy_efficiency
|
|
277
|
+
@xml_doc.search("Main-Heating/Energy-Efficiency-Rating").map(&:content)
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
def all_main_heating_environmental_efficiency
|
|
281
|
+
@xml_doc
|
|
282
|
+
.search("Main-Heating/Environmental-Efficiency-Rating")
|
|
283
|
+
.map(&:content)
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
def all_hot_water_descriptions
|
|
287
|
+
@xml_doc.search("Hot-Water/Description").map(&:content)
|
|
288
|
+
end
|
|
289
|
+
|
|
290
|
+
def all_lighting_descriptions
|
|
291
|
+
@xml_doc.search("Lighting/Description").map(&:content)
|
|
292
|
+
end
|
|
293
|
+
|
|
294
|
+
def all_secondary_heating_descriptions
|
|
295
|
+
@xml_doc.search("Secondary-Heating/Description").map(&:content)
|
|
296
|
+
end
|
|
297
|
+
|
|
298
|
+
def country_code
|
|
299
|
+
xpath(%w[Country-Code])
|
|
300
|
+
end
|
|
301
|
+
|
|
302
|
+
def main_fuel_type
|
|
303
|
+
xpath(%w[Main-Fuel-Type])
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
def secondary_fuel_type
|
|
307
|
+
xpath(%w[Secondary-Fuel-Type])
|
|
308
|
+
end
|
|
309
|
+
|
|
310
|
+
def water_heating_fuel
|
|
311
|
+
xpath(%w[Water-Heating-Fuel])
|
|
312
|
+
end
|
|
313
|
+
|
|
314
|
+
def co2_emissions_current_per_floor_area
|
|
315
|
+
xpath(%w[CO2-Emissions-Current-Per-Floor-Area])&.to_f
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
def mains_gas
|
|
319
|
+
xpath(%w[Mains-Gas])
|
|
320
|
+
end
|
|
321
|
+
|
|
322
|
+
def level
|
|
323
|
+
xpath(%w[Level])
|
|
324
|
+
end
|
|
325
|
+
|
|
326
|
+
def top_storey
|
|
327
|
+
xpath(%w[Top-Storey])
|
|
328
|
+
end
|
|
329
|
+
|
|
330
|
+
def storey_count
|
|
331
|
+
xpath(%w[Storey-Count])&.to_i
|
|
332
|
+
end
|
|
333
|
+
|
|
334
|
+
def main_heating_controls
|
|
335
|
+
xpath(%w[Main-Heating-Controls Description])
|
|
336
|
+
end
|
|
337
|
+
|
|
338
|
+
def multiple_glazed_proportion
|
|
339
|
+
xpath(%w[Multiple-Glazed-Proportion])
|
|
340
|
+
end
|
|
341
|
+
|
|
342
|
+
def glazed_area
|
|
343
|
+
xpath(%w[Glazed-Area])
|
|
344
|
+
end
|
|
345
|
+
|
|
346
|
+
def heated_room_count
|
|
347
|
+
xpath(%w[Heated-Room-Count])&.to_i
|
|
348
|
+
end
|
|
349
|
+
|
|
350
|
+
def low_energy_lighting
|
|
351
|
+
xpath(%w[Low-Energy-Lighting])
|
|
352
|
+
end
|
|
353
|
+
|
|
354
|
+
def fixed_lighting_outlets_count
|
|
355
|
+
xpath(%w[Fixed-Lighting-Outlets-Count])&.to_i
|
|
356
|
+
end
|
|
357
|
+
|
|
358
|
+
def low_energy_fixed_lighting_outlets_count
|
|
359
|
+
xpath(%w[Low-Energy-Fixed-Lighting-Outlets-Count])&.to_i
|
|
360
|
+
end
|
|
361
|
+
|
|
362
|
+
def open_fireplaces_count
|
|
363
|
+
xpath(%w[Open-Fireplaces-Count])&.to_i
|
|
364
|
+
end
|
|
365
|
+
|
|
366
|
+
def hot_water_description
|
|
367
|
+
xpath(%w[Hot-Water Description])
|
|
368
|
+
end
|
|
369
|
+
|
|
370
|
+
def hot_water_energy_efficiency_rating
|
|
371
|
+
xpath(%w[Hot-Water Energy-Efficiency-Rating])
|
|
372
|
+
end
|
|
373
|
+
|
|
374
|
+
def hot_water_environmental_efficiency_rating
|
|
375
|
+
xpath(%w[Hot-Water Environmental-Efficiency-Rating])
|
|
376
|
+
end
|
|
377
|
+
|
|
378
|
+
def wind_turbine_count
|
|
379
|
+
xpath(%w[Wind-Turbines-Count])&.to_i
|
|
380
|
+
end
|
|
381
|
+
|
|
382
|
+
def heat_loss_corridor
|
|
383
|
+
xpath(%w[Heat-Loss-Corridor])
|
|
384
|
+
end
|
|
385
|
+
|
|
386
|
+
def unheated_corridor_length
|
|
387
|
+
xpath(%w[Unheated-Corridor-Length])
|
|
388
|
+
end
|
|
389
|
+
|
|
390
|
+
def window_description
|
|
391
|
+
xpath(%w[Window Description])
|
|
392
|
+
end
|
|
393
|
+
|
|
394
|
+
def window_energy_efficiency_rating
|
|
395
|
+
xpath(%w[Window Energy-Efficiency-Rating])
|
|
396
|
+
end
|
|
397
|
+
|
|
398
|
+
def window_environmental_efficiency_rating
|
|
399
|
+
xpath(%w[Window Environmental-Efficiency-Rating])
|
|
400
|
+
end
|
|
401
|
+
|
|
402
|
+
def secondary_heating_description
|
|
403
|
+
xpath(%w[Secondary-Heating Description])
|
|
404
|
+
end
|
|
405
|
+
|
|
406
|
+
def secondary_heating_energy_efficiency_rating
|
|
407
|
+
xpath(%w[Secondary-Heating Energy-Efficiency-Rating])
|
|
408
|
+
end
|
|
409
|
+
|
|
410
|
+
def secondary_heating_environmental_efficiency_rating
|
|
411
|
+
xpath(%w[Secondary-Heating Environmental-Efficiency-Rating])
|
|
412
|
+
end
|
|
413
|
+
|
|
414
|
+
def lighting_description
|
|
415
|
+
xpath(%w[Lighting Description])
|
|
416
|
+
end
|
|
417
|
+
|
|
418
|
+
def lighting_energy_efficiency_rating
|
|
419
|
+
xpath(%w[Lighting Energy-Efficiency-Rating])
|
|
420
|
+
end
|
|
421
|
+
|
|
422
|
+
def lighting_environmental_efficiency_rating
|
|
423
|
+
xpath(%w[Lighting Environmental-Efficiency-Rating])
|
|
424
|
+
end
|
|
425
|
+
|
|
426
|
+
def photovoltaic_roof_area_percent
|
|
427
|
+
xpath(%w[Photovoltaic-Supply Percent-Roof-Area])
|
|
428
|
+
end
|
|
429
|
+
|
|
430
|
+
def built_form
|
|
431
|
+
xpath(%w[Built-Form])
|
|
432
|
+
end
|
|
433
|
+
|
|
434
|
+
def extensions_count
|
|
435
|
+
xpath(%w[Extensions-Count])&.to_i
|
|
436
|
+
end
|
|
437
|
+
|
|
438
|
+
def report_type
|
|
439
|
+
xpath(%w[Report-Type])
|
|
440
|
+
end
|
|
441
|
+
|
|
442
|
+
def all_wall_descriptions
|
|
443
|
+
@xml_doc.search("Wall/Description").map(&:content)
|
|
444
|
+
end
|
|
445
|
+
|
|
446
|
+
def all_wall_energy_efficiency_rating
|
|
447
|
+
@xml_doc.search("Wall/Energy-Efficiency-Rating").map(&:content)
|
|
448
|
+
end
|
|
449
|
+
|
|
450
|
+
def all_wall_env_energy_efficiency_rating
|
|
451
|
+
@xml_doc.search("Wall/Environmental-Efficiency-Rating").map(&:content)
|
|
452
|
+
end
|
|
453
|
+
|
|
454
|
+
def meter_type
|
|
455
|
+
xpath(%w[Meter-Type])
|
|
456
|
+
end
|
|
457
|
+
|
|
458
|
+
def floor_level
|
|
459
|
+
xpath(%w[Flat-Location])
|
|
460
|
+
end
|
|
461
|
+
|
|
462
|
+
def solar_water_heating_flag
|
|
463
|
+
xpath(%w[Solar-Water-Heating])
|
|
464
|
+
end
|
|
465
|
+
|
|
466
|
+
def mechanical_ventilation
|
|
467
|
+
xpath(%w[Mechanical-Ventilation])
|
|
468
|
+
end
|
|
469
|
+
|
|
470
|
+
def floor_height
|
|
471
|
+
@xml_doc.search("Room-Height").map(&:content)
|
|
472
|
+
end
|
|
473
|
+
|
|
474
|
+
def all_floor_descriptions
|
|
475
|
+
@xml_doc.search("Property-Summary/Floor/Description").map(&:content)
|
|
476
|
+
end
|
|
477
|
+
|
|
478
|
+
def all_floor_energy_efficiency_rating
|
|
479
|
+
@xml_doc
|
|
480
|
+
.search("Property-Summary/Floor/Energy-Efficiency-Rating")
|
|
481
|
+
.map(&:content)
|
|
482
|
+
end
|
|
483
|
+
|
|
484
|
+
def all_floor_env_energy_efficiency_rating
|
|
485
|
+
@xml_doc
|
|
486
|
+
.search("Property-Summary/Floor/Environmental-Efficiency-Rating")
|
|
487
|
+
.map(&:content)
|
|
488
|
+
end
|
|
489
|
+
|
|
490
|
+
def all_main_heating_controls_energy_efficiency
|
|
491
|
+
@xml_doc
|
|
492
|
+
.search("Main-Heating-Controls/Energy-Efficiency-Rating")
|
|
493
|
+
.map(&:content)
|
|
494
|
+
end
|
|
495
|
+
|
|
496
|
+
def all_main_heating_controls_environmental_efficiency
|
|
497
|
+
@xml_doc
|
|
498
|
+
.search("Main-Heating-Controls/Environmental-Efficiency-Rating")
|
|
499
|
+
.map(&:content)
|
|
500
|
+
end
|
|
501
|
+
|
|
502
|
+
def main_dwelling_construction_age_band_or_year
|
|
503
|
+
sap_building_parts =
|
|
504
|
+
@xml_doc.xpath("//SAP-Building-Parts/SAP-Building-Part")
|
|
505
|
+
sap_building_parts.each do |sap_building_part|
|
|
506
|
+
building_part_number = sap_building_part.at("Building-Part-Number")
|
|
507
|
+
|
|
508
|
+
# Identifies the Main Dwelling
|
|
509
|
+
if building_part_number&.content == "1"
|
|
510
|
+
return (
|
|
511
|
+
sap_building_part.at_xpath(
|
|
512
|
+
"Construction-Age-Band | Construction-Year",
|
|
513
|
+
)&.content
|
|
514
|
+
)
|
|
515
|
+
end
|
|
516
|
+
end
|
|
517
|
+
nil
|
|
518
|
+
end
|
|
519
|
+
|
|
520
|
+
def cylinder_insul_thickness
|
|
521
|
+
xpath(%w[Cylinder-Insulation-Thickness])
|
|
522
|
+
end
|
|
523
|
+
|
|
524
|
+
def cylinder_insulation_type
|
|
525
|
+
xpath(%w[Cylinder-Insulation-Type])
|
|
526
|
+
end
|
|
527
|
+
|
|
528
|
+
def cylinder_size
|
|
529
|
+
xpath(%w[Cylinder-Size])
|
|
530
|
+
end
|
|
531
|
+
|
|
532
|
+
def has_cylinder_thermostat
|
|
533
|
+
xpath(%w[Cylinder-Thermostat])
|
|
534
|
+
end
|
|
535
|
+
|
|
536
|
+
def party_wall_construction
|
|
537
|
+
xpath(%w[SAP-Building-Part Party-Wall-Construction])
|
|
538
|
+
end
|
|
539
|
+
end
|
|
540
|
+
end
|
|
541
|
+
end
|
|
@@ -543,7 +543,7 @@ module ViewModel
|
|
|
543
543
|
@xml_doc
|
|
544
544
|
.search("SAP-Building-Part")
|
|
545
545
|
.map do |node|
|
|
546
|
-
|
|
546
|
+
xpath(%w[Party-Wall-Construction], node)
|
|
547
547
|
end
|
|
548
548
|
end
|
|
549
549
|
|
|
@@ -551,16 +551,16 @@ module ViewModel
|
|
|
551
551
|
@xml_doc
|
|
552
552
|
.search("SAP-Building-Part")
|
|
553
553
|
.map do |node|
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
554
|
+
{
|
|
555
|
+
alternative_wall_thickness: node.at_xpath("SAP-Alternative-Wall/Wall-Thickness")&.content,
|
|
556
|
+
alternative_wall_thickness_measured: node.at_xpath("SAP-Alternative-Wall/Wall-Thickness-Measured")&.content,
|
|
557
|
+
alternative_wall_construction: node.at_xpath("SAP-Alternative-Wall/Wall-Construction")&.content,
|
|
558
|
+
alternative_wall_u_value: node.at_xpath("SAP-Alternative-Wall/Wall-U-Value")&.content,
|
|
559
|
+
alternative_wall_insulation_thickness: node.at_xpath("SAP-Alternative-Wall/Wall-Insulation-Thickness")&.content,
|
|
560
|
+
wall_thickness: node.at_xpath("Wall-Thickness")&.content,
|
|
561
|
+
wall_construction: node.at_xpath("Wall-Construction")&.content,
|
|
562
|
+
wall_thickness_measured: node.at_xpath("Wall-Thickness-Measured")&.content,
|
|
563
|
+
}
|
|
564
564
|
end
|
|
565
565
|
end
|
|
566
566
|
|
|
@@ -568,18 +568,18 @@ module ViewModel
|
|
|
568
568
|
@xml_doc
|
|
569
569
|
.search("SAP-Building-Part")
|
|
570
570
|
.map do |node|
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
571
|
+
{
|
|
572
|
+
roof_insulation_location: node.at_xpath("Roof-Insulation-Location")&.content,
|
|
573
|
+
roof_construction: node.at_xpath("Roof-Construction")&.content,
|
|
574
|
+
}
|
|
575
575
|
end
|
|
576
576
|
end
|
|
577
577
|
|
|
578
578
|
def rooms_in_roof_insulation
|
|
579
579
|
@xml_doc
|
|
580
580
|
.search("SAP-Building-Part")
|
|
581
|
-
.map do |
|
|
582
|
-
|
|
581
|
+
.map do |_node|
|
|
582
|
+
xpath(%w[SAP-Room-In-Roof Insulation])
|
|
583
583
|
end
|
|
584
584
|
end
|
|
585
585
|
|
|
@@ -587,10 +587,10 @@ module ViewModel
|
|
|
587
587
|
@xml_doc
|
|
588
588
|
.search("SAP-Building-Part")
|
|
589
589
|
.map do |node|
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
590
|
+
{
|
|
591
|
+
floor_u_value: node.at_xpath("Floor-U-Value")&.content,
|
|
592
|
+
floor_insulation_thickness: node.at_xpath("Floor-Insulation-Thickness")&.content,
|
|
593
|
+
}
|
|
594
594
|
end
|
|
595
595
|
end
|
|
596
596
|
|
|
@@ -598,13 +598,13 @@ module ViewModel
|
|
|
598
598
|
@xml_doc
|
|
599
599
|
.search("SAP-Building-Part")
|
|
600
600
|
.map do |node|
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
601
|
+
{
|
|
602
|
+
roof_u_value: node.at_xpath("Roof-U-Value")&.content,
|
|
603
|
+
roof_insulation_thickness: node.at_xpath("Roof-Insulation-Thickness")&.content,
|
|
604
|
+
rafter_insulation_thickness: node.at_xpath("Rafter-Insulation-Thickness")&.content,
|
|
605
|
+
flat_roof_insulation_thickness: node.at_xpath("Flat-Roof-Insulation-Thickness")&.content,
|
|
606
|
+
sloping_ceiling_insulation_thickness: node.at_xpath("Sloping-Ceiling-Insulation-Thickness")&.content,
|
|
607
|
+
}
|
|
608
608
|
end
|
|
609
609
|
end
|
|
610
610
|
|
|
@@ -612,10 +612,10 @@ module ViewModel
|
|
|
612
612
|
@xml_doc
|
|
613
613
|
.search("SAP-Building-Part")
|
|
614
614
|
.map do |node|
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
615
|
+
{
|
|
616
|
+
wall_u_value: node.at_xpath("Wall-U-Value")&.content,
|
|
617
|
+
wall_insulation_thickness: node.at_xpath("Wall-Insulation-Thickness")&.content,
|
|
618
|
+
}
|
|
619
619
|
end
|
|
620
620
|
end
|
|
621
621
|
|
|
@@ -623,30 +623,30 @@ module ViewModel
|
|
|
623
623
|
@xml_doc
|
|
624
624
|
.search("SAP-Building-Part")
|
|
625
625
|
.map do |node|
|
|
626
|
-
|
|
626
|
+
node.at_xpath("SAP-Room-In-Roof")&.content.to_s
|
|
627
627
|
end
|
|
628
628
|
end
|
|
629
629
|
|
|
630
630
|
def rooms_in_roof_roof_insulation
|
|
631
631
|
@xml_doc
|
|
632
632
|
.search("SAP-Building-Part")
|
|
633
|
-
.map do |
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
633
|
+
.map do |_node|
|
|
634
|
+
{
|
|
635
|
+
roof_insulation_thickness: xpath(%w[SAP-Room-In-Roof Roof-Insulation-Thickness]),
|
|
636
|
+
room_in_roof_details: xpath(%w[SAP-Room-In-Roof Room-In-Roof-Details]),
|
|
637
|
+
}
|
|
638
638
|
end
|
|
639
639
|
end
|
|
640
640
|
|
|
641
641
|
def main_heating_details
|
|
642
642
|
@xml_doc
|
|
643
643
|
.search("Main-Heating")
|
|
644
|
-
.map do |
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
644
|
+
.map do |_node|
|
|
645
|
+
{
|
|
646
|
+
main_heating_index_number: xpath(%w[Main-Heating-Index-Number]),
|
|
647
|
+
sap_main_heating_code: xpath(%w[SAP-Main-Heating-Code]),
|
|
648
|
+
main_fuel_type: xpath(%w[Main-Fuel-Type]),
|
|
649
|
+
}
|
|
650
650
|
end
|
|
651
651
|
end
|
|
652
652
|
|