3 // Immunization storage and update module
6 include_once("../../globals.php");
7 include_once("$srcdir/api.inc");
8 include_once("$srcdir/forms.inc");
10 $flds = sqlListFields("form_immunization_record");
11 $flds = array_slice($flds,7);
12 foreach ($flds as $key => $fld){
16 foreach ($_POST as $k => $var) {
17 $_POST[$k] = mysql_escape_string($var);
21 "vacc_tetanus"=>1, "vacc_influenza"=>1,
22 "vacc_pneumococcal"=>1, "vacc_mmr"=>1,
23 "vacc_hep_a"=>1, "vacc_hep_b"=>1,
26 $hdrimmrecord = array(
27 "vacc_tetanus"=> "Tetanus-Diphteria booster",
28 "vacc_influenza"=> "Influenza vaccine",
29 "vacc_pneumococcal"=> "Pneumococcal vaccine",
30 "vacc_mmr"=> "MMR Vaccine",
31 "vacc_hep_a"=> "Hepatitis A vaccine",
32 "vacc_hep_b"=> "Hepatitis B vaccine",
33 "vacc_varicella"=> "Varicella vaccine"
38 foreach ($vaccs as $key => $val){
42 $data[$key] .= $_POST["${key}_${si}"].'|~';
43 if ($_POST["${key}_${si}"] != ''){
44 $data["last_${key}"] = $_POST["${key}_${si}"];
50 if ($_GET["mode"] == "new"){
51 if ($encounter == "") { $encounter = date("Ymd"); }
52 $newid = formSubmit("form_immunization_record", $data, $_GET["id"], $userauthorized);
53 addForm($encounter, "Immunization record", $newid, "immunization_record", $pid, $userauthorized);
54 $_SESSION["encounter"] = $encounter;
55 } elseif ($_GET["mode"] == "update") {
57 foreach ($data as $key => $val){
58 $q1 .= "$key='$val', ";
60 sqlInsert("update form_immunization_record set pid = {$_SESSION["pid
"]},groupname='".$_SESSION["authProvider"]."',user='".$_SESSION["authUser"]."',authorized=$userauthorized,activity=1, $q1 date = NOW() where id=$id");
62 sqlInsert("update patient_data set DOB='".$_POST['pbdate']."' where id=$pid");
64 //$_SESSION["pid"] = $pid;
65 formHeader("Redirecting....");