epb_view_models 1.0.0 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.buildspec.yml +13 -0
- data/.gitignore +5 -0
- data/.ruby-version +1 -0
- data/Gemfile.lock +22 -17
- data/Makefile +1 -1
- data/api/schemas/xml/RdSAP-Schema-NI-19.0/RdSAP/Templates/EPC-CollectedData.xsd +13 -12
- data/lib/epb_view_models.rb +1 -1
- data/lib/helper/ac_report_extraction.rb +26 -28
- data/lib/helper/energy_band_calculator.rb +1 -1
- data/lib/helper/xml_enums_to_output.rb +286 -126
- data/lib/presenter/cepc/report.rb +5 -2
- data/lib/presenter/dec/report.rb +5 -2
- data/lib/presenter/export/domestic.rb +1 -1
- data/lib/presenter/rd_sap/report.rb +213 -5
- data/lib/presenter/sap/report.rb +213 -4
- data/lib/presenter/sap/summary.rb +1 -1
- data/lib/view_model/cepc50/cepc.rb +0 -4
- data/lib/view_model/cepc60/cepc.rb +0 -4
- data/lib/view_model/cepc71/dec.rb +0 -4
- data/lib/view_model/cepc_ni800/ac_report.rb +3 -2
- data/lib/view_model/domestic_epc_view_model.rb +4 -0
- data/lib/view_model/rd_sap_schema_170/common_schema.rb +16 -0
- data/lib/view_model/rd_sap_schema_171/common_schema.rb +16 -0
- data/lib/view_model/rd_sap_schema_180/common_schema.rb +16 -0
- data/lib/view_model/rd_sap_schema_190/common_schema.rb +16 -0
- data/lib/view_model/rd_sap_schema_200/common_schema.rb +16 -8
- data/lib/view_model/rd_sap_schema_ni_173/common_schema.rb +16 -0
- data/lib/view_model/rd_sap_schema_ni_174/common_schema.rb +16 -0
- data/lib/view_model/rd_sap_schema_ni_180/common_schema.rb +16 -0
- data/lib/view_model/rd_sap_schema_ni_190/common_schema.rb +16 -0
- data/lib/view_model/rd_sap_schema_ni_200/common_schema.rb +16 -4
- data/lib/view_model/rd_sap_wrapper.rb +4 -0
- data/lib/view_model/sap_schema_102/common_schema.rb +33 -10
- data/lib/view_model/sap_schema_102/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_110/common_schema.rb +1 -10
- data/lib/view_model/sap_schema_110/rdsap.rb +36 -0
- data/lib/view_model/sap_schema_110/sap.rb +36 -0
- data/lib/view_model/sap_schema_112/common_schema.rb +1 -10
- data/lib/view_model/sap_schema_112/rdsap.rb +36 -0
- data/lib/view_model/sap_schema_112/sap.rb +36 -0
- data/lib/view_model/sap_schema_120/common_schema.rb +0 -12
- data/lib/view_model/sap_schema_120/rdsap.rb +36 -0
- data/lib/view_model/sap_schema_120/sap.rb +36 -0
- data/lib/view_model/sap_schema_130/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_130/rdsap.rb +36 -0
- data/lib/view_model/sap_schema_130/sap.rb +36 -0
- data/lib/view_model/sap_schema_140/common_schema.rb +0 -8
- data/lib/view_model/sap_schema_140/rdsap.rb +36 -0
- data/lib/view_model/sap_schema_140/sap.rb +36 -0
- data/lib/view_model/sap_schema_141/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_141/rdsap.rb +36 -0
- data/lib/view_model/sap_schema_141/sap.rb +36 -0
- data/lib/view_model/sap_schema_142/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_142/rdsap.rb +36 -0
- data/lib/view_model/sap_schema_142/sap.rb +36 -0
- data/lib/view_model/sap_schema_150/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_150/rdsap.rb +36 -0
- data/lib/view_model/sap_schema_150/sap.rb +36 -0
- data/lib/view_model/sap_schema_160/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_160/rdsap.rb +36 -0
- data/lib/view_model/sap_schema_160/sap.rb +36 -0
- data/lib/view_model/sap_schema_161/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_161/rdsap.rb +36 -0
- data/lib/view_model/sap_schema_161/sap.rb +36 -0
- data/lib/view_model/sap_schema_162/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_162/rdsap.rb +36 -0
- data/lib/view_model/sap_schema_162/sap.rb +36 -0
- data/lib/view_model/sap_schema_163/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_163/rdsap.rb +36 -0
- data/lib/view_model/sap_schema_163/sap.rb +36 -0
- data/lib/view_model/sap_schema_170/common_schema.rb +32 -0
- data/lib/view_model/sap_schema_171/common_schema.rb +32 -4
- data/lib/view_model/sap_schema_1800/common_schema.rb +32 -8
- data/lib/view_model/sap_schema_ni_112/common_schema.rb +1 -5
- data/lib/view_model/sap_schema_ni_112/rdsap.rb +45 -4
- data/lib/view_model/sap_schema_ni_112/sap.rb +35 -0
- data/lib/view_model/sap_schema_ni_120/common_schema.rb +1 -5
- data/lib/view_model/sap_schema_ni_120/rdsap.rb +40 -0
- data/lib/view_model/sap_schema_ni_120/sap.rb +36 -0
- data/lib/view_model/sap_schema_ni_130/common_schema.rb +1 -5
- data/lib/view_model/sap_schema_ni_130/rdsap.rb +40 -0
- data/lib/view_model/sap_schema_ni_130/sap.rb +36 -0
- data/lib/view_model/sap_schema_ni_140/common_schema.rb +1 -5
- data/lib/view_model/sap_schema_ni_140/rdsap.rb +40 -0
- data/lib/view_model/sap_schema_ni_140/sap.rb +36 -0
- data/lib/view_model/sap_schema_ni_141/common_schema.rb +1 -5
- data/lib/view_model/sap_schema_ni_141/rdsap.rb +40 -0
- data/lib/view_model/sap_schema_ni_141/sap.rb +36 -0
- data/lib/view_model/sap_schema_ni_142/common_schema.rb +1 -5
- data/lib/view_model/sap_schema_ni_142/rdsap.rb +40 -0
- data/lib/view_model/sap_schema_ni_142/sap.rb +36 -0
- data/lib/view_model/sap_schema_ni_150/common_schema.rb +1 -5
- data/lib/view_model/sap_schema_ni_150/rdsap.rb +40 -0
- data/lib/view_model/sap_schema_ni_150/sap.rb +36 -0
- data/lib/view_model/sap_schema_ni_160/common_schema.rb +2 -6
- data/lib/view_model/sap_schema_ni_160/rdsap.rb +36 -0
- data/lib/view_model/sap_schema_ni_160/sap.rb +36 -0
- data/lib/view_model/sap_schema_ni_161/common_schema.rb +1 -5
- data/lib/view_model/sap_schema_ni_161/rdsap.rb +36 -0
- data/lib/view_model/sap_schema_ni_161/sap.rb +36 -0
- data/lib/view_model/sap_schema_ni_170/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_ni_170/rdsap.rb +36 -0
- data/lib/view_model/sap_schema_ni_170/sap.rb +36 -0
- data/lib/view_model/sap_schema_ni_171/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_ni_171/rdsap.rb +36 -0
- data/lib/view_model/sap_schema_ni_171/sap.rb +36 -0
- data/lib/view_model/sap_schema_ni_172/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_ni_172/rdsap.rb +44 -0
- data/lib/view_model/sap_schema_ni_172/sap.rb +36 -0
- data/lib/view_model/sap_schema_ni_173/common_schema.rb +32 -0
- data/lib/view_model/sap_schema_ni_174/common_schema.rb +32 -0
- data/lib/view_model/sap_schema_ni_1800/common_schema.rb +32 -22
- data/lib/view_model/sap_wrapper.rb +4 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: feafa754037d1b8749e1e9b5a7308641da5870f851529cf3377078e51da48687
|
4
|
+
data.tar.gz: bd830849348a8cee04b84c565458211c28a50c31caf420b0cd407d6655a17602
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f1210802f8694ba26463bc14b321b4e97b242af4ea69dc8b4a1d6409568cec9383f12b36104c572d760cdf1c6f1ab3aed00e6fb89e5e7efda142fe1e9322a06
|
7
|
+
data.tar.gz: 51d788026927bbab0d9ad3def044e8f56b0a986fae552f2c550810ea2649f49638b144621743353daf8cf56f4a713bd23b8071c2487fbb8edc035b33c49f8db3
|
data/.buildspec.yml
ADDED
data/.gitignore
CHANGED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.7.3
|
data/Gemfile.lock
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
GEM
|
2
2
|
specs:
|
3
|
+
|
4
|
+
GEM
|
5
|
+
remote: https://rubygems.org/
|
6
|
+
specs:
|
3
7
|
activesupport (6.1.4)
|
4
8
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
5
9
|
i18n (>= 1.6, < 2)
|
@@ -11,15 +15,26 @@ GEM
|
|
11
15
|
diff-lcs (1.4.4)
|
12
16
|
i18n (1.8.10)
|
13
17
|
concurrent-ruby (~> 1.0)
|
18
|
+
mini_portile2 (2.5.3)
|
14
19
|
minitest (5.14.4)
|
20
|
+
nokogiri (1.11.7)
|
21
|
+
mini_portile2 (~> 2.5.0)
|
22
|
+
racc (~> 1.4)
|
23
|
+
nokogiri (1.11.7-x86_64-darwin)
|
24
|
+
racc (~> 1.4)
|
15
25
|
parallel (1.20.1)
|
16
26
|
parser (3.0.2.0)
|
17
27
|
ast (~> 2.4.1)
|
18
28
|
racc (1.5.2)
|
19
29
|
rack (2.2.3)
|
20
30
|
rainbow (3.0.0)
|
31
|
+
rake (13.0.6)
|
21
32
|
regexp_parser (2.1.1)
|
22
33
|
rexml (3.2.5)
|
34
|
+
rspec (3.10.0)
|
35
|
+
rspec-core (~> 3.10.0)
|
36
|
+
rspec-expectations (~> 3.10.0)
|
37
|
+
rspec-mocks (~> 3.10.0)
|
23
38
|
rspec-core (3.10.1)
|
24
39
|
rspec-support (~> 3.10.0)
|
25
40
|
rspec-expectations (3.10.1)
|
@@ -40,6 +55,12 @@ GEM
|
|
40
55
|
unicode-display_width (>= 1.4.0, < 3.0)
|
41
56
|
rubocop-ast (1.6.0)
|
42
57
|
parser (>= 3.0.1.1)
|
58
|
+
rubocop-govuk (4.0.0)
|
59
|
+
rubocop (~> 1.15.0)
|
60
|
+
rubocop-ast (~> 1.6.0)
|
61
|
+
rubocop-rails (~> 2.10.0)
|
62
|
+
rubocop-rake (= 0.5.1)
|
63
|
+
rubocop-rspec (~> 2.3.0)
|
43
64
|
rubocop-rails (2.10.1)
|
44
65
|
activesupport (>= 4.2.0)
|
45
66
|
rack (>= 1.1)
|
@@ -53,26 +74,10 @@ GEM
|
|
53
74
|
tzinfo (2.0.4)
|
54
75
|
concurrent-ruby (~> 1.0)
|
55
76
|
unicode-display_width (2.0.0)
|
56
|
-
|
57
|
-
GEM
|
58
|
-
remote: https://rubygems.org/
|
59
|
-
specs:
|
60
|
-
nokogiri (1.11.7-x86_64-darwin)
|
61
|
-
racc (~> 1.4)
|
62
|
-
rake (13.0.6)
|
63
|
-
rspec (3.10.0)
|
64
|
-
rspec-core (~> 3.10.0)
|
65
|
-
rspec-expectations (~> 3.10.0)
|
66
|
-
rspec-mocks (~> 3.10.0)
|
67
|
-
rubocop-govuk (4.0.0)
|
68
|
-
rubocop (~> 1.15.0)
|
69
|
-
rubocop-ast (~> 1.6.0)
|
70
|
-
rubocop-rails (~> 2.10.0)
|
71
|
-
rubocop-rake (= 0.5.1)
|
72
|
-
rubocop-rspec (~> 2.3.0)
|
73
77
|
zeitwerk (2.4.2)
|
74
78
|
|
75
79
|
PLATFORMS
|
80
|
+
ruby
|
76
81
|
x86_64-darwin-20
|
77
82
|
|
78
83
|
DEPENDENCIES
|
data/Makefile
CHANGED
@@ -4,7 +4,7 @@ SHELL := /bin/bash
|
|
4
4
|
.PHONY: help install test format
|
5
5
|
|
6
6
|
help: ## Print help documentation
|
7
|
-
@echo -e "Makefile Help for epb-
|
7
|
+
@echo -e "Makefile Help for epb-view-models"
|
8
8
|
@cat $(MAKEFILE_LIST) | grep -E '^[a-zA-Z_-]+:.*?## .*$$' | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
9
9
|
|
10
10
|
install: ## Install required libraries and setup
|
@@ -1,5 +1,6 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<xs:schema xmlns="http://www.epbniregister.com/xsd/rdsap" xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
2
|
+
<xs:schema xmlns="http://www.epbniregister.com/xsd/rdsap" xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
3
|
+
targetNamespace="http://www.epbniregister.com/xsd/rdsap" elementFormDefault="qualified" attributeFormDefault="unqualified" version="LIG-NI-19.0">
|
3
4
|
<xs:include schemaLocation="../UDT/SAP-Domains.xsd"/>
|
4
5
|
<xs:element name="SAP-Data" type="SAP-Data"/>
|
5
6
|
<xs:complexType name="SAP-Data">
|
@@ -17,7 +18,7 @@
|
|
17
18
|
<xs:annotation>
|
18
19
|
<xs:documentation>The building type of the Property e.g. Detached, Semi-Detached, Terrace etc.
|
19
20
|
|
20
|
-
Together with the Property Type, the Build Form produces a structured description of the property.</xs:documentation>
|
21
|
+
Together with the Property Type, the Build Form produces a structured description of the property.</xs:documentation>
|
21
22
|
</xs:annotation>
|
22
23
|
</xs:element>
|
23
24
|
<xs:element name="Multiple-Glazed-Proportion" type="Percentage" minOccurs="0">
|
@@ -48,9 +49,9 @@ Together with the Property Type, the Build Form produces a structured descriptio
|
|
48
49
|
</xs:element>
|
49
50
|
<xs:element name="Habitable-Room-Count" type="Count">
|
50
51
|
<xs:annotation>
|
51
|
-
<xs:documentation>Count of the number of habitable rooms within the property.
|
52
|
+
<xs:documentation>Count of the number of habitable rooms within the property.
|
52
53
|
|
53
|
-
This is the number of Reception Rooms (including Living Rooms, Sitting Rooms, Dining Rooms), Bedrooms, Study and similar rooms but excludes hall, stairs, kitchen, utility rooms, bathrooms, cloakrooms, en-suites and similar rooms.</xs:documentation>
|
54
|
+
This is the number of Reception Rooms (including Living Rooms, Sitting Rooms, Dining Rooms), Bedrooms, Study and similar rooms but excludes hall, stairs, kitchen, utility rooms, bathrooms, cloakrooms, en-suites and similar rooms.</xs:documentation>
|
54
55
|
</xs:annotation>
|
55
56
|
</xs:element>
|
56
57
|
<xs:element name="Heated-Room-Count" type="Count">
|
@@ -82,14 +83,14 @@ This is the number of Reception Rooms (including Living Rooms, Sitting Rooms, Di
|
|
82
83
|
<xs:annotation>
|
83
84
|
<xs:documentation>The number of Open Fireplaces in the Property.
|
84
85
|
|
85
|
-
An Open Fireplace is a fireplace that still allows air to pass between the inside of the Property and the outside.</xs:documentation>
|
86
|
+
An Open Fireplace is a fireplace that still allows air to pass between the inside of the Property and the outside.</xs:documentation>
|
86
87
|
</xs:annotation>
|
87
88
|
</xs:element>
|
88
89
|
<xs:element name="Property-Type" type="PropertyTypeCode">
|
89
90
|
<xs:annotation>
|
90
91
|
<xs:documentation>Describes the type of property such as House, Flat, Mansion, Maisonette etc.
|
91
92
|
|
92
|
-
This is actually the type differentiator for Property but only a limited number of property types, notably Apartment and Apartment Block, have any specific characteristics and warrant their own definition.</xs:documentation>
|
93
|
+
This is actually the type differentiator for Property but only a limited number of property types, notably Apartment and Apartment Block, have any specific characteristics and warrant their own definition.</xs:documentation>
|
93
94
|
</xs:annotation>
|
94
95
|
</xs:element>
|
95
96
|
<xs:element name="Solar-Water-Heating" type="Flag">
|
@@ -191,8 +192,8 @@ This is actually the type differentiator for Property but only a limited number
|
|
191
192
|
<xs:annotation>
|
192
193
|
<xs:documentation>Details of the significant building parts that comprise the main habitable building in the property. The main habitable area generally consists of a single main building but can over time be extended to include extensions such as new wings and additional storeys.
|
193
194
|
|
194
|
-
For the purpose of calculating the overall Energy Assessment for the property details of each distinct Building Part, such as its construction, have to be gathered because different materials have different insulation ratings (obviously) which affects the overall rating.
|
195
|
-
</xs:documentation>
|
195
|
+
For the purpose of calculating the overall Energy Assessment for the property details of each distinct Building Part, such as its construction, have to be gathered because different materials have different insulation ratings (obviously) which affects the overall rating.
|
196
|
+
</xs:documentation>
|
196
197
|
</xs:annotation>
|
197
198
|
<xs:sequence>
|
198
199
|
<xs:element name="SAP-Integral-Conservatory" type="SAP-Integral-Conservatory" minOccurs="0"/>
|
@@ -564,7 +565,7 @@ For the purpose of calculating the overall Energy Assessment for the property de
|
|
564
565
|
<xs:complexType name="SAP-Deselected-Improvements">
|
565
566
|
<xs:annotation>
|
566
567
|
<xs:documentation>There are 22 possible improvement measures, designated from A to V. This must record measures deselected by DEA
|
567
|
-
(A to V is the full set, only E, N, U and V are considered at the moment for new build).</xs:documentation>
|
568
|
+
(A to V is the full set, only E, N, U and V are considered at the moment for new build).</xs:documentation>
|
568
569
|
</xs:annotation>
|
569
570
|
<xs:sequence>
|
570
571
|
<xs:element name="Deselected-Improvement-Measure" type="SAP-ImprovementMeasureCode" maxOccurs="unbounded"/>
|
@@ -674,7 +675,7 @@ For the purpose of calculating the overall Energy Assessment for the property de
|
|
674
675
|
<xs:element name="Emitter-Temperature" type="EmitterTemperatureCode" minOccurs="0">
|
675
676
|
<xs:annotation>
|
676
677
|
<xs:documentation>0, 1, 3 or 4 applicable to condensing boilers and heat pumps.
|
677
|
-
Other systems NA.</xs:documentation>
|
678
|
+
Other systems NA.</xs:documentation>
|
678
679
|
</xs:annotation>
|
679
680
|
</xs:element>
|
680
681
|
<xs:element name="MCS-Installed-Heat-Pump" type="xs:boolean" minOccurs="0">
|
@@ -716,7 +717,7 @@ Other systems NA.</xs:documentation>
|
|
716
717
|
<xs:element name="Peak-Power" type="Measurement">
|
717
718
|
<xs:annotation>
|
718
719
|
<xs:documentation>Peak kW of photovoltaics (PVs) (kWp).
|
719
|
-
If the total peak power has been apportioned between different dwellings within the same building, this is the kWp ascribed to the dwelling being assessed.</xs:documentation>
|
720
|
+
If the total peak power has been apportioned between different dwellings within the same building, this is the kWp ascribed to the dwelling being assessed.</xs:documentation>
|
720
721
|
</xs:annotation>
|
721
722
|
</xs:element>
|
722
723
|
<xs:element name="Orientation" type="SAP-CompassDirectionCode">
|
@@ -1032,4 +1033,4 @@ If the total peak power has been apportioned between different dwellings within
|
|
1032
1033
|
</xs:element>
|
1033
1034
|
</xs:sequence>
|
1034
1035
|
</xs:complexType>
|
1035
|
-
</xs:schema>
|
1036
|
+
</xs:schema>
|
data/lib/epb_view_models.rb
CHANGED
@@ -12,43 +12,41 @@ module Helper
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def checklist_values(checklist, skip_state: false)
|
15
|
-
|
16
|
-
checklist&.element_children&.map { |node|
|
17
|
-
next if xpath(%w[Flag], node).nil? && !skip_state
|
15
|
+
return {} if checklist.nil? || checklist.element_children.nil?
|
18
16
|
|
19
|
-
|
20
|
-
|
21
|
-
{ checklist_item => { note: xpath(%w[Note], node) } }
|
22
|
-
else
|
23
|
-
{
|
24
|
-
checklist_item => {
|
25
|
-
state: xpath(%w[Flag], node) == "Yes",
|
26
|
-
note: xpath(%w[Note], node),
|
27
|
-
},
|
28
|
-
}
|
29
|
-
end
|
30
|
-
}&.compact.inject(&:merge)
|
31
|
-
|
32
|
-
results.nil? ? {} : results
|
33
|
-
end
|
34
|
-
|
35
|
-
def checklist_values_with_guidance(checklist)
|
36
|
-
results =
|
37
|
-
checklist&.element_children&.map { |node|
|
38
|
-
next if xpath(%w[Flag], node).nil?
|
39
|
-
|
40
|
-
checklist_item = node.name.underscore.to_sym
|
17
|
+
checklist.element_children.map { |node|
|
18
|
+
next if xpath(%w[Flag], node).nil? && !skip_state
|
41
19
|
|
20
|
+
checklist_item = node.name.underscore.to_sym
|
21
|
+
if skip_state
|
22
|
+
{ checklist_item => { note: xpath(%w[Note], node) } }
|
23
|
+
else
|
42
24
|
{
|
43
25
|
checklist_item => {
|
44
26
|
state: xpath(%w[Flag], node) == "Yes",
|
45
27
|
note: xpath(%w[Note], node),
|
46
|
-
guidance: xpath(%w[Text], node),
|
47
28
|
},
|
48
29
|
}
|
49
|
-
|
30
|
+
end
|
31
|
+
}.compact.inject(&:merge)
|
32
|
+
end
|
33
|
+
|
34
|
+
def checklist_values_with_guidance(checklist)
|
35
|
+
return {} if checklist.nil? || checklist.element_children.nil?
|
36
|
+
|
37
|
+
checklist.element_children.map { |node|
|
38
|
+
next if xpath(%w[Flag], node).nil?
|
50
39
|
|
51
|
-
|
40
|
+
checklist_item = node.name.underscore.to_sym
|
41
|
+
|
42
|
+
{
|
43
|
+
checklist_item => {
|
44
|
+
state: xpath(%w[Flag], node) == "Yes",
|
45
|
+
note: xpath(%w[Note], node),
|
46
|
+
guidance: xpath(%w[Text], node),
|
47
|
+
},
|
48
|
+
}
|
49
|
+
}.compact.inject(&:merge)
|
52
50
|
end
|
53
51
|
|
54
52
|
def guidance(guidance_elements)
|
@@ -15,6 +15,7 @@ module Helper
|
|
15
15
|
"4" => "Mid-Terrace",
|
16
16
|
"5" => "Enclosed End-Terrace",
|
17
17
|
"6" => "Enclosed Mid-Terrace",
|
18
|
+
"7" => "Linked Detached",
|
18
19
|
"NR" => "Not Recorded",
|
19
20
|
}.freeze
|
20
21
|
SAP_ENERGY_TARIFF = {
|
@@ -31,109 +32,6 @@ module Helper
|
|
31
32
|
"4" => "dual (24 hour)",
|
32
33
|
"5" => "off-peak 18 hour",
|
33
34
|
}.freeze
|
34
|
-
RDSAP_MAIN_FUEL = {
|
35
|
-
"0" =>
|
36
|
-
"To be used only when there is no heating/hot-water system or data is from a community network",
|
37
|
-
"1" =>
|
38
|
-
"mains gas - this is for backwards compatibility only and should not be used",
|
39
|
-
"2" =>
|
40
|
-
"LPG - this is for backwards compatibility only and should not be used",
|
41
|
-
"3" => "bottled LPG",
|
42
|
-
"4" =>
|
43
|
-
"oil - this is for backwards compatibility only and should not be used",
|
44
|
-
"5" => "anthracite",
|
45
|
-
"6" => "wood logs",
|
46
|
-
"7" => "bulk wood pellets",
|
47
|
-
"8" => "wood chips",
|
48
|
-
"9" => "dual fuel - mineral + wood",
|
49
|
-
"10" =>
|
50
|
-
"electricity - this is for backwards compatibility only and should not be used",
|
51
|
-
"11" =>
|
52
|
-
"waste combustion - this is for backwards compatibility only and should not be used",
|
53
|
-
"12" =>
|
54
|
-
"biomass - this is for backwards compatibility only and should not be used",
|
55
|
-
"13" =>
|
56
|
-
"biogas - landfill - this is for backwards compatibility only and should not be used",
|
57
|
-
"14" =>
|
58
|
-
"house coal - this is for backwards compatibility only and should not be used",
|
59
|
-
"15" => "smokeless coal",
|
60
|
-
"16" => "wood pellets in bags for secondary heating",
|
61
|
-
"17" => "LPG special condition",
|
62
|
-
"18" => "B30K (not community)",
|
63
|
-
"19" => "bioethanol",
|
64
|
-
"20" => "mains gas (community)",
|
65
|
-
"21" => "LPG (community)",
|
66
|
-
"22" => "oil (community)",
|
67
|
-
"23" => "B30D (community)",
|
68
|
-
"24" => "coal (community)",
|
69
|
-
"25" => "electricity (community)",
|
70
|
-
"26" => "mains gas (not community)",
|
71
|
-
"27" => "LPG (not community)",
|
72
|
-
"28" => "oil (not community)",
|
73
|
-
"29" => "electricity (not community)",
|
74
|
-
"30" => "waste combustion (community)",
|
75
|
-
"31" => "biomass (community)",
|
76
|
-
"32" => "biogas (community)",
|
77
|
-
"33" => "house coal (not community)",
|
78
|
-
"34" => "biodiesel from any biomass source",
|
79
|
-
"35" => "biodiesel from used cooking oil only",
|
80
|
-
"36" => "biodiesel from vegetable oil only (not community)",
|
81
|
-
"37" => "appliances able to use mineral oil or liquid biofuel",
|
82
|
-
"51" => "biogas (not community)",
|
83
|
-
"56" =>
|
84
|
-
"heat from boilers that can use mineral oil or biodiesel (community)",
|
85
|
-
"57" =>
|
86
|
-
"heat from boilers using biodiesel from any biomass source (community)",
|
87
|
-
"58" => "biodiesel from vegetable oil only (community)",
|
88
|
-
"99" => "from heat network data (community)",
|
89
|
-
}.freeze
|
90
|
-
SAP_MAIN_FUEL = {
|
91
|
-
"1" => "Gas: mains gas",
|
92
|
-
"2" => "Gas: bulk LPG",
|
93
|
-
"3" => "Gas: bottled LPG",
|
94
|
-
"4" => "Oil: heating oil",
|
95
|
-
"7" => "Gas: biogas",
|
96
|
-
"8" => "LNG",
|
97
|
-
"9" => "LPG subject to Special Condition 18",
|
98
|
-
"10" => "Solid fuel: dual fuel appliance (mineral and wood)",
|
99
|
-
"11" => "Solid fuel: house coal",
|
100
|
-
"12" => "Solid fuel: manufactured smokeless fuel",
|
101
|
-
"15" => "Solid fuel: anthracite",
|
102
|
-
"20" => "Solid fuel: wood logs",
|
103
|
-
"21" => "Solid fuel: wood chips",
|
104
|
-
"22" => "Solid fuel: wood pellets (in bags, for secondary heating)",
|
105
|
-
"23" =>
|
106
|
-
"Solid fuel: wood pellets (bulk supply in bags, for main heating)",
|
107
|
-
"36" => "Electricity: electricity sold to grid",
|
108
|
-
"37" => "Electricity: electricity displaced from grid",
|
109
|
-
"39" => "Electricity: electricity, unspecified tariff",
|
110
|
-
"41" => "Community heating schemes: heat from electric heat pump",
|
111
|
-
"42" => "Community heating schemes: heat from boilers - waste combustion",
|
112
|
-
"43" => "Community heating schemes: heat from boilers - biomass",
|
113
|
-
"44" => "Community heating schemes: heat from boilers - biogas",
|
114
|
-
"45" => "Community heating schemes: waste heat from power stations",
|
115
|
-
"46" => "Community heating schemes: geothermal heat source",
|
116
|
-
"48" => "Community heating schemes: heat from CHP",
|
117
|
-
"49" => "Community heating schemes: electricity generated by CHP",
|
118
|
-
"50" =>
|
119
|
-
"Community heating schemes: electricity for pumping in distribution network",
|
120
|
-
"51" => "Community heating schemes: heat from mains gas",
|
121
|
-
"52" => "Community heating schemes: heat from LPG",
|
122
|
-
"53" => "Community heating schemes: heat from oil",
|
123
|
-
"54" => "Community heating schemes: heat from coal",
|
124
|
-
"55" => "Community heating schemes: heat from B30D",
|
125
|
-
"56" =>
|
126
|
-
"Community heating schemes: heat from boilers that can use mineral oil or biodiesel",
|
127
|
-
"57" =>
|
128
|
-
"Community heating schemes: heat from boilers using biodiesel from any biomass source",
|
129
|
-
"58" => "Community heating schemes: biodiesel from vegetable oil only",
|
130
|
-
"72" => "biodiesel from used cooking oil only",
|
131
|
-
"73" => "biodiesel from vegetable oil only",
|
132
|
-
"74" => "appliances able to use mineral oil or liquid biofuel",
|
133
|
-
"75" => "B30K",
|
134
|
-
"76" => "bioethanol from any biomass source",
|
135
|
-
"99" => "Community heating schemes: special fuel",
|
136
|
-
}.freeze
|
137
35
|
RDSAP_GLAZED_TYPE = {
|
138
36
|
"1" => "double glazing installed before 2002",
|
139
37
|
"2" => "double glazing installed during or after 2002",
|
@@ -168,6 +66,7 @@ module Helper
|
|
168
66
|
"4" =>
|
169
67
|
"rental (private) - this is for backwards compatibility only and should not be used",
|
170
68
|
"5" => "not sale or rental",
|
69
|
+
"ni_5" => "None of the above",
|
171
70
|
"6" => "new dwelling",
|
172
71
|
"7" =>
|
173
72
|
"not recorded - this is for backwards compatibility only and should not be used",
|
@@ -227,8 +126,128 @@ module Helper
|
|
227
126
|
"6" => "Voluntary (No legal requirement for an EPC).",
|
228
127
|
"7" => "Not recorded.",
|
229
128
|
}.freeze
|
129
|
+
VENTILATION_TYPE = {
|
130
|
+
"1" => "natural with intermittent extract fans",
|
131
|
+
"2" => "natural with passive vents",
|
132
|
+
"3" => "positive input from loft",
|
133
|
+
"4" => "positive input from outside",
|
134
|
+
"5" => "mechanical extract, centralised (MEV c)",
|
135
|
+
"6" => "mechanical extract, decentralised (MEV dc)",
|
136
|
+
"7" => "balanced without heat recovery (MV)",
|
137
|
+
"8" => "balanced with heat recovery (MVHR)",
|
138
|
+
"9" => "natural with intermittent extract fans and/or passive vents. For backwards compatibility only, do not use.",
|
139
|
+
"10" => "natural with intermittent extract fans and passive vents",
|
140
|
+
}.freeze
|
141
|
+
CYLINDER_INSULATION_THICKNESS = {
|
142
|
+
"12" => "12 mm",
|
143
|
+
"25" => "25 mm",
|
144
|
+
"38" => "38 mm",
|
145
|
+
"50" => "50 mm",
|
146
|
+
"80" => "80 mm",
|
147
|
+
"120" => "120 mm",
|
148
|
+
"160" => "160 mm",
|
149
|
+
}.freeze
|
150
|
+
RDSAP_FUEL_TYPE = {
|
151
|
+
"0" => "To be used only when there is no heating/hot-water system or data is from a community network",
|
152
|
+
"1" => "mains gas - this is for backwards compatibility only and should not be used",
|
153
|
+
"2" => "LPG - this is for backwards compatibility only and should not be used",
|
154
|
+
"3" => "bottled LPG",
|
155
|
+
"4" => "oil - this is for backwards compatibility only and should not be used",
|
156
|
+
"5" => "anthracite",
|
157
|
+
"6" => "wood logs",
|
158
|
+
"7" => "bulk wood pellets",
|
159
|
+
"8" => "wood chips",
|
160
|
+
"9" => "dual fuel - mineral + wood",
|
161
|
+
"10" => "electricity - this is for backwards compatibility only and should not be used",
|
162
|
+
"11" => "waste combustion - this is for backwards compatibility only and should not be used",
|
163
|
+
"12" => "biomass - this is for backwards compatibility only and should not be used",
|
164
|
+
"13" => "biogas - landfill - this is for backwards compatibility only and should not be used",
|
165
|
+
"14" => "house coal - this is for backwards compatibility only and should not be used",
|
166
|
+
"15" => "smokeless coal",
|
167
|
+
"16" => "wood pellets in bags for secondary heating",
|
168
|
+
"17" => "LPG special condition",
|
169
|
+
"18" => "B30K (not community)",
|
170
|
+
"19" => "bioethanol",
|
171
|
+
"20" => "mains gas (community)",
|
172
|
+
"21" => "LPG (community)",
|
173
|
+
"22" => "oil (community)",
|
174
|
+
"23" => "B30D (community)",
|
175
|
+
"24" => "coal (community)",
|
176
|
+
"25" => "electricity (community)",
|
177
|
+
"26" => "mains gas (not community)",
|
178
|
+
"27" => "LPG (not community)",
|
179
|
+
"28" => "oil (not community)",
|
180
|
+
"29" => "electricity (not community)",
|
181
|
+
"30" => "waste combustion (community)",
|
182
|
+
"31" => "biomass (community)",
|
183
|
+
"32" => "biogas (community)",
|
184
|
+
"33" => "house coal (not community)",
|
185
|
+
"34" => "biodiesel from any biomass source",
|
186
|
+
"35" => "biodiesel from used cooking oil only",
|
187
|
+
"36" => "biodiesel from vegetable oil only (not community)",
|
188
|
+
"36-rapeseed-oil" => "rapeseed oil",
|
189
|
+
"37" => "appliances able to use mineral oil or liquid biofuel",
|
190
|
+
"51" => "biogas (not community)",
|
191
|
+
"56" => "heat from boilers that can use mineral oil or biodiesel (community)",
|
192
|
+
"57" => "heat from boilers using biodiesel from any biomass source (community)",
|
193
|
+
"58" => "biodiesel from vegetable oil only (community)",
|
194
|
+
"99" => "from heat network data (community)",
|
195
|
+
}.freeze
|
196
|
+
RDSAP_FUEL_TYPE_PRE_143 = {
|
197
|
+
"1-pre14.3-sap" => "mains gas",
|
198
|
+
"4-pre14.3-sap" => "oil",
|
199
|
+
"10-pre14.3-sap" => "electricity",
|
200
|
+
"11-pre14.3-sap" => "waste combustion",
|
201
|
+
"12-pre14.3-sap" => "biomass",
|
202
|
+
"13-pre14.3-sap" => "biogas - landfill",
|
203
|
+
"14-pre14.3-sap" => "house coal",
|
204
|
+
}.freeze
|
205
|
+
SAP_FUEL_TYPE = {
|
206
|
+
"1" => "Gas: mains gas",
|
207
|
+
"2" => "Gas: bulk LPG",
|
208
|
+
"3" => "Gas: bottled LPG",
|
209
|
+
"4" => "Oil: heating oil",
|
210
|
+
"7" => "Gas: biogas",
|
211
|
+
"8" => "LNG",
|
212
|
+
"9" => "LPG subject to Special Condition 18",
|
213
|
+
"10" => "Solid fuel: dual fuel appliance (mineral and wood)",
|
214
|
+
"11" => "Solid fuel: house coal",
|
215
|
+
"12" => "Solid fuel: manufactured smokeless fuel",
|
216
|
+
"15" => "Solid fuel: anthracite",
|
217
|
+
"20" => "Solid fuel: wood logs",
|
218
|
+
"21" => "Solid fuel: wood chips",
|
219
|
+
"22" => "Solid fuel: wood pellets (in bags, for secondary heating)",
|
220
|
+
"23" => "Solid fuel: wood pellets (bulk supply in bags, for main heating)",
|
221
|
+
"36" => "Electricity: electricity sold to grid",
|
222
|
+
"37" => "Electricity: electricity displaced from grid",
|
223
|
+
"39" => "Electricity: electricity, unspecified tariff",
|
224
|
+
"41" => "Community heating schemes: heat from electric heat pump",
|
225
|
+
"42" => "Community heating schemes: heat from boilers - waste combustion",
|
226
|
+
"43" => "Community heating schemes: heat from boilers - biomass",
|
227
|
+
"44" => "Community heating schemes: heat from boilers - biogas",
|
228
|
+
"45" => "Community heating schemes: waste heat from power stations",
|
229
|
+
"46" => "Community heating schemes: geothermal heat source",
|
230
|
+
"48" => "Community heating schemes: heat from CHP",
|
231
|
+
"49" => "Community heating schemes: electricity generated by CHP",
|
232
|
+
"50" => "Community heating schemes: electricity for pumping in distribution network",
|
233
|
+
"51" => "Community heating schemes: heat from mains gas",
|
234
|
+
"52" => "Community heating schemes: heat from LPG",
|
235
|
+
"53" => "Community heating schemes: heat from oil",
|
236
|
+
"54" => "Community heating schemes: heat from coal",
|
237
|
+
"55" => "Community heating schemes: heat from B30D",
|
238
|
+
"56" => "Community heating schemes: heat from boilers that can use mineral oil or biodiesel",
|
239
|
+
"57" => "Community heating schemes: heat from boilers using biodiesel from any biomass source",
|
240
|
+
"58" => "Community heating schemes: biodiesel from vegetable oil only",
|
241
|
+
"71" => "biodiesel from any biomass source",
|
242
|
+
"72" => "biodiesel from used cooking oil only",
|
243
|
+
"73" => "biodiesel from vegetable oil only",
|
244
|
+
"74" => "appliances able to use mineral oil or liquid biofuel",
|
245
|
+
"75" => "B30K",
|
246
|
+
"76" => "bioethanol from any biomass source",
|
247
|
+
"99" => "Community heating schemes: special fuel",
|
248
|
+
}.freeze
|
230
249
|
|
231
|
-
def self.
|
250
|
+
def self.built_form_string(number)
|
232
251
|
BUILT_FORM[number]
|
233
252
|
end
|
234
253
|
|
@@ -236,23 +255,16 @@ module Helper
|
|
236
255
|
RATINGS[value]
|
237
256
|
end
|
238
257
|
|
239
|
-
def self.energy_tariff(value, report_type
|
240
|
-
|
241
|
-
when "3"
|
258
|
+
def self.energy_tariff(value, report_type)
|
259
|
+
if is_sap(report_type)
|
242
260
|
SAP_ENERGY_TARIFF[value] || value
|
243
|
-
|
261
|
+
elsif is_rdsap(report_type)
|
244
262
|
RDSAP_ENERGY_TARIFF[value] || value
|
263
|
+
else
|
264
|
+
value
|
245
265
|
end
|
246
266
|
end
|
247
267
|
|
248
|
-
def self.main_fuel_rdsap(value)
|
249
|
-
RDSAP_MAIN_FUEL[value]
|
250
|
-
end
|
251
|
-
|
252
|
-
def self.main_fuel_sap(value)
|
253
|
-
SAP_MAIN_FUEL[value]
|
254
|
-
end
|
255
|
-
|
256
268
|
def self.glazed_area_rdsap(value)
|
257
269
|
RDSAP_GLAZED_AREA[value]
|
258
270
|
end
|
@@ -265,15 +277,32 @@ module Helper
|
|
265
277
|
TENURE[value] || value
|
266
278
|
end
|
267
279
|
|
268
|
-
def self.transaction_type(value, report_type = "2")
|
269
|
-
|
280
|
+
def self.transaction_type(value, report_type = "2", schema_type = "")
|
281
|
+
types_of_ni = %w[
|
282
|
+
RdSAP-Schema-NI-20.0.0
|
283
|
+
RdSAP-Schema-NI-19.0
|
284
|
+
RdSAP-Schema-NI-18.0
|
285
|
+
RdSAP-Schema-NI-17.4
|
286
|
+
RdSAP-Schema-NI-17.3
|
287
|
+
SAP-Schema-NI-16.1
|
288
|
+
SAP-Schema-NI-17.0
|
289
|
+
SAP-Schema-NI-17.1
|
290
|
+
SAP-Schema-NI-17.2
|
291
|
+
SAP-Schema-NI-17.3
|
292
|
+
SAP-Schema-NI-17.4
|
293
|
+
SAP-Schema-NI-18.0.0
|
294
|
+
]
|
295
|
+
|
296
|
+
if is_rdsap(report_type) && value.to_i >= 12
|
270
297
|
TRANSACTION_TYPE["#{value}RdSAP"]
|
298
|
+
elsif types_of_ni.include?(schema_type) && value.to_i == 5
|
299
|
+
TRANSACTION_TYPE["ni_5"]
|
271
300
|
else
|
272
301
|
TRANSACTION_TYPE[value] || value
|
273
302
|
end
|
274
303
|
end
|
275
304
|
|
276
|
-
def self.construction_age_band_lookup(value, schema_type, report_type
|
305
|
+
def self.construction_age_band_lookup(value, schema_type, report_type)
|
277
306
|
types_of_sap_pre17 = %w[
|
278
307
|
SAP-Schema-16.3
|
279
308
|
SAP-Schema-16.2
|
@@ -344,7 +373,7 @@ module Helper
|
|
344
373
|
RdSAP-Schema-NI-17.3
|
345
374
|
]
|
346
375
|
|
347
|
-
if value == "K" && schema_type == "SAP-Schema-12.0" && report_type
|
376
|
+
if value == "K" && schema_type == "SAP-Schema-12.0" && is_rdsap(report_type)
|
348
377
|
return CONSTRUCTION_AGE_BAND["K-12.0"]
|
349
378
|
end
|
350
379
|
|
@@ -353,15 +382,14 @@ module Helper
|
|
353
382
|
end
|
354
383
|
|
355
384
|
if value == "NR" &&
|
356
|
-
!schemes_that_use_not_recorded.include?(schema_type) ||
|
357
|
-
report_type == 3
|
385
|
+
(!schemes_that_use_not_recorded.include?(schema_type) || is_sap(report_type))
|
358
386
|
return value
|
359
387
|
end
|
360
388
|
|
361
389
|
return value if value == "L" && !schemes_that_use_l.include?(schema_type)
|
362
390
|
|
363
|
-
if value == "0" &&
|
364
|
-
|
391
|
+
if value == "0" &&
|
392
|
+
(!schemes_that_use_0.include?(schema_type) || is_sap(report_type))
|
365
393
|
return value
|
366
394
|
end
|
367
395
|
|
@@ -376,14 +404,15 @@ module Helper
|
|
376
404
|
HEAT_LOSS_CORRIDOR[value] || value
|
377
405
|
end
|
378
406
|
|
379
|
-
def self.mechanical_ventilation(value, schema_type, report_type
|
407
|
+
def self.mechanical_ventilation(value, schema_type, report_type)
|
380
408
|
types_of_sap_pre12 = %w[
|
381
409
|
SAP-Schema-11.2
|
382
410
|
SAP-Schema-11.0
|
383
411
|
SAP-Schema-10.2
|
412
|
+
SAP-Schema-NI-11.2
|
384
413
|
].freeze
|
385
414
|
|
386
|
-
if types_of_sap_pre12.include?(schema_type) && report_type
|
415
|
+
if types_of_sap_pre12.include?(schema_type.to_s) && is_rdsap(report_type)
|
387
416
|
return MECHANICAL_VENTILATION["#{value}-pre12.0"]
|
388
417
|
end
|
389
418
|
|
@@ -393,5 +422,136 @@ module Helper
|
|
393
422
|
def self.cepc_transaction_type(value)
|
394
423
|
CEPC_TRANSACTION_TYPE[value] || value
|
395
424
|
end
|
425
|
+
|
426
|
+
def self.cylinder_insulation_thickness(value, report_type = "2")
|
427
|
+
if is_rdsap(report_type)
|
428
|
+
CYLINDER_INSULATION_THICKNESS[value]
|
429
|
+
else
|
430
|
+
value
|
431
|
+
end
|
432
|
+
end
|
433
|
+
|
434
|
+
def self.is_rdsap(report_type)
|
435
|
+
report_type == "2"
|
436
|
+
end
|
437
|
+
|
438
|
+
def self.is_sap(report_type)
|
439
|
+
report_type == "3"
|
440
|
+
end
|
441
|
+
|
442
|
+
def self.ventilation_type(value, schema_type = "")
|
443
|
+
ni_sap = %w[
|
444
|
+
SAP-Schema-NI-16.1
|
445
|
+
SAP-Schema-NI-16.0
|
446
|
+
SAP-Schema-NI-15.0
|
447
|
+
SAP-Schema-NI-14.2
|
448
|
+
SAP-Schema-NI-14.1
|
449
|
+
SAP-Schema-NI-14.0
|
450
|
+
SAP-Schema-NI-13.0
|
451
|
+
].freeze
|
452
|
+
|
453
|
+
if ni_sap.include?(schema_type) && value == "9"
|
454
|
+
VENTILATION_TYPE[value].split(".").first
|
455
|
+
else
|
456
|
+
VENTILATION_TYPE[value]
|
457
|
+
end
|
458
|
+
end
|
459
|
+
|
460
|
+
def self.fuel_type(value, schema_type = "", report_type = "2")
|
461
|
+
rdsap = %i[
|
462
|
+
RdSAP-Schema-20.0.0
|
463
|
+
RdSAP-Schema-19.0
|
464
|
+
RdSAP-Schema-18.0
|
465
|
+
RdSAP-Schema-17.1
|
466
|
+
RdSAP-Schema-17.0
|
467
|
+
RdSAP-Schema-NI-20.0.0
|
468
|
+
RdSAP-Schema-NI-19.0
|
469
|
+
RdSAP-Schema-NI-18.0
|
470
|
+
RdSAP-Schema-NI-17.4
|
471
|
+
RdSAP-Schema-NI-17.3
|
472
|
+
]
|
473
|
+
|
474
|
+
pre143_sap = %i[
|
475
|
+
SAP-Schema-14.2
|
476
|
+
SAP-Schema-14.1
|
477
|
+
SAP-Schema-14.0
|
478
|
+
SAP-Schema-13.0
|
479
|
+
SAP-Schema-12.0
|
480
|
+
SAP-Schema-11.2
|
481
|
+
SAP-Schema-11.0
|
482
|
+
SAP-Schema-10.2
|
483
|
+
SAP-Schema-NI-14.2
|
484
|
+
SAP-Schema-NI-14.1
|
485
|
+
SAP-Schema-NI-14.0
|
486
|
+
SAP-Schema-NI-13.0
|
487
|
+
SAP-Schema-NI-12.0
|
488
|
+
SAP-Schema-NI-11.2
|
489
|
+
]
|
490
|
+
|
491
|
+
includes_rapeseed_oil = %i[
|
492
|
+
SAP-Schema-16.3
|
493
|
+
SAP-Schema-16.2
|
494
|
+
SAP-Schema-16.1
|
495
|
+
SAP-Schema-16.0
|
496
|
+
SAP-Schema-15.0
|
497
|
+
SAP-Schema-NI-17.2
|
498
|
+
SAP-Schema-NI-17.1
|
499
|
+
SAP-Schema-NI-17.0
|
500
|
+
SAP-Schema-NI-16.1
|
501
|
+
SAP-Schema-NI-16.0
|
502
|
+
SAP-Schema-NI-15.0
|
503
|
+
]
|
504
|
+
|
505
|
+
sap = %i[
|
506
|
+
SAP-Schema-18.0.0
|
507
|
+
SAP-Schema-17.1
|
508
|
+
SAP-Schema-17.0
|
509
|
+
SAP-Schema-16.3
|
510
|
+
SAP-Schema-16.2
|
511
|
+
SAP-Schema-16.1
|
512
|
+
SAP-Schema-16.0
|
513
|
+
SAP-Schema-15.0
|
514
|
+
SAP-Schema-14.2
|
515
|
+
SAP-Schema-14.1
|
516
|
+
SAP-Schema-14.0
|
517
|
+
SAP-Schema-13.0
|
518
|
+
SAP-Schema-12.0
|
519
|
+
SAP-Schema-11.2
|
520
|
+
SAP-Schema-11.0
|
521
|
+
SAP-Schema-10.2
|
522
|
+
SAP-Schema-NI-18.0.0
|
523
|
+
SAP-Schema-NI-17.4
|
524
|
+
SAP-Schema-NI-17.3
|
525
|
+
SAP-Schema-NI-17.2
|
526
|
+
SAP-Schema-NI-17.1
|
527
|
+
SAP-Schema-NI-17.0
|
528
|
+
SAP-Schema-NI-16.1
|
529
|
+
SAP-Schema-NI-16.0
|
530
|
+
SAP-Schema-NI-15.0
|
531
|
+
SAP-Schema-NI-14.2
|
532
|
+
SAP-Schema-NI-14.1
|
533
|
+
SAP-Schema-NI-14.0
|
534
|
+
SAP-Schema-NI-13.0
|
535
|
+
SAP-Schema-NI-12.0
|
536
|
+
SAP-Schema-NI-11.2
|
537
|
+
]
|
538
|
+
|
539
|
+
if rdsap.include?(schema_type)
|
540
|
+
RDSAP_FUEL_TYPE[value]
|
541
|
+
elsif sap.include?(schema_type) && is_sap(report_type)
|
542
|
+
SAP_FUEL_TYPE[value]
|
543
|
+
elsif sap.include?(schema_type) && is_rdsap(report_type)
|
544
|
+
if includes_rapeseed_oil.include?(schema_type) && value == "36"
|
545
|
+
return RDSAP_FUEL_TYPE["#{value}-rapeseed-oil"]
|
546
|
+
end
|
547
|
+
if pre143_sap.include?(schema_type)
|
548
|
+
return RDSAP_FUEL_TYPE_PRE_143["#{value}-pre14.3-sap"] || RDSAP_FUEL_TYPE[value]
|
549
|
+
else
|
550
|
+
RDSAP_FUEL_TYPE[value]
|
551
|
+
end
|
552
|
+
end
|
553
|
+
end
|
554
|
+
|
555
|
+
private_class_method :is_rdsap, :is_sap
|
396
556
|
end
|
397
557
|
end
|