-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathpatients.php
140 lines (111 loc) · 2.38 KB
/
patients.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
<?php
include('class/Appointment.php');
$object = new Appointment;
$object->query = "
SELECT patient_phone_no FROM patient_table
WHERE patient_id = '".$_SESSION["patient_id"]."'
";
$result = $object->get_result();
foreach($result as $row){
// echo $row['patient_phone_no'];
$phoneNo=$row['patient_phone_no'];
}
// include('db.php');
// $query = mysqli_query($conn,"SELECT patient_phone_no FROM patient_table WHERE patient_id = 8");
// while ($row = $query->fetch_assoc()) {
// // // echo $row['patient_phone_no']."<br>";
// $phoneNo=$row['patient_phone_no'];
// }
//// $query1=strval($query);
$patients_url="https://tk7qoyktw2.execute-api.us-east-1.amazonaws.com/health/patient?phoneNo=".$phoneNo;
// $patients_url="https://tk7qoyktw2.execute-api.us-east-1.amazonaws.com/health/patients";
$patient_json=file_get_contents($patients_url);
$patient_array=json_decode($patient_json,true);
// if (!empty($patient_array)) {
// foreach ($patient_array as $data) {
// echo $data;
// }
// }
if (!empty($patient_array)) {
foreach ($patient_array as $key => $value) {
// echo "$key:$value\n";
if ($key=='name') {
$name=$value;
}
elseif ($key=='temp') {
$temp=$value;
}
elseif ($key=='pulse') {
$pulse=$value;
}
elseif ($key=='oximeter') {
$oximeter=$value;
}
elseif ($key=='bp') {
$bp=$value;
}
else{
$no=$value;
}
}
}
// echo "<br>",$name."<br>", $temp."<br>",$pulse."<br>";
// if (!empty($patient_array)) {
// foreach ($patient_array as $value) {
// echo $value['phoneNo']."<br>";
// echo $value['temp']."<br>";
// echo $value['name']."<br>";
// echo $value['pulse']."<br>";
// }
// }
?>
<!DOCTYPE html>
<html>
<head>
<title></title>
<style>
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
}
td, th {
border: 1px solid #dddddd;
text-align: left;
padding: 8px;
}
tr:nth-child(even) {
background-color: #dddddd;
}
</style>
</head>
<body>
<h1 style="text-align: center;">Patient Sensor Data for Analysis</h1>
<table>
<tr>
<th>Patient Name</th>
<th>Temperature Value</th>
<th>Pulse Rate</th>
<th>Oximeter</th>
<th>Blood Pressure</th>
</tr>
<tr>
<td>
<?php echo $name; ?>
</td>
<td>
<?php echo $temp; ?>
</td>
<td>
<?php echo $pulse; ?>
</td>
<td>
<?php echo $oximeter; ?>
</td>
<td>
<?php echo $bp; ?>
</td>
</tr>
</table>
</body>
</html>