-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
345 lines (297 loc) · 9.44 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Northern Ireland GP Prescription Spending April 2013 - May 2016</title>
<link rel="stylesheet" type="text/css" href="css/site.css" />
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.4.0/knockout-min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.3.0/Chart.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<button type="button" class="navbar-toggle"
data-toggle="collapse"
data-target=".navbar-collapse"
>
<span class="sr-only"> Toggle navigation</span>
<span class="icon-bar"> </span>
<span class="icon-bar"> </span>
<span class="icon-bar"> </span>
</button> <a class="navbar-brand" href="http://stiona.com" target="_blank">Stiona Software</a>
<a class="navbar-brand" href="index.html"><i class="fa fa-home"></i></a>
<a class="navbar-brand hidden-xs" href="https://github.com/shaydoc/NorthernIrelandGPData" target="_blank"><i class="fa fa-github"></i></a>
<a class="navbar-brand hidden-xs" href="https://twitter.com/shaydmusic" target="_blank"><i class="fa fa-twitter"></i></a>
<a class="navbar-brand" href="https://www.linkedin.com/pub/shay-doherty/7/45b/7bb" target="_blank"><i class="fa fa-linkedin"></i></a>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li> <a href="NorthernIrelandGPPrescriptionsCircleSpirals.html">BNF Chapter Chart</a> </li>
<li> <a href="practicespending.html">GP Surgery Chart</a> </li>
<li> <a href="NortherIrelandGPPrescriptionsBubbleChart.html">Drug Chart</a> </li>
<li> <a href="diabetes.html">Diabetes Map</a> </li>
<li> <a href="diabetestimeseries.html">Diabetes Time</a> </li>
</ul>
</div>
</div>
</nav>
<div class="container content-pad">
<div class="jumbotron">
<h2>
Northern Ireland GP Prescription Spending Overview
</h2>
<h3>
April 2013 - May 2016
</h3>
</div>
<div class="row">
<div class="col-md-6">
<div class="card">
<div class="card-content">
<h2>
Health Trusts
</h2>
<canvas id="trusts" width="600" height="600"></canvas>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card">
<div class="card-content">
<h2>
BNF Chapters
</h2>
<canvas id="bnfChapters" width="600" height="600"></canvas>
</div>
</div>
</div>
</div>
</div>
<div class="container">
<div class="col-md-6 col-md-offset-3">
<!-- Search Form -->
<form role="form">
<!-- Search Field -->
<div class="row">
<h1 class="text-center">GP Practices NI</h1>
<div class="form-group">
<input class="form-control" type="text" name="search" placeholder="Search" data-bind="value:filter, valueUpdate:'input'" required />
</div>
</div>
</form>
<!-- End of Search Form -->
</div>
<div class="row">
<!-- ko template: { foreach: filteredPractices } -->
<div class="col-md-4">
<div class="card">
<div class="card-content">
<h4>
<a data-bind="attr:{href:practiceUrl}, text:practiceName"></a>
</h4>
<span data-bind="text:address1.substring(0,30)"></span>
<br />
<span data-bind="text:address2.substring(0,30)"></span>
<br />
<span data-bind="text:address3"></span>
<br />
<span data-bind="text:postcode"></span>
<br />
<strong data-bind="text:telNo"></strong>
<br />
</div>
</div>
</div>
<!-- /ko -->
</div>
</div>
<script>
var trusts = [{
name: "Northern",
amount: 296074131.40
}, {
name: "Belfast",
amount: 279202946.60
}, {
name: "South Eastern",
amount: 221817752.25
}, {
name: "Southern",
amount: 218901566.23
}, {
name: "Western",
amount: 197999288.54
}];
var bnfChapters = [{
"name": "CENTRAL NERVOUS SYSTEM",
"amount": 327746418.07
}, {
"name": "CARDIOVASCULAR SYSTEM",
"amount": 146485533.30
}, {
"name": "ENDOCRINE SYSTEM",
"amount": 146210854.07
}, {
"name": "RESPIRATORY SYSTEM",
"amount": 135402536.39
}, {
"name": "NUTRITION AND BLOOD\r",
"amount": 83694436.01
}, {
"name": "GASTRO-INTESTINAL SYSTEM",
"amount": 62185680.07
}, {
"name": "MISCELLANOUS",
"amount": 47742216.65
}, {
"name": "OBSTETRICS,GYNAE+URINARY TRACT DISORDERS",
"amount": 47161024.55
}, {
"name": "SKIN",
"amount": 45618447.62
}, {
"name": "MALIGNANT DISEASE AND IMMUNOSUPPRESSION",
"amount": 31264509.84
}, {
"name": "MUSCULOSKELETAL AND JOINT DISEASES",
"amount": 29944625.57
}, {
"name": "INFECTIONS",
"amount": 29127931.22
}, {
"name": "DRESSINGS",
"amount": 22819817.42
}, {
"name": "STOMA APPLIANCES",
"amount": 15737899.87
}, {
"name": "APPLICANCES",
"amount": 15613430.00
}, {
"name": "EYE",
"amount": 12172032.95
}, {
"name": "EAR, NOSE AND OROPHARYNX",
"amount": 11024281.39
}, {
"name": "ANAESTHESIA",
"amount": 7171580.07
}, {
"name": "INCONTINENCE APPLIANCES",
"amount": 3810949.42
}, {
"name": "IMMUNOLOGICAL PRODUCTS AND VACCINES\r",
"amount": 3389029.00
}, {
"name": "OTHER DRUGS AND PREPARATIONS\r",
"amount": 122644.76
}, {
"name": "PREPARATIONS USED IN DIAGNOSIS",
"amount": 16.34
}];
var trustsData = {
labels: [
"Northern Trust",
"Belfast Trust",
"South Eastern Trust",
"Southern Trust",
"Western Trust"
],
datasets: [{
data: [296074131, 279202946, 221817752, 218901566, 197999288],
backgroundColor: [
"#FF6384",
"#4BC0C0",
"#FFCE56",
"#C0CFED",
"#36A2EB"
],
hoverBackgroundColor: [
"#FF6384",
"#4BC0C0",
"#FFCE56",
"#C0CFED",
"#36A2EB"
]
}]
};
function getRandomColor() {
var letters = '0123456789ABCDEF';
var color = '#';
for (var i = 0; i < 6; i++ ) {
color += letters[Math.floor(Math.random() * 16)];
}
return color;
}
var bnfColors = [];
for(i = 0; i < 23; i++) {
bnfColors.push(getRandomColor());
}
var bnfData = {
labels: _.pluck(bnfChapters,'name'),
datasets:[{
label:'BNF Chapter',
data: _.pluck(bnfChapters,'amount'),
backgroundColor:bnfColors
}]
}
var trustsElement = document.getElementById("trusts");
var bnfChaptersElement = document.getElementById("bnfChapters");
var ctxTrusts = trustsElement.getContext("2d");
var ctxbnfChapters = bnfChaptersElement.getContext("2d");
// And for a doughnut chart
var myDoughnutChart = new Chart(ctxTrusts, {
type: 'polarArea',
data: trustsData
});
// And for a doughnut chart
var bnfChapters = new Chart(ctxbnfChapters, {
type: 'horizontalBar',
data: bnfData
});
function gpVM(){
var self = this;
self.practices = ko.observable();
self.filter = ko.observable();
self.filteredPractices = ko.computed(function () {
if (self.filter()) {
return ko.utils.arrayFilter(self.practices(), function (item) {
return (item.practiceName.toLowerCase().indexOf(self.filter().toLowerCase()) >= 0 || item.address1.toLowerCase().indexOf(self.filter().toLowerCase()) >= 0
|| item.address2.toLowerCase().indexOf(self.filter().toLowerCase()) >= 0
|| item.address3.toLowerCase().indexOf(self.filter().toLowerCase()) >= 0
);
});
}
return self.practices();
}, self);
self.practiceUrl = function (prac) {
return 'https://gpvisualizations.azurewebsites.net/Home/Practice/'
+ prac.pracNo
+ '-' + prac.practiceName.replace(/\W/g, '-')
+ '-' + prac.address1.replace(/\W/g, '-')
+ '-' + prac.address2.replace(/\W/g, '-')
+ '-' + prac.address3.replace(/\W/g, '-');
}
$.get('https://shaydoc.github.io/NorthernIrelandGPData/json/practices.json').done(function (res) {
ko.utils.arrayForEach(res, function (item) {
item.practiceUrl = self.practiceUrl(item);
});
self.practices(res);
});
}
ko.applyBindings(new gpVM());
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-84653625-1', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>