-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlistdata.html
More file actions
260 lines (196 loc) · 8.44 KB
/
listdata.html
File metadata and controls
260 lines (196 loc) · 8.44 KB
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
<!doctype html>
<html lang="en">
<head>
<!-- Basic Page Needs
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<meta charset="utf-8" />
<title>ICARDS Flash Cards</title>
<meta name="description" content="St John NZ ICARDS Flash Cards" />
<meta name="keywords" content="St John, icards, flash cards, drugs, indications, action, contraindications, cautions, dose, route, gtn, methoxy, adrenaline, aspirin, ondansetron, glucagon, paracetamol, salbutamol"/>
<meta name="author" content="Jarrod Oberto" />
<!-- Mobile Specific Metas
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- CSS
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<link rel="stylesheet" href="css/normalize.css" />
<link rel="stylesheet" href="css/skeleton.css" />
<!-- Favicon
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<link rel="icon" type="image/png" href="images/favicon.png" />
<style>
@font-face {
font-family: "Raleway";
src:
url("fonts/Raleway/Raleway-VariableFont_wght.ttf")
format("truetype"),
font-weight: normal;
font-style: normal;
}
hr {
margin-top: 2rem;
/* border-top: 1px solid #eef1f3;*/
border-style: dashed;
}
h1 .sub {
font-size: 2rem;
vertical-align: middle;
}
h4 {
text-decoration: underline;
color: #18ab14;
}
h6 {
font-size: 16px;
font-weight: bold;
text-decoration: underline;
margin: 0 0 10px 0;
padding: 0;
}
/* Checkboxes */
#checkbox-container-icards, #checkbox-container-drugs {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 10px;
padding: 15px;
}
#checkbox-container-icards input,
#checkbox-container-drugs input {
margin-bottom: 0.6rem;
}
.item {
display: flex;
align-items: center;
}
.item label {
margin-left: 5px;
/* margin-bottom: 1.5rem; */
font-weight: normal;
}
ul {
list-style-position: outside;
}
.li-header {
/* text-decoration: underline; */
font-weight: bold;
margin: 10px 0 15px 0;
display: inline-block;
}
#show-icards-container {
grid-template-columns: repeat(3, 1fr
}
</style>
<script
type="module"
src="https://unpkg.com/ionicons@5.5.2/dist/ionicons/ionicons.esm.js"
></script>
<script
nomodule
src="https://unpkg.com/ionicons@5.5.2/dist/ionicons/ionicons.js"
></script>
</head>
<body>
<!-- Primary Page Layout
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<div class="container">
<div class="row" style="margin-top: 20px">
<div class="column">
<h1 class="u-pull-left">ICARDS <span class="sub">St John NZ - ICARDS Flash Cards</span></h1>
</div>
</div>
<div class="row" style="margin-top: 0px">
<div class="column">
<span style="font-size: 14px;">This page lists all data used by this service.</span>
</div>
</div>
<div class="row" id="show-icards-container" style="margin-top: 20px; ">
<div class="column">
<div id="show-icards-details"></div>
</div>
</div>
<hr />
<div class="row" id="footer" style="margin-top: 20px; color: #ccc; font-size: 12px;">
<div class="column" >
<span>Contact: <a href="mailto:jarrod.oberto@stjohn.org.nz">Jarrod Oberto</a></span> <br />
</div>
</div>
</div>
<!-- End Document
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<!-- Main script that imports helper.js -->
<script src="./data/drugs.js"></script>
<script src="./data/icards.js"></script>
<script src="./js/utils.js"></script>
<script>
let drugs = Utils.sortByName(drugData.getAllDrugs());
let icards = icardData.getAllIcards();
console.log('%c> drugs:', 'color:orange', drugs);
console.log('%c> icards:', 'color:orange', icards);
drawDrugIcardClick(drugs, icards);
function drawDrugIcardClick(drugsObj, icardsObj)
{
/*
var output = '<div style="display: flex; gap: 20px;">'; // Create a flex container
// Initialize two columns
let column1 = '<div style="flex: 1;">';
let column2 = '<div style="flex: 1;">';
// Loop through each drug
drugsObj.forEach((drugObj, index) => {
let content = '<h4>' + drugObj.name + '</h4>';
// Loop through each icard
icardsObj.forEach((icardObj) => {
content += '<h6>' + icardObj.name + '</h6>';
const answerArr = drugObj[icardObj.id];
console.log('%c> answerArr:', "color:orange", answerArr);
content += formatAnswer(answerArr);
});
// Alternate between columns
if (index % 2 === 0) {
column1 += content;
} else {
column2 += content;
}
});
// Close the columns
column1 += '</div>';
column2 += '</div>';
// Combine columns into the container
output += column1 + column2 + '</div>';
// Add the icards contents
let detailsElement = document.getElementById("show-icards-details");
detailsElement.innerHTML = output;
*/
var output = '';
// Loop through each drug
drugsObj.forEach((drugObj) => {
output += '<h4>~ ' + drugObj.name + ' ~</h4>';
// loop through each icard
icardsObj.forEach((icardObj) => {
output += '<h6>' + icardObj.name + '</h6>';
const answerArr = drugObj[icardObj.id];
console.log('%c> answerArr:', "color:orange", answerArr);
output += formatAnswer(answerArr);
});
});
// Add the icards contents
let detailsElement = document.getElementById("show-icards-details");
detailsElement.innerHTML = output;
}
function formatAnswer(answerArr)
{
let html = "";
html += "<ul>";
for (i = 0, len = answerArr.length; i < len; i++) {
var answer = answerArr[i];
if (answer.indexOf("no-bullet") >= 0) {
html += answer;
} else {
html += "<li>" + answer + "</li>";
}
}
html += "</ul>";
return html;
}
</script>
</body>
</html>