Exemplo n.º 1
0
	function form_vaccine_data_import() {
        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);	
        }
        $patient_id = healthcenter::get_patient_id($get_vars["consult_id"]);
        $mc_id = mc::registry_record_exists($patient_id);
        if ($mc_id) {
            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=mc&mc=SVC&mc_id=".$get_vars["mc_id"]."' name='form_mc_services' method='post'>";
            print "<tr valign='top'><td>";
            print "<b>".FTITLE_VACCINE_DATA_IMPORT."</b><br/><br/>";
            print "</td></tr>";
            print "<tr valign='top'><td>";
            print "<span class='boxtitle'>REGISTRY INFORMATION</span><br/>";
            print "<span class='tinylight'>";
            print "REGISTRY ID: <font color='red'>".module::pad_zero($mc_id, 7)."</font><br/>";
            print "</span>";
            print "</td></tr>";
            print "<tr valign='top'><td>";
            // VACCINE DATA
            print "<table bgcolor='#CCCCFF' width='300' cellpadding='3'><tr><td>";
            print "<span class='boxtitle'>".LBL_VACCINATIONS_RECEIVED."</span><br> ";
            $sql = "select vaccine_id, actual_vaccine_date, consult_id,actual_vaccine_date from m_consult_vaccine ".
                   "where patient_id = '$patient_id'";
            if ($result = mysql_query($sql)) {
                if (mysql_num_rows($result)) {
					$disp = 0;
                    while (list($id, $vdate,$consultid,$actual_vdate) = mysql_fetch_array($result)) {
						$check_mc_vacc = mysql_query("SELECT patient_id FROM m_consult_mc_vaccine WHERE consult_id='$consultid' AND vaccine_id='$id' AND patient_id='$patient_id' AND actual_vaccine_date='$actual_vdate'") or die(mysql_error());
						
						if(mysql_num_rows($check_mc_vacc)==0):
							print "<input type='checkbox' name='vaccines[]' value='$id'/> ";
							print vaccine::get_vaccine_name($id);
							print " $vdate <br/>";
							$disp = 1;
						endif;
                    }
                } else {
                    print "<font color='red'>No vaccine data available.</font><br/>";
                }
            }
            print "</td></tr>";
            print "</table>";

            print "</td></tr>";
            print "<tr><td><br/>";			
			if($disp!=0):
				if ($_SESSION["priv_add"]) {
					print "<input type='hidden' name='mc_id' value='$mc_id'>";
					print "<input type='hidden' name='patient_id' value='$patient_id'>";
					print "<input type='hidden' name='consult_id' value='".$get_vars["consult_id"]."'>";
					print "<input type='submit' value = 'Import Data' class='textbox' name='submitmc' style='border: 1px solid #000000'> ";
				}
			endif;

			print "</td></tr>";
            print "</form>";
            print "</table><br>";
        } else {
            print "<font color='red'>No valid Registry ID. Please create a new one.</font>";
        }

    }
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/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();
		$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();
Exemplo n.º 3
0
 function display_vaccine_record_details()
 {
     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);
     }
     $sql = "select ccdev_id, consult_id, user_id, patient_id, vaccine_timestamp, date_format(vaccine_timestamp, '%a %d %b %Y, %h:%i%p'), " . "vaccine_id, adr_flag, actual_vaccine_date, round(age_on_vaccine,2) " . "from m_consult_ccdev_vaccine where " . "ccdev_id = '" . $get_vars["ccdev_id"] . "' and vaccine_id = '" . $get_vars["vaccine"] . "' and " . "vaccine_timestamp = '" . $get_vars["ts"] . "'";
     if ($result = mysql_query($sql)) {
         if (mysql_num_rows($result)) {
             list($cdid, $cid, $uid, $pid, $vstamp, $vdate, $vid, $adr, $actual_date, $age_vaccine) = mysql_fetch_array($result);
             print "<a name='detail'>";
             print "<table width='250' cellpadding='3' style='border:1px dashed black'><tr><td>";
             print "<form name='form_vaccine_detail' method='post' action='" . $_SERVER["PHP_SELF"] . "?page=" . $get_vars["page"] . "&menu_id=" . $get_vars["menu_id"] . "&consult_id=" . $get_vars["consult_id"] . "&ptmenu=" . $get_vars["ptmenu"] . "&module=" . $get_vars["module"] . "&ccdev=" . $get_vars["ccdev"] . "&vaccine={$vid}&ts={$vstamp}'>";
             print "<span class='tinylight'>";
             print "REGISTRY ID: {$cdid}<br/>";
             print "VACCINE: " . vaccine::get_vaccine_name($vid) . "<br/>";
             print "REPORT DATE: {$vdate}<br/>";
             //print "AGE ON VACCINATION: ".ccdev::age_on_vaccination($pid, $actual_date)." weeks<br/>";
             print "AGE ON VACCINATION: {$age_vaccine} weeks<br/>";
             print "RECORDED BY: " . user::get_username($uid) . "<br/>";
             print "ACTUAL VACCINE DATE:<br/>";
             if ($actual_date != "0000-00-00") {
                 list($year, $month, $day) = explode("-", $actual_date);
                 $conv_date = "{$month}/{$day}/{$year}";
             }
             print "<input type='text' size='10' maxlength='10' class='tinylight' name='actual_vaccine_date' value='" . ($conv_date ? $conv_date : $post_vars["actual_vaccine_date"]) . "' style='border: 1px solid #000000'> ";
             print "<a href=\"javascript:show_calendar4('document.form_vaccine_detail.actual_vaccine_date', document.form_vaccine_detail.actual_vaccine_date.value);\"><img src='../images/cal.gif' width='16' height='16' border='0' alt='Click Here to Pick up the date'></a><br>";
             print "<input type='checkbox' name='adr_flag' " . ($adr == "Y" ? "checked" : "") . " value='1'/> " . INSTR_ADVERSE_VACCINE_REACTION . "<br/>";
             print "<input type='hidden' name='vaccine' value='" . $get_vars["vaccine"] . "'/>";
             print "<input type='hidden' name='vaccine_consult_id' value='{$cid}'/>";
             print "<input type='hidden' name='ts' value='" . $get_vars["ts"] . "'/>";
             print "<input type='hidden' name='ccdev_id' value='" . $get_vars["ccdev_id"] . "'/>";
             if ($_SESSION["priv_delete"]) {
                 print "<input type='submit' name='submitdetail' value='Delete Record' class='tinylight' style='border: 1px solid black'/> ";
             }
             if ($_SESSION["priv_add"] || $_SESSION["priv_update"]) {
                 print "<input type='submit' name='submitdetail' value='Update Record' class='tinylight' style='border: 1px solid black'/> ";
             }
             print "</span>";
             print "</form>";
             print "</td></tr></table>";
         }
     }
 }
Exemplo n.º 4
0
 function checkbox_vaccines()
 {
     if (func_num_args() > 0) {
         $arg_list = func_get_args();
         $patient_id = $arg_list[0];
     }
     $sql = "select vaccine_id, vaccine_interval, vaccine_name " . "from m_lib_vaccine order by vaccine_name";
     if ($result = mysql_query($sql)) {
         if (mysql_num_rows($result)) {
             while (list($id, $interval, $name) = mysql_fetch_array($result)) {
                 $vaccine_status = vaccine::check_vaccine_status($id, $patient_id);
                 $ret_val .= "<input type='checkbox' name='vaccine[]' value='{$id}'> {$name} {$vaccine_status}<br>";
             }
             return $ret_val;
         }
     }
 }