-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfiner.html
More file actions
239 lines (206 loc) · 8.42 KB
/
finer.html
File metadata and controls
239 lines (206 loc) · 8.42 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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FiO2 Calculator</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css"
integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
<script>
changeCell = () => {
let output = document.getElementById("output").value
switch (output) {
case "fio2":
return document.getElementById('last-cell').innerHTML = "Oxygen Flow (mL/min or cc/min)";
case "flow":
return document.getElementById('last-cell').innerHTML = "FiO2 (%)";
default:
return document.getElementById('last-cell').innerHTML = "Select Option Above"
}
};
calculate = () => {
const weight = Number(document.getElementById('qty_weight').value);
const respRate = Number(document.getElementById('qty_respiratory_rate').value);
const B = Number(document.getElementById("qty_blender_oxygen").value); //%
const Vt = 5.5 * weight;
const Ve = Vt * respRate;
output = document.getElementById("output").value;
let result = "Please select your desired output";
let warning = "<br />";
let warning2 = "<br />";
switch (output) {
case "fio2":
const flow = Number(document.getElementById('last-cell-value').value);
let calculatedFio2 = 0;
if (flow > 200) {
alert('Flow rate too high, please use a different calculator.');
warning = "WARNING: flow rate too high, results may be inaccurate";
};
if (flow > Ve) {
calculatedFio2 = B;
};
if (flow <= Ve) {
calculatedFio2 = (((flow * (B - 21) / 100) + (0.21 * Ve)) / Ve) * 100;
};
result = "FiO2 = " + Math.round(calculatedFio2) + " %";
break;
case "flow":
const fio2 = Number(document.getElementById('last-cell-value').value);
const maxFio2 = B;
let calculatedFlow = 0;
if (fio2 <= maxFio2) {
calculatedFlow = (Ve / ((B - 21))) * ((fio2) - 21);
};
if (fio2 > maxFio2) {
calculatedFlow = Ve;
console.log("max fio2 passed = " + maxFio2); //100
console.log("fio2 entered = " + fio2); //50
warning = "The FiO2 value you entered cannot be reached with this blender oxygen. The max FiO2 possible is " + Math.round(maxFio2) + "% and the lowest flow rate at which it is reached is:";
};
if (calculatedFlow > 200) {
alert('Calculated flow rate too high, please use a different calculator.')
warning2 = "WARNING: calculated flow rate too high, results may be inaccurate";
};
result = "Flow rate = " + Math.round(calculatedFlow) + " mL/min";
break;
default:
result = "Please select your desired output";
break;
}
return (
document.getElementById('result').innerHTML = result,
document.getElementById('warning').innerHTML = warning,
document.getElementById('warning2').innerHTML = warning2
)
};
</script>
</head>
<body>
<header>
<h4>FiO2 Calculator</h4>
<div class="nav">
<ul>
<li>
<a href="aboutUs.html" class="btn btn-secondary" role="button" aria-pressed="true">
About Us
</a>
</li>
</ul>
</div>
</header>
<nav class="navbar navbar-expand navbar-light bg-light">
<div class="collapse navbar-collapse justify-content-center" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item active">
<a class="nav-link" href="index.html">Home</a>
</li>
<li class="nav-item active">
<div class="dropdown">
<a class="nav-link active dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
Calculators
</a>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="finer.html">Finer</a>
<a class="dropdown-item" href="bb.html">Benaron-Benitz</a>
<a class="dropdown-item" href="hybrid.html">Hybrid</a>
</div>
</div>
</li>
<li class="nav-item active">
<div class="dropdown">
<a class="nav-link active dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
How it Works
</a>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="finerHIW.html">Finer</a>
<a class="dropdown-item" href="bbHIW.html">Benaron-Benitz</a>
<a class="dropdown-item" href="hybridHIW.html">Hybrid</a>
</div>
</div>
</li>
</ul>
</div>
</nav>
<div class="page-content">
<h5>Finer Calculator (as adapted by NICU Tools):</h5>
<p>Recommended conditions for use:
<ul>
<li>If known, flow rate below 200 ml/min</li>
<li>Measured respiratory rate</li>
</ul>
</p>
<div class="container mt-4">
<div class="row my-3">
<div class="col-6">
Weight (Kg)
</div>
<div class="col-3">
<input type="number" value="1.5" class="qty" id="qty_weight" />
</div>
</div>
<div class="row my-3">
<div class="col-6">
Respiratory rate (Breaths/Min)
</div>
<div class="col-3">
<input type="number" value="65" class="qty" id="qty_respiratory_rate" />
</div>
</div>
<div class="row my-3">
<div class="col-6">
Blender Oxygen (%)
</div>
<div class="col-3">
<input type="number" value="100" class="qty" id="qty_blender_oxygen" />
</div>
</div>
<div class="row my-3">
<div class="col-6">
Preferred output:
</div>
<div class="col-3" onload="changeCell()">
<select id="output" onchange="changeCell()">
<option value="none">Select Option</option>
<option value="fio2">FiO2</option>
<option value="flow">Flow Rate</option>
</select>
</div>
</div>
<div class="row my-3">
<div class="col-6" id=last-cell>Select Option Above</div>
<div class="col-3">
<input type="number" class="qty" value="0" id="last-cell-value" />
</div>
</div>
</div>
<p class="result-div">
<div class="center" onload="calculate()">
<button class="btn btn-success" type="button" onclick="calculate()">Calculate Results</button>
</div>
<div class="warning" id="warning"><br /></div>
<div class="result" id="result"></div>
<div class="warning" id="warning2"><br /></div>
</p>
<p xmlns:cc="http://creativecommons.org/ns#">This work is licensed under <a
href="http://creativecommons.org/licenses/by-nc-sa/4.0/?ref=chooser-v1" target="_blank"
rel="license noopener noreferrer" style="display:inline-block;">CC BY-NC-SA 4.0<img
style="height:22px!important;margin-left:3px;vertical-align:text-bottom;"
src="https://mirrors.creativecommons.org/presskit/icons/cc.svg?ref=chooser-v1"><img
style="height:22px!important;margin-left:3px;vertical-align:text-bottom;"
src="https://mirrors.creativecommons.org/presskit/icons/by.svg?ref=chooser-v1"><img
style="height:22px!important;margin-left:3px;vertical-align:text-bottom;"
src="https://mirrors.creativecommons.org/presskit/icons/nc.svg?ref=chooser-v1"><img
style="height:22px!important;margin-left:3px;vertical-align:text-bottom;"
src="https://mirrors.creativecommons.org/presskit/icons/sa.svg?ref=chooser-v1"></a></p>
</div>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"
integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx"
crossorigin="anonymous"></script>
</body>
</html>