示例#1
0
 function form_patient_ntp()
 {
     //
     // get ntp data for this visit1
     // of patient
     //
     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);
     }
     if ($get_vars["ntp_id"]) {
         $sql = "select patient_id, ntp_id, user_id, occupation_id, household_contacts, " . "region_id, body_weight, bcg_scar, tb_class, " . "previous_treatment_flag, previous_treatment_duration, previous_treatment_drugs, " . "treatment_category_id, contact_person, outcome_id, patient_type_id, " . "treatment_partner_id, course_end_flag, treatment_end_date,source_patient,refer_physician,tbdc_review " . "from m_patient_ntp where ntp_id = '" . $get_vars["ntp_id"] . "'";
         if ($result = mysql_query($sql)) {
             if (mysql_num_rows($result)) {
                 $ntp = mysql_fetch_array($result);
                 list($y, $m, $d) = explode('-', $ntp["treatment_end_date"]);
                 $date_outcome = $ntp["treatment_end_date"] == '0000-00-00' ? '' : $m . '/' . $d . '/' . $y;
                 if ($ntp[source_patient] == 'Public') {
                     $public = 'SELECTED';
                 } elseif ($ntp[source_patient] == 'Private') {
                     $private = 'SELECTED';
                 } else {
                     $def = 'SELECTED';
                 }
             }
         }
     }
     print "<a name='visit1_form'>";
     print "<table width='300' bgcolor='#5CB3FF'>";
     print "<form action = '" . $_SERVER["SELF"] . "?page=" . $get_vars["page"] . "&menu_id={$menu_id}&consult_id=" . $get_vars["consult_id"] . "&ptmenu=" . $get_vars["ptmenu"] . "&module=" . $get_vars["module"] . "&ntp=VISIT1&ntp_id=" . $get_vars["ntp_id"] . "#prevtx' name='form_ntp_visit1' method='post'>";
     print "<tr valign='top' class='tb_table_header'><td>";
     print "<b>" . FTITLE_NTP_VISIT1_DATA . "</b>";
     print "</td></tr>";
     print "<tr valign='top'><td>";
     print "<span class='tinylight'>" . INSTR_NTP_VISIT1_DATA . "</span><br/><br/>";
     print "</td></tr>";
     print "<tr valign='top'><td>";
     print "<a name='prevtx'>";
     print "<span class='boxtitle'>" . LBL_PREVIOUS_TREATMENT . "</span><br> ";
     print "<input type='checkbox' name='previous_treatment_flag' onchange='this.form.submit();' " . ($ntp["previous_treatment_flag"] == "Y" || $post_vars["previous_treatment_flag"] ? "checked" : "") . " value='1'/> Check previous treatment<br />";
     print "</td></tr>";
     if ($ntp["previous_treatment_flag"] == "Y" || $post_vars["previous_treatment_flag"]) {
         print "<tr valign='top'><td>";
         print "<span class='boxtitle'>" . LBL_PREVIOUS_TREATMENT_DURATION . "</span><br>";
         print "<select name='previous_treatment_duration'>";
         print "<option value='M1' " . ($ntp["previous_treatment_duration"] == "M1" ? "selected" : "") . ">More than 1 month</option>";
         print "<option value='L1' " . ($ntp["previous_treatment_duration"] == "L1" ? "selected" : "") . ">Less than 1 month</option>";
         print "</select>";
         print "</td></tr>";
         print "<tr valign='top'><td>";
         print "<span class='boxtitle'>" . LBL_PREVIOUS_TREATMENT_DRUGS . "</span><br> ";
         print "<input type='checkbox' name='previous_treatment_drugs[]' value='E' " . (ereg("E", $ntp["previous_treatment_drugs"]) ? "checked" : "") . "> Ethambutol<br>";
         print "<input type='checkbox' name='previous_treatment_drugs[]' value='R' " . (ereg("R", $ntp["previous_treatment_drugs"]) ? "checked" : "") . "> Rifampicin<br>";
         print "<input type='checkbox' name='previous_treatment_drugs[]' value='H' " . (ereg("H", $ntp["previous_treatment_drugs"]) ? "checked" : "") . "> Isoniazid<br>";
         print "<input type='checkbox' name='previous_treatment_drugs[]' value='S' " . (ereg("S", $ntp["previous_treatment_drugs"]) ? "checked" : "") . "> Streptomycin<br>";
         print "<input type='checkbox' name='previous_treatment_drugs[]' value='Z' " . (ereg("Z", $ntp["previous_treatment_drugs"]) ? "checked" : "") . "> Pyrazinamide<br>";
         print "</td></tr>";
     }
     print "<tr valign='top'><td>";
     print "<span class='boxtitle'>" . LBL_OCCUPATION . "</span><br> ";
     print occupation::show_occupation($ntp["occupation_id"]);
     print "</td></tr>";
     print "<tr valign='top'><td>";
     print "<span class='boxtitle'>" . LBL_HOUSEHOLD_CONTACTS . "</span><br> ";
     print "<select name='hh_contacts' class='textbox'>";
     print "<option value='0'>None</option>";
     for ($i = 1; $i < 20; $i++) {
         print "<option value='{$i}' " . ($ntp["household_contacts"] == $i ? "selected" : "") . ">{$i}</option>";
     }
     print "</select>";
     print "</td></tr>";
     print "<tr valign='top'><td>";
     print "<span class='boxtitle'>SOURCE OF PATIENT</span><br> ";
     print "<select name='source_px'>";
     print "<option value='' {$def}>Select Source</option>";
     print "<option value='Public' {$public}>Public</option>";
     print "<option value='Private' {$private}>Private</option>";
     print "</select>";
     print "</td></tr>";
     print "<tr valign='top'><td>";
     print "<span class='boxtitle'>NAME OF REFERRING PHYSICIAN</span><br> ";
     print "<input type='text' name='refer_physician' value='{$ntp['refer_physician']}' size='20'></input>";
     print "</td></tr>";
     print "<tr valign='top'><td>";
     print "<span class='boxtitle'>" . LBL_BCG_SCAR . "</span><br> ";
     print "<select name='bcg_scar'>";
     print "<option 'Y' " . ($ntp["bcg_scar"] == "Y" ? "selected" : "") . ">Yes</option>";
     print "<option 'N' " . ($ntp["bcg_scar"] == "N" ? "selected" : "") . ">No</option>";
     print "<option 'D' " . ($ntp["bcg_scar"] == "D" ? "selected" : "") . ">Doubtful</option>";
     print "</select>";
     print "</td></tr>";
     print "<tr valign='top'><td>";
     print "<span class='boxtitle'>" . LBL_TB_CLASS . "</span><br> ";
     print "<select name='tb_class'>";
     print "<option 'P' " . ($ntp["tb_class"] == "P" ? "selected" : "") . ">Pulmonary</option>";
     print "<option 'E' " . ($ntp["tb_class"] == "E" ? "selected" : "") . ">Extrapulmonary</option>";
     print "</select>";
     print "</td></tr>";
     print "<tr valign='top'><td>";
     print "<span class='boxtitle'>" . LBL_REGION . "</span><br> ";
     if (!$ntp["region_id"]) {
         $region = "NCR";
     } else {
         $region = $ntp["region_id"];
     }
     print region::show_region($region);
     print "</td></tr>";
     print "<tr valign='top'><td>";
     print "<span class='boxtitle'>" . LBL_CONTACT_PERSON . "</span><br> ";
     print "<input type='text' class='textbox' name='contact_person' value='" . $ntp["contact_person"] . "' style='border: 1px solid #000000'><br>";
     print "</td></tr>";
     print "<tr valign='top'><td>";
     print "<span class='boxtitle'>" . LBL_PATIENT_TYPE . "</span><br> ";
     if (!$ntp["patient_type_id"]) {
         $patient_type = "NEW";
     } else {
         $patient_type = $ntp["patient_type_id"];
     }
     print ntp::show_patient_type($patient_type);
     print "</td></tr>";
     print "<tr valign='top'><td>";
     print "<span class='boxtitle'>" . LBL_TREATMENT_CAT . "</span><br> ";
     print ntp::show_treatment_cat($ntp["treatment_category_id"]);
     print "</td></tr>";
     print "<tr valign='top'><td>";
     print "<span class='boxtitle'>" . LBL_TREATMENT_PARTNER . "</span><br> ";
     print ntp::show_treatment_partners($ntp["treatment_partner_id"]);
     print "</td></tr>";
     print "<tr><td>";
     print "<span class='boxtitle'>REVIEWED BY TBDC?</span><br> ";
     print "<select name='tbdc_review' size='1'>";
     print "<option value='' " . ($ntp["tbdc_review"] == "" ? "selected" : "") . ">Select</option>";
     print "<option value='Y' " . ($ntp["tbdc_review"] == "Y" ? "selected" : "") . ">Yes</option>";
     print "<option value='N' " . ($ntp["tbdc_review"] == "N" ? "selected" : "") . ">No</option>";
     print "</select>";
     print "</td></tr>";
     print "<tr valign='top'><td>";
     if (!$ntp["outcome_id"]) {
         $outcome = "TX";
     } else {
         $outcome = $ntp["outcome_id"];
     }
     print "<br><span class='boxtitle'>" . LBL_TREATMENT_OUTCOME . "</span><br> ";
     print ntp::show_treatment_outcomes($outcome);
     print "<br/><small>" . INSTR_TREATMENT_OUTCOME . "</small><br/>";
     print "</td></tr>";
     print "<tr><td>";
     print "<span class='boxtitle'>DATE FINAL OUTCOME RECORDED</span><br> ";
     print "<input type='text' name='date_outcome' size='8' value='{$date_outcome}'></input>&nbsp;";
     print "<a href=\"javascript:show_calendar4('document.form_ntp_visit1.date_outcome', document.form_ntp_visit1.date_outcome.value);\"><img src='../images/cal.gif' width='16' height='16' border='0' alt='Click Here to Pick up the date'></a><br>";
     print "</td></tr>";
     print "<tr><td>";
     if ($get_vars["ntp_id"]) {
         print "<input type='hidden' name='ntp_id' value='" . $get_vars["ntp_id"] . "'/>";
         if ($_SESSION["priv_update"] || $_SESSION["isadmin"]) {
             if ($ntp["course_end_flag"] == "N" || $_SESSION["isadmin"]) {
                 print "<br><input type='submit' value = 'Update NTP Data' class='textbox' name='submitntp' style='border: 1px solid #000000'><br>";
             }
         }
     } else {
         if ($_SESSION["priv_add"]) {
             print "<br><input type='submit' value = 'Save NTP Data' class='textbox' name='submitntp' style='border: 1px solid #000000'><br>";
         }
     }
     print "</td></tr>";
     print "</form>";
     print "</table><br>";
 }
示例#2
0
    function form_patient_ntp() {
    //
    // get ntp data for this visit1
    // of patient
    //
        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);
        }
        if ($get_vars["ntp_id"]) {
            $sql = "select patient_id, ntp_id, user_id, occupation_id, household_contacts, ".
                   "region_id, body_weight, bcg_scar, tb_class, ".
                   "previous_treatment_flag, previous_treatment_duration, previous_treatment_drugs, ".
                   "treatment_category_id, contact_person, outcome_id, patient_type_id, ".
                   "treatment_partner_id, course_end_flag ".
                   "from m_patient_ntp where ntp_id = '".$get_vars["ntp_id"]."'";
            if ($result = mysql_query($sql)) {
                if (mysql_num_rows($result)) {
                    $ntp = mysql_fetch_array($result);
                }
            }
        }
        print "<a name='visit1_form'>";
        print "<table width='300'>";
        print "<form action = '".$_SERVER["SELF"]."?page=".$get_vars["page"]."&menu_id=$menu_id&consult_id=".$get_vars["consult_id"]."&ptmenu=".$get_vars["ptmenu"]."&module=".$get_vars["module"]."&ntp=VISIT1&ntp_id=".$get_vars["ntp_id"]."#prevtx' name='form_ntp_visit1' method='post'>";
        print "<tr valign='top'><td>";
        print "<b>".FTITLE_NTP_VISIT1_DATA."</b><br/><br/>";
        print "</td></tr>";
        print "<tr valign='top'><td>";
        print "<span class='tinylight'>".INSTR_NTP_VISIT1_DATA."</span><br/><br/>";
        print "</td></tr>";
        print "<tr valign='top'><td>";
        print "<a name='prevtx'>";
        print "<span class='boxtitle'>".LBL_PREVIOUS_TREATMENT."</span><br> ";
        print "<input type='checkbox' name='previous_treatment_flag' onchange='this.form.submit();' ".(($ntp["previous_treatment_flag"]=="Y"||$post_vars["previous_treatment_flag"])?"checked":"")." value='1'/> Check previous treatment<br />";
        print "</td></tr>";
        if ($ntp["previous_treatment_flag"]=="Y" || $post_vars["previous_treatment_flag"]) {
            print "<tr valign='top'><td>";
            print "<span class='boxtitle'>".LBL_PREVIOUS_TREATMENT_DURATION."</span><br>";
            print "<select name='previous_treatment_duration'>";
            print "<option value='M1' ".($ntp["previous_treatment_duration"]=="M1"?"selected":"").">More than 1 month</option>";
            print "<option value='L1' ".($ntp["previous_treatment_duration"]=="L1"?"selected":"").">Less than 1 month</option>";
            print "</select>";
            print "</td></tr>";
            print "<tr valign='top'><td>";
            print "<span class='boxtitle'>".LBL_PREVIOUS_TREATMENT_DRUGS."</span><br> ";
            print "<input type='checkbox' name='previous_treatment_drugs[]' value='E' ".(ereg("E", $ntp["previous_treatment_drugs"])?"checked":"")."> Ethambutol<br>";
            print "<input type='checkbox' name='previous_treatment_drugs[]' value='R' ".(ereg("R", $ntp["previous_treatment_drugs"])?"checked":"")."> Rifampicin<br>";
            print "<input type='checkbox' name='previous_treatment_drugs[]' value='H' ".(ereg("H", $ntp["previous_treatment_drugs"])?"checked":"")."> Isoniazid<br>";
            print "<input type='checkbox' name='previous_treatment_drugs[]' value='S' ".(ereg("S", $ntp["previous_treatment_drugs"])?"checked":"")."> Streptomycin<br>";
            print "<input type='checkbox' name='previous_treatment_drugs[]' value='Z' ".(ereg("Z", $ntp["previous_treatment_drugs"])?"checked":"")."> Pyrazinamide<br>";
            print "</td></tr>";
        }
        print "<tr valign='top'><td>";
        print "<span class='boxtitle'>".LBL_OCCUPATION."</span><br> ";
        print occupation::show_occupation($ntp["occupation_id"]);
        print "</td></tr>";
        print "<tr valign='top'><td>";
        print "<span class='boxtitle'>".LBL_HOUSEHOLD_CONTACTS."</span><br> ";
        print "<select name='hh_contacts' class='textbox'>";
        print "<option value='0'>None</option>";
        for ($i=1; $i<20; $i++) {
            print "<option value='$i' ".($ntp["household_contacts"]==$i?"selected":"").">$i</option>";
        }
        print "</select>";
        print "</td></tr>";
        print "<tr valign='top'><td>";
        print "<span class='boxtitle'>".LBL_BCG_SCAR."</span><br> ";
        print "<select name='bcg_scar'>";
        print "<option 'Y' ".($ntp["bcg_scar"]=="Y"?"selected":"").">Yes</option>";
        print "<option 'N' ".($ntp["bcg_scar"]=="N"?"selected":"").">No</option>";
        print "<option 'D' ".($ntp["bcg_scar"]=="D"?"selected":"").">Doubtful</option>";
        print "</select>";
        print "</td></tr>";
        print "<tr valign='top'><td>";
        print "<span class='boxtitle'>".LBL_TB_CLASS."</span><br> ";
        print "<select name='tb_class'>";
        print "<option 'P' ".($ntp["tb_class"]=="P"?"selected":"").">Pulmonary</option>";
        print "<option 'E' ".($ntp["tb_class"]=="E"?"selected":"").">Extrapulmonary</option>";
        print "</select>";
        print "</td></tr>";
        print "<tr valign='top'><td>";
        print "<span class='boxtitle'>".LBL_REGION."</span><br> ";
        if (!$ntp["region_id"]) {
            $region = "NCR";
        } else {
            $region = $ntp["region_id"];
        }
        print region::show_region($region);
        print "</td></tr>";
        print "<tr valign='top'><td>";
        print "<span class='boxtitle'>".LBL_CONTACT_PERSON."</span><br> ";
        print "<input type='text' class='textbox' name='contact_person' value='".$ntp["contact_person"]."' style='border: 1px solid #000000'><br>";
        print "</td></tr>";
        print "<tr valign='top'><td>";
        print "<span class='boxtitle'>".LBL_PATIENT_TYPE."</span><br> ";
        if (!$ntp["patient_type_id"]) {
            $patient_type = "NEW";
        } else {
            $patient_type = $ntp["patient_type_id"];
        }
        print ntp::show_patient_type($patient_type);
        print "</td></tr>";
        print "<tr valign='top'><td>";
        print "<span class='boxtitle'>".LBL_TREATMENT_CAT."</span><br> ";
        print ntp::show_treatment_cat($ntp["treatment_category_id"]);
        print "</td></tr>";
        print "<tr valign='top'><td>";
        print "<span class='boxtitle'>".LBL_TREATMENT_PARTNER."</span><br> ";
        print ntp::show_treatment_partners($ntp["treatment_partner_id"]);
        print "</td></tr>";
        print "<tr valign='top'><td>";
        if (!$ntp["outcome_id"]) {
            $outcome = "TX";
        } else {
            $outcome = $ntp["outcome_id"];
        }
        print "<span class='boxtitle'>".LBL_TREATMENT_OUTCOME."</span><br> ";
        print ntp::show_treatment_outcomes($outcome);
        print "<br/><small>".INSTR_TREATMENT_OUTCOME."</small><br/>";
        print "</td></tr>";
        print "<tr><td>";
        if ($get_vars["ntp_id"]) {
            print "<input type='hidden' name='ntp_id' value='".$get_vars["ntp_id"]."'/>";
            if ($_SESSION["priv_update"] || $_SESSION["isadmin"]) {
                if ($ntp["course_end_flag"]=="N" || $_SESSION["isadmin"]) {
                    print "<br><input type='submit' value = 'Update NTP Data' class='textbox' name='submitntp' style='border: 1px solid #000000'><br>";
                }
            }
        } else {
            if ($_SESSION["priv_add"]) {
                print "<br><input type='submit' value = 'Save NTP Data' class='textbox' name='submitntp' style='border: 1px solid #000000'><br>";
            }
        }
        print "</td></tr>";
        print "</form>";
        print "</table><br>";

    }