Esempio n. 1
0
 function _family() {
 //
 // main program for family module
 //
     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);
     }
     // always check dependencies
     if ($exitinfo = $this->missing_dependencies('family')) {
         return print($exitinfo);
     }
     
     mysql_query("ALTER TABLE `m_consult_notes` DROP PRIMARY KEY , ADD PRIMARY KEY (`notes_id`)");
     
     
     print "<span class='patient'>".FTITLE_FAMILY_RECORDS."</span><br/>";
     print "<table width='600' cellpadding='2'>";
     print "<tr valign='top'><td width='50%'>";
     // column 1
     print "<b>".LBL_FOLDER_HOWTO."</b><br/>";
     print "<ol>";
     print "<li>If you are creating a new family folder, type in address and ".
           "barangay then click on the <b>Create Folder</b> button. Famiy numbers ".
           "are created sequentially and automatically.</li>";
     print "<li>If you are looking for an existing family folder, ".
           "type in the name of a family member. Important - The patient ".
           "account to be included in ".
           "a family must be created first.</li>";
     print "</ol>";
     if ($post_vars["submitfolder"]) {
         $this->process_folder($menu_id, $post_vars, $get_vars);
     }
     if ($_SESSION["priv_add"]) {
         $this->form_folder($menu_id, $post_vars, $get_vars);
     }
     // end of column 1
     print "</td><td>";
     // column 2
     if ($get_vars["delete_family_id"]) {
         $this->process_stats($menu_id, $post_vars, $get_vars);
     }
     $this->family_stats($menu_id, $post_vars, $get_vars);
     if ($get_vars["family_id"]) {
         $this->process_member($menu_id, $post_vars, $get_vars);
         $this->family_info($menu_id, $post_vars, $get_vars);
     }
     if ($post_vars["submitsearch"]) {
         $this->process_search($menu_id, $post_vars, $get_vars);
     } else {
         $this->familysearch($menu_id, $post_vars, $get_vars);
     }
     // end of column 2
     print "</td></tr>";
     print "<tr><td colspan='2'>";
     healthcenter::consult_info($menu_id, $post_vars, $get_vars);
     print "</td></tr>";
     print "</table>";
 }
Esempio n. 2
0
 function _consult_schedule() {
 //
 // appointments for today
 //
     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];
     }
     if ($post_vars["submitsked"]) {
         appointment::process_appointment_record($menu_id, $post_vars, $get_vars);
     }
     print "<span class='patient'>".FTITLE_APPOINTMENTS_TODAY."</span><br/><br/>";
     $base_url = $_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=".$get_vars["menu_id"];
     if ($get_vars["year"] && $get_vars["month"] && $get_vars["day"]) {
         $date = $get_vars["year"]."-".$get_vars["month"]."-".$get_vars["day"];
     } else {
         $date = date("Y-m-d");
     }
     print "<table><tr valign='top'><td>";
     calendar::display_calendar($menu_id, $post_vars, $get_vars, $validuser, $isadmin, $base_url);
     print "</td><td>";
     print "<span class='tinylight'>";
     print "<ol><b>APPOINTMENT HOWTO:</b></ol>";
     print "<ol>";
     print "<li>THIS PAGE SHOWS THE APPOINTMENTS FOR TODAY.</li>";
     print "<li>TO SEE APPOINTMENTS OTHER THAN TODAY CLICK ON DESIRED CALENDAR DATE.</li>";
     print "<li>YOU CAN ALSO USE THE CALENDAR NAVIGATION BUTTONS TO GO TO A DIFFERENT MONTH OR YEAR.</li>";
     print "<li>CLICK ON PATIENT NAME TO SEE APPOINTMENT RECORD. HIGHLIGHTED NAME MEANS THE PATIENT FOLLOWED UP ALREADY.</li>";
     print "</ol>";
     print "</span>";
     print "</td></tr></table>";
     $sql = "select a.schedule_id, a.patient_id, p.patient_lastname, p.patient_firstname, ".
            "p.patient_dob, p.patient_gender, l.appointment_name, ".
            "round((to_days(now())-to_days(p.patient_dob))/365 , 1) computed_age, actual_date ".
            "from m_patient p, m_consult_appointments a, m_lib_appointment l ".
            "where p.patient_id = a.patient_id and ".
            "a.appointment_id = l.appointment_id and ".
            "to_days(a.visit_date) = to_days('$date') ".
            "order by p.patient_lastname, p.patient_firstname";
     if ($result = mysql_query($sql)) {
         print "<br/><table width=600 bgcolor='#FFFFFF' cellpadding='3' cellspacing='0' style='border: 2px solid black'>";
         print "<tr><td>";
         print "<span class='tinylight'><b>".LBL_EXPECTED_TO_ARRIVE_TODAY." ".$date.":</b></span><br/><br/>";
         if (mysql_num_rows($result)) {
             $i=0;
             while (list($sid, $pid, $plast, $pfirst, $pdob, $pgender, $appname, $p_age, $actual_date) = mysql_fetch_array($result)) {
                 if ($prev_app<>$appname) {
                     $patient_array[$i] .= "<span class='boxtitle'><font color='red'>".strtoupper($appname)."</font></span><br/>";
                 }
                 $patient_array[$i] .= "<a href='".$_SERVER["PHP_SELF"]."?page=CONSULTS&menu_id=$menu_id&patient_id=$pid&schedule_id=$sid&year=".$get_vars["year"]."&month=".$get_vars["month"]."&day=".$get_vars["day"]."&s=0#detail' style='".($actual_date<>"0000-00-00"?"background-color: #FFFF00":"")."'><b>$plast, $pfirst</b></a> [$p_age/$pgender] $pdob";
                 if (class_exists("family")) {
                     // show family icon if patient has a family
                     $family_id = family::get_family_id($pid);
                     if ($family_id<>0) {
                         $family_menu_id = module::get_menu_id("_family");
                         $patient_array[$i] .= " <a href='".$_SERVER["PHP_SELF"]."?page=PATIENTS&menu_id=$family_menu_id&family_id=$family_id' title='GO TO FAMILY'><img src='../images/family.gif' border='0'/></a>";
                     }
                 }
                 if (class_exists("healthcenter")) {
                     $consult_menu_id = module::get_menu_id("_consult");
                     // show link only if today
                     if ($date == date("Y-m-d")) {
                         $patient_array[$i] .= " <a href='".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=$consult_menu_id&enter_consult=$pid&appt_date=$date&sked_id=$sid' title='LOAD PATIENT RECORD'><img src='../images/records.gif' border='0'/></a>";
                     }
                 }
                 $i++;
                 $prev_app = $appname;
             }
             print $this->columnize_list($patient_array);
         } else {
             print "<font color='red'>No patients scheduled today.</font><br/>";
         }
         print "</td></tr>";
         print "</table><br/>";
         if ($get_vars["schedule_id"]) {
             appointment::display_appointment_details($menu_id, $post_vars, $get_vars);
         }
         // consult patient list based on appointment date
         appointment::consult_info($menu_id, $post_vars, $get_vars);
         // consult patient list today
         healthcenter::consult_info($menu_id, $post_vars, $get_vars);
     }
 }