<?php error_reporting(E_COMPILE_ERROR | E_ERROR | E_CORE_ERROR); require './roots.php'; require $root_path . 'include/inc_environment_global.php'; //require('con_db.php'); //connect_db(); #Load and create paginator object require_once $root_path . 'include/care_api_classes/class_tz_reporting.php'; /** * getting summary of OPD... */ $rep_obj = new selianreport(); $lang_tables[] = 'date_time.php'; $lang_tables[] = 'reporting.php'; require $root_path . 'include/inc_front_chain_lang.php'; require_once 'include/inc_timeframe.php'; $month = array_search(1, $ARR_SELECT_MONTH); $year = array_search(1, $ARR_SELECT_YEAR); if ($printout) { $start = $_GET['start']; $end = $_GET['end']; $start_timeframe = $start; $end_timeframe = $end; $startdate = date("y.m.d ", $start_timeframe); $enddate = date("y.m.d", $end_timeframe); } else { $start = mktime(0, 0, 0, $month, 1, $year); $end = mktime(0, 0, 0, $month + 1, 1, $year); //$start_timeframe = mktime (0,0,0,$month, 1, $year); //$end_timeframe = mktime (0,0,0,$month+1, 0, $year);
function Display_OPD_Summary($start, $end) { global $db; $WITH_TIMEFRAME = FALSE; if (func_num_args()) { $start = func_get_arg(0); $end = func_get_arg(1); $WITH_TIMEFRAME = TRUE; } $rep_obj = new selianreport(); $tmp_tbl_OPD_summary = $rep_obj->SetReportingLink('care_person', 'pid', 'care_tz_diagnosis', 'PID'); //$tmp_tbl_allpatients = $rep_obj -> SetReportingTable('care_person'); $debug = FALSE; $debug ? $db->debug = TRUE : ($db->debug = FALSE); $arr_ret['return']['underage']; $arr_ret['return']['adult']; $arr_ret['return']['male']; $arr_ret['return']['female']; $arr_ret['return']['total']; $arr_ret['NewRegistration']['underage']; $arr_ret['NewRegistration']['adult']; $arr_ret['NewRegistration']['male']; $arr_ret['NewRegistration']['female']; $arr_ret['NewRegistration']['total']; $arr_ret['Total']['underage']; $arr_ret['Total']['adult']; $arr_ret['Total']['male']; $arr_ret['Total']['female']; $arr_ret['Total']['total']; $arr_ret['Total_Pedriatics']['underage']; $arr_ret['revisit']['underage']; $arr_ret['revisit']['adult']; $arr_ret['revisit']['male']; $arr_ret['revisit']['female']; $arr_ret['revisit']['total']; /**************************************************************************************************** * Revisit�s under 5 */ $sql = "SELECT count(*) AS return_underage FROM {$tmp_tbl_OPD_summary}\r\n\t\t\t\t\t WHERE type='new' AND UNIX_TIMESTAMP(date_birth) > (UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 5 year))) "; if ($WITH_TIMEFRAME) { $sql .= " AND ( timestamp>=" . $start . " AND timestamp<=" . $end . ")"; } $rs_ptr = $db->Execute($sql); $row = $rs_ptr->FetchRow(); $arr_ret['return']['underage'] = $row['return_underage']; /** * Total revisits */ $sql = "SELECT count(*) AS total FROM {$tmp_tbl_OPD_summary}\r\n\t\t\t\t\t WHERE type='new'"; if ($WITH_TIMEFRAME) { $sql .= " AND ( timestamp>=" . $start . " AND timestamp<=" . $end . ")"; } $rs_ptr = $db->Execute($sql); $row = $rs_ptr->FetchRow(); $arr_ret['return']['total'] = $row['total']; /** * Revist�s over 5 */ $arr_ret['return']['adult'] = $arr_ret['return']['total'] - $arr_ret['return']['underage']; /** * Total male revisits */ $sql = "SELECT count(*) AS male FROM {$tmp_tbl_OPD_summary}\r\n\t\t\t\t\t WHERE type='new' and sex='m'"; if ($WITH_TIMEFRAME) { $sql .= " AND ( timestamp>=" . $start . " AND timestamp<=" . $end . ")"; } $rs_ptr = $db->Execute($sql); $row = $rs_ptr->FetchRow(); $arr_ret['return']['male'] = $row['male']; /** * Total female revisits */ $sql = "SELECT count(*) AS female FROM {$tmp_tbl_OPD_summary}\r\n\t\t\t\t\t WHERE type='new' and sex='f'"; if ($WITH_TIMEFRAME) { $sql .= " AND ( timestamp>=" . $start . " AND timestamp<=" . $end . ")"; } $rs_ptr = $db->Execute($sql); $row = $rs_ptr->FetchRow(); $arr_ret['return']['female'] = $row['female']; /**************************************************************************************************** * New Registration�s under 5 */ $sql = "SELECT count(*) AS return_underage FROM {$tmp_tbl_OPD_summary}\r\n\t\t\t\t\t WHERE type='new patient' AND UNIX_TIMESTAMP(date_birth) > (UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 5 year)))"; if ($WITH_TIMEFRAME) { $sql .= " AND ( timestamp>=" . $start . " AND timestamp<=" . $end . ")"; } $rs_ptr = $db->Execute($sql); $row = $rs_ptr->FetchRow(); $arr_ret['NewRegistration']['underage'] = $row['return_underage']; /** * Total New Registration */ $sql = "SELECT count(*) AS Total FROM {$tmp_tbl_OPD_summary}\r\n\t\t\t\t\t WHERE type='new patient' "; if ($WITH_TIMEFRAME) { $sql .= " AND ( timestamp>=" . $start . " AND timestamp<=" . $end . ")"; } $rs_ptr = $db->Execute($sql); $row = $rs_ptr->FetchRow(); $arr_ret['NewRegistration']['total'] = $row['Total']; /** * New Registration�s over 5 */ $arr_ret['NewRegistration']['adult'] = $arr_ret['NewRegistration']['total'] - $arr_ret['NewRegistration']['underage']; /** * Total male New Registration */ $sql = "SELECT count(*) AS male FROM {$tmp_tbl_OPD_summary}\r\n\t\t\t\t\t WHERE type='new patient' and sex='m'"; if ($WITH_TIMEFRAME) { $sql .= " AND ( timestamp>=" . $start . " AND timestamp<=" . $end . ")"; } $rs_ptr = $db->Execute($sql); $row = $rs_ptr->FetchRow(); $arr_ret['NewRegistration']['male'] = $row['male']; /** * Total female New Registration */ $sql = "SELECT count(*) AS female FROM {$tmp_tbl_OPD_summary}\r\n\t\t\t\t\t WHERE type='new patient' and sex='f'"; if ($WITH_TIMEFRAME) { $sql .= " AND ( timestamp>=" . $start . " AND timestamp<=" . $end . ")"; } $rs_ptr = $db->Execute($sql); $row = $rs_ptr->FetchRow(); $arr_ret['NewRegistration']['female'] = $row['female']; /**************************************************************************************************** * Total Registration�s under 5 */ $sql = "SELECT count(*) AS Total_underage FROM {$tmp_tbl_OPD_summary}\r\n\t\t\t\t\t WHERE UNIX_TIMESTAMP(date_birth) > (UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 5 year)))"; if ($WITH_TIMEFRAME) { $sql .= " AND (timestamp>=" . $start . " AND timestamp<=" . $end . ")"; } $rs_ptr = $db->Execute($sql); $row = $rs_ptr->FetchRow(); $arr_ret['Total']['underage'] = $row['Total_underage']; /** * Total New Registration */ $sql = "SELECT count(*) AS Total FROM {$tmp_tbl_OPD_summary} "; if ($WITH_TIMEFRAME) { $sql .= " WHERE ( timestamp>=" . $start . " AND timestamp<=" . $end . ")"; } $rs_ptr = $db->Execute($sql); $row = $rs_ptr->FetchRow(); $arr_ret['Total']['total'] = $row['Total']; /** * New Registration�s over 5 */ $arr_ret['Total']['adult'] = $arr_ret['Total']['total'] - $arr_ret['Total']['underage']; /** * Total male New Registration */ $sql = "SELECT count(*) AS Total_male FROM {$tmp_tbl_OPD_summary}\r\n\t\t\t\t\t WHERE sex='m'"; if ($WITH_TIMEFRAME) { $sql .= " AND ( timestamp>=" . $start . " AND timestamp<=" . $end . ")"; } $rs_ptr = $db->Execute($sql); $row = $rs_ptr->FetchRow(); $arr_ret['Total']['male'] = $row['Total_male']; /** * Total female New Registration */ $sql = "SELECT count(*) AS Total_female FROM {$tmp_tbl_OPD_summary}\r\n\t\t\t\t\t WHERE sex='f'"; if ($WITH_TIMEFRAME) { $sql .= " AND ( timestamp>=" . $start . " AND timestamp<=" . $end . ")"; } $rs_ptr = $db->Execute($sql); $row = $rs_ptr->FetchRow(); $arr_ret['Total']['female'] = $row['Total_female']; /** * ************************************************************************************************** * Total Pedriatics */ $sql = "SELECT count(*) AS Total_underage FROM {$tmp_tbl_OPD_summary}\r\n\t\t\t\t\t WHERE UNIX_TIMESTAMP(date_birth) > (UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 5 year)))"; if ($WITH_TIMEFRAME) { $sql .= " AND ( timestamp>=" . $start . " AND timestamp<=" . $end . ")"; } $rs_ptr = $db->Execute($sql); $row = $rs_ptr->FetchRow(); $arr_ret['Total_Pedriatics']['underage'] = $row['Total_underage']; /**************************************************************************************************** * Views for the same reasons: */ $sql = "SELECT count(*) AS return_underage FROM {$tmp_tbl_OPD_summary}\r\n\t\t\t\t\t WHERE type='revisit' AND UNIX_TIMESTAMP(date_birth) > (UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 5 year)))\r\n\t\t "; if ($WITH_TIMEFRAME) { $sql .= " AND ( timestamp>=" . $start . " AND timestamp<=" . $end . ")"; } $rs_ptr = $db->Execute($sql); $row = $rs_ptr->FetchRow(); $arr_ret['revisit']['underage'] = empty($row['return_underage']) ? 0 : $row['return_underage']; //$arr_ret['revisit']['underage'] = $row['return_underage']; /** * Total revisits */ $sql = "SELECT count(*) AS total FROM {$tmp_tbl_OPD_summary}\r\n\t\t\t\t\t WHERE type='revisit'"; if ($WITH_TIMEFRAME) { $sql .= " AND ( timestamp>=" . $start . " AND timestamp<=" . $end . ")"; } $sql .= " GROUP BY ICD_10_code"; $rs_ptr = $db->Execute($sql); $row = $rs_ptr->FetchRow(); $arr_ret['revisit']['total'] = empty($row['total']) ? 0 : $row['total']; /** * Revist�s over 5 */ $arr_ret['revisit']['adult'] = $arr_ret['revisit']['total'] - $arr_ret['revisit']['underage']; /** * Total male revisits */ $sql = "SELECT count(*) AS male FROM {$tmp_tbl_OPD_summary}\r\n\t\t\t\t\t WHERE type='revisit' and sex='m'"; if ($WITH_TIMEFRAME) { $sql .= " AND ( timestamp>=" . $start . " AND timestamp<=" . $end . ")"; } $sql .= " GROUP BY ICD_10_code"; $rs_ptr = $db->Execute($sql); $row = $rs_ptr->FetchRow(); $arr_ret['revisit']['male'] = empty($row['male']) ? 0 : $row['male']; /** * Total female revisits */ $sql = "SELECT count(*) AS female FROM {$tmp_tbl_OPD_summary}\r\n\t\t\t\t\t WHERE type='revisit' and sex='f'"; if ($WITH_TIMEFRAME) { $sql .= " AND ( timestamp>=" . $start . " AND timestamp<=" . $end . ")"; } $sql .= " GROUP BY ICD_10_code"; $rs_ptr = $db->Execute($sql); $row = $rs_ptr->FetchRow(); $arr_ret['revisit']['female'] = empty($row['female']) ? 0 : $row['female']; $rep_obj->DisconnectReportingTable($tmp_tbl_OPD_summary); return $arr_ret; }
<?php error_reporting(E_COMPILE_ERROR | E_ERROR | E_CORE_ERROR); require './roots.php'; require $root_path . 'include/inc_environment_global.php'; //require('con_db.php'); //connect_db(); #Load and create paginator object require_once $root_path . 'include/care_api_classes/class_tz_selianreporting.php'; /** * getting summary of OPD... */ $rep_obj = new selianreport(); $lang_tables[] = 'date_time.php'; $lang_tables[] = 'reporting.php'; require $root_path . 'include/inc_front_chain_lang.php'; require_once 'include/inc_timeframe.php'; $month = array_search(1, $ARR_SELECT_MONTH); $year = array_search(1, $ARR_SELECT_YEAR); if ($printout) { $start = $_GET['start']; $end = $_GET['end']; $start_timeframe = $start; $end_timeframe = $end; $startdate = date("y.m.d ", $start_timeframe); $enddate = date("y.m.d", $end_timeframe); } else { $start = mktime(0, 0, 0, $month, 1, $year); $end = mktime(0, 0, 0, $month + 1, 1, $year); //$start_timeframe = mktime (0,0,0,$month, 1, $year); //$end_timeframe = mktime (0,0,0,$month+1, 0, $year);
<?php error_reporting(E_COMPILE_ERROR | E_ERROR | E_CORE_ERROR); require './roots.php'; require $root_path . 'include/inc_environment_global.php'; //require('con_db.php'); //connect_db(); #Load and create paginator object $lang_tables[] = 'date_time.php'; $lang_tables[] = 'reporting.php'; require $root_path . 'include/inc_front_chain_lang.php'; require_once $root_path . 'include/care_api_classes/class_tz_selianreporting.php'; /** * getting summary of OPD... */ $rep_obj = new selianreport(); require_once 'include/inc_timeframe.php'; $month = array_search(1, $ARR_SELECT_MONTH); $year = array_search(1, $ARR_SELECT_YEAR); if ($printout) { $start = $_GET['start']; $end = $_GET['end']; $start_timeframe = $start; $end_timeframe = $end; $startdate = date("y.m.d ", $start_timeframe); $enddate = date("y.m.d", $end_timeframe); } else { $start = mktime(0, 0, 0, $month, 1, $year); $end = mktime(0, 0, 0, $month + 1, 1, $year); //$start_timeframe = mktime (0,0,0,$month, 1, $year); //$end_timeframe = mktime (0,0,0,$month+1, 0, $year);
<?php error_reporting(E_COMPILE_ERROR | E_ERROR | E_CORE_ERROR); require './roots.php'; require $root_path . 'include/inc_environment_global.php'; //require('con_db.php'); //connect_db(); #Load and create paginator object $lang_tables[] = 'date_time.php'; $lang_tables[] = 'reporting.php'; require $root_path . 'include/inc_front_chain_lang.php'; require_once $root_path . 'include/care_api_classes/class_tz_selianreporting.php'; /** * getting summary of OPD... */ $rep_obj = new selianreport(); require_once 'include/inc_timeframe.php'; $month = array_search(1, $ARR_SELECT_MONTH); $year = array_search(1, $ARR_SELECT_YEAR); if ($printout) { $start = $_GET['start']; $end = $_GET['end']; $start_timeframe = $start; $end_timeframe = $end; $startdate = date("y.m.d ", $start_timeframe); $enddate = date("y.m.d", $end_timeframe); } else { $start = mktime(0, 0, 0, $month, 1, $year); $end = mktime(0, 0, 0, $month + 1, 1, $year); $start_timeframe = $start; $end_timeframe = $end;
<?php error_reporting(E_COMPILE_ERROR | E_ERROR | E_CORE_ERROR); require './roots.php'; require $root_path . 'include/inc_environment_global.php'; #Load and create paginator object require_once $root_path . 'include/care_api_classes/class_tz_reporting.php'; /** * getting summary of OPD... */ $rep_obj = new selianreport(); !empty($_GET['printout']) ? $PRINTOUT = TRUE : ($PRINTOUT = FALSE); $lang_tables[] = 'date_time.php'; $lang_tables[] = 'reporting.php'; require $root_path . 'include/inc_front_chain_lang.php'; require_once 'include/inc_timeframe.php'; $month = array_search(1, $ARR_SELECT_MONTH); $year = array_search(1, $ARR_SELECT_YEAR); $arr_ret = $rep_obj->Display_OPD_Summary(); require_once 'gui/gui_OPD_total_summary.php';
<?php error_reporting(E_COMPILE_ERROR | E_ERROR | E_CORE_ERROR); require './roots.php'; require $root_path . 'include/inc_environment_global.php'; #Load and create paginator object require_once $root_path . 'include/care_api_classes/class_tz_reporting.php'; /** * getting summary of OPD... */ $rep_obj = new selianreport(); $lang_tables[] = 'reporting.php'; $lang_tables[] = 'date_time.php'; require $root_path . 'include/inc_front_chain_lang.php'; require_once 'include/inc_timeframe.php'; $month = array_search(1, $ARR_SELECT_MONTH); $year = array_search(1, $ARR_SELECT_YEAR); if ($printout) { $start = $_GET['start']; $end = $_GET['end']; } else { $start = mktime(0, 0, 0, $month, 1, $year); $end = mktime(0, 0, 0, $month + 1, 1, $year); } $tmp_tbl_admissions = $rep_obj->SetReportingLink_Admissions("care_encounter", "pid", "encounter_date", "care_person", "pid", $start, $end, "2"); $arr_reg = $rep_obj->Get_Visits_Count(); $arr_new = $rep_obj->Get_FirstTime_Reg_Count(); $arr_newreg = $rep_obj->Get_New_Reg_Count(); $arr_ret = $rep_obj->Get_Return_Reg_Count(); require_once 'gui/gui_mtuha_opd_summary.php';
<?php error_reporting(E_COMPILE_ERROR | E_ERROR | E_CORE_ERROR); require './roots.php'; require $root_path . 'include/inc_environment_global.php'; #Load and create paginator object require_once $root_path . 'include/care_api_classes/class_tz_reporting.php'; /** * getting summary of OPD... */ $rep_obj = new selianreport(); $lang_tables[] = 'reporting.php'; $lang_tables[] = 'date_time.php'; require $root_path . 'include/inc_front_chain_lang.php'; require_once 'include/inc_timeframe.php'; $month = array_search(1, $ARR_SELECT_MONTH); $year = array_search(1, $ARR_SELECT_YEAR); if ($printout) { $start = $_GET['start']; $end = $_GET['end']; } else { $start = mktime(0, 0, 0, $month, 1, $year); $end = mktime(0, 0, 0, $month + 1, 1, $year); } $arr_ret = $rep_obj->Display_OPD_Summary($start, $end); require_once 'gui/gui_OPD_summary.php';