epb_view_models 2.0.13 → 2.0.14
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/SAP-Schema-S-19.0.0/SAP/ExternalDefinitions.xml +1352 -0
- data/api/schemas/xml/SAP-Schema-S-19.0.0/SAP/ExternalDefinitions.xsd +242 -0
- data/api/schemas/xml/SAP-Schema-S-19.0.0/SAP/Templates/AssessorManagement.xsd +210 -0
- data/api/schemas/xml/SAP-Schema-S-19.0.0/SAP/Templates/EPC-Certificate.xsd +493 -0
- data/api/schemas/xml/SAP-Schema-S-19.0.0/SAP/Templates/ExceptionList.xsd +18 -0
- data/api/schemas/xml/SAP-Schema-S-19.0.0/SAP/Templates/Property.xsd +73 -0
- data/api/schemas/xml/SAP-Schema-S-19.0.0/SAP/Templates/ReportList.xsd +25 -0
- data/api/schemas/xml/SAP-Schema-S-19.0.0/SAP/Templates/SAP-CollectedData.xsd +1800 -0
- data/api/schemas/xml/SAP-Schema-S-19.0.0/SAP/Templates/SAP-Compliance-Report.xsd +40 -0
- data/api/schemas/xml/SAP-Schema-S-19.0.0/SAP/Templates/SAP-Report.cs +12672 -0
- data/api/schemas/xml/SAP-Schema-S-19.0.0/SAP/Templates/SAP-Report.xsd +205 -0
- data/api/schemas/xml/SAP-Schema-S-19.0.0/SAP/UDT/EPC-Domains.xsd +564 -0
- data/api/schemas/xml/SAP-Schema-S-19.0.0/SAP/UDT/SAP-Domains.xsd +3139 -0
- data/lib/epb_view_models.rb +1 -1
- data/lib/view_model/factory.rb +1 -0
- data/lib/view_model/sap_schema_s_1900/common_schema.rb +600 -0
- data/lib/view_model/sap_wrapper.rb +2 -0
- metadata +16 -2
data/lib/epb_view_models.rb
CHANGED
data/lib/view_model/factory.rb
CHANGED
@@ -61,6 +61,7 @@ module ViewModel
|
|
61
61
|
SAP-Schema-NI-13.0
|
62
62
|
SAP-Schema-NI-12.0
|
63
63
|
SAP-Schema-NI-11.2
|
64
|
+
SAP-Schema-S-19.0.0
|
64
65
|
].freeze
|
65
66
|
def create(xml, schema_type, filter_results_for = nil, additional_data = {})
|
66
67
|
# Hack to use symbols, we need to update all callers to use symbols instead
|
@@ -0,0 +1,600 @@
|
|
1
|
+
module ViewModel
|
2
|
+
module SapSchemaS1900
|
3
|
+
class CommonSchema < ViewModel::DomesticEpcViewModel
|
4
|
+
THRESHOLD_LOW_ENERGY_LIGHTING_EFFICACY = 65
|
5
|
+
|
6
|
+
def assessment_id
|
7
|
+
xpath(%w[Report-Header RRN])
|
8
|
+
end
|
9
|
+
|
10
|
+
def address_line1
|
11
|
+
xpath(%w[Report-Header Property Address Address-Line-1])
|
12
|
+
end
|
13
|
+
|
14
|
+
def address_line2
|
15
|
+
xpath(%w[Report-Header Property Address Address-Line-2])
|
16
|
+
end
|
17
|
+
|
18
|
+
def address_line3
|
19
|
+
xpath(%w[Report-Header Property Address Address-Line-3])
|
20
|
+
end
|
21
|
+
|
22
|
+
def town
|
23
|
+
xpath(%w[Report-Header Property Address Post-Town])
|
24
|
+
end
|
25
|
+
|
26
|
+
def postcode
|
27
|
+
xpath(%w[Report-Header Property Address Postcode])
|
28
|
+
end
|
29
|
+
|
30
|
+
def scheme_assessor_id
|
31
|
+
xpath(%w[Certificate-Number])
|
32
|
+
end
|
33
|
+
|
34
|
+
def assessor_name
|
35
|
+
xpath(%w[Home-Inspector Name])
|
36
|
+
end
|
37
|
+
|
38
|
+
def assessor_email
|
39
|
+
xpath(%w[Home-Inspector/E-Mail])
|
40
|
+
end
|
41
|
+
|
42
|
+
def assessor_telephone
|
43
|
+
xpath(%w[Home-Inspector/Telephone])
|
44
|
+
end
|
45
|
+
|
46
|
+
def date_of_assessment
|
47
|
+
xpath(%w[Inspection-Date])
|
48
|
+
end
|
49
|
+
|
50
|
+
def date_of_registration
|
51
|
+
xpath(%w[Registration-Date])
|
52
|
+
end
|
53
|
+
|
54
|
+
def date_of_completion
|
55
|
+
xpath(%w[Completion-Date])
|
56
|
+
end
|
57
|
+
|
58
|
+
def address_id
|
59
|
+
xpath(%w[UPRN])
|
60
|
+
end
|
61
|
+
|
62
|
+
def date_of_expiry
|
63
|
+
expires_at = (Date.parse(date_of_registration) - 1) >> 12 * 10
|
64
|
+
|
65
|
+
expires_at.to_s
|
66
|
+
end
|
67
|
+
|
68
|
+
def property_summary
|
69
|
+
@xml_doc.search("Energy-Assessment Property-Summary").children.select(
|
70
|
+
&:element?
|
71
|
+
).map { |node|
|
72
|
+
next if xpath(%w[Energy-Efficiency-Rating], node).nil?
|
73
|
+
|
74
|
+
{
|
75
|
+
energy_efficiency_rating:
|
76
|
+
xpath(%w[Energy-Efficiency-Rating], node).to_i,
|
77
|
+
environmental_efficiency_rating:
|
78
|
+
xpath(%w[Environmental-Efficiency-Rating], node).to_i,
|
79
|
+
name: node.name.underscore,
|
80
|
+
description: xpath(%w[Description], node),
|
81
|
+
}
|
82
|
+
}.compact
|
83
|
+
end
|
84
|
+
|
85
|
+
def related_party_disclosure_text
|
86
|
+
xpath(%w[Related-Party-Disclosure-Text])
|
87
|
+
end
|
88
|
+
|
89
|
+
def related_party_disclosure_number
|
90
|
+
xpath(%w[Related-Party-Disclosure-Number])&.to_i
|
91
|
+
end
|
92
|
+
|
93
|
+
def improvements
|
94
|
+
@xml_doc
|
95
|
+
.search("Suggested-Improvements Improvement")
|
96
|
+
.map do |node|
|
97
|
+
{
|
98
|
+
energy_performance_rating_improvement:
|
99
|
+
xpath(%w[Energy-Performance-Rating], node).to_i,
|
100
|
+
environmental_impact_rating_improvement:
|
101
|
+
xpath(%w[Environmental-Impact-Rating], node).to_i,
|
102
|
+
green_deal_category_code: xpath(%w[Green-Deal-Category], node),
|
103
|
+
improvement_category: xpath(%w[Improvement-Category], node),
|
104
|
+
improvement_code:
|
105
|
+
xpath(%w[Improvement-Details Improvement-Number], node),
|
106
|
+
improvement_description: xpath(%w[Improvement-Description], node),
|
107
|
+
improvement_title: improvement_title(node),
|
108
|
+
improvement_type: xpath(%w[Improvement-Type], node),
|
109
|
+
indicative_cost: xpath(%w[Indicative-Cost], node),
|
110
|
+
sequence: xpath(%w[Sequence], node).to_i,
|
111
|
+
typical_saving: xpath(%w[Typical-Saving], node),
|
112
|
+
}
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
def recommendations_for_report
|
117
|
+
accessor = Accessor::DomesticRecommendationsAccessor.instance
|
118
|
+
@xml_doc
|
119
|
+
.search("Suggested-Improvements Improvement")
|
120
|
+
.map do |node|
|
121
|
+
improvement_code = xpath(%w[Improvement-Details Improvement-Number], node)
|
122
|
+
{
|
123
|
+
sequence: xpath(%w[Sequence], node).to_i,
|
124
|
+
improvement_summary: improvement_code ? accessor.fetch_details(schema_version: "SAP-Schema-19.0.0", improvement_number: improvement_code).summary : xpath(%w[Improvement-Summary], node),
|
125
|
+
improvement_description: improvement_code ? accessor.fetch_details(schema_version: "SAP-Schema-19.0.0", improvement_number: improvement_code).description : xpath(%w[Improvement-Description], node),
|
126
|
+
improvement_code:
|
127
|
+
xpath(%w[Improvement-Details Improvement-Number], node),
|
128
|
+
indicative_cost: xpath(%w[Indicative-Cost], node),
|
129
|
+
}
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
def hot_water_cost_potential
|
134
|
+
xpath(%w[Hot-Water-Cost-Potential])
|
135
|
+
end
|
136
|
+
|
137
|
+
def heating_cost_potential
|
138
|
+
xpath(%w[Heating-Cost-Potential])
|
139
|
+
end
|
140
|
+
|
141
|
+
def lighting_cost_potential
|
142
|
+
xpath(%w[Lighting-Cost-Potential])
|
143
|
+
end
|
144
|
+
|
145
|
+
def hot_water_cost_current
|
146
|
+
xpath(%w[Hot-Water-Cost-Current])
|
147
|
+
end
|
148
|
+
|
149
|
+
def heating_cost_current
|
150
|
+
xpath(%w[Heating-Cost-Current])
|
151
|
+
end
|
152
|
+
|
153
|
+
def lighting_cost_current
|
154
|
+
xpath(%w[Lighting-Cost-Current])
|
155
|
+
end
|
156
|
+
|
157
|
+
def potential_carbon_emission
|
158
|
+
xpath(%w[CO2-Emissions-Potential])
|
159
|
+
end
|
160
|
+
|
161
|
+
def current_carbon_emission
|
162
|
+
xpath(%w[CO2-Emissions-Current])
|
163
|
+
end
|
164
|
+
|
165
|
+
def potential_energy_rating
|
166
|
+
xpath(%w[Energy-Rating-Potential])&.to_i
|
167
|
+
end
|
168
|
+
|
169
|
+
def current_energy_rating
|
170
|
+
xpath(%w[Energy-Rating-Current])&.to_i
|
171
|
+
end
|
172
|
+
|
173
|
+
def primary_energy_use
|
174
|
+
xpath(%w[Energy-Consumption-Current])
|
175
|
+
end
|
176
|
+
|
177
|
+
def energy_consumption_potential
|
178
|
+
xpath(%w[Energy-Consumption-Potential])
|
179
|
+
end
|
180
|
+
|
181
|
+
def estimated_energy_cost; end
|
182
|
+
|
183
|
+
def total_floor_area
|
184
|
+
xpath(%w[Property-Summary Total-Floor-Area])&.to_i
|
185
|
+
end
|
186
|
+
|
187
|
+
def total_roof_area
|
188
|
+
roofs = @xml_doc.xpath("//SAP-Roofs/SAP-Roof")
|
189
|
+
return nil if roofs.count.zero?
|
190
|
+
|
191
|
+
total_roof_area = 0
|
192
|
+
roofs.each do |roof|
|
193
|
+
roof_area = roof.at("Total-Roof-Area")&.content.to_i
|
194
|
+
total_roof_area += roof_area
|
195
|
+
end
|
196
|
+
total_roof_area
|
197
|
+
end
|
198
|
+
|
199
|
+
def dwelling_type
|
200
|
+
xpath(%w[Dwelling-Type])
|
201
|
+
end
|
202
|
+
|
203
|
+
def potential_energy_saving; end
|
204
|
+
|
205
|
+
def property_age_band
|
206
|
+
xpath(%w[Construction-Year])
|
207
|
+
end
|
208
|
+
|
209
|
+
def main_dwelling_construction_age_band_or_year
|
210
|
+
sap_building_parts =
|
211
|
+
@xml_doc.xpath("//SAP-Building-Parts/SAP-Building-Part")
|
212
|
+
sap_building_parts.each do |sap_building_part|
|
213
|
+
building_part_number = sap_building_part.at("Building-Part-Number")
|
214
|
+
|
215
|
+
# Identifies the Main Dwelling
|
216
|
+
if building_part_number&.content == "1"
|
217
|
+
return(
|
218
|
+
sap_building_part.at_xpath(
|
219
|
+
"Construction-Age-Band | Construction-Year",
|
220
|
+
)&.content
|
221
|
+
)
|
222
|
+
end
|
223
|
+
end
|
224
|
+
nil
|
225
|
+
end
|
226
|
+
|
227
|
+
def tenure
|
228
|
+
xpath(%w[Tenure])
|
229
|
+
end
|
230
|
+
|
231
|
+
def transaction_type
|
232
|
+
xpath(%w[Transaction-Type])
|
233
|
+
end
|
234
|
+
|
235
|
+
def current_space_heating_demand
|
236
|
+
xpath(%w[Space-Heating]) or xpath(%w[Space-Heating-Existing-Dwelling])
|
237
|
+
end
|
238
|
+
|
239
|
+
def current_water_heating_demand
|
240
|
+
xpath(%w[Water-Heating])
|
241
|
+
end
|
242
|
+
|
243
|
+
def impact_of_cavity_insulation
|
244
|
+
if xpath(%w[Impact-Of-Cavity-Insulation])
|
245
|
+
xpath(%w[Impact-Of-Cavity-Insulation])&.to_i
|
246
|
+
end
|
247
|
+
end
|
248
|
+
|
249
|
+
def impact_of_loft_insulation
|
250
|
+
if xpath(%w[Impact-Of-Loft-Insulation])
|
251
|
+
xpath(%w[Impact-Of-Loft-Insulation])&.to_i
|
252
|
+
end
|
253
|
+
end
|
254
|
+
|
255
|
+
def impact_of_solid_wall_insulation
|
256
|
+
if xpath(%w[Impact-Of-Solid-Wall-Insulation])
|
257
|
+
xpath(%w[Impact-Of-Solid-Wall-Insulation])&.to_i
|
258
|
+
end
|
259
|
+
end
|
260
|
+
|
261
|
+
def all_sap_floor_dimensions
|
262
|
+
@xml_doc.search("SAP-Floor-Dimension").select(&:element?).map { |node|
|
263
|
+
{ total_floor_area: xpath(%w[Total-Floor-Area], node).to_f }
|
264
|
+
}.compact
|
265
|
+
end
|
266
|
+
|
267
|
+
def type_of_assessment
|
268
|
+
"SAP"
|
269
|
+
end
|
270
|
+
|
271
|
+
def level
|
272
|
+
xpath(%w[Level])
|
273
|
+
end
|
274
|
+
|
275
|
+
def top_storey
|
276
|
+
flat_level_code = xpath(%w[SAP-FlatLevelCode])
|
277
|
+
flat_level_code == "3" ? "Y" : "N"
|
278
|
+
end
|
279
|
+
|
280
|
+
def storey_count
|
281
|
+
xpath(%w[Storeys])
|
282
|
+
end
|
283
|
+
|
284
|
+
def building_part_number
|
285
|
+
xpath(%w[Building-Part-Number])
|
286
|
+
end
|
287
|
+
|
288
|
+
def all_building_parts
|
289
|
+
@xml_doc
|
290
|
+
.search("SAP-Building-Parts/SAP-Building-Part")
|
291
|
+
.map do |part|
|
292
|
+
{
|
293
|
+
roof_insulation_thickness:
|
294
|
+
if part.xpath("Roof-Insulation-Thickness").empty?
|
295
|
+
nil
|
296
|
+
else
|
297
|
+
part.xpath("Roof-Insulation-Thickness").text
|
298
|
+
end,
|
299
|
+
rafter_insulation_thickness:
|
300
|
+
xpath(%w[Rafter-Insulation-Thickness], part),
|
301
|
+
flat_roof_insulation_thickness:
|
302
|
+
xpath(%w[Flat-Roof-Insulation-Thickness], part),
|
303
|
+
sloping_ceiling_insulation_thickness:
|
304
|
+
xpath(%w[Sloping-Ceiling-Insulation-Thickness], part),
|
305
|
+
roof_u_value: xpath(%w[Roof-U-Value], part),
|
306
|
+
}
|
307
|
+
end
|
308
|
+
end
|
309
|
+
|
310
|
+
def floor_heat_loss
|
311
|
+
xpath(%w[Floor-Heat-Loss])
|
312
|
+
end
|
313
|
+
|
314
|
+
def immersion_heating_type
|
315
|
+
xpath(%w[Immersion-Heating-Type])
|
316
|
+
end
|
317
|
+
|
318
|
+
def main_fuel_type
|
319
|
+
xpath(%w[Main-Fuel-Type])
|
320
|
+
end
|
321
|
+
|
322
|
+
def secondary_fuel_type
|
323
|
+
xpath(%w[Secondary-Fuel-Type])
|
324
|
+
end
|
325
|
+
|
326
|
+
def water_heating_fuel
|
327
|
+
xpath(%w[Water-Fuel-Type])
|
328
|
+
end
|
329
|
+
|
330
|
+
def boiler_flue_type
|
331
|
+
xpath(%w[Boiler-Flue-Type])
|
332
|
+
end
|
333
|
+
|
334
|
+
def meter_type
|
335
|
+
xpath(%w[Meter-Type])
|
336
|
+
end
|
337
|
+
|
338
|
+
def sap_main_heating_code
|
339
|
+
xpath(%w[SAP-Main-Heating-Code])
|
340
|
+
end
|
341
|
+
|
342
|
+
def country_code
|
343
|
+
xpath(%w[Country-Code])
|
344
|
+
end
|
345
|
+
|
346
|
+
def environmental_impact_current
|
347
|
+
xpath(%w[Environmental-Impact-Current])&.to_i
|
348
|
+
end
|
349
|
+
|
350
|
+
def environmental_impact_potential
|
351
|
+
xpath(%w[Environmental-Impact-Potential])&.to_i
|
352
|
+
end
|
353
|
+
|
354
|
+
def co2_emissions_current_per_floor_area
|
355
|
+
xpath(%w[CO2-Emissions-Current-Per-Floor-Area])
|
356
|
+
end
|
357
|
+
|
358
|
+
def main_heating_controls
|
359
|
+
xpath(%w[Main-Heating-Controls Description])
|
360
|
+
end
|
361
|
+
|
362
|
+
def multiple_glazed_proportion
|
363
|
+
xpath(%w[Multiple-Glazed-Percentage])
|
364
|
+
end
|
365
|
+
|
366
|
+
def fixed_lighting_outlets_count
|
367
|
+
@xml_doc.search("Fixed-Lights/Fixed-Light/Lighting-Outlets").map(&:content).map(&:to_i).sum
|
368
|
+
end
|
369
|
+
|
370
|
+
def format_fixed_light_array
|
371
|
+
@xml_doc
|
372
|
+
.search("Fixed-Lights/Fixed-Light")
|
373
|
+
.map do |part|
|
374
|
+
{
|
375
|
+
lighting_efficacy:
|
376
|
+
xpath(%w[Lighting-Efficacy], part),
|
377
|
+
lighting_outlets:
|
378
|
+
xpath(%w[Lighting-Outlets], part),
|
379
|
+
}
|
380
|
+
end
|
381
|
+
end
|
382
|
+
|
383
|
+
def low_energy_lighting
|
384
|
+
total_energy_outlet_count = []
|
385
|
+
low_energy_outlet_count = []
|
386
|
+
|
387
|
+
format_fixed_light_array.each do |outlet|
|
388
|
+
if outlet[:lighting_efficacy].to_i > THRESHOLD_LOW_ENERGY_LIGHTING_EFFICACY
|
389
|
+
low_energy_outlet_count << outlet[:lighting_outlets].to_i
|
390
|
+
end
|
391
|
+
total_energy_outlet_count << outlet[:lighting_outlets].to_f
|
392
|
+
end
|
393
|
+
|
394
|
+
if total_energy_outlet_count.sum.zero?
|
395
|
+
return 0
|
396
|
+
end
|
397
|
+
|
398
|
+
(low_energy_outlet_count.sum / total_energy_outlet_count.sum * 100).round
|
399
|
+
end
|
400
|
+
|
401
|
+
def low_energy_fixed_lighting_outlets_count
|
402
|
+
low_energy_outlet_count = []
|
403
|
+
|
404
|
+
format_fixed_light_array.each do |outlet|
|
405
|
+
if outlet[:lighting_efficacy].to_i > THRESHOLD_LOW_ENERGY_LIGHTING_EFFICACY
|
406
|
+
low_energy_outlet_count << outlet[:lighting_outlets].to_i
|
407
|
+
end
|
408
|
+
end
|
409
|
+
|
410
|
+
low_energy_outlet_count.sum
|
411
|
+
end
|
412
|
+
|
413
|
+
def open_fireplaces_count
|
414
|
+
xpath(%w[Open-Chimneys-Count])&.to_i
|
415
|
+
end
|
416
|
+
|
417
|
+
def hot_water_description
|
418
|
+
xpath(%w[Hot-Water Description])
|
419
|
+
end
|
420
|
+
|
421
|
+
def hot_water_energy_efficiency_rating
|
422
|
+
xpath(%w[Hot-Water Energy-Efficiency-Rating])
|
423
|
+
end
|
424
|
+
|
425
|
+
def hot_water_environmental_efficiency_rating
|
426
|
+
xpath(%w[Hot-Water Environmental-Efficiency-Rating])
|
427
|
+
end
|
428
|
+
|
429
|
+
def window_description
|
430
|
+
xpath(%w[Windows Description])
|
431
|
+
end
|
432
|
+
|
433
|
+
def window_energy_efficiency_rating
|
434
|
+
xpath(%w[Windows Energy-Efficiency-Rating])
|
435
|
+
end
|
436
|
+
|
437
|
+
def window_environmental_efficiency_rating
|
438
|
+
xpath(%w[Windows Environmental-Efficiency-Rating])
|
439
|
+
end
|
440
|
+
|
441
|
+
def secondary_heating_description
|
442
|
+
xpath(%w[Secondary-Heating Description])
|
443
|
+
end
|
444
|
+
|
445
|
+
def secondary_heating_energy_efficiency_rating
|
446
|
+
xpath(%w[Secondary-Heating Energy-Efficiency-Rating])
|
447
|
+
end
|
448
|
+
|
449
|
+
def secondary_heating_environmental_efficiency_rating
|
450
|
+
xpath(%w[Secondary-Heating Environmental-Efficiency-Rating])
|
451
|
+
end
|
452
|
+
|
453
|
+
def lighting_description
|
454
|
+
xpath(%w[Lighting Description])
|
455
|
+
end
|
456
|
+
|
457
|
+
def lighting_energy_efficiency_rating
|
458
|
+
xpath(%w[Lighting Energy-Efficiency-Rating])
|
459
|
+
end
|
460
|
+
|
461
|
+
def lighting_environmental_efficiency_rating
|
462
|
+
xpath(%w[Lighting Environmental-Efficiency-Rating])
|
463
|
+
end
|
464
|
+
|
465
|
+
def built_form
|
466
|
+
xpath(%w[Built-Form])
|
467
|
+
end
|
468
|
+
|
469
|
+
def wind_turbine_count
|
470
|
+
@xml_doc.search("Wind-Turbines/Wind-Turbine").map(&:content).count
|
471
|
+
end
|
472
|
+
|
473
|
+
def all_main_heating_descriptions
|
474
|
+
@xml_doc.search("Main-Heating/Description").map(&:content)
|
475
|
+
end
|
476
|
+
|
477
|
+
def all_main_heating_controls_descriptions
|
478
|
+
@xml_doc.search("Main-Heating-Controls/Description").map(&:content)
|
479
|
+
end
|
480
|
+
|
481
|
+
def report_type
|
482
|
+
xpath(%w[Report-Type])
|
483
|
+
end
|
484
|
+
|
485
|
+
def all_roof_descriptions
|
486
|
+
@xml_doc.search("Roof/Description").map(&:content)
|
487
|
+
end
|
488
|
+
|
489
|
+
def all_roof_env_energy_efficiency_rating
|
490
|
+
@xml_doc.search("Roof/Environmental-Efficiency-Rating").map(&:content)
|
491
|
+
end
|
492
|
+
|
493
|
+
def all_roof_energy_efficiency_rating
|
494
|
+
@xml_doc.search("Roof/Environmental-Efficiency-Rating").map(&:content)
|
495
|
+
end
|
496
|
+
|
497
|
+
def all_wall_descriptions
|
498
|
+
@xml_doc.search("Walls/Description").map(&:content)
|
499
|
+
end
|
500
|
+
|
501
|
+
def all_wall_energy_efficiency_rating
|
502
|
+
@xml_doc.search("Walls/Energy-Efficiency-Rating").map(&:content)
|
503
|
+
end
|
504
|
+
|
505
|
+
def all_wall_env_energy_efficiency_rating
|
506
|
+
@xml_doc.search("Walls/Environmental-Efficiency-Rating").map(&:content)
|
507
|
+
end
|
508
|
+
|
509
|
+
def energy_tariff
|
510
|
+
xpath(%w[Electricity-Tariff])
|
511
|
+
end
|
512
|
+
|
513
|
+
def floor_level
|
514
|
+
xpath(%w[SAP-Flat-Details Level])
|
515
|
+
end
|
516
|
+
|
517
|
+
def all_main_heating_energy_efficiency
|
518
|
+
@xml_doc.search("Main-Heating/Energy-Efficiency-Rating").map(&:content)
|
519
|
+
end
|
520
|
+
|
521
|
+
def floor_height
|
522
|
+
@xml_doc.search("Storey-Height").map(&:content)
|
523
|
+
end
|
524
|
+
|
525
|
+
def all_floor_descriptions
|
526
|
+
@xml_doc.search("Property-Summary/Floor/Description").map(&:content)
|
527
|
+
end
|
528
|
+
|
529
|
+
def all_floor_energy_efficiency_rating
|
530
|
+
@xml_doc
|
531
|
+
.search("Property-Summary/Floor/Energy-Efficiency-Rating")
|
532
|
+
.map(&:content)
|
533
|
+
end
|
534
|
+
|
535
|
+
def all_floor_env_energy_efficiency_rating
|
536
|
+
@xml_doc
|
537
|
+
.search("Property-Summary/Floor/Environmental-Efficiency-Rating")
|
538
|
+
.map(&:content)
|
539
|
+
end
|
540
|
+
|
541
|
+
def all_main_heating_controls_energy_efficiency
|
542
|
+
@xml_doc
|
543
|
+
.search("Main-Heating-Controls/Energy-Efficiency-Rating")
|
544
|
+
.map(&:content)
|
545
|
+
end
|
546
|
+
|
547
|
+
def all_main_heating_controls_environmental_efficiency
|
548
|
+
@xml_doc
|
549
|
+
.search("Main-Heating-Controls/Environmental-Efficiency-Rating")
|
550
|
+
.map(&:content)
|
551
|
+
end
|
552
|
+
|
553
|
+
def all_main_heating_environmental_efficiency
|
554
|
+
@xml_doc
|
555
|
+
.search("Main-Heating/Environmental-Efficiency-Rating")
|
556
|
+
.map(&:content)
|
557
|
+
end
|
558
|
+
|
559
|
+
def cylinder_insul_thickness
|
560
|
+
xpath(%w[Hot-Water-Store-Insulation-Thickness])
|
561
|
+
end
|
562
|
+
|
563
|
+
def cylinder_insulation_type
|
564
|
+
xpath(%w[Hot-Water-Store-Insulation-Type])
|
565
|
+
end
|
566
|
+
|
567
|
+
def cylinder_size
|
568
|
+
xpath(%w[Hot-Water-Store-Size])
|
569
|
+
end
|
570
|
+
|
571
|
+
def has_cylinder_thermostat
|
572
|
+
xpath(%w[Has-Cylinder-Thermostat])
|
573
|
+
end
|
574
|
+
|
575
|
+
def mech_vent_sys_index_number
|
576
|
+
xpath(%w[Mechanical-Vent-System-Index-Number])&.to_i
|
577
|
+
end
|
578
|
+
|
579
|
+
def mechanical_vent_data_source
|
580
|
+
xpath(%w[Mechanical-Ventilation-Data-Source])
|
581
|
+
end
|
582
|
+
|
583
|
+
def thermal_store
|
584
|
+
xpath(%w[Thermal-Store])
|
585
|
+
end
|
586
|
+
|
587
|
+
def ventilation_type
|
588
|
+
xpath(%w[Ventilation-Type])
|
589
|
+
end
|
590
|
+
|
591
|
+
def gas_smart_meter_present
|
592
|
+
Helper::ToBool.execute(xpath(%w[Gas-Smart-Meter-Present]))
|
593
|
+
end
|
594
|
+
|
595
|
+
def electricity_smart_meter_present
|
596
|
+
Helper::ToBool.execute(xpath(%w[Electricity-Smart-Meter-Present]))
|
597
|
+
end
|
598
|
+
end
|
599
|
+
end
|
600
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: epb_view_models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DLUHC Energy Performance of Buildings
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -1656,6 +1656,19 @@ files:
|
|
1656
1656
|
- api/schemas/xml/SAP-Schema-NI-18.0.0/SAP/UDT/EPC-Domains.xsd
|
1657
1657
|
- api/schemas/xml/SAP-Schema-NI-18.0.0/SAP/UDT/SAP09-Domains.xsd
|
1658
1658
|
- api/schemas/xml/SAP-Schema-NI-18.0.0/SAP/UDT/SharedDomains.xsd
|
1659
|
+
- api/schemas/xml/SAP-Schema-S-19.0.0/SAP/ExternalDefinitions.xml
|
1660
|
+
- api/schemas/xml/SAP-Schema-S-19.0.0/SAP/ExternalDefinitions.xsd
|
1661
|
+
- api/schemas/xml/SAP-Schema-S-19.0.0/SAP/Templates/AssessorManagement.xsd
|
1662
|
+
- api/schemas/xml/SAP-Schema-S-19.0.0/SAP/Templates/EPC-Certificate.xsd
|
1663
|
+
- api/schemas/xml/SAP-Schema-S-19.0.0/SAP/Templates/ExceptionList.xsd
|
1664
|
+
- api/schemas/xml/SAP-Schema-S-19.0.0/SAP/Templates/Property.xsd
|
1665
|
+
- api/schemas/xml/SAP-Schema-S-19.0.0/SAP/Templates/ReportList.xsd
|
1666
|
+
- api/schemas/xml/SAP-Schema-S-19.0.0/SAP/Templates/SAP-CollectedData.xsd
|
1667
|
+
- api/schemas/xml/SAP-Schema-S-19.0.0/SAP/Templates/SAP-Compliance-Report.xsd
|
1668
|
+
- api/schemas/xml/SAP-Schema-S-19.0.0/SAP/Templates/SAP-Report.cs
|
1669
|
+
- api/schemas/xml/SAP-Schema-S-19.0.0/SAP/Templates/SAP-Report.xsd
|
1670
|
+
- api/schemas/xml/SAP-Schema-S-19.0.0/SAP/UDT/EPC-Domains.xsd
|
1671
|
+
- api/schemas/xml/SAP-Schema-S-19.0.0/SAP/UDT/SAP-Domains.xsd
|
1659
1672
|
- api/schemas/xml/examples/CEPC-7.1(DEC).xml
|
1660
1673
|
- api/schemas/xml/examples/CEPC-7.1(DEC_RR).xml
|
1661
1674
|
- api/schemas/xml/examples/CEPC-7.1(EPC).xml
|
@@ -1884,6 +1897,7 @@ files:
|
|
1884
1897
|
- lib/view_model/sap_schema_ni_173/common_schema.rb
|
1885
1898
|
- lib/view_model/sap_schema_ni_174/common_schema.rb
|
1886
1899
|
- lib/view_model/sap_schema_ni_1800/common_schema.rb
|
1900
|
+
- lib/view_model/sap_schema_s_1900/common_schema.rb
|
1887
1901
|
- lib/view_model/sap_wrapper.rb
|
1888
1902
|
- lib/view_model_boundary/node_not_found.rb
|
1889
1903
|
- lib/view_model_boundary/xsd_files_not_found.rb
|