-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
1216 lines (1163 loc) · 42.5 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
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html >
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1 user-scalable=no">
<meta property="fb:admins" content="1678986882" />
<title>20181021 普悠瑪列車事故</title>
<link rel='stylesheet prefetch' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css'>
<style>
[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
display: none !important;
}
.navbar {
background: #656D78;
border-radius: 0;
margin-bottom: 0;
border: none;
}
.navbar-default .navbar-brand,
.navbar-default .navbar-nav>li>a {
color: #FFFFFF;
}
#tab a {
padding: 23px 0px 23px 0px;
box-shadow: none;
background: #E6E9EE;
border: none;
cursor: pointer;
line-height: 21px;
font-size: 20px;
color: #656D78;
border-left: 3px solid #FFF;
border-radius: 0;
}
#tab a.btn-first {
border: none;
}
#tab a.active {
background: #2EBD9B;
color: #FFFFFF;
}
#input-box {
background: #2EBD9B;
padding-top: 49px;
padding-bottom: 39px;
}
#input-box input{
padding: 22px 24px 23px 24px;
}
#input-box .btn{
padding-top: 12px;
padding-bottom: 13px;
}
#input-box .form-group {
margin-bottom: 0px;
}
#input-box .label {
display: inline;
padding: 0;
font-size: 75%;
font-weight: 700;
line-height: 1;
color: #fff;
text-align: center;
white-space: nowrap;
vertical-align: baseline;
border-radius: .25em;
}
p {
word-break: break-all;
}
.nearby {
display: inline-block;
white-space: normal;
text-align: left;
}
.progress {
margin-top: 4px;
}
.progress-bar-def {
background-color: #bbb;
}
.label-angel {
background: #7DB1E0;
color: #FDFDFD;
}
</style>
<link rel="stylesheet" href="css/all.css">
<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','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-64601259-2', 'auto');
ga('send', 'pageview');
</script>
<!-- fork 陳小風 -->
</head>
<body ng-cloak ng-app="app" ng-controller="MainController as MainCtrl">
<nav class="navbar navbar-default">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<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="#">
<span ng-show="type=='people' || type=='hospital'">20181021 普悠瑪列車事故</span>
<span ng-show="type=='care'">傷者家屬住宿查詢</span>
<span ng-show="type=='blood'">捐血車/站查詢</span>
</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/g0v/1021puyuma/issues" target="_blank">
錯誤回報 New Issue
</a>
</li>
<li>
<a ng-show="type=='people' || type=='hospital'" href="https://drive.google.com/drive/folders/1qHAOXID3_pW7JBE4xYN2xNjjumKTl38y" target="_blank">資料來源: 衛生福利部</a>
<a ng-show="type=='blood'" href="http://www.blood.org.tw" target="_blank">資料來源: 血液基金會</a>
</li>
<li>
<a href="http://creativecommons.tw/cc0" target="_blank">License: CC0</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">其他平台 <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="http://er.mohw.g0v.tw/" target="_blank">全國重度級急救責任醫院急診即時訊息</a></li>
<li><a href="https://hackmd.io/c/SJOXaW9oQ" target="_blank">HackMD</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<div class="btn-group btn-group-justified" role="group" id="tab">
<div class="btn-group" role="group">
<a class="btn btn-default btn-first" ng-class="{'active': type=='people'}" href="#people" ng-click="type='people'"><i class="icon-find"></i>家屬尋人</a>
</div>
<div class="btn-group" role="group">
<a class="btn btn-default" ng-class="{'active': type=='hospital'}" href="#hospital" ng-click="type='hospital'"><i class="icon-hospital"></i>醫院概況</a>
</div>
<div class="btn-group" role="group">
<a class="btn btn-default" ng-class="{'active': type=='blood'}" href="#blood" ng-click="type='blood'"><i class="icon-blood"></i>捐血資訊</a>
</div>
</div>
<div id="input-box" ng-show="type=='people' || type=='blood' || type=='care'">
<div class="container">
<div class="form-group">
<div class="input-group" ng-show="type=='people'">
<input type="text" class="form-control" ng-model="query" id="search" placeholder="請輸入搜尋的條件(ex. 姓名、檢傷、收治單位)" ng-change="sent(query)" ng-keypress="enter($event, query)" />
<span class="input-group-btn">
<button class="btn btn-default" type="button" ng-click="query='其他國家'" ng-hide="query">↪ Foreigners</button>
<button class="btn btn-default" type="button" ng-click="query=''" ng-show="query">↪ Locals</button>
</span>
</div>
<input type="text" ng-show="type=='blood'" class="form-control" ng-model="blood" placeholder="請輸入搜尋的捐血車/站" />
<input type="text" ng-show="type=='care'" class="form-control" ng-model="careQuery" placeholder="請輸入附近地點或縣市" />
</div>
<span class="label" ng-show="type=='people'">最後更新: {{ data.lastmodify }}</span>
</div>
</div>
<br />
<div class="container">
<div class="row" ng-hide="type=='people' || type=='hospital' || type=='blood' || type=='care'">
<div class="col-lg-12">
<h4>
<span ng-switch="people['即時動向']">
<span ng-switch-when="出院" class="label label-success">
即時動向: {{people['即時動向']}}
</span>
<span ng-switch-when="自動出院(AAD)" class="label label-success">
即時動向: {{people['即時動向']}}
</span>
<span ng-switch-default class="label label-primary">
即時動向: {{people['即時動向']}}
</span>
</span>
</h4>
編號: {{ people['編號'] }}<br />
個資: {{ people['姓名']}}
<span class="label label-default">{{ people['性別']}} {{ people['年齡']}}</span>
<span class="label label-default">{{ people['國籍']}}</span><br />
<br />
收治單位: <a class="btn btn-info btn-xs" href="https://www.google.com/maps?q={{ map[people['縣市別']+people['收治單位']].address || people['收治單位'] }}" target="_blank" ng-click="open('people','地圖')">{{people['縣市別']}} {{people['收治單位']}}<i class="glyphicon glyphicon-map-marker"></i></a>
<br />
<span ng-if="map[people['縣市別']+people['收治單位']].address">
地址: {{map[people['縣市別']+people['收治單位']].address}}
<br />
</span>
<span ng-if="map[people['縣市別']+people['收治單位']].phone" class="animate-if">
電話: <a href="tel:{{map[people['縣市別']+people['收治單位']].phone}}" style="white-space: nowrap;" ng-click="open('people','醫院電話')">{{map[people['縣市別']+people['收治單位']].phone}}<i class="glyphicon glyphicon-earphone"></i></a><br />
</span>
<span class="label label-default">醫療檢傷: {{people['醫療檢傷']}}</span><br />
<span class="label label-default">救護檢傷: {{people['救護檢傷']}}</span><br />
<span class="label label-default">檢傷編號: {{people['檢傷編號']}}</span><br />
<span class="label label-default">轉診要求: {{people['轉診要求']}}</span><br />
<span class="label label-default">刪除註記: {{people['刪除註記']}}</span><br />
<span ng-if="hospital[people['收治單位']]" class="animate-if">
<br />
社福中心: {{hospital[people['收治單位']]['社福中心']}} <a href="tel:{{hospital[people['收治單位']]['辦公室電話']}}" style="white-space: nowrap;" ng-click="open('people','社福電話')">{{hospital[people['收治單位']]['辦公室電話']}}<i class="glyphicon glyphicon-earphone"></i></a>
</span>
<span ng-if="sun[people['縣市別']]" class="animate-if">
<br />
陽光基金會: <a href="tel:{{sun[people['縣市別']]}}" style="white-space: nowrap;" ng-click="open('people','陽光基金會電話')">{{sun[people['縣市別']]}}<i class="glyphicon glyphicon-earphone"></i></a>
</span>
<span ng-if="people['國籍']=='其他國家' || people['國籍']=='大陸地區'" class="animate-if">
<br />
香港灼傷互助會: <a href="tel:+852-62087525" style="white-space: nowrap;" ng-click="open('people','陽光基金會電話')">+852-62087525<i class="glyphicon glyphicon-earphone"></i></a>
</span>
<div ng-repeat="row in hotels | hotelFilter: people['縣市別'] + people['收治單位']">
<br />
<span class="label label-success label-xs">家屬免費旅館</span>
<a ng-href="http://{{row['網址']}}" target="_blank" ng-if="row['網址']">{{row['旅館名稱']}}</a>
<span ng-if="!row['網址']">{{row['旅館名稱']}}</span>
<br />
電話: <a href="tel:{{row['連絡電話']}}" target="_blank">{{row['連絡電話']}}<i class="glyphicon glyphicon-earphone"></i></a>
<br />
地址: <a href="https://www.google.com/maps?q={{row['地址']}}" target="_blank">{{row['地址']}}</a>
<br />
<button type="button" class="btn btn-info btn-xs" ng-click="showHotelInfo(row)">其他說明</button>
</div>
<br />
<br />
</div>
</div>
<div class="row" ng-show="type=='hospital'">
<div class="col-lg-12">
</div>
</div>
<div class="row" ng-show="type=='people' && !query">
<div class="col-lg-12">
<div class="alert alert-warning" role="alert">
- 宜蘭縣政府消防局:<br />
<a href="tel:039365027" target="_blank" ng-click="open('提醒','宜蘭縣政府消防局')">039-365027 轉 1808 <i class="glyphicon glyphicon-earphone"></i></a>
</div>
<br />
<div class="alert alert-info" role="alert">
請輸入搜尋的條件(ex. 姓名、檢傷、收治單位)
</div>
<!-- <span class="label label-success">已出院: {{total['已出院']}}</span> -->
</div>
</div>
<div class="row" ng-show="type=='people' && query">
<div class="col-lg-12">
<table class="table table-striped">
<thead>
<tr>
<th>收治單位</th>
<th>個資</th>
<th>檢傷</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="row in data.data | advancefilter: query">
<td>
<a href="#{{row['編號']}}" ng-click="setType(row['編號'], row);open('list','編號')">{{ row['編號'] }}</a><br />
<span class="label label-default">{{row['縣市別']}}</span><br />
<a href="https://www.google.com/maps?q={{ map[row['縣市別']+row['收治單位']].address || row['收治單位'] }}" target="_blank" ng-click="open('list','地圖')">{{row['收治單位']}} <i class="glyphicon glyphicon-map-marker"></i></a>
<span ng-if="map[row['縣市別']+row['收治單位']].phone" class="animate-if">
<a href="tel:{{map[row['縣市別']+row['收治單位']].phone}}" target="_blank" style="white-space: nowrap;" ng-click="open('list','醫院電話')">{{map[row['縣市別']+row['收治單位']].phone}}</a>
</span>
</td>
<td>
{{ row['姓名']}}
<hr />
<span class="label label-default">{{ row['性別']}} {{ row['年齡']}}</span><br />
<span class="label label-default">{{ row['國籍']}}</span>
</td>
<td>
<span class="label label-default">醫療檢傷: {{row['醫療檢傷']}}</span><br />
<span class="label label-default">救護檢傷: {{row['救護檢傷']}}</span><br />
<span class="label label-default">檢傷編號: {{row['檢傷編號']}}</span><br />
<span class="label label-default">轉診要求: {{row['轉診要求']}}</span><br />
<span class="label label-default">刪除註記: {{row['刪除註記']}}</span><br />
<h4>
<span class="label label-default">即時動向:</span>
</h4>
<h4>
<span ng-switch="row['即時動向']">
<span ng-switch-when="出院" class="label label-success">
{{row['即時動向']}}
</span>
<span ng-switch-when="自動出院(AAD)" class="label label-info">
{{row['即時動向']}}
</span>
<span ng-switch-when="加護病房" class="label label-warning">
{{row['即時動向']}}
</span>
<span ng-switch-when="死亡" class="label label-default label-angel">
{{row['即時動向']}}
</span>
<span ng-switch-default class="label label-primary">
{{row['即時動向']}}
</span>
</span>
</h4>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="row" ng-show="type=='care'">
<div class="col-xs-12 col-lg-12">
<table class="table table-striped">
<thead>
<tr>
<th>服務項目</th>
<th>聯絡資訊</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="row in care | filter: careQuery">
<td>
<span class="label label-primary">換藥</span>
<span class="label label-default">{{row['縣市']}}</span>
<br />
{{row['名稱']}}
</td>
<td>
<a href="tel:{{phone}}" target="_blank" ng-repeat="phone in row['電話']">
{{phone}}<i class="glyphicon glyphicon-earphone"></i>
<br />
</a>
<a href="https://www.google.com/maps?q={{row['地址']}}" target="_blank">{{row['地址']}}<i class="glyphicon glyphicon-map-marker"></i></a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="row" ng-show="type=='hospital'">
<div class="col-lg-12">
<div>
<span class="label label-default">未出院: {{total['未出院']}}人</span>
<span class="label label-danger">重傷: {{total['重傷']}}</span>
<span class="label label-warning">中傷: {{total['中傷']}}</span>
<span class="label label-success">輕傷: {{total['輕傷']}}</span>
</div>
<div class="progress">
<div class="progress-bar progress-bar-danger" style="width: {{ total['重傷'] / data.data.length * 100 }}%">
</div>
<div class="progress-bar progress-bar-warning" style="width: {{ total['中傷'] / data.data.length * 100 }}%">
</div>
<div class="progress-bar progress-bar-success" style="width: {{ total['輕傷'] / data.data.length * 100 }}%">
</div>
</div>
</div>
<div class="col-lg-12">
<div>
<span class="label label-default">加護病房: {{total['加護病房']}}人</span>
</div>
<div class="progress">
<div class="progress-bar progress-bar-def" style="width: {{ total['加護病房'] / data.data.length * 100 }}%">
</div>
</div>
</div>
<div class="col-lg-12">
<div>
<span class="label label-default">一般病房: {{total['一般病房']}}人</span>
</div>
<div class="progress">
<div class="progress-bar progress-bar-def" style="width: {{ total['一般病房'] / data.data.length * 100 }}%">
</div>
</div>
</div>
<br />
<div class="col-lg-12">
<table class="table table-striped">
<thead>
<tr>
<th>醫院</th>
<th>統計</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="row in total['醫院']">
<td>{{row['name']}}</td>
<td>
<div>
<span class="label label-danger">重傷: {{row['重傷']}}</span>
<span class="label label-warning">中傷: {{row['中傷']}}</span>
<span class="label label-success">輕傷: {{row['輕傷']}}</span>
</div>
<div class="progress">
<div class="progress-bar progress-bar-danger" style="width: {{ row['重傷'] / total.max * 100 }}%">
</div>
<div class="progress-bar progress-bar-warning" style="width: {{ row['中傷'] / total.max * 100 }}%">
</div>
<div class="progress-bar progress-bar-success" style="width: {{ row['輕傷'] / total.max * 100 }}%">
</div>
</div>
<div>
<span class="label label-default">加護病房: {{row['加護病房']}}</span>
<span class="label label-default">一般病房: {{row['一般病房']}}</span>
<span class="label label-default">其它: {{row['其它']}}</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="row blood" ng-show="type=='blood'">
<div class="col-md-6 col-sm-12">
<h1><span><img src="images/donate-blood.svg" alt="捐血圖示"> 捐血</span></h1>
<hr class="header-line">
<div class="content">
- 捐血車/站 資料可能過舊,出發前建議電話確認<br />
- 血有保存期限問題,建議分散捐血時間<br />
<a href="http://www.blood.org.tw/Internet/main/blood_before/index.html" target="_blank">更多捐血須知,點此連結</a>
</div>
</div>
<div class="col-md-12 storage">
<h1><span><img src="images/donate-blood.svg" alt="捐血圖示"> 各地血庫存量資訊</span></h1>
<hr class="header-line">
<div class="content">
<div ng-repeat="row in bloodStatus.data">
<div class="col-md-2 col-sm-12"><span class="storage-center">{{row['name']}}:</span></div>
<div class="col-md-10 col-sm-12">
<span class="volume" ng-class="{'full': row['StorageA']=='full', 'medium': row['StorageA']=='medium', 'empty': row['StorageA']=='empty'}">A型: {{row['StorageA'] | blood}}</span>
<span class="volume" ng-class="{'full': row['StorageB']=='full', 'medium': row['StorageB']=='medium', 'empty': row['StorageB']=='empty'}">B型: {{row['StorageB'] | blood}}</span>
<span class="volume" ng-class="{'full': row['StorageO']=='full', 'medium': row['StorageO']=='medium', 'empty': row['StorageO']=='empty'}">O型: {{row['StorageO'] | blood}}</span>
<span class="volume" ng-class="{'full': row['StorageAB']=='full', 'medium': row['StorageAB']=='medium', 'empty': row['StorageAB']=='empty'}">AB型: {{row['StorageAB'] | blood}}</span>
</div>
</div>
<span class="label label-default">最後更新: {{bloodStatus.time}}</span>
</div>
</div>
</div>
<div class="row" ng-show="type=='blood'">
<div class="col-lg-12">
<table class="table table-striped">
<thead>
<tr>
<th>捐血車/站</th>
<th>聯絡方式</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="row in bloods | filter: blood ">
<td>
{{row[0]}}<br />
{{row[1]}}
</td>
<td>
<a href="tel:{{row[2]}}">{{row[2]}}</a><br />
<a href="https://www.google.com/maps?q={{row[3]}}" target="_blank">{{row[3]}}</a><br />
<span class="label label-info nearby">{{row[4]}}</span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.14/angular.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.3/moment-with-locales.js"></script>
<script>
angular
.module('app', [])
.filter('advancefilter', [
'$filter',
function($filter) {
return function(data, text) {
if (!text) {
return [];
}
var textArr;
if (/^\w+$/.test(text)) {
textArr = [text];
} else if ((text || "").indexOf(" ") > -1) {
textArr = (text || "").split(' ');
} else {
textArr = (text || "").split('');
if (text && text.length > 1) {
textArr.splice(1,1);
}
}
angular.forEach(textArr, function(test){
if (test) {
data = data.filter(function(item) {
return item.keyword.search(test) > -1;
});
}
});
return data;
};
}
])
.filter('blood', [
'$filter',
function($filter) {
return function(data, text) {
if (data == 'full') {
return '正常';
} else if (data == 'medium') {
return '偏低';
} else if (data == 'empty') {
return '急缺';
} else {
return '異常';
}
};
}
])
.filter('hotelFilter', [
'$filter',
function($filter) {
return function(data, text) {
return data.filter(function(item) {
return item['靠近醫院'].search(text) > -1;
});
};
}
])
.controller('MainController',
function ($http, $scope) {
$scope.people = {};
$scope.sent = function(query) {
ga('send', 'event', 'input', 'search', query);
};
$scope.enter = function(e, query) {
if (e.which == 13) {
ga('send', 'event', 'input', 'enter', query);
}
};
$scope.open = function(group, name) {
ga('send', 'event', 'open', group, name);
};
$scope.setType = function(id, people) {
$scope.type = id;
$scope.people = people;
};
$scope.data = {
data: []
};
$scope.type = 'people';
$scope.total = {
'已出院': 0,
'未出院': 0,
'重傷': 0,
'中傷': 0,
'輕傷': 0,
'加護病房': 0,
'一般病房': 0,
'醫院': {},
'max': 0
};
if (location.hash) {
$scope.type = location.hash.slice(1);
}
$scope.bloodStatus = {
time: ' ',
data: []
};
$http.get('//g0v.github.io/blood/blood.json').success(function (data) {
var _d = new Date(data.time);
$scope.bloodStatus.time = moment(_d).fromNow();
for(var key in data) {
if (key.search('捐血中心') > -1) {
$scope.bloodStatus.data.push(data[key]);
}
}
});
$http.get('./people.json').success(function (data) {
$scope.data = data;
$scope.data.data = $scope.data.data.filter(function(item) {
return !!item['編號'];
});
$scope.data.data.forEach(function(item) {
item.keyword = [
item['編號'],
item['縣市別'],
item['收治單位'],
item['姓名'],
item['性別'],
item['年齡'],
item['國籍'],
item['醫療檢傷'],
item['救護檢傷'],
item['檢傷編號'],
item['轉診要求'],
item['刪除註記'],
item['即時動向']
].join(';');
if ($scope.type == item['編號']) {
$scope.people = item;
}
if (/(出院|死亡)/gi.test(item['即時動向'])) {
$scope.total['已出院'] += 1;
} else {
$scope.total['未出院'] += 1;
if (!$scope.total['醫院'][item['收治單位']]) {
$scope.total['醫院'][item['收治單位']] = {
'name': item['收治單位'],
'重傷': 0,
'中傷': 0,
'輕傷': 0,
'加護病房': 0,
'一般病房': 0,
'其它': 0
};
}
var hosp = $scope.total['醫院'][item['收治單位']];
if (item['救護檢傷'].trim() == '重傷') {
$scope.total['重傷'] += 1;
hosp['重傷'] += 1;
} else if (item['救護檢傷'].trim() == '中傷') {
$scope.total['中傷'] += 1;
hosp['中傷'] += 1;
} else if (item['救護檢傷'].trim() == '輕傷') {
$scope.total['輕傷'] += 1;
hosp['輕傷'] += 1;
}
if (item['即時動向'].trim() == '加護病房') {
$scope.total['加護病房'] += 1;
hosp['加護病房'] += 1;
} else if (item['即時動向'].trim() == '一般病房') {
$scope.total['一般病房'] += 1;
hosp['一般病房'] += 1;
} else if (item['即時動向'].trim() == '其它') {
$scope.total['其它'] += 1;
hosp['其它'] += 1;
}
var tmp = hosp['重傷'] + hosp['中傷'] + hosp['輕傷'];
if ($scope.total.max < tmp) {
$scope.total.max = tmp;
}
}
});
$http.get('./care.json').success(function (result) {
$scope.care = result.data;
});
$http.get('./hotels.json')
.success(function (result) {
$scope.hotels = result.data;
});
$scope.showHotelInfo = function(info) {
alert('靠近醫院:' + info['靠近醫院'] + '\n說明:' + info['說明']);
};
$scope.findNearHotel = function(hospitalKeywords) {
return $scope.hotels.filter(function(item) {
return item['靠近醫院'].search(hospitalKeywords) > -1;
});
};
var temp = [];
var sortKey = ['重傷', '中傷', '輕傷'];
for (var key in $scope.total['醫院']) {
temp.push($scope.total['醫院'][key]);
}
temp = temp.sort(function(a, b) {
for (var i = 0; i < sortKey.length; i++) {
if (a[sortKey[i]] > b[sortKey[i]]) {
return -1;
} else if (a[sortKey[i]] < b[sortKey[i]]) {
return 1;
}
}
return 0;
});
$scope.total['醫院'] = temp;
});
$scope.map = {
'台北市聯醫仁愛': {
'phone': '02-27093600',
'address': '台北市大安區仁愛路四段10號'
},
'台北市聯醫中興': {
'phone': '02-25523234',
'address': '台北市鄭州路145號'
},
'台北市聯醫忠孝': {
'phone': '02-27861288',
'address': '台北市南港區同德路87號'
},
'台北市聯醫陽明': {
'phone': '02-28353456',
'address': '台北市雨聲街105號'
},
'台北市臺大醫院': {
'phone': '02-23123456',
'address': '台北市中正區中山南路7號'
},
'台北市松山三總': {
'phone': '02-27642151',
'address': '台北市松山區健康路131號'
},
'台北市內湖三總': {
'phone': '02-87923311',
'address': '台北市內湖區成功路二段325號'
},
'台北市臺北榮總': {
'phone': '02-28712121',
'address': '台北市北投區石牌路二段201號'
},
'台北市臺北國泰': {
'phone': '02-27082121',
'address': '台北市仁愛路四段280號'
},
'台北市臺北馬偕': {
'phone': '02-25433535',
'address': '台北市中山區中山北路二段92號'
},
'台北市新光醫院': {
'phone': '02-28332211',
'address': '台北市士林區文昌路95號'
},
'台北市振興醫院': {
'phone': '02-28264400',
'address': '台北市北投區振興街45號'
},
'新北市淡水馬偕': {
'phone': '02-25433535',
'address': '新北市淡水區民生路45號'
},
'桃園市聖保祿醫': {
'phone': '03-3773300',
'address': '桃園市桃園區建新街123號'
},
'台北市中國附醫': {
'phone': '02-27919696',
'address': '台北市內湖區內湖路二段360號'
},
'台北市中國': {
'phone': '02-27919696',
'address': '台北市內湖區內湖路二段360號'
},
'台北市北醫附醫': {
'phone': '02-27372181',
'address': '台北市信義區吳興街252號'
},
'台北市萬芳醫院': {
'phone': '02-29307930',
'address': '台北市文山區興隆路三段111號'
},
'台北市中山醫院': {
'phone': '02-27081166',
'address': '台北市大安區仁愛路四段112巷11號'
},
'雄市燕義大醫院': {
'phone': '07-6150011',
'address': '雄市燕巢區義大路1號'
},
'基隆市基隆長庚': {
'phone': '02-24313131',
'address': '基隆市安樂區麥金路222號'
},
'新竹市新竹馬偕': {
'phone': '03-6119595',
'address': '新竹市東區光復路二段690號'
},
'新北巿衛部台北': {
'phone': '02-22765566',
'address': '新北巿新莊區思源路127號'
},
'新北市板橋市醫': {
'phone': '02-22575151',
'address': '新北市板橋區英士路198號'
},
'新北市三重市醫': {
'phone': '02-29829111',
'address': '新北市三重區新北大道一段3號'
},
'新北市亞東醫院': {
'phone': '02-89667000',
'address': '新北市板橋區南雅南路二段21號'
},
'新北市慈濟台北': {
'phone': '02-66289779',
'address': '新北市新店區建國路289號'
},
'新北市恩主': {
'phone': '02-26723456',
'address': '新北市三峽區復興路399號'
},
'新北市國泰汐止': {
'phone': '02-26482121',
'address': '新北市汐止區建成路59巷2號'
},
'新北市耕莘醫院': {
'phone': '02-22193391',
'address': '新北市新店區中正路362號'
},
'新北市雙和醫院': {
'phone': '02-22490088',
'address': '新北市中和區中正路291號'
},
'新北市板橋中興': {
'phone': '02-29590707',
'address': '新北市板橋區忠孝路15號'
},
'新北市新泰': {
'phone': '02-29962121',
'address': '新北市新莊區新泰路157號'
},
'桃園市桃園醫院': {
'phone': '03-3699721',
'address': '桃園市園區中山路1492號'
},
'桃園縣桃園總醫': {
'phone': '03-4799595',
'address': '桃園縣龍潭鄉中興路168號'
},
'桃園市林口長庚': {
'phone': '03-3281200',
'address': '桃園市龜山區復興街5號'
},
'桃園市敏盛': {
'phone': '03-3179599',
'address': '桃園市桃園區經國路168號'
},
'桃園市壢新': {
'phone': '03-4941234',
'address': '桃園市平鎮區廣泰路77號'
},
'台北市台北長庚': {
'phone': '02-27135211',
'address': '台北市敦化北路199號'
},
'桃園市聖保祿醫院': {
'phone': '03-3613141',
'address': '桃園市桃園區建新街123號'
},
'台中市臺中醫院': {
'phone': '04-22294411',
'address': '台中市西區三民路一段199號'
},
'台中市台中榮總': {
'phone': '04-23592525',
'address': '台中市西屯區台灣大道四段1650號'
},
'台中市童綜合': {
'phone': '04-26581919',
'address': '台中市梧棲區臺灣大道八段699號'
},
'台南市成大': {
'phone': '06-2353535',
'address': '台南市北區勝利路138號'
},
'台南市永康奇美': {
'phone': '06-2812811',
'address': '台南市永康區中華路901號'
},
'高雄市國軍左營': {
'phone': '07-5817121',
'address': '高雄市左營區軍校路553號'
},
'高雄市高雄長庚': {
'phone': '07-7317123高',
'address': '雄市鳥松區大埤路123號'
},
'新竹市台大新竹': {
'phone': '03-5326151',
'address': '新竹市北區經國路一段442巷25號'
},
'嘉義市嘉基': {
'phone': '05-2765041',
'address': '嘉義市東區忠孝路539號'
},
'新北市恩主公': {
'phone': '02-26723456',
'address': '新北市三峽區復興路399號'
},
'新北市耕莘永和': {
'phone': '02-29286060',
'address': '新北市永和區中興街80號'
},
'桃園市桃園總醫院': {
'phone': '03-4799595',
'address': '桃園市龍潭區中興路168號'
},
'彰化縣彰基': {
'phone': '04-7238595',
'address': '彰化縣彰化市南校街135號'
},
'彰化縣秀傳': {
'phone': '04-7256166',
'address': '彰化縣彰化市中山路一段542號'
},
'嘉義縣嘉義長庚': {
'phone': '05-3621000',
'address': '嘉義縣朴子市嘉朴路西段6號'
},
'台中市中國': {
'phone': '04-22053366',
'address': '台中市北區學士路91號'
}
};
$scope.hospital = {
'臺大醫院': {
"社福中心": "中正",
"辦公室電話": "02-23962340",
"主任": "林巧翊主任"
},
'聯醫中興': {
"社福中心": "大同",
"辦公室電話": "02-25974280",
"主任": "李恩琪"
},
'臺北馬偕': {
"社福中心": "中山",
"辦公室電話": "02-25156223",
"主任": "蔡淑婉主任"
},
'松山三總': {
"社福中心": "松山",
"辦公室電話": "02-27565018",
"主任": "黃婉貞"
},
'聯醫仁愛': {
"社福中心": "大安",
"辦公室電話": "02-27000960",
"主任": "張必宜"
},
'臺北國泰': {
"社福中心": "大安",
"辦公室電話": "02-27000960",
"主任": "張必宜"
},
'北醫附醫': {
"社福中心": "信義",
"辦公室電話": "02-27616515",
"主任": "蔡雅芬"
},
'新光醫院': {
"社福中心": "士林",
"辦公室電話": "02-28350247",
"主任": "許嘉倪"
},
'聯醫陽明': {
"社福中心": "士林",
"辦公室電話": "02-28350247",
"主任": "許嘉倪"
},
'臺北榮總': {
"社福中心": "北投",
"辦公室電話": "02-28942640",
"主任": "謝麗華"
},
'振興醫院': {
"社福中心": "北投",
"辦公室電話": "02-28942640",