45 lines
1.4 KiB
PHP
45 lines
1.4 KiB
PHP
![]() |
<?php
|
||
|
include ('includes/config/config.php');
|
||
|
include ('includes/functions.php');
|
||
|
include ('log_entry.php');
|
||
|
$id = $_REQUEST['id'];
|
||
|
$query = "SELECT * from prescription_master where prescription_id = '" . $id . "'";
|
||
|
error_log($query);
|
||
|
if (!$result = @mysqli_query($conn, $query)) {
|
||
|
exit(mysqli_error($conn));
|
||
|
}
|
||
|
$data = array();
|
||
|
|
||
|
|
||
|
if (mysqli_num_rows($result) > 0) {
|
||
|
$row = @mysqli_fetch_assoc($result);
|
||
|
|
||
|
$diagnosis_date = $row['diagnosis_date'];
|
||
|
|
||
|
$data = [
|
||
|
|
||
|
'prescription_id' => $row['prescription_id'],
|
||
|
'diseases' => $row['diseases'],
|
||
|
'emp_id' => $row['emp_id'],
|
||
|
'patient_name' => getTableFieldValue('patient_master', 'patient_name', 'id', $row['emp_id']),
|
||
|
'medicine_name' => $row['medicine_name'],
|
||
|
'medicine_frequency' => $row['medicine_frequency'],
|
||
|
'medicine_timing' => $row['medicine_timing'],
|
||
|
'admin_route' => $row['admin_route'],
|
||
|
'duration' => $row['duration'],
|
||
|
'dose_qty' => $row['dose_qty'],
|
||
|
'health_advices' => $row['health_advices'],
|
||
|
'diagnosis_date' => $diagnosis_date,
|
||
|
'remission_date' => $row['remission_date'],
|
||
|
'remark' => $row['remark'],
|
||
|
'other_med' => $row['other_med'],
|
||
|
];
|
||
|
} else {
|
||
|
$data['status'] = 200;
|
||
|
$data['message'] = "Data not found!";
|
||
|
error_log($data['message']);
|
||
|
}
|
||
|
|
||
|
// error_log('data ' . print_r($data, true));
|
||
|
echo json_encode($data);
|