Exemplo n.º 1
0
 function _consult_lab_urinalysis()
 {
     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 ($exitinfo = $this->missing_dependencies('urinalysis')) {
         return print $exitinfo;
     }
     $u = new urinalysis();
     if ($_POST["submitlab"]) {
         //print_r($_POST);
         $q_request = mysql_query("SELECT request_id FROM m_consult_lab_urinalysis WHERE request_id='{$_POST['request_id']}'") or die("Cannot query 94:" . mysql_error());
         if ($_POST["release_flag"] == 1) {
             $release = 'Y';
             $release_date = date('Y-m-d H:i:s');
             $q_update_lab = mysql_query("UPDATE m_consult_lab SET request_done='{$release}',done_timestamp='{$release_date}',done_user_id='{$_SESSION['userid']}' WHERE request_id='{$_POST['request_id']}' AND lab_id='{$_GET['lab_id']}'") or die("Cannot query 99" . mysql_error());
         } else {
             $release = 'N';
             $release_date = '';
         }
         $pxid = healthcenter::get_patient_id($_GET[consult_id]);
         list($m, $d, $y) = explode('/', $_POST[urinalysis_date]);
         $date_lab_exam = $y . '-' . $m . '-' . $d;
         if (mysql_num_rows($q_request) != 0) {
             $update_urinalysis = mysql_query("UPDATE m_consult_lab_urinalysis SET consult_id='{$_GET['consult_id']}',patient_id='{$pxid}',date_lab_exam='{$date_lab_exam}',physical_color='{$_POST['sel_color']}',physical_reaction='{$_POST['sel_reaction']}',physical_transparency='{$_POST['sel_transparency']}',physical_gravity='{$_POST['sel_gravity']}',physical_ph='{$_POST['sel_ph']}',chem_albumin='{$_POST['sel_albumin']}',chem_sugar='{$_POST['sel_sugar']}',chem_pregnancy='{$_POST['sel_pregnancy']}',sediments_rbc='{$_POST['txt_red']}',sediments_pus='{$_POST['txt_pus']}',sediments_epithelial='{$_POST['txt_epithelial']}',sediments_urates='{$_POST['txt_amorphous']}',sediments_calcium='{$_POST['txt_calcium_oxelates']}',sediments_fat='{$_POST['txt_fat']}',sediments_phosphate='{$_POST['txt_triple']}',sediments_uric='{$_POST['txt_uric']}',sediments_amorphous='{$_POST['txt_amorphouse_phosphate']}',sediments_carbonates='{$_POST['txt_calcium_carb']}',sediments_bacteria='{$_POST['txt_bacteria']}',sediments_mucus='{$_POST['txt_mucus']}',cast_coarsely='{$_POST['txt_granular']}',cast_pus='{$_POST['txt_pus_cast']}',cast_hyaline='{$_POST['txt_hyaline']}',cast_finely='{$_POST['txt_finely_cast']}',cast_redcell='{$_POST['txt_red_cell']}',cast_waxy='{$_POST['txt_wax']}',release_flag='{$release}',release_date='{$release_date}',user_id='{$_SESSION['userid']}' WHERE request_id='{$_POST['request_id']}'") or die("Cannot query 114" . mysql_error());
             //update the db contents of urinalysis form
         } else {
             $update_urinalysis = mysql_query("INSERT INTO m_consult_lab_urinalysis SET consult_id='{$_GET['consult_id']}',request_id='{$_POST['request_id']}',patient_id='{$pxid}',date_lab_exam='{$date_lab_exam}',physical_color='{$_POST['sel_color']}',physical_reaction='{$_POST['sel_reaction']}',physical_transparency='{$_POST['sel_transparency']}',physical_gravity='{$_POST['sel_gravity']}',physical_ph='{$_POST['sel_ph']}',chem_albumin='{$_POST['sel_albumin']}',chem_sugar='{$_POST['sel_sugar']}',chem_pregnancy='{$_POST['sel_pregnancy']}',sediments_rbc='{$_POST['txt_red']}',sediments_pus='{$_POST['txt_pus']}',sediments_epithelial='{$_POST['txt_epithelial']}',sediments_urates='{$_POST['txt_amorphous']}',sediments_calcium='{$_POST['txt_calcium_oxelates']}',sediments_fat='{$_POST['txt_fat']}',sediments_phosphate='{$_POST['txt_triple']}',sediments_uric='{$_POST['txt_uric']}',sediments_amorphous='{$_POST['txt_amorphouse_phosphate']}',sediments_carbonates='{$_POST['txt_calcium_carb']}',sediments_bacteria='{$_POST['txt_bacteria']}',sediments_mucus='{$_POST['txt_mucus']}',cast_coarsely='{$_POST['txt_granular']}',cast_pus='{$_POST['txt_pus_cast']}',cast_hyaline='{$_POST['txt_hyaline']}',cast_finely='{$_POST['txt_finely_cast']}',cast_redcell='{$_POST['txt_red_cell']}',cast_waxy='{$_POST['txt_wax']}',release_flag='{$release}',release_date='{$release_date}',user_id='{$_SESSION['userid']}'") or die("Cannot query 116" . mysql_error());
             //insert into the db the contents of urinalysis form
         }
         if ($update_urinalysis) {
             echo "<script language='Javascript'>";
             echo "window.alert('Urinalysis data was successfully been saved.')";
             echo "</script>";
         }
     }
     $u->form_consult_lab_urinalysis($menu_id, $post_vars, $get_vars);
 }
Exemplo n.º 2
0
    }
}
if (file_exists('../modules/template/class.template.php')) {
    include '../modules/template/class.template.php';
    $template = new template();
    if (!$module->activated('template') && $initmod) {
        $template->init_sql();
        $template->init_menu();
        $template->init_deps();
        $template->init_lang();
        $template->init_help();
    }
}
if (file_exists('../modules/urinalysis/class.urinalysis.php')) {
    include '../modules/urinalysis/class.urinalysis.php';
    $urinalysis = new urinalysis();
    if (!$module->activated('urinalysis') && $initmod) {
        $urinalysis->init_sql();
        $urinalysis->init_menu();
        $urinalysis->init_deps();
        $urinalysis->init_lang();
        $urinalysis->init_help();
    }
}
if (file_exists('../modules/vaccine/class.vaccine.php')) {
    include '../modules/vaccine/class.vaccine.php';
    $vaccine = new vaccine();
    if (!$module->activated('vaccine') && $initmod) {
        $vaccine->init_sql();
        $vaccine->init_menu();
        $vaccine->init_deps();