epb_view_models 1.0.3 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +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/energy_band_calculator.rb +1 -1
- data/lib/helper/xml_enums_to_output.rb +339 -129
- data/lib/presenter/export/domestic.rb +1 -1
- data/lib/presenter/rd_sap/report.rb +21 -11
- data/lib/presenter/sap/report.rb +18 -6
- data/lib/presenter/sap/summary.rb +1 -1
- data/lib/view_model/domestic_epc_view_model.rb +4 -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/sap_schema_102/common_schema.rb +5 -6
- data/lib/view_model/sap_schema_102/rdsap.rb +4 -0
- data/lib/view_model/sap_schema_110/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_110/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_110/sap.rb +8 -0
- data/lib/view_model/sap_schema_112/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_112/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_112/sap.rb +8 -0
- data/lib/view_model/sap_schema_120/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_120/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_120/sap.rb +8 -0
- data/lib/view_model/sap_schema_130/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_130/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_130/sap.rb +8 -0
- data/lib/view_model/sap_schema_140/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_140/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_140/sap.rb +8 -0
- data/lib/view_model/sap_schema_141/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_141/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_141/sap.rb +8 -0
- data/lib/view_model/sap_schema_142/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_142/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_142/sap.rb +8 -0
- data/lib/view_model/sap_schema_150/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_150/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_150/sap.rb +8 -0
- data/lib/view_model/sap_schema_160/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_160/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_160/sap.rb +8 -0
- data/lib/view_model/sap_schema_161/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_161/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_161/sap.rb +8 -0
- data/lib/view_model/sap_schema_162/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_162/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_162/sap.rb +8 -0
- data/lib/view_model/sap_schema_163/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_163/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_163/sap.rb +8 -0
- data/lib/view_model/sap_schema_170/common_schema.rb +4 -0
- data/lib/view_model/sap_schema_171/common_schema.rb +4 -0
- data/lib/view_model/sap_schema_1800/common_schema.rb +4 -4
- data/lib/view_model/sap_schema_ni_112/common_schema.rb +1 -5
- data/lib/view_model/sap_schema_ni_112/rdsap.rb +13 -0
- data/lib/view_model/sap_schema_ni_112/sap.rb +8 -0
- data/lib/view_model/sap_schema_ni_120/common_schema.rb +1 -5
- data/lib/view_model/sap_schema_ni_120/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_ni_120/sap.rb +8 -0
- data/lib/view_model/sap_schema_ni_130/common_schema.rb +1 -5
- data/lib/view_model/sap_schema_ni_130/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_ni_130/sap.rb +8 -0
- data/lib/view_model/sap_schema_ni_140/common_schema.rb +1 -5
- data/lib/view_model/sap_schema_ni_140/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_ni_140/sap.rb +8 -0
- data/lib/view_model/sap_schema_ni_141/common_schema.rb +1 -5
- data/lib/view_model/sap_schema_ni_141/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_ni_141/sap.rb +8 -0
- data/lib/view_model/sap_schema_ni_142/common_schema.rb +1 -5
- data/lib/view_model/sap_schema_ni_142/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_ni_142/sap.rb +8 -0
- data/lib/view_model/sap_schema_ni_150/common_schema.rb +1 -5
- data/lib/view_model/sap_schema_ni_150/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_ni_150/sap.rb +8 -0
- data/lib/view_model/sap_schema_ni_160/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_ni_160/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_ni_160/sap.rb +8 -0
- data/lib/view_model/sap_schema_ni_161/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_ni_161/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_ni_161/sap.rb +8 -0
- data/lib/view_model/sap_schema_ni_170/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_ni_170/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_ni_170/sap.rb +8 -0
- data/lib/view_model/sap_schema_ni_171/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_ni_171/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_ni_171/sap.rb +8 -0
- data/lib/view_model/sap_schema_ni_172/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_ni_172/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_ni_172/sap.rb +8 -0
- data/lib/view_model/sap_schema_ni_173/common_schema.rb +4 -0
- data/lib/view_model/sap_schema_ni_174/common_schema.rb +4 -0
- data/lib/view_model/sap_schema_ni_1800/common_schema.rb +4 -4
- metadata +2 -3
- data/.DS_Store +0 -0
@@ -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",
|
@@ -198,6 +97,34 @@ module Helper
|
|
198
97
|
"0" => "Not applicable",
|
199
98
|
"NR" => "Not recorded",
|
200
99
|
}.freeze
|
100
|
+
CONSTRUCTION_AGE_BAND_NI = {
|
101
|
+
"A" => "Northern Ireland: before 1919",
|
102
|
+
"A-12.0" => "Pre-1900",
|
103
|
+
"B" => "Northern Ireland: 1919-1929",
|
104
|
+
"B-12.0" => "1900-1929",
|
105
|
+
"C" => "Northern Ireland: 1930-1949",
|
106
|
+
"C-12.0" => "1930-1949",
|
107
|
+
"D" => "Northern Ireland: 1950-1973",
|
108
|
+
"D-12.0" => "1950-1966",
|
109
|
+
"E" => "Northern Ireland: 1974-1977",
|
110
|
+
"E-12.0" => "1967-1975",
|
111
|
+
"F" => "Northern Ireland: 1978-1985",
|
112
|
+
"F-12.0" => "1976-1982",
|
113
|
+
"G" => "Northern Ireland: 1986-1991",
|
114
|
+
"G-12.0" => "1983-1990",
|
115
|
+
"H" => "Northern Ireland: 1992-1999",
|
116
|
+
"H-12.0" => "1991-1995",
|
117
|
+
"I" => "Northern Ireland: 2000-2006",
|
118
|
+
"I-12.0" => "1996-2002",
|
119
|
+
"J" => "Northern Ireland: not applicable",
|
120
|
+
"J-12.0" => "2003-2006",
|
121
|
+
"K-RdSAP-NI" => "Northern Ireland: 2007-2013",
|
122
|
+
"K-SAP-NI" => "Northern Ireland: 2007 onwards",
|
123
|
+
"K-12.0" => "Post-2006",
|
124
|
+
"L" => "Northern Ireland: 2014 onwards",
|
125
|
+
"0" => "Not applicable",
|
126
|
+
"NR" => "Not recorded",
|
127
|
+
}.freeze
|
201
128
|
PROPERTY_TYPE = {
|
202
129
|
"0" => "House",
|
203
130
|
"1" => "Bungalow",
|
@@ -227,8 +154,128 @@ module Helper
|
|
227
154
|
"6" => "Voluntary (No legal requirement for an EPC).",
|
228
155
|
"7" => "Not recorded.",
|
229
156
|
}.freeze
|
157
|
+
VENTILATION_TYPE = {
|
158
|
+
"1" => "natural with intermittent extract fans",
|
159
|
+
"2" => "natural with passive vents",
|
160
|
+
"3" => "positive input from loft",
|
161
|
+
"4" => "positive input from outside",
|
162
|
+
"5" => "mechanical extract, centralised (MEV c)",
|
163
|
+
"6" => "mechanical extract, decentralised (MEV dc)",
|
164
|
+
"7" => "balanced without heat recovery (MV)",
|
165
|
+
"8" => "balanced with heat recovery (MVHR)",
|
166
|
+
"9" => "natural with intermittent extract fans and/or passive vents. For backwards compatibility only, do not use.",
|
167
|
+
"10" => "natural with intermittent extract fans and passive vents",
|
168
|
+
}.freeze
|
169
|
+
CYLINDER_INSULATION_THICKNESS = {
|
170
|
+
"12" => "12 mm",
|
171
|
+
"25" => "25 mm",
|
172
|
+
"38" => "38 mm",
|
173
|
+
"50" => "50 mm",
|
174
|
+
"80" => "80 mm",
|
175
|
+
"120" => "120 mm",
|
176
|
+
"160" => "160 mm",
|
177
|
+
}.freeze
|
178
|
+
RDSAP_FUEL_TYPE = {
|
179
|
+
"0" => "To be used only when there is no heating/hot-water system or data is from a community network",
|
180
|
+
"1" => "mains gas - this is for backwards compatibility only and should not be used",
|
181
|
+
"2" => "LPG - this is for backwards compatibility only and should not be used",
|
182
|
+
"3" => "bottled LPG",
|
183
|
+
"4" => "oil - this is for backwards compatibility only and should not be used",
|
184
|
+
"5" => "anthracite",
|
185
|
+
"6" => "wood logs",
|
186
|
+
"7" => "bulk wood pellets",
|
187
|
+
"8" => "wood chips",
|
188
|
+
"9" => "dual fuel - mineral + wood",
|
189
|
+
"10" => "electricity - this is for backwards compatibility only and should not be used",
|
190
|
+
"11" => "waste combustion - this is for backwards compatibility only and should not be used",
|
191
|
+
"12" => "biomass - this is for backwards compatibility only and should not be used",
|
192
|
+
"13" => "biogas - landfill - this is for backwards compatibility only and should not be used",
|
193
|
+
"14" => "house coal - this is for backwards compatibility only and should not be used",
|
194
|
+
"15" => "smokeless coal",
|
195
|
+
"16" => "wood pellets in bags for secondary heating",
|
196
|
+
"17" => "LPG special condition",
|
197
|
+
"18" => "B30K (not community)",
|
198
|
+
"19" => "bioethanol",
|
199
|
+
"20" => "mains gas (community)",
|
200
|
+
"21" => "LPG (community)",
|
201
|
+
"22" => "oil (community)",
|
202
|
+
"23" => "B30D (community)",
|
203
|
+
"24" => "coal (community)",
|
204
|
+
"25" => "electricity (community)",
|
205
|
+
"26" => "mains gas (not community)",
|
206
|
+
"27" => "LPG (not community)",
|
207
|
+
"28" => "oil (not community)",
|
208
|
+
"29" => "electricity (not community)",
|
209
|
+
"30" => "waste combustion (community)",
|
210
|
+
"31" => "biomass (community)",
|
211
|
+
"32" => "biogas (community)",
|
212
|
+
"33" => "house coal (not community)",
|
213
|
+
"34" => "biodiesel from any biomass source",
|
214
|
+
"35" => "biodiesel from used cooking oil only",
|
215
|
+
"36" => "biodiesel from vegetable oil only (not community)",
|
216
|
+
"36-rapeseed-oil" => "rapeseed oil",
|
217
|
+
"37" => "appliances able to use mineral oil or liquid biofuel",
|
218
|
+
"51" => "biogas (not community)",
|
219
|
+
"56" => "heat from boilers that can use mineral oil or biodiesel (community)",
|
220
|
+
"57" => "heat from boilers using biodiesel from any biomass source (community)",
|
221
|
+
"58" => "biodiesel from vegetable oil only (community)",
|
222
|
+
"99" => "from heat network data (community)",
|
223
|
+
}.freeze
|
224
|
+
RDSAP_FUEL_TYPE_PRE_143 = {
|
225
|
+
"1-pre14.3-sap" => "mains gas",
|
226
|
+
"4-pre14.3-sap" => "oil",
|
227
|
+
"10-pre14.3-sap" => "electricity",
|
228
|
+
"11-pre14.3-sap" => "waste combustion",
|
229
|
+
"12-pre14.3-sap" => "biomass",
|
230
|
+
"13-pre14.3-sap" => "biogas - landfill",
|
231
|
+
"14-pre14.3-sap" => "house coal",
|
232
|
+
}.freeze
|
233
|
+
SAP_FUEL_TYPE = {
|
234
|
+
"1" => "Gas: mains gas",
|
235
|
+
"2" => "Gas: bulk LPG",
|
236
|
+
"3" => "Gas: bottled LPG",
|
237
|
+
"4" => "Oil: heating oil",
|
238
|
+
"7" => "Gas: biogas",
|
239
|
+
"8" => "LNG",
|
240
|
+
"9" => "LPG subject to Special Condition 18",
|
241
|
+
"10" => "Solid fuel: dual fuel appliance (mineral and wood)",
|
242
|
+
"11" => "Solid fuel: house coal",
|
243
|
+
"12" => "Solid fuel: manufactured smokeless fuel",
|
244
|
+
"15" => "Solid fuel: anthracite",
|
245
|
+
"20" => "Solid fuel: wood logs",
|
246
|
+
"21" => "Solid fuel: wood chips",
|
247
|
+
"22" => "Solid fuel: wood pellets (in bags, for secondary heating)",
|
248
|
+
"23" => "Solid fuel: wood pellets (bulk supply in bags, for main heating)",
|
249
|
+
"36" => "Electricity: electricity sold to grid",
|
250
|
+
"37" => "Electricity: electricity displaced from grid",
|
251
|
+
"39" => "Electricity: electricity, unspecified tariff",
|
252
|
+
"41" => "Community heating schemes: heat from electric heat pump",
|
253
|
+
"42" => "Community heating schemes: heat from boilers - waste combustion",
|
254
|
+
"43" => "Community heating schemes: heat from boilers - biomass",
|
255
|
+
"44" => "Community heating schemes: heat from boilers - biogas",
|
256
|
+
"45" => "Community heating schemes: waste heat from power stations",
|
257
|
+
"46" => "Community heating schemes: geothermal heat source",
|
258
|
+
"48" => "Community heating schemes: heat from CHP",
|
259
|
+
"49" => "Community heating schemes: electricity generated by CHP",
|
260
|
+
"50" => "Community heating schemes: electricity for pumping in distribution network",
|
261
|
+
"51" => "Community heating schemes: heat from mains gas",
|
262
|
+
"52" => "Community heating schemes: heat from LPG",
|
263
|
+
"53" => "Community heating schemes: heat from oil",
|
264
|
+
"54" => "Community heating schemes: heat from coal",
|
265
|
+
"55" => "Community heating schemes: heat from B30D",
|
266
|
+
"56" => "Community heating schemes: heat from boilers that can use mineral oil or biodiesel",
|
267
|
+
"57" => "Community heating schemes: heat from boilers using biodiesel from any biomass source",
|
268
|
+
"58" => "Community heating schemes: biodiesel from vegetable oil only",
|
269
|
+
"71" => "biodiesel from any biomass source",
|
270
|
+
"72" => "biodiesel from used cooking oil only",
|
271
|
+
"73" => "biodiesel from vegetable oil only",
|
272
|
+
"74" => "appliances able to use mineral oil or liquid biofuel",
|
273
|
+
"75" => "B30K",
|
274
|
+
"76" => "bioethanol from any biomass source",
|
275
|
+
"99" => "Community heating schemes: special fuel",
|
276
|
+
}.freeze
|
230
277
|
|
231
|
-
def self.
|
278
|
+
def self.built_form_string(number)
|
232
279
|
BUILT_FORM[number]
|
233
280
|
end
|
234
281
|
|
@@ -246,14 +293,6 @@ module Helper
|
|
246
293
|
end
|
247
294
|
end
|
248
295
|
|
249
|
-
def self.main_fuel_rdsap(value)
|
250
|
-
RDSAP_MAIN_FUEL[value]
|
251
|
-
end
|
252
|
-
|
253
|
-
def self.main_fuel_sap(value)
|
254
|
-
SAP_MAIN_FUEL[value]
|
255
|
-
end
|
256
|
-
|
257
296
|
def self.glazed_area_rdsap(value)
|
258
297
|
RDSAP_GLAZED_AREA[value]
|
259
298
|
end
|
@@ -266,16 +305,33 @@ module Helper
|
|
266
305
|
TENURE[value] || value
|
267
306
|
end
|
268
307
|
|
269
|
-
def self.transaction_type(value, report_type = "2")
|
308
|
+
def self.transaction_type(value, report_type = "2", schema_type = "")
|
309
|
+
types_of_ni = %w[
|
310
|
+
RdSAP-Schema-NI-20.0.0
|
311
|
+
RdSAP-Schema-NI-19.0
|
312
|
+
RdSAP-Schema-NI-18.0
|
313
|
+
RdSAP-Schema-NI-17.4
|
314
|
+
RdSAP-Schema-NI-17.3
|
315
|
+
SAP-Schema-NI-16.1
|
316
|
+
SAP-Schema-NI-17.0
|
317
|
+
SAP-Schema-NI-17.1
|
318
|
+
SAP-Schema-NI-17.2
|
319
|
+
SAP-Schema-NI-17.3
|
320
|
+
SAP-Schema-NI-17.4
|
321
|
+
SAP-Schema-NI-18.0.0
|
322
|
+
]
|
323
|
+
|
270
324
|
if is_rdsap(report_type) && value.to_i >= 12
|
271
325
|
TRANSACTION_TYPE["#{value}RdSAP"]
|
326
|
+
elsif types_of_ni.include?(schema_type) && value.to_i == 5
|
327
|
+
TRANSACTION_TYPE["ni_5"]
|
272
328
|
else
|
273
329
|
TRANSACTION_TYPE[value] || value
|
274
330
|
end
|
275
331
|
end
|
276
332
|
|
277
333
|
def self.construction_age_band_lookup(value, schema_type, report_type)
|
278
|
-
types_of_sap_pre17 = %
|
334
|
+
types_of_sap_pre17 = %i[
|
279
335
|
SAP-Schema-16.3
|
280
336
|
SAP-Schema-16.2
|
281
337
|
SAP-Schema-16.1
|
@@ -290,7 +346,7 @@ module Helper
|
|
290
346
|
SAP-Schema-11.0
|
291
347
|
].freeze
|
292
348
|
|
293
|
-
schemes_that_use_not_recorded = %
|
349
|
+
schemes_that_use_not_recorded = %i[
|
294
350
|
SAP-Schema-16.3
|
295
351
|
SAP-Schema-16.2
|
296
352
|
SAP-Schema-16.1
|
@@ -299,14 +355,9 @@ module Helper
|
|
299
355
|
RdSAP-Schema-18.0
|
300
356
|
RdSAP-Schema-17.1
|
301
357
|
RdSAP-Schema-17.0
|
302
|
-
RdSAP-Schema-NI-20.0.0
|
303
|
-
RdSAP-Schema-NI-19.0
|
304
|
-
RdSAP-Schema-NI-18.0
|
305
|
-
RdSAP-Schema-NI-17.4
|
306
|
-
RdSAP-Schema-NI-17.3
|
307
358
|
]
|
308
359
|
|
309
|
-
schemes_that_use_l = %
|
360
|
+
schemes_that_use_l = %i[
|
310
361
|
SAP-Schema-18.0.0
|
311
362
|
SAP-Schema-17.1
|
312
363
|
SAP-Schema-17.0
|
@@ -315,14 +366,9 @@ module Helper
|
|
315
366
|
RdSAP-Schema-18.0
|
316
367
|
RdSAP-Schema-17.1
|
317
368
|
RdSAP-Schema-17.0
|
318
|
-
RdSAP-Schema-NI-20.0.0
|
319
|
-
RdSAP-Schema-NI-19.0
|
320
|
-
RdSAP-Schema-NI-18.0
|
321
|
-
RdSAP-Schema-NI-17.4
|
322
|
-
RdSAP-Schema-NI-17.3
|
323
369
|
]
|
324
370
|
|
325
|
-
schemes_that_use_0 = %
|
371
|
+
schemes_that_use_0 = %i[
|
326
372
|
SAP-Schema-16.3
|
327
373
|
SAP-Schema-16.2
|
328
374
|
SAP-Schema-16.1
|
@@ -338,6 +384,25 @@ module Helper
|
|
338
384
|
RdSAP-Schema-18.0
|
339
385
|
RdSAP-Schema-17.1
|
340
386
|
RdSAP-Schema-17.0
|
387
|
+
]
|
388
|
+
|
389
|
+
sap_schemas_ni = %i[
|
390
|
+
SAP-Schema-NI-18.0.0
|
391
|
+
SAP-Schema-NI-17.4
|
392
|
+
SAP-Schema-NI-17.3
|
393
|
+
SAP-Schema-NI-17.2
|
394
|
+
SAP-Schema-NI-17.1
|
395
|
+
SAP-Schema-NI-17.0
|
396
|
+
SAP-Schema-NI-16.1
|
397
|
+
SAP-Schema-NI-16.0
|
398
|
+
SAP-Schema-NI-15.0
|
399
|
+
SAP-Schema-NI-14.2
|
400
|
+
SAP-Schema-NI-14.1
|
401
|
+
SAP-Schema-NI-14.0
|
402
|
+
SAP-Schema-NI-13.0
|
403
|
+
]
|
404
|
+
|
405
|
+
rdsap_schemas_ni = %i[
|
341
406
|
RdSAP-Schema-NI-20.0.0
|
342
407
|
RdSAP-Schema-NI-19.0
|
343
408
|
RdSAP-Schema-NI-18.0
|
@@ -345,7 +410,29 @@ module Helper
|
|
345
410
|
RdSAP-Schema-NI-17.3
|
346
411
|
]
|
347
412
|
|
348
|
-
|
413
|
+
ni_schemas_pre_12 = %i[
|
414
|
+
SAP-Schema-NI-12.0
|
415
|
+
SAP-Schema-NI-11.2
|
416
|
+
]
|
417
|
+
|
418
|
+
if value == "K" && rdsap_schemas_ni.include?(schema_type)
|
419
|
+
return CONSTRUCTION_AGE_BAND_NI["K-RdSAP-NI"] || value
|
420
|
+
end
|
421
|
+
|
422
|
+
if value == "K" && sap_schemas_ni.include?(schema_type)
|
423
|
+
return CONSTRUCTION_AGE_BAND_NI["K-SAP-NI"] || value
|
424
|
+
end
|
425
|
+
|
426
|
+
if ni_schemas_pre_12.include?(schema_type)
|
427
|
+
key = (value == "0" ? value : "#{value}-12.0")
|
428
|
+
return CONSTRUCTION_AGE_BAND_NI[key] || value
|
429
|
+
end
|
430
|
+
|
431
|
+
if sap_schemas_ni.include?(schema_type) || rdsap_schemas_ni.include?(schema_type)
|
432
|
+
return CONSTRUCTION_AGE_BAND_NI[value] || value
|
433
|
+
end
|
434
|
+
|
435
|
+
if value == "K" && schema_type == :"SAP-Schema-12.0" && is_rdsap(report_type)
|
349
436
|
return CONSTRUCTION_AGE_BAND["K-12.0"]
|
350
437
|
end
|
351
438
|
|
@@ -381,9 +468,10 @@ module Helper
|
|
381
468
|
SAP-Schema-11.2
|
382
469
|
SAP-Schema-11.0
|
383
470
|
SAP-Schema-10.2
|
471
|
+
SAP-Schema-NI-11.2
|
384
472
|
].freeze
|
385
473
|
|
386
|
-
if types_of_sap_pre12.include?(schema_type) && is_rdsap(report_type)
|
474
|
+
if types_of_sap_pre12.include?(schema_type.to_s) && is_rdsap(report_type)
|
387
475
|
return MECHANICAL_VENTILATION["#{value}-pre12.0"]
|
388
476
|
end
|
389
477
|
|
@@ -394,6 +482,14 @@ module Helper
|
|
394
482
|
CEPC_TRANSACTION_TYPE[value] || value
|
395
483
|
end
|
396
484
|
|
485
|
+
def self.cylinder_insulation_thickness(value, report_type = "2")
|
486
|
+
if is_rdsap(report_type)
|
487
|
+
CYLINDER_INSULATION_THICKNESS[value]
|
488
|
+
else
|
489
|
+
value
|
490
|
+
end
|
491
|
+
end
|
492
|
+
|
397
493
|
def self.is_rdsap(report_type)
|
398
494
|
report_type == "2"
|
399
495
|
end
|
@@ -402,6 +498,120 @@ module Helper
|
|
402
498
|
report_type == "3"
|
403
499
|
end
|
404
500
|
|
501
|
+
def self.ventilation_type(value, schema_type = "")
|
502
|
+
ni_sap = %w[
|
503
|
+
SAP-Schema-NI-16.1
|
504
|
+
SAP-Schema-NI-16.0
|
505
|
+
SAP-Schema-NI-15.0
|
506
|
+
SAP-Schema-NI-14.2
|
507
|
+
SAP-Schema-NI-14.1
|
508
|
+
SAP-Schema-NI-14.0
|
509
|
+
SAP-Schema-NI-13.0
|
510
|
+
].freeze
|
511
|
+
|
512
|
+
if ni_sap.include?(schema_type) && value == "9"
|
513
|
+
VENTILATION_TYPE[value].split(".").first
|
514
|
+
else
|
515
|
+
VENTILATION_TYPE[value]
|
516
|
+
end
|
517
|
+
end
|
518
|
+
|
519
|
+
def self.fuel_type(value, schema_type = "", report_type = "2")
|
520
|
+
rdsap = %i[
|
521
|
+
RdSAP-Schema-20.0.0
|
522
|
+
RdSAP-Schema-19.0
|
523
|
+
RdSAP-Schema-18.0
|
524
|
+
RdSAP-Schema-17.1
|
525
|
+
RdSAP-Schema-17.0
|
526
|
+
RdSAP-Schema-NI-20.0.0
|
527
|
+
RdSAP-Schema-NI-19.0
|
528
|
+
RdSAP-Schema-NI-18.0
|
529
|
+
RdSAP-Schema-NI-17.4
|
530
|
+
RdSAP-Schema-NI-17.3
|
531
|
+
]
|
532
|
+
|
533
|
+
pre143_sap = %i[
|
534
|
+
SAP-Schema-14.2
|
535
|
+
SAP-Schema-14.1
|
536
|
+
SAP-Schema-14.0
|
537
|
+
SAP-Schema-13.0
|
538
|
+
SAP-Schema-12.0
|
539
|
+
SAP-Schema-11.2
|
540
|
+
SAP-Schema-11.0
|
541
|
+
SAP-Schema-10.2
|
542
|
+
SAP-Schema-NI-14.2
|
543
|
+
SAP-Schema-NI-14.1
|
544
|
+
SAP-Schema-NI-14.0
|
545
|
+
SAP-Schema-NI-13.0
|
546
|
+
SAP-Schema-NI-12.0
|
547
|
+
SAP-Schema-NI-11.2
|
548
|
+
]
|
549
|
+
|
550
|
+
includes_rapeseed_oil = %i[
|
551
|
+
SAP-Schema-16.3
|
552
|
+
SAP-Schema-16.2
|
553
|
+
SAP-Schema-16.1
|
554
|
+
SAP-Schema-16.0
|
555
|
+
SAP-Schema-15.0
|
556
|
+
SAP-Schema-NI-17.2
|
557
|
+
SAP-Schema-NI-17.1
|
558
|
+
SAP-Schema-NI-17.0
|
559
|
+
SAP-Schema-NI-16.1
|
560
|
+
SAP-Schema-NI-16.0
|
561
|
+
SAP-Schema-NI-15.0
|
562
|
+
]
|
563
|
+
|
564
|
+
sap = %i[
|
565
|
+
SAP-Schema-18.0.0
|
566
|
+
SAP-Schema-17.1
|
567
|
+
SAP-Schema-17.0
|
568
|
+
SAP-Schema-16.3
|
569
|
+
SAP-Schema-16.2
|
570
|
+
SAP-Schema-16.1
|
571
|
+
SAP-Schema-16.0
|
572
|
+
SAP-Schema-15.0
|
573
|
+
SAP-Schema-14.2
|
574
|
+
SAP-Schema-14.1
|
575
|
+
SAP-Schema-14.0
|
576
|
+
SAP-Schema-13.0
|
577
|
+
SAP-Schema-12.0
|
578
|
+
SAP-Schema-11.2
|
579
|
+
SAP-Schema-11.0
|
580
|
+
SAP-Schema-10.2
|
581
|
+
SAP-Schema-NI-18.0.0
|
582
|
+
SAP-Schema-NI-17.4
|
583
|
+
SAP-Schema-NI-17.3
|
584
|
+
SAP-Schema-NI-17.2
|
585
|
+
SAP-Schema-NI-17.1
|
586
|
+
SAP-Schema-NI-17.0
|
587
|
+
SAP-Schema-NI-16.1
|
588
|
+
SAP-Schema-NI-16.0
|
589
|
+
SAP-Schema-NI-15.0
|
590
|
+
SAP-Schema-NI-14.2
|
591
|
+
SAP-Schema-NI-14.1
|
592
|
+
SAP-Schema-NI-14.0
|
593
|
+
SAP-Schema-NI-13.0
|
594
|
+
SAP-Schema-NI-12.0
|
595
|
+
SAP-Schema-NI-11.2
|
596
|
+
]
|
597
|
+
|
598
|
+
if rdsap.include?(schema_type)
|
599
|
+
RDSAP_FUEL_TYPE[value]
|
600
|
+
elsif sap.include?(schema_type) && is_sap(report_type)
|
601
|
+
SAP_FUEL_TYPE[value]
|
602
|
+
elsif sap.include?(schema_type) && is_rdsap(report_type)
|
603
|
+
if includes_rapeseed_oil.include?(schema_type) && value == "36"
|
604
|
+
return RDSAP_FUEL_TYPE["#{value}-rapeseed-oil"]
|
605
|
+
end
|
606
|
+
|
607
|
+
if pre143_sap.include?(schema_type)
|
608
|
+
RDSAP_FUEL_TYPE_PRE_143["#{value}-pre14.3-sap"] || RDSAP_FUEL_TYPE[value]
|
609
|
+
else
|
610
|
+
RDSAP_FUEL_TYPE[value]
|
611
|
+
end
|
612
|
+
end
|
613
|
+
end
|
614
|
+
|
405
615
|
private_class_method :is_rdsap, :is_sap
|
406
616
|
end
|
407
617
|
end
|
@@ -7,7 +7,7 @@ module Presenter::Export
|
|
7
7
|
view[:assessment_id] = @view_model.assessment_id
|
8
8
|
view[:assessor] = assessor
|
9
9
|
view[:built_form] =
|
10
|
-
enum_value(:
|
10
|
+
enum_value(:built_form_string, @view_model.built_form)
|
11
11
|
view[:co2_emissions_current_per_floor_area] =
|
12
12
|
@view_model.co2_emissions_current_per_floor_area.to_i
|
13
13
|
view[:construction_age_band] =
|
@@ -24,14 +24,14 @@ module Presenter
|
|
24
24
|
address2: @view_model.address_line2,
|
25
25
|
address3: @view_model.address_line3,
|
26
26
|
built_form:
|
27
|
-
Helper::XmlEnumsToOutput.
|
27
|
+
Helper::XmlEnumsToOutput.built_form_string(@view_model.built_form),
|
28
28
|
co2_emiss_curr_per_floor_area:
|
29
29
|
@view_model.co2_emissions_current_per_floor_area,
|
30
30
|
co2_emissions_current: @view_model.current_carbon_emission,
|
31
31
|
co2_emissions_potential: @view_model.potential_carbon_emission,
|
32
32
|
construction_age_band:
|
33
33
|
Helper::XmlEnumsToOutput.construction_age_band_lookup(
|
34
|
-
@view_model.
|
34
|
+
@view_model.main_dwelling_construction_age_band_or_year,
|
35
35
|
@schema_type,
|
36
36
|
@view_model.report_type,
|
37
37
|
),
|
@@ -101,14 +101,13 @@ module Presenter
|
|
101
101
|
@view_model.lighting_energy_efficiency_rating,
|
102
102
|
),
|
103
103
|
lighting_env_eff:
|
104
|
-
Helper::XmlEnumsToOutput.energy_rating_string(
|
105
|
-
@view_model.lighting_environmental_efficiency_rating,
|
106
|
-
),
|
104
|
+
Helper::XmlEnumsToOutput.energy_rating_string(@view_model.lighting_environmental_efficiency_rating),
|
107
105
|
low_energy_lighting: @view_model.low_energy_lighting,
|
108
|
-
|
106
|
+
low_energy_fixed_lighting_count:
|
109
107
|
@view_model.low_energy_fixed_lighting_outlets_count,
|
110
|
-
main_fuel:
|
111
|
-
|
108
|
+
main_fuel: Helper::XmlEnumsToOutput.fuel_type(@view_model.main_fuel_type,
|
109
|
+
@schema_type,
|
110
|
+
@view_model.report_type),
|
112
111
|
mainheat_description:
|
113
112
|
@view_model.all_main_heating_descriptions.join(", "),
|
114
113
|
mainheat_energy_eff:
|
@@ -134,7 +133,7 @@ module Presenter
|
|
134
133
|
Helper::XmlEnumsToOutput.mechanical_ventilation(
|
135
134
|
@view_model.mechanical_ventilation,
|
136
135
|
@schema_type,
|
137
|
-
@report_type,
|
136
|
+
@view_model.report_type,
|
138
137
|
),
|
139
138
|
mech_vent_sys_index_number: nil,
|
140
139
|
mechanical_vent_data_source: nil,
|
@@ -179,8 +178,11 @@ module Presenter
|
|
179
178
|
transaction_type:
|
180
179
|
Helper::XmlEnumsToOutput.transaction_type(
|
181
180
|
@view_model.transaction_type,
|
181
|
+
@view_model.report_type,
|
182
|
+
@schema_type,
|
182
183
|
),
|
183
184
|
unheated_corridor_length: @view_model.unheated_corridor_length,
|
185
|
+
ventilation_type: nil,
|
184
186
|
walls_description: @view_model.all_wall_descriptions.first,
|
185
187
|
walls_energy_eff:
|
186
188
|
Helper::XmlEnumsToOutput.energy_rating_string(
|
@@ -190,6 +192,12 @@ module Presenter
|
|
190
192
|
Helper::XmlEnumsToOutput.energy_rating_string(
|
191
193
|
@view_model.all_wall_env_energy_efficiency_rating.first,
|
192
194
|
),
|
195
|
+
water_heating_code: @view_model.water_heating_code,
|
196
|
+
water_heating_fuel: Helper::XmlEnumsToOutput.fuel_type(
|
197
|
+
@view_model.water_heating_fuel,
|
198
|
+
@schema_type,
|
199
|
+
@view_model.report_type,
|
200
|
+
),
|
193
201
|
wind_turbine_count: @view_model.wind_turbine_count,
|
194
202
|
windows_description: @view_model.window_description,
|
195
203
|
windows_energy_eff:
|
@@ -311,7 +319,7 @@ module Presenter
|
|
311
319
|
),
|
312
320
|
photo_supply: @view_model.photovoltaic_roof_area_percent,
|
313
321
|
built_form:
|
314
|
-
Helper::XmlEnumsToOutput.
|
322
|
+
Helper::XmlEnumsToOutput.built_form_string(@view_model.built_form),
|
315
323
|
mainheat_description:
|
316
324
|
@view_model.all_main_heating_descriptions.join(", "),
|
317
325
|
mainheat_energy_eff:
|
@@ -359,7 +367,9 @@ module Presenter
|
|
359
367
|
),
|
360
368
|
floor_height: @view_model.floor_height.first,
|
361
369
|
main_fuel:
|
362
|
-
Helper::XmlEnumsToOutput.
|
370
|
+
Helper::XmlEnumsToOutput.fuel_type(@view_model.main_fuel_type,
|
371
|
+
@schema_type,
|
372
|
+
@view_model.report_type),
|
363
373
|
floor_description: @view_model.all_floor_descriptions.first,
|
364
374
|
floor_energy_eff:
|
365
375
|
Helper::XmlEnumsToOutput.energy_rating_string(
|