isPhysician() ? $this_user->getPhysician() : 0 ); // ... continue ... if (strlen($citookcall)<1) { $citookcall = $this_user->getDescription(); } // if there wasn't one passed to us... $display_buffer .= "

".__("Name")."
".__("Last")."
".__("First")."
".__("Middle")."
".__("Contact Information")."
".__("Home Phone")."   ".fm_phone_entry('cihphone', -1, false)."
".__("Work Phone")."   ".fm_phone_entry('ciwphone', -1, false)."
".__("Took Call")."  

"; if (!isset($cifacility)) $cifacility=$_SESSION['default_facility']; // doesn't seem to hurt, but doesn't seem to do anything... if ($ciphysician < 1) { $ciphysician = freemed::get_link_field ($default_facility, "facility", "psrdefphy"); } $display_buffer .= "
".__("Date of Birth")." ".fm_date_entry("cidob", true)."
".__("Complaint")."
".__("Facility")." ".module_function('facilitymodule', 'widget', array('cifacility'))."
".__("Physician")." ".module_function('providermodule', 'widget', array ('ciphysician'))."

"; break; case "add": $page_title = __("Adding")." ".$record_name; $display_buffer .= "\n".__("Adding")." ".$record_name." ... \n"; $query = $sql->insert_query( "callin", array ( 'cilname', 'cifname', 'cimname', 'cihphone' => fm_phone_assemble('cihphone'), 'ciwphone' => fm_phone_assemble('ciwphone'), 'cidob' => fm_date_assemble('cidob'), 'cicomplaint', 'cidatestamp' => date('Y-m-d'), 'cifacility' => $default_facility, 'ciphysician', 'citookcall', 'cipatient' => '0' ) ); $result = $sql->query ($query); if ($result) $display_buffer .= __("done"); else $display_buffer .= __("ERROR"); $display_buffer .= "

Patient Menu | Call In Menu | ".__("Return to the Main Menu")."

"; break; case "view": case "display": $page_title = $record_name." ".__("View/Manage"); $query = "SELECT * FROM scheduler WHERE ((calpatient='$id') AND (caltype='temp')) ORDER BY caldateof, calhour, calminute"; $result = $sql->query ($query); $rows = $sql->num_rows ($result); $ciname = freemed::get_link_rec ($id, "callin"); $cilname = $ciname ["cilname"]; $cifname = $ciname ["cifname"]; $cimname = $ciname ["cimname"]; $display_buffer .= "
$cilname, $cifname $cimname : $rows ".__("Appointments")."

".__("Show Today's Appointments")."

".__("Show All Appointments")."

".__("Return to the Main Menu")."

"; break; // deletes should fall through case "del": if ($id>0) { $sql->query("DELETE FROM callin WHERE id='".addslashes($id)."'"); } // no break default: // Set page title $page_title = $record_name; // Push onto stack page_push(); // Make sure that we "return" to the main menu $_ref = $__ref = "main.php"; $display_buffer .= template::link_bar(array( __("Old") => "$page_name?type=old", __("All") => "$page_name?type=all", __("Current") => "$page_name?type=cur" ))."

\n"; $display_buffer .= freemed_display_actionbar ($page_name); $display_buffer .= " "; // checks to make sure this hasn't been entered yet... switch ($type) { case "old": $__type_call_in__ = "cipatient > 0"; break; case "all": $__type_call_in__ = "0 = 0"; break; case "cur": default: $__type_call_in__ = "cipatient = 0"; break; } // end checking for type... $result = $sql->query ("SELECT * FROM $db_name WHERE ($__type_call_in__) ORDER BY cidatestamp, cilname, cifname, cimname"); while ($r = $sql->fetch_array ($result)) { extract ($r); if (freemed::check_access_for_facility ($cifacility)) { if (strlen($cimname)>0) $ci_comma = ", "; else $ci_comma = " "; $cihphone_raw = $r["cihphone"]; if (strlen($cihphone_raw)>6) $cihphone = "H: " . substr ($cihphone_raw, 0, 3) . "-" . substr ($cihphone_raw, 3, 3) . "-" . substr ($cihphone_raw, 6, 4); else $cihphone = ""; $ciwphone_raw = $r["ciwphone"]; if (strlen($ciwphone_raw)>6) $ciwphone = "W: " . substr ($ciwphone_raw, 0, 3) . "-" . substr ($ciwphone_raw, 3, 3) . "-" . substr ($ciwphone_raw, 6, 4); else $ciwphone = ""; if ((strlen($ciwphone)>0) and (strlen($cihphone)>0)) $ciphonesep = "
"; else $ciphonesep = " "; $display_buffer .= " "; } // if there was no access for the facility $cihphone = ""; $ciwphone = ""; } // end while $display_buffer .= "
".__("Name")." ".__("Date of Call")." ".__("Home/Work Phone")." ".__("Action")."
$cilname, $cifname$ci_comma $cimname $cidatestamp $ciwphone $ciphonesep $cihphone  "; // display the convert link $display_buffer .= template::link_bar(array( __("Enter") => "patient.php?action=addform". "&ptfname=".rawurlencode ($cifname). "&ptlname=".rawurlencode ($cilname). "&ptmname=".rawurlencode ($cimname). "&pthphone=".rawurlencode ($cihphone_raw). "&pthphone1=".rawurlencode (substr($cihphone_raw, 0, 3)). "&pthphone2=".rawurlencode (substr($cihphone_raw, 3, 3)). "&pthphone3=".rawurlencode (substr($cihphone_raw, 6, 4)). "&ptwphone=".rawurlencode ($ciwphone_raw). "&ptwphone1=".rawurlencode (substr($ciwphone_raw, 0, 3)). "&ptwphone2=".rawurlencode (substr($ciwphone_raw, 3, 3)). "&ptwphone3=".rawurlencode (substr($ciwphone_raw, 6, 4)). "&ptdob=".rawurlencode ($cidob). "&ptdob1=".rawurlencode (substr($cidob, 0, 4)). "&ptdob2=".rawurlencode (substr($cidob, 5, 2)). "&ptdob3=".rawurlencode (substr($cidob, 8, 2)). "&ci=" . $id, __("View") => "$page_name?action=display&id=$id", __("Book") => "book_appointment.php?action=&". "patient=$id&type=temp", __("Delete") => "call-in.php?id=".urlencode($id)."&action=del" ), array('align' => 'LEFT')); $display_buffer .= "
". prepare($cicomplaint)."
"; // end of the table $display_buffer .= freemed_display_actionbar ($page_name); $display_buffer .= "

\n".template::link_bar(array( __("Old") => "$page_name?type=old", __("All") => "$page_name?type=all", __("Current") => "$page_name?type=cur" )); break; } // end master switch template_display(); ?>