=str_to_date('" . $start_date . "','%d-%m-%Y') "; $qry_date1 .= "and date(patient_master.doj) >=str_to_date('" . $start_date . "','%d-%m-%Y')"; } if (isset($end_date) && $end_date != '') { $qry_filter .= " and date(medical_examination.medical_entry_date) <=str_to_date('" . $end_date . "','%d-%m-%Y') "; $qry_date1 .= "and date(patient_master.doj) >=str_to_date('" . $end_date . "','%d-%m-%Y')"; } if (isset($month) && $month != '') { $qry_filter .= " and date(medical_examination.medical_entry_date) in (" . $month . ")"; } ?> 1) { for ($j = 0; $j < sizeof($year1); $j++) { error_log("year:" . $year1[$j] . " size:" . sizeof($year1)); $qry_date = ""; $qry_date1 = ""; $qry_date .= "and year(medical_entry_date) ='" . $year1[$j] . "'"; $qry_date1 .= " and year(doj) <='" . $year1[$j] . "'"; $query = "select max(medical_exam_id),patient_name from medical_examination left join patient_master on medical_examination.patient_id = patient_master.id where patient_id in (SELECT id FROM `patient_master` where status='Active' and YEAR(CURDATE())-year(doj)>=0 and YEAR(CURDATE())-year(doj)<2 $qry_date1 $qry_filter ORDER by id asc) $qry_date and medical_examination.spirometry_remarks NOT LIKE 'WNL%' GROUP BY patient_id ORDER BY patient_id asc"; $result = mysqli_query($conn, $query); error_log("query:" . $query); ?> =2 and YEAR(CURDATE())-year(doj)<5 $qry_date1 $qry_filter ORDER by id asc) $qry_date and spirometry_remarks NOT LIKE 'WNL%' GROUP BY patient_id ORDER BY patient_id asc"; $result = mysqli_query($conn, $query); error_log("query:" . $query); ?> =5 and YEAR(CURDATE())-year(doj)<10 $qry_date1 $qry_filter ORDER by id asc) $qry_date and spirometry_remarks NOT LIKE 'WNL%' GROUP BY patient_id ORDER BY patient_id asc"; $result = mysqli_query($conn, $query); error_log("query:" . $query); ?> =10 and YEAR(CURDATE())-year(doj)<15 $qry_date1 $qry_filter ORDER by id asc) $qry_date and spirometry_remarks NOT LIKE 'WNL%' GROUP BY patient_id ORDER BY patient_id asc"; $result = mysqli_query($conn, $query); error_log("query:" . $query); ?> =15 and YEAR(CURDATE())-year(doj)<20 $qry_date1 $qry_filter ORDER by id asc) $qry_date and spirometry_remarks NOT LIKE 'WNL%' GROUP BY patient_id ORDER BY patient_id asc"; $result = mysqli_query($conn, $query); ?> =20 and YEAR(CURDATE())-year(doj)<25 $qry_date1 $qry_filter ORDER by id asc) $qry_date and spirometry_remarks NOT LIKE 'WNL%' GROUP BY patient_id ORDER BY patient_id asc"; $result = mysqli_query($conn, $query); error_log("query:" . $query); ?> =25 $qry_date1 $qry_filter ORDER by id asc) $qry_date and spirometry_remarks NOT LIKE 'WNL%' GROUP BY patient_id ORDER BY patient_id asc"; $result = mysqli_query($conn, $query); error_log("query:" . $query); ?> =0 and YEAR(CURDATE())-year(doj)<2 $qry_date1 $qry_filter ORDER by id asc) $qry_date and spirometry_remarks NOT LIKE 'WNL%' GROUP BY patient_id ORDER BY patient_id asc"; $result = mysqli_query($conn, $query); error_log("query:" . $query); ?> =2 and YEAR(CURDATE())-year(doj)<5 $qry_date1 $qry_filter ORDER by id asc) $qry_date and spirometry_remarks NOT LIKE 'WNL%' GROUP BY patient_id ORDER BY patient_id asc"; $result = mysqli_query($conn, $query); error_log("query:" . $query); ?> =5 and YEAR(CURDATE())-year(doj)<10 $qry_date1 $qry_filter ORDER by id asc) $qry_date and spirometry_remarks NOT LIKE 'WNL%' GROUP BY patient_id ORDER BY patient_id asc"; $result = mysqli_query($conn, $query); error_log("query:" . $query); ?> =10 and YEAR(CURDATE())-year(doj)<15 $qry_date1 $qry_filter ORDER by id asc) $qry_date and spirometry_remarks NOT LIKE 'WNL%' GROUP BY patient_id ORDER BY patient_id asc"; $result = mysqli_query($conn, $query); error_log("query:" . $query); ?> =15 and YEAR(CURDATE())-year(doj)<20 $qry_date1 $qry_filter ORDER by id asc) $qry_date and bmi>=25 and bmi<30 GROUP BY patient_id ORDER BY patient_id asc"; $result = mysqli_query($conn, $query); error_log("query:" . $query); ?> =20 and YEAR(CURDATE())-year(doj)<25 $qry_date1 $qry_filter ORDER by id asc) $qry_date and spirometry_remarks NOT LIKE 'WNL%' GROUP BY patient_id ORDER BY patient_id asc"; $result = mysqli_query($conn, $query); error_log("query:" . $query); ?> =25 $qry_date1 $qry_filter ORDER by id asc) $qry_date and spirometry_remarks NOT LIKE 'WNL%' GROUP BY patient_id ORDER BY patient_id asc"; $result = mysqli_query($conn, $query); error_log("query:" . $query); ?>
EXPERIENCE WISE PFT ABNORMALITY Report
Run Date :      User :
Filters Applied- Range: to , EMPLOYER/CONTRACTOR:, Gender:, OHC Location:, Patient Category:, Department:, Designation:, Employee Cadre:, Month:, Year:
For year:
Duration in years(00-02)
Patient Name
No Records
Duration in years(02-05)
Patient Name
No Records
Duration in years(05-10)
Patient Name
No Records
Duration in years(10-15)
Patient Name
No Records
Duration in years(15-20)
Patient Name
No Records
Duration in years(20-25)
Patient Name
No Records
Duration in years(>=25)
Patient Name
No Records
Duration in years(00-02)
Patient Name
No Records
Duration in years(02-05)
Patient Name
No Records
Duration in years(05-10)
Patient Name
No Records
Duration in years(10-15)
Patient Name
No Records
Duration in years(15-20)
Patient Name
No Records
Duration in years(20-25)
Patient Name
No Records
Duration in years(>=25)
Patient Name
No Records