-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 4ad44c9
Showing
25 changed files
with
1,265 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
require "conn.php"; | ||
$tag_id = $_POST["tag_id"]; | ||
$type = $_POST["type"]; | ||
|
||
$mysql_qry1 = "SELECT `patient_id` FROM `patient` WHERE tag_id='$tag_id'"; | ||
|
||
if ($result1=mysqli_query($conn,$mysql_qry1)) | ||
{ | ||
while($row1=mysqli_fetch_row($result1)) | ||
{ | ||
$patient_id = $row1[0]; | ||
} | ||
} | ||
|
||
$mysql_qry = "INSERT INTO `hospital`.`allergies` (`allergy_id`, `patient_id`, `type`) VALUES (NULL, '$patient_id', '$type')"; | ||
|
||
if ($result=mysqli_query($conn,$mysql_qry)) | ||
{ | ||
echo "success"; | ||
} | ||
mysqli_close($conn); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
require "conn.php"; | ||
$tag_id = $_POST["tag_id"]; | ||
$doctor_tag = $_POST["doctor_tag"]; | ||
$description = $_POST["description"]; | ||
|
||
$patient_id = ""; | ||
$doctor_id = ""; | ||
|
||
$mysql_qry1 = "SELECT `patient_id` FROM `patient` WHERE tag_id='$tag_id'"; | ||
|
||
if ($result1=mysqli_query($conn,$mysql_qry1)) | ||
{ | ||
while($row1=mysqli_fetch_row($result1)) | ||
{ | ||
$patient_id = $row1[0]; | ||
} | ||
} | ||
|
||
$mysql_qry2 = "SELECT `doctor_id` FROM `doctor` WHERE tag_id='$doctor_tag'"; | ||
|
||
if ($result2=mysqli_query($conn,$mysql_qry2)) | ||
{ | ||
while($row2=mysqli_fetch_row($result2)) | ||
{ | ||
$doctor_id = $row2[0]; | ||
} | ||
} | ||
|
||
$curr_date = date("Y-m-d"); | ||
|
||
$mysql_qry = "INSERT INTO `hospital`.`diagnostics` (`diagnostic_id`, `date`, `doctor_id`, `patient_id`, `description`) VALUES (NULL, '$curr_date', '$doctor_id', '$patient_id', '$description')"; | ||
|
||
if ($result=mysqli_query($conn,$mysql_qry)) | ||
{ | ||
echo "success"; | ||
} | ||
mysqli_close($conn); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
require "conn.php"; | ||
$tag_id = $_POST["tag_id"]; | ||
$reader_id = $_POST["reader_id"]; | ||
|
||
$mysql_qry = "select * from login where tag_id like '$tag_id'"; | ||
$result = mysqli_query($conn,$mysql_qry); | ||
if(mysqli_num_rows($result)>0) | ||
{ | ||
} | ||
else | ||
{ | ||
echo "not success"; | ||
} | ||
|
||
$mysql_qry1 = "SELECT `patient_id` FROM `patient` WHERE tag_id='$tag_id'"; | ||
|
||
if ($result1=mysqli_query($conn,$mysql_qry1)) | ||
{ | ||
while($row1=mysqli_fetch_row($result1)) | ||
{ | ||
$patient_id = $row1[0]; | ||
} | ||
} | ||
else | ||
{ | ||
echo "not success"; | ||
|
||
} | ||
|
||
$mysql_qry2 = "SELECT `ward_id` FROM `ward` WHERE reader_id='$reader_id'"; | ||
if ($result2=mysqli_query($conn,$mysql_qry2)) | ||
{ | ||
while($row2=mysqli_fetch_row($result2)) | ||
{ | ||
$ward_id = $row2[0]; | ||
} | ||
} | ||
else | ||
{ | ||
echo "not success"; | ||
|
||
} | ||
|
||
$mysql_qry3 = "INSERT INTO `hospital`.`location` (`location_id`, `patient_id`, `time`,`ward_id`) VALUES (NULL, '$patient_id', CURRENT_TIMESTAMP,'$ward_id')"; | ||
if ($result3=mysqli_query($conn,$mysql_qry3)) | ||
{ | ||
echo "success"; | ||
} | ||
|
||
mysqli_close($conn); | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?php | ||
require "conn.php" | ||
$mysql_qry = "INSERT"; | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
require "conn.php"; | ||
$tag_id = $_POST["tag_id"]; | ||
$doctor_tag = $_POST["doctor_tag"]; | ||
$bpn = $_POST["bpn"]; | ||
$bpd = $_POST["bpd"]; | ||
$temperature = $_POST["temperature"]; | ||
$pulse = $_POST["pulse"]; | ||
$weight = $_POST["weight"]; | ||
|
||
$patient_id = ""; | ||
$doctor_id = ""; | ||
|
||
$mysql_qry1 = "SELECT `patient_id` FROM `patient` WHERE tag_id='$tag_id'"; | ||
|
||
if ($result1=mysqli_query($conn,$mysql_qry1)) | ||
{ | ||
while($row1=mysqli_fetch_row($result1)) | ||
{ | ||
$patient_id = $row1[0]; | ||
} | ||
} | ||
|
||
$mysql_qry2 = "SELECT `doctor_id` FROM `doctor` WHERE tag_id='$doctor_tag'"; | ||
|
||
if ($result2=mysqli_query($conn,$mysql_qry2)) | ||
{ | ||
while($row2=mysqli_fetch_row($result2)) | ||
{ | ||
$doctor_id = $row2[0]; | ||
} | ||
} | ||
|
||
$mysql_qry = "INSERT INTO `hospital`.`observation` (`observation_id`, `patient_id`, `doctor_id`, `date`, `bpn`, `bpd`, `temperature`, `pulse`, `weight`) VALUES (NULL, '$patient_id', '$doctor_id', CURRENT_TIMESTAMP, '$bpn', '$bpd', '$temperature', '$pulse', '$weight')"; | ||
|
||
if ($result=mysqli_query($conn,$mysql_qry)) | ||
{ | ||
echo "success"; | ||
} | ||
mysqli_close($conn); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
require "conn.php"; | ||
$tag_id = $_POST["tag_id"]; | ||
$doctor_tag = $_POST["doctor_tag"]; | ||
$medicine_name = $_POST["medicine_name"]; | ||
$quantity_per_day = $_POST["quantity_per_day"]; | ||
$frequency_per_day = $_POST["frequency_per_day"]; | ||
$end_date = $_POST["end_date"]; | ||
|
||
$patient_id = ""; | ||
$doctor_id = ""; | ||
$medicine_id = ""; | ||
|
||
$mysql_qry1 = "SELECT `patient_id` FROM `patient` WHERE tag_id='$tag_id'"; | ||
|
||
if ($result1=mysqli_query($conn,$mysql_qry1)) | ||
{ | ||
while($row1=mysqli_fetch_row($result1)) | ||
{ | ||
$patient_id = $row1[0]; | ||
} | ||
} | ||
|
||
$mysql_qry2 = "SELECT `doctor_id` FROM `doctor` WHERE tag_id='$doctor_tag'"; | ||
|
||
if ($result2=mysqli_query($conn,$mysql_qry2)) | ||
{ | ||
while($row2=mysqli_fetch_row($result2)) | ||
{ | ||
$doctor_id = $row2[0]; | ||
} | ||
} | ||
|
||
$mysql_qry3 = "SELECT `medicine_id` FROM `medicine` WHERE medicine_name='$medicine_name'"; | ||
|
||
if ($result3=mysqli_query($conn,$mysql_qry3)) | ||
{ | ||
while($row3=mysqli_fetch_row($result3)) | ||
{ | ||
$medicine_id = $row3[0]; | ||
} | ||
} | ||
|
||
$curr_date = date("Y-m-d"); | ||
|
||
$status = "active"; | ||
|
||
$mysql_qry = "INSERT INTO `hospital`.`prescription` (`prescription_id`, `patient_id`, `doctor_id`, `medicine_id`, `quantity_per_day`, `frequency_per_day`, `start_date`, `end_date`, `status`) VALUES (NULL, '$patient_id', '$doctor_id','$medicine_id' ,'$quantity_per_day', '$frequency_per_day', '$curr_date', '$end_date', '$status')"; | ||
|
||
if ($result=mysqli_query($conn,$mysql_qry)) | ||
{ | ||
echo "success"; | ||
} | ||
mysqli_close($conn); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
require "conn.php"; | ||
$tag_id = $_POST["tag_id"]; | ||
|
||
$mysql_qry1 = "SELECT `patient_id` FROM `patient` WHERE tag_id='$tag_id'"; | ||
|
||
if ($result1=mysqli_query($conn,$mysql_qry1)) | ||
{ | ||
while($row1=mysqli_fetch_row($result1)) | ||
{ | ||
$patient_id = $row1[0]; | ||
} | ||
} | ||
|
||
$mysql_qry2 = "SELECT `type` FROM `allergies` WHERE patient_id='$patient_id'"; | ||
|
||
$response = array(); | ||
|
||
if ($result2=mysqli_query($conn,$mysql_qry2)) | ||
{ | ||
while($row2=mysqli_fetch_row($result2)) | ||
{ | ||
array_push($response, array("type"=>$row2[0])); | ||
} | ||
|
||
} | ||
echo json_encode(array("server_response"=>$response)); | ||
|
||
mysqli_close($conn); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
require "conn.php"; | ||
$tag_id = $_POST["tag_id"]; | ||
|
||
$mysql_qry1 = "SELECT `patient_id` FROM `patient` WHERE tag_id='$tag_id'"; | ||
|
||
if ($result1=mysqli_query($conn,$mysql_qry1)) | ||
{ | ||
while($row1=mysqli_fetch_row($result1)) | ||
{ | ||
$patient_id = $row1[0]; | ||
} | ||
} | ||
|
||
$mysql_qry2 = "SELECT `date`, `doctor_id`, `description` FROM `diagnostics` WHERE patient_id='$patient_id'"; | ||
|
||
$response = array(); | ||
|
||
if ($result2=mysqli_query($conn,$mysql_qry2)) | ||
{ | ||
while($row2=mysqli_fetch_row($result2)) | ||
{ | ||
$mysql_qry3 = "SELECT `first_name`, `last_name` FROM `doctor` WHERE doctor_id='$row2[1]'"; | ||
if ($result3=mysqli_query($conn,$mysql_qry3)) | ||
{ | ||
while($row3=mysqli_fetch_row($result3)) | ||
{ | ||
$docFName = $row3[0]; | ||
$docLName = $row3[1]; | ||
} | ||
} | ||
array_push($response, array("date"=>$row2[0], "doc_first_name"=>$docFName,"doc_last_name"=>$docLName,"description"=>$row2[2])); | ||
} | ||
|
||
} | ||
echo json_encode(array("server_response"=>$response)); | ||
|
||
mysqli_close($conn); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
require "conn.php"; | ||
$tag_id = $_POST["tag_id"]; | ||
|
||
$mysql_qry1 = "SELECT `patient_id` FROM `patient` WHERE tag_id='$tag_id'"; | ||
|
||
if ($result1=mysqli_query($conn,$mysql_qry1)) | ||
{ | ||
while($row1=mysqli_fetch_row($result1)) | ||
{ | ||
$patient_id = $row1[0]; | ||
} | ||
} | ||
|
||
$mysql_qry2 = "SELECT `time`, `ward_id` FROM `location` WHERE patient_id='$patient_id'"; | ||
|
||
$response = array(); | ||
|
||
if ($result2=mysqli_query($conn,$mysql_qry2)) | ||
{ | ||
while($row2=mysqli_fetch_row($result2)) | ||
{ | ||
$mysql_qry3 = "SELECT `ward_name` FROM `ward` WHERE ward_id='$row2[1]'"; | ||
if ($result3=mysqli_query($conn,$mysql_qry3)) | ||
{ | ||
while($row3=mysqli_fetch_row($result3)) | ||
{ | ||
$ward_name = $row3[0]; | ||
} | ||
} | ||
|
||
array_push($response, array("time_stamp"=>$row2[0],"ward_name"=>$ward_name)); | ||
} | ||
|
||
} | ||
echo json_encode(array("server_response"=>$response)); | ||
|
||
mysqli_close($conn); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
require "conn.php"; | ||
|
||
$response = array(); | ||
|
||
$mysql_qry = "SELECT `medicine_name` FROM `medicine`"; | ||
|
||
if ($result=mysqli_query($conn,$mysql_qry)) | ||
{ | ||
while($row=mysqli_fetch_row($result)) | ||
{ | ||
array_push($response, array("medicine_name"=>$row[0])); | ||
} | ||
} | ||
|
||
echo json_encode(array("server_response"=>$response)); | ||
|
||
mysqli_close($conn); | ||
?> |
Oops, something went wrong.