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