-
Notifications
You must be signed in to change notification settings - Fork 0
/
formPreview.php
429 lines (379 loc) · 12.5 KB
/
formPreview.php
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
<!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">
<title>Immunisation Schedule Preview</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/stylesheet.css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<!-- print function -->
<script>
function printForm() {
window.print();
}
</script>
</head>
<?php
require_once ('dbaccess.php');
$pID = $_POST["patientID"];
//query to get all patients data
$sqlPatient = "SELECT PATIENTS.SURNAME,
PATIENTS.FIRSTNAME,
PATIENTS.ADDRESS1,
PATIENTS.DOB,
PATIENTS.SEXCODE,
PATIENTS.RECORDNO
FROM BPSPatients.dbo.PATIENTS
WHERE PATIENTS.INTERNALID = " . $pID;// . $_POST["patientID"];
$stmtPatient = sqlsrv_query($conn,$sqlPatient);
if ($stmtPatient === false)
{
exit(print_r(sqlsrv_errors(),true));
}
while ($rowPatient = sqlsrv_fetch_array($stmtPatient,SQLSRV_FETCH_ASSOC))
{
echo $rowPatient["FIRSTNAME"]." ".$rowPatient["SURNAME"]."<br/>";
}
//query to get all of a patients
// $sql = "SELECT * FROM BPSPatients.dbo.IMMUNISATIONS";
$sql = "SELECT
BPSPatients.dbo.IMMUNISATIONS.INTERNALID,
BPSPatients.dbo.IMMUNISATIONS.RECORDID,
BPSPatients.dbo.IMMUNISATIONS.RECORDSTATUS,
BPSPatients.dbo.IMMUNISATIONS.VACCINEID,
BPSPatients.dbo.IMMUNISATIONS.GIVENDATE
FROM
BPSPatients.dbo.IMMUNISATIONS
WHERE
BPSPatients.dbo.IMMUNISATIONS.RECORDSTATUS <> 0 AND BPSPatients.dbo.IMMUNISATIONS.INTERNALID = " . $pID;
$stmt = sqlsrv_query($conn,$sql);
if ($stmt === false)
{
exit(print_r(sqlsrv_errors(),true));
}
while ($row = sqlsrv_fetch_array($stmt,SQLSRV_FETCH_ASSOC))
{
//echo $row ["FIRSTNAME"]." ".$row["MIDDLENAME"]." ".$row["SURNAME"]."<br/>";
echo ("internalID: " . $row ["INTERNALID"] . //int
", RecordID: " . $row["RECORDID"] . //int
", RecordStatus: " . $row["RECORDSTATUS"] . //int
", VaccineID: " . $row["VACCINEID"] . //int
", Given Date: " . $row["GIVENDATE"]->format('d/m/Y') . "<br/>"); //string
}
$drug = "SELECT
BPSDrugs.dbo.VACCINES.VACCINEID,
BPSDrugs.dbo.VACCINES.VACCINENAME,
BPSDrugs.dbo.VAXDISEASES.DISEASENAME
FROM
BPSDrugs.dbo.VACCINES
INNER JOIN BPSDrugs.dbo.VACCINE_DISEASE ON BPSDrugs.dbo.VACCINE_DISEASE.VACCINEID = BPSDrugs.dbo.VACCINES.VACCINEID
INNER JOIN BPSDrugs.dbo.VAXDISEASES ON BPSDrugs.dbo.VACCINE_DISEASE.DISEASECODE = BPSDrugs.dbo.VAXDISEASES.DISEASECODE
ORDER BY
VAXDISEASES.DISEASENAME
";
$stmtDrug = sqlsrv_query($conn,$drug);
$HepBVaccineID = array();
$ADTdToaVaccineID = array();
$IPVVaccineID = array();
$MMRVaccineID = array();
$VZVVaccineID = array();
$HPVVaccineID = array();
$BCGVaccineID = array();
$MenACWYVaccineID = array();
if ($stmtDrug === false)
{
exit(print_r(sqlsrv_errors(),true));
}
// require_once ('dbaccess.php');
//
// $sql = "SELECT PATIENTS.SURNAME + ' ' + PATIENTS.FIRSTNAME + ' DOB ' + CONVERT(VARCHAR,CAST(PATIENTS.DOB AS DATE)) + ' ID ' + ':' + CONVERT(varchar,PATIENTS.INTERNALID) AS Result FROM PATIENTS ORDER BY dbo.PATIENTS.SURNAME";
//
// $stmt = sqlsrv_query($conn,$sql);
//
// if ($stmt === false)
// {
// exit(print_r(sqlsrv_errors(),true));
// }
//
// while ($row = sqlsrv_fetch_array($stmt,SQLSRV_FETCH_ASSOC))
// {
// //echo $row ["FIRSTNAME"]." ".$row["MIDDLENAME"]." ".$row["SURNAME"]."<br/>";
// echo $row ["Result"]."<br/>";
//
// }
while ($rowX = sqlsrv_fetch_array($stmtDrug,SQLSRV_FETCH_ASSOC))
{
// echo ("Vaccine ID: " . $rowX ["VACCINEID"] . //int
// ", Vaccine Name: " . $rowX["VACCINENAME"] . //int
// ", Disease Name: " . $rowX["DISEASENAME"]) . '<br>';
if($rowX["DISEASENAME"] == "Hepatitis B "){
array_push($HepBVaccineID, $rowX["VACCINEID"]);
} elseif ($rowX["DISEASENAME"] == "Diphtheria " || $rowX["DISEASENAME"] == "Tetnus "){
array_push($ADTdToaVaccineID, $rowX['VACCINEID']);
} elseif ($rowX["DISEASENAME"] == "Poliomyelitis ") {
array_push($IPVVaccineID, $rowX['VACCINEID']);
} elseif ($rowX["DISEASENAME"] == "Measels " || $rowX["DISEASENAME"] == "Mumps " || $rowX["DISEASENAME"] == "Rubella ") {
array_push($MMRVaccineID, $rowX["VACCINEID"]);
} elseif ($rowX["DISEASENAME"] == "Varicella-Zoster ") {
array_push($VZVVaccineID, $rowX["VACCINEID"]);
} elseif ($rowX["DISEASENAME"] == "HPV ") {
array_push($HPVVaccineID, $rowX["VACCINEID"]);
} elseif ($rowX["DISEASENAME"] == "Tuberculosis ") {
array_push($BCGVaccineID, $rowX["VACCINEID"]);
} elseif ($rowX["DISEASENAME"] == "Meningococcus ACWY ") {
array_push($MenACWYVaccineID, $rowX['VACCINEID']);
}
}
echo "Hep B: ";
print_r($HepBVaccineID);
echo "<br> ADT/dTpa: ";
print_r($ADTdToaVaccineID);
echo "<br> IPV: ";
print_r($IPVVaccineID);
echo "<br> MMR: ";
print_r($MMRVaccineID);
echo "<br> VZV: ";
print_r($VZVVaccineID);
echo "<br> HPV: ";
print_r($HPVVaccineID);
echo "<br> BCG: ";
print_r($BCGVaccineID);
echo "<br> MenACWY: ";
print_r($MenACWYVaccineID);
?>
<body>
<!-- pop-up confirm modal -->
<!-- Example from w3schools.com -->
<div id="myModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<div class="modal-body">
<div id="pop-up-iframe">
<iframe src="formPreview.php"></iframe>
</div>
<h3>Are you sure you want to upload this form to Best Practice?</h3>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal">Yes</button>
<button type="button" class="btn btn-danger" data-dismiss="modal">No</button>
</div>
</div>
</div>
</div>
<!--header for form -->
<div class="container">
<div class="row">
<!-- action buttons -->
<button type="button" class="btn btn-upload" data-toggle="modal" data-target="#myModal">Upload to Best Practice</button>
<button onclick="printForm()" type="button" class="btn btn-print">Print</button>
</div>
<div class="table" id="header">
<div class="row">
<img src="assets/logos/IPC.png" class="img-fluid" alt="Inala Primary Care Logo">
<p id="companyName">Inala Primary Care</p>
<p id="companyAddress">64 Wirraway Pde INALA 4064</p>
<p id="companyPhone">07 3275 5444</p>
</div>
</div>
</div>
<!--page heading for form-->
<div class="container">
<div class="table" id="headingBox">
<h2 id="formTitle">Refugee Immunisation Catch-up Advisory Schedule</h2>
<h3 id="ageGroup">10 - 19 Years</h3>
</div>
</div>
<!--patient info section-->
<?php
echo('<div class="container">
<div class="table" id="patientInfo">
<h2>Patient Details</h2>
<div class=".col-md-6">
<label>Name:</label>
<input id="PtFullName"></input>
<label>Age:</label>
<input id="PtAge"></input>
<label>Address:</label>
<input id="PtAddress"></input>
</div>
<div class=".col-md-6">
<label>DOB:</label>
<input id="PtDoB"></input>
<label>Patient Record No.:</label>
<input id="PtRecordNo"></input>
<label>Sex:</label>
<input id="PtSex"></input>
</div>
</div>
</div')
?>
<!--Dosage section-->
<div class="container">
<div class="table">
<table class="table" id="dosageTable">
<h2>Dosage Record</h2>
<tr>
<th>Dose</th>
<th>1</th>
<th>2</th>
<th>3</th>
<th>COMMENTS</th>
</tr>
<tr>
<td>Antigen</td>
<td colspan="5">For recording previously given vaccinations enter date given and leave blank for ones still required</td>
</tr>
<tr>
<td>Hep B</td>
<td><input id="hepBdate1" type="date"></input></td>
<td><input id="hepBdate2" type="date"></input></td>
<td><input id="hepBdate3" type="date"></input></td>
<td></td>
</tr>
<tr>
<td>ADT/dTpa</td>
<td><input id="ADTdate1" type="date"></input></td>
<td><input id="ADTdate2" type="date"></input></td>
<td><input id="ADTdate3" type="date"></input></td>
<td></td>
</tr>
<tr>
<td>IPV</td>
<td><input id="IPVdate1" type="date"></input></td>
<td><input id="IPVdate2" type="date"></input></td>
<td><input id="IPVdate3" type="date"></input></td>
<td></td>
</tr>
<tr>
<td>MMR</td>
<td><input id="MMRdate1" type="date"></input></td>
<td><input id="MMRdate2" type="date"></input></td>
<td><input id="MMRdate3" type="date"></input></td>
<td>Refer to TB clinicafter 2nd MMR</td>
</tr>
<tr>
<td>VZV*</td>
<td><input id="VZVdate1" type="date"></input></td>
<td><input id="VZVdate2" type="date"></input></td>
<td><input id="VZVdate3" type="date"></input></td>
<td>School based vaccination program only</td>
</tr>
<tr>
<td>HPV#</td>
<td><input id="HPVdate1" type="date"></input></td>
<td><input id="HPVdate2" type="date"></input></td>
<td><input id="HPVdate3" type="date"></input></td>
<td>School based vaccination program only</td>
</tr>
<tr>
<td>BCG</td>
<td><input id="BCGdate1" type="date"></input></td>
<td><input id="BCGdate2" type="date"></input></td>
<td><input id="BCGdate3" type="date"></input></td>
<td>Refer to Metro South Clinical TB Service</td>
</tr>
<tr>
<td>MenACWY</td>
<td><input id="MenACWYdate1" type="date"></input></td>
<td><input id="MenACWYdate2" type="date"></input></td>
<td><input id="MenACWYdate3" type="date"></input></td>
<td>School based vaccination (Yr10) OR catch up for 15-19 year olds with GP</td>
</tr>
</table>
</div>
</div>
<!--timeline table-->
<div class="container">
<table class="table" id="timelineTable">
<h2>Vaccination Schedule</h2>
<tr>
<th>Time Due</th>
<th>Date</th>
<th>Vaccinations Needed</th>
<th>Batch</th>
<th>Site</th>
<th>Vaccinator</th>
</tr>
<!--Now row-->
<tr>
<td>Now</td>
<td><input id="timelineDate1" type="date"></input></td>
<td>
<ul>
<li>Paediatric Hep B</li>
<li>Boostrix</li>
<li>IPV</li>
<li>MMRV</li>
</ul>
</td>
<td><input id="batch1" type="text"></input></td>
<td><input id="site1" type="text"></input></td>
<td>Checked:</td>
</tr>
<!--4 month row-->
<tr>
<td>1 month from last</td>
<td><input id="timelineDate2" type="date"></input></td>
<td>
<ul>
<li>Paediatric Hep B</li>
<li>ADT</li>
<li>IPV</li>
<li>MMR</li>
</ul>
</td>
<td><input id="batch2" type="text"></input></td>
<td><input id="site2" type="text"></input></td>
<td>Checked:</td>
</tr>
<!--6 months row-->
<tr>
<td>3 months from last</td>
<td><input id="timelineDate3" type="date"></input></td>
<td>
<ul>
<li>Paediatric Hep B</li>
<li>ADT</li>
<li>IPV</li>
<li>MenC</li>
</ul>
</td>
<td><input id="batch3" type="text"></input></td>
<td><input id="site3" type="text"></input></td>
<td>Checked:</td>
</tr>
<!--table notes row 1-->
<tr>
<td colspan="6" id="notes1"># HPV can be ordered from QHIP for males and females, if year 8 school dose has been missed. * At least 1 dose Varicella if child aged < 14 years however if child is ≥ 14 years at first dose, give second dose, 4 weeks after 1st dose - as per Australian Standard Vaccination Schedule- 10th Edition</td>
</tr>
<tr>
<td colspan="6" id="notes2">Record on VIVAS as Refugee Catch-up</td>
</tr>
</table>
</container>
<!-- additional notes -->
<div class="container">
<table class="table" id="additional-notes">
<h2>Additional Notes</h2>
<form>
<div class="form-group">
<textarea class="form-control" rows="5" id="comment"></textarea>
</div>
</form>
</table
</div>
<!-- action buttons -->
<div class="container">
<div class="table" id="tools">
<button type="button" class="btn btn-upload" data-toggle="modal" data-target="#myModal">Upload to Best Practice</button>
<button onclick="printForm()" type="button" class="btn btn-print">Print</button>
</div>
</div>
</body>
</html>