function vitals_detail() { if (func_num_args()>0) { $arg_list = func_get_args(); $menu_id = $arg_list[0]; $post_vars = $arg_list[1]; $get_vars = $arg_list[2]; $validuser = $arg_list[3]; $isadmin = $arg_list[4]; //print_r($arg_list); } // process delete here if ($post_vars["submitvitals"]) { if ($post_vars["submitvitals"]=="Delete") { if (module::confirm_delete($menu_id, $post_vars, $get_vars)) { $sql_delete = "delete from m_consult_vitals ". "where consult_id = '".$get_vars["consult_id"]."' and ". "vitals_timestamp = '".$get_vars["timestamp"]."'"; if ($result_delete = mysql_query($sql_delete)) { header("location: ".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=".$get_vars["menu_id"]."&consult_id=".$get_vars["consult_id"]."&ptmenu=VITALS"); } } else { if ($post_vars["confirm_delete"]=="No") { header("location: ".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=".$get_vars["menu_id"]."&consult_id=".$get_vars["consult_id"]."&ptmenu=VITALS"); } } } } $sql = "select user_id, vitals_weight, vitals_temp, vitals_systolic, vitals_diastolic, vitals_heartrate, vitals_resprate,vitals_height,vitals_pulse ". "from m_consult_vitals where consult_id = '".$get_vars["consult_id"]."' and vitals_timestamp = '".$get_vars["timestamp"]."'"; $edad = healthcenter::get_patient_age($get_vars["consult_id"]); if ($result = mysql_query($sql)) { if (mysql_num_rows($result)) { list($uid, $wt, $temp, $syst, $diast, $hrate, $rrate,$ht,$pulse) = mysql_fetch_array($result); print "<a name='detail'>"; print "<form method='post' action='".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=".$get_vars["menu_id"]."&consult_id=".$get_vars["consult_id"]."&ptmenu=VITALS×tamp=".$get_vars["timestamp"]."' name='form_vitals_detail'>"; print "<table width='250' style='border: 1px dotted black'><tr><td colspan='2'>"; print "Taken by: ".user::get_username($uid)."<br/>"; print "<td></tr>"; print "<tr valign='top'><td>"; print "BP: $syst/$diast<br/>"; print "HR: $hrate<br/>"; print "RR: $rrate<br/>"; print "Pulse Rate: $pulse<br/>"; print "</td><td>"; print "Weight (kg): $wt<br/>"; print "Temp deg C: $temp<br/>"; print "Height: $ht cms<br/>"; print "</td></tr>"; print "<tr><td colspan='2'>"; print "HPN STAGE: ".healthcenter::hypertension_stage($syst, $diast, $edad)."<br/>"; print healthcenter::compute_bmi($ht,$wt); print "</td></tr>"; print "<tr><td colspan='2'>"; //if ($_SESSION["priv_delete"]) { print "<input type='submit' name='submitvitals' value='Update' class='tinylight' style='border: 1px solid black'/> "; print "<input type='submit' name='submitvitals' value='Delete' class='tinylight' style='border: 1px solid black'/>"; //} print "</td></tr>"; print "</table>"; print "</form>"; } } }
function _consult_dental() { echo "<form name='form_dental' action='$_POST[PHP_SELF]' method='POST'>"; $dental = new dental; $dental->toothnumber = 0; $dental->condition[$dental->toothnumber] = 'Y'; $dental->consult_id = $_GET['consult_id']; $dental->patient_id = healthcenter::get_patient_id($_GET['consult_id']); $dental->patient_age = healthcenter::get_patient_age($_GET['consult_id']); $dental->dentist = $_SESSION['userid']; // The following codes will initialize hidden textboxes and their values echo "<input type='hidden' name='h_patient_id' value='{$dental->patient_id}'></input>"; echo "<input type='hidden' name='h_consult_id' value='{$dental->consult_id}'></input>"; echo "<input type='hidden' name='h_dentist' value='{$dental->dentist}'></input>"; if (@$_POST['h_save_flag'] == 'GO') { $dental->new_dental_record(); print " "; $dental->show_message_if_patient_is_pregnant($dental->patient_id, date("Y-m-d")); echo " "; $dental->show_date_of_oral(); $dental->get_teeth_conditions($dental->patient_age); //echo " "; //$dental->select_tooth_and_condition($dental->patient_age); //echo " "; //$dental->show_teeth_conditions($dental->patient_age); print " "; $dental->show_teeth_conditions_v02(); echo " "; $dental->show_ohc_table_a($dental->patient_id); echo " "; $dental->show_ohc_table_b($dental->patient_id); echo " "; $dental->show_services_monitoring_chart($dental->patient_id); print " "; $dental->show_other_dental_services($dental->patient_id); echo " "; $dental->show_tooth_legends($dental->patient_age); } else { $dental->init_primary_keys(); print " "; $dental->show_message_if_patient_is_pregnant($dental->patient_id, date("Y-m-d")); echo " "; $dental->show_date_of_oral(); $dental->get_teeth_conditions($dental->patient_age); //echo " "; //$dental->select_tooth_and_condition($dental->patient_age); //echo " "; //$dental->show_teeth_conditions($dental->patient_age); print " "; $dental->show_teeth_conditions_v02(); echo " "; $dental->show_ohc_table_a($dental->patient_id); echo " "; $dental->show_ohc_table_b($dental->patient_id); echo " "; $dental->show_services_monitoring_chart($dental->patient_id); print " "; $dental->show_other_dental_services($dental->patient_id); echo " "; $dental->show_tooth_legends($dental->patient_age); } echo "<input type='hidden' name='h_save_flag' value='GO'></input>"; echo "</form>"; }
function diagnosis_record() { $loc_patient_id = $_POST['h_patient_id']; $loc_consult_id = $_POST['h_consult_id']; $loc_patient_age = healthcenter::get_patient_age($loc_consult_id); $loc_userid = $_POST['h_userid']; list($month, $day, $year) = explode("/", $_POST['date_of_diagnosis']); $loc_date_of_diagnosis = $year . "-" . str_pad($month, 2, "0", STR_PAD_LEFT) . "-" . str_pad($day, 2, "0", STR_PAD_LEFT); $loc_patient_case = $_POST['patient_case']; $loc_classification = $_POST['classification']; $loc_mode_of_detection = $_POST['mode_of_detection']; list($month, $day, $year) = explode("/", date("m/d/Y")); $loc_current_date = $year . "-" . str_pad($month, 2, "0", STR_PAD_LEFT) . "-" . str_pad($day, 2, "0", STR_PAD_LEFT); $query = "SELECT consult_id, patient_id FROM m_leprosy_diagnosis WHERE " . "consult_id = {$loc_consult_id} AND " . "patient_id = {$loc_patient_id} "; $result = mysql_query($query) or die("Couldn't execute query. " . mysql_error()); if (mysql_num_rows($result)) { $query = "UPDATE m_leprosy_diagnosis SET " . "date_of_diagnosis = '{$loc_date_of_diagnosis}', " . "patient_case = '{$loc_patient_case}', " . "classification = '{$loc_classification}', " . "mode_of_detection = '{$loc_mode_of_detection}', " . "date_last_updated = '{$loc_current_date}', " . "user_id = {$loc_userid} " . "WHERE consult_id = {$loc_consult_id} AND " . "patient_id = {$loc_patient_id} "; $result = mysql_query($query) or die("Couldn't execute query. " . mysql_error()); } else { $query = "INSERT INTO m_leprosy_diagnosis " . "(consult_id, patient_id, patient_age, date_of_diagnosis, patient_case, classification, " . "mode_of_detection, date_last_updated, user_id) " . "VALUES({$loc_consult_id}, {$loc_patient_id}, {$loc_patient_age}, '{$loc_date_of_diagnosis}', '{$loc_patient_case}', " . "'{$loc_classification}', '{$loc_mode_of_detection}', '{$loc_current_date}', {$loc_userid}) "; $result = mysql_query($query) or die("Couldn't execute query. " . mysql_error()); } }
function get_bp($pxid) { $arr_bp = array(); $q_bp = mysql_query("SELECT a.vitals_systolic, a.vitals_diastolic,date_format(b.consult_date,'%m/%d/%Y') as 'consult_date',a.consult_id FROM m_consult_vitals a, m_consult b WHERE a.vitals_systolic!=0 AND a.vitals_diastolic!=0 AND a.consult_id = b.consult_id AND a.patient_id='{$pxid}' ORDER by b.consult_date ASC") or die("Cannot query 154 " . mysql_error()); array_push($arr_bp, array(0, 0, 0, 0)); if (mysql_num_rows($q_bp) != 0) { while (list($systolic, $diastolic, $consult_date, $consult_id) = mysql_fetch_array($q_bp)) { $arr_bp_details = array(); $edad = healthcenter::get_patient_age($consult_id); $bp_stage = healthcenter::hypertension_code($systolic, $diastolic, $edad); array_push($arr_bp_details, $consult_date, $systolic, $diastolic, $bp_stage); array_push($arr_bp, $arr_bp_details); } } return $arr_bp; }