Esempio n. 1
0
 function display_patient_data()
 {
     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];
     }
     $patient_id = healthcenter::get_patient_id($get_vars["consult_id"]);
     $actual_weight = wtforage::get_body_weight($get_vars["consult_id"]);
     $ccdev_id = ccdev::registry_record_exists($patient_id);
     print "<span class='tinylight'>";
     print LBL_CCDEV_ID . ": <font color='red'>" . ($ccdev_id ? module::pad_zero($ccdev_id, 7) : "none") . "</font><br/>";
     print LBL_AGE_IN_WEEKS . ": " . ccdev::get_age_weeks($patient_id) . "<br/>";
     print LBL_WEIGHT . ": {$actual_weight}<br/>";
     list($min, $max, $class) = wtforage::_wtforage($get_vars["consult_id"]);
     if ($class) {
         print LBL_WT_FOR_AGE . ": <font color='red'>" . strtoupper($class) . "</font> (min: {$min}, max: {$max})<br/>";
     } else {
         print LBL_WT_FOR_AGE . ": <font color='red'>" . LBL_NO_WEIGHT_AVAILABLE . "</font><br/>";
     }
     print LBL_IMMUNIZATION_STATUS . ": ";
     $vacc_status = ccdev::determine_vacc_status($patient_id);
     if ($vacc_status == 'Incomplete') {
         echo "<font color='red'><b>{$vacc_status}</b></font><br>";
     } else {
         echo "<b>{$vacc_status}</b><br>";
     }
     print "CHILD PROTECTECTED AT BIRTH" . ": ";
     echo ccdev::get_cpab_status($ccdev_id, $patient_id) . "<br>";
     print "LOW BIRTH WEIGHT" . ": ";
     echo ccdev::check_low_birth_wt($ccdev_id, $patient_id) . '<br>';
     print "</span>";
 }
Esempio n. 2
0
		$vaccine->init_lang();
		$vaccine->init_help();
	}
}
if (file_exists('../modules/weekly_calendar/class.weekly_calendar.php')) {
	include '../modules/weekly_calendar/class.weekly_calendar.php';
	$weekly_calendar = new weekly_calendar;
	if (!$module->activated('weekly_calendar') && $initmod) {
		$weekly_calendar->init_sql();
		$weekly_calendar->init_menu();
		$weekly_calendar->init_deps();
		$weekly_calendar->init_lang();
		$weekly_calendar->init_help();
	}
}
if (file_exists('../modules/wtforage/class.wtforage.php')) {
	include '../modules/wtforage/class.wtforage.php';
	$wtforage = new wtforage;
	if (!$module->activated('wtforage') && $initmod) {
		$wtforage->init_sql();
		$wtforage->init_menu();
		$wtforage->init_deps();
		$wtforage->init_lang();
		$wtforage->init_help();
	}
}

// END SERVER CODE

?>
Esempio n. 3
0
 function display_consult_notes_detail()
 {
     if (func_num_args()) {
         $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];
     }
     // do some processing here
     if ($get_vars["delete_complaint_id"]) {
         if (module::confirm_delete($menu_id, $post_vars, $get_vars)) {
             $sql = "delete from m_consult_notes_complaint " . "where notes_id = '" . $get_vars["notes_id"] . "' and " . "consult_id = '" . $get_vars["consult_id"] . "' and " . "complaint_id = '" . $get_vars["delete_complaint_id"] . "'";
             if ($result = mysql_query($sql)) {
                 header("location: " . $_SERVER["PHP_SELF"] . "?page=" . $get_vars["page"] . "&menu_id=" . $get_vars["menu_id"] . "&consult_id=" . $get_vars["consult_id"] . "&ptmenu=DETAILS&module=notes&notes=" . $get_vars["notes"] . "&notes_id=" . $get_vars["notes_id"]);
             }
         } 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=DETAILS&module=notes&notes=" . $get_vars["notes"] . "&notes_id=" . $get_vars["notes_id"]);
             }
         }
     }
     if ($get_vars["delete_class_id"]) {
         if (module::confirm_delete($menu_id, $post_vars, $get_vars)) {
             $sql = "delete from m_consult_notes_dxclass " . "where notes_id = '" . $get_vars["notes_id"] . "' and " . "consult_id = '" . $get_vars["consult_id"] . "' and " . "class_id = '" . $get_vars["delete_class_id"] . "'";
             if ($result = mysql_query($sql)) {
                 header("location: " . $_SERVER["PHP_SELF"] . "?page=" . $get_vars["page"] . "&menu_id=" . $get_vars["menu_id"] . "&consult_id=" . $get_vars["consult_id"] . "&ptmenu=DETAILS&module=notes&notes=" . $get_vars["notes"] . "&notes_id=" . $get_vars["notes_id"]);
             }
         } 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=DETAILS&module=notes&notes=" . $get_vars["notes"] . "&notes_id=" . $get_vars["notes_id"]);
             }
         }
     }
     // continue with real task
     $sql = "select notes_id, consult_id, notes_history, " . "notes_physicalexam, notes_plan, user_id, date_format(notes_timestamp, '%a %d %b %Y, %h:%i%p') ts, plan_px_info " . "from m_consult_notes where consult_id = '" . $get_vars["consult_id"] . "' and " . "notes_id = '" . $get_vars["notes_id"] . "'";
     if ($result = mysql_query($sql)) {
         if (mysql_num_rows($result)) {
             $notes = mysql_fetch_array($result);
             list($min, $max, $class) = wtforage::_wtforage($_GET["consult_id"]);
             print "<form method='post' action=''>";
             print "<table width='300' cellpadding='2' style='border: 1px dashed black'><tr><td>";
             print "<span class='tinylight'>";
             print "<b>NOTES ID:</b> <font color='red'>" . module::pad_zero($notes["notes_id"], 7) . "</font><br/>";
             print "<b>DATE/TIME:</b> " . $notes["ts"] . "<br/>";
             print "<b>TAKEN BY:</b> " . user::get_username($notes["user_id"]) . "<br/>";
             print "<br><b>VITAL SIGNS:</b><br>" . $this->get_vitals($_GET["consult_id"]) . "<br/>";
             print "<b>WEIGHT FOR AGE (0-6 yo):</b>" . $class . "<br/>";
             print "<hr size='1'/>";
             print "<b>COMPLAINTS:</b><br/>";
             notes::show_complaints($menu_id, $post_vars, $get_vars);
             print "<hr size='1'/>";
             print "<b>COMPLAINT NOTES:</b><br/>";
             print $this->get_consult_note($get_vars["consult_id"]);
             print "<hr size='1'/>";
             print "<b>HISTORY:</b><br/>";
             if (strlen($notes["notes_physicalexam"]) > 0 || notes::get_history_list()) {
                 print notes::get_history_list();
                 if (strlen($notes["notes_history"]) > 0) {
                     print "<b>Notes:</b><br/>";
                     print stripslashes(nl2br($notes["notes_history"])) . "<br/>";
                 }
                 if ($_SESSION["priv_update"]) {
                     print "<br/>";
                     print "<input type='submit' name='submitdetail' value='Update History' class='tinylight' style='border: 1px solid black'";
                 }
             } else {
                 print "<font color='red'>No recorded history.</font><br/>";
             }
             print "<br><br><hr size='1'/>";
             print "<b>PHYSICAL EXAM:</b><br/>";
             if (strlen($notes["notes_physicalexam"]) > 0 || notes::get_pe_list($notes["notes_id"])) {
                 print notes::get_pe_list($notes["notes_id"]);
                 if (strlen($notes["notes_physicalexam"]) > 0) {
                     print "<b>PE Notes:</b><br/>";
                     print stripslashes(nl2br($notes["notes_physicalexam"])) . "<br/>";
                 }
                 if ($_SESSION["priv_update"]) {
                     print "<br/>";
                     print "<input type='submit' name='submitdetail' value='Update PE' class='tinylight' style='border: 1px solid black'";
                 }
             } else {
                 print "<font color='red'>No recorded PE.</font><br/>";
             }
             print "<br><br><hr size='1'>";
             print "<b>DIAGNOSIS:</b><br/>";
             notes::show_diagnosis($menu_id, $post_vars, $get_vars);
             print "<br><br><hr size='1'/>";
             print "<b>PLAN:</b><br/>";
             if (strlen($notes["notes_plan"]) >= 0) {
                 print stripslashes(nl2br($notes["notes_plan"])) . "<br/><br />";
                 print stripslashes(nl2br($notes["plan_px_info"])) . "<br/>";
                 $plan = stripslashes(nl2br($notes["notes_plan"]));
                 if ($_SESSION["priv_update"]) {
                     print "<br/>";
                     print "<input type='submit' name='submitdetail' value='Update Plan' class='tinylight' style='border: 1px solid black'";
                 }
                 $_SESSION["plan_details"] = $plan;
                 print "<br/>&nbsp;";
                 print "<input type='submit' name='submitdetail' value='Print Plan' class='tinylight' style='border: 1px solid black'";
                 echo "<br>";
             } else {
                 print "<font color='red'>No recorded plan.</font><br/>";
             }
             print "<hr size='1'/>";
             print "<input type='hidden' name='notes_id' value='" . $get_vars["notes_id"] . "' />";
             if ($_SESSION["priv_delete"]) {
                 print "<input type='submit' name='submitdetail' value='Delete Notes' class='tinylight' style='border: 1px solid black; background-color: #FF6633;'/> ";
             }
             print "</span>";
             print "</td></tr></table><br>";
             print "</form>";
         }
     }
 }
 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];
         $pxid = $arg_list[5];
         $vitals_date = $arg_list[6];
         //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,vitals_waist " . "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, $waist) = 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&timestamp=" . $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 "Waist Circumference: {$waist} cms<br/>";
             print "</td></tr>";
             print "<tr><td colspan='2'>";
             //print "HPN STAGE: ".healthcenter::hypertension_stage($syst, $diast, $edad)."<br/>";
             print "HPN STAGE: ";
             healthcenter::hypertension_stage($syst, $diast, $edad);
             print "<br/>";
             print healthcenter::compute_bmi($ht, $wt);
             print "<br/>";
             list($min, $max, $class) = wtforage::_wtforage($get_vars["consult_id"]);
             echo "Weight for Age(0-6 yo): " . $class;
             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'/>&nbsp;&nbsp;";
             print "<input type='submit' name='submitvitals' value='Delete' class='tinylight' style='border: 1px solid black'/>";
             //}
             print "</td></tr>";
             print "</table>";
             print "</form>";
         }
     }
 }
    function _wtforage() {
    //
    // main method for wtforage
    // caution -> use only for age 5 and below
    // call method:
    // $wt_class = wtforage ($age_month, $gender, $actual_weight);
    // where $age_month = age of patient
    //              can be obtained from m_patient
    //       $gender = patient gender (M or F)
    //                 can be obtained from m_patient
    //       $weight = actual patient weight
    //                 can be obtained from m_consult_vitals
    // $wt_class: BELOW NORMAL (Very Low), BELOW NORMAL (Low), NORMAL, ABOVE NORMAL
    //
        // always check dependencies
        if ($exitinfo = $this->missing_dependencies('wtforage')) {
            return print($exitinfo);
        }
        if (func_num_args()>0) {
            $arg_list = func_get_args();
            $consult_id = $arg_list[0];
		}
        $patient_id = healthcenter::get_patient_id($consult_id);
		$age_month = round((ccdev::get_age_weeks($patient_id))/4.33,0);
		$gender = patient::get_gender($patient_id);
		$actual_weight = wtforage::get_body_weight($consult_id);
        /*
		print $sql = "select wt_class from m_lib_wtforage where age_month='$age_month' AND gender='$gender' ".
		 		"AND weight_min <= '$actual_weight' AND weight_max >= '$actual_weight'";
		if ($result = mysql_query($sql)) {
            if (mysql_num_rows($result)) {
                list($wt_class) = mysql_fetch_array($result);
				return $wt_class;
  		}
        */
        $sql = "select weight_min, weight_max, wt_class ".
               "from m_lib_wtforage ".
               "where age_month = '$age_month' and gender = '$gender'";
        if ($result = mysql_query($sql)) {
            if (mysql_num_rows($result)) {
                while (list($min, $max, $class) = mysql_fetch_array($result)) {
                    if ($max > $min) {
                        if ($actual_weight >= $min && $actual_weight <= $max) {
                            //print "Min $min<br/>";
                            //print "Max $max<br/>";
                            //print "Class $class<br/>";
                            $ret_val = array ($min, $max, $class);
                        }
                    }
                    if ($min === $max) {
                        if ($actual_weight >= $max) {
                            //print "Min $min<br/>";
                            //print "Max $max<br/>";
                            //print "Class $class<br/>";
                            $ret_val = array ($min, $max, $class);
                        }
                    }
                }
                return $ret_val;
            }
        }

	}
Esempio n. 6
0
    function display_patient_data() {
        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];
        }
        $patient_id = healthcenter::get_patient_id($get_vars["consult_id"]);
		$actual_weight = wtforage::get_body_weight($get_vars["consult_id"]);
        $ccdev_id = ccdev::registry_record_exists($patient_id);
        print "<span class='tinylight'>";
        print LBL_CCDEV_ID.": <font color='red'>".($ccdev_id?module::pad_zero($ccdev_id,7):"none")."</font><br/>";
        print LBL_AGE_IN_WEEKS.": ".ccdev::get_age_weeks($patient_id)."<br/>";
        print LBL_WEIGHT.": $actual_weight<br/>";
        list($min, $max, $class) = wtforage::_wtforage($get_vars["consult_id"]);
        if ($class) {
            print LBL_WT_FOR_AGE.": <font color='red'>".strtoupper($class)."</font> (min: $min, max: $max)<br/>";
        } else {
            print LBL_WT_FOR_AGE.": <font color='red'>".LBL_NO_WEIGHT_AVAILABLE."</font><br/>";
        }
        print LBL_IMMUNIZATION_STATUS.": ".ccdev::get_immunization_status($patient_id)."<br/>";
        print "</span>";
    }