$sidebar_html .= "<div style=\"margin-top: 10px\">\n"; $sidebar_html .= "\tYou have " . $remaining_weeks . " required elective week" . ($remaining_weeks != 1 ? "s" : "") . " remaining.\n"; if ($remaining_weeks > 0) { $sidebar_html .= "\tTo submit electives for approval, <a href=\"" . ENTRADA_URL . "/clerkship/electives?section=add\">click here</a>."; } $sidebar_html .= "</div>\n"; new_sidebar_item("Elective Weeks", $sidebar_html, "page-clerkship", "open"); /* Logbook Review setup */ $query = "SELECT *\n FROM `" . CLERKSHIP_DATABASE . "`.`events` AS a\n LEFT JOIN `" . CLERKSHIP_DATABASE . "`.`event_contacts` AS b\n ON b.`event_id` = a.`event_id`\n LEFT JOIN `" . CLERKSHIP_DATABASE . "`.`regions` AS c\n ON c.`region_id` = a.`region_id`\n WHERE a.`event_finish` >= " . $db->qstr(strtotime("00:00:00", time())) . "\n AND (a.`event_status` = 'published' OR a.`event_status` = 'approval')\n AND b.`econtact_type` = 'student'\n AND b.`etype_id` = " . $db->qstr($ENTRADA_USER->getActiveId()) . "\n ORDER BY a.`event_start` ASC"; $clerkship_schedule = $db->GetAll($query); $query = "SELECT *\n FROM `" . CLERKSHIP_DATABASE . "`.`events` AS a\n LEFT JOIN `" . CLERKSHIP_DATABASE . "`.`event_contacts` AS b\n ON b.`event_id` = a.`event_id`\n LEFT JOIN `" . CLERKSHIP_DATABASE . "`.`regions` AS c\n ON c.`region_id` = a.`region_id`\n WHERE a.`event_finish` <= " . $db->qstr(strtotime("00:00:00", time())) . "\n AND (a.`event_status` = 'published' OR a.`event_status` = 'approval')\n AND b.`econtact_type` = 'student'\n AND b.`etype_id` = " . $db->qstr($ENTRADA_USER->getActiveId()) . "\n ORDER BY a.`event_start` ASC"; $clerkship_past_schedule = $db->GetAll($query); if (isset($clerkship_schedule[0]) && $clerkship_schedule[0]["event_start"] <= time() || isset($clerkship_past_schedule) && $clerkship_past_schedule) { $ROTATION_ID = isset($clerkship_schedule[0]) && $clerkship_schedule[0]["rotation_id"] ? $clerkship_schedule[0]["rotation_id"] : $clerkship_past_schedule[count($clerkship_past_schedule) - 1]["rotation_id"]; $SHOW_LOGBOOK = (int) $_SESSION["details"]["role"] <= date("Y", strtotime("+1 year")) ? true : false; $clinical_rotation = clerkship_get_rotation($rotation ? $rotation : ($ROTATION_ID ? $ROTATION_ID : 0)); $rotation = $clinical_rotation["id"]; $clinical_encounters = clerkship_get_rotation_overview($rotation); $objectives_required = 0; $objectives_recorded = 0; $grad_year = get_account_data("grad_year", $ENTRADA_USER->getID()); if ($rotation < 10) { $query = "\tSELECT `objective_id`, MAX(`number_required`) AS `required`\n\t\t\t\t\t\t\tFROM `" . CLERKSHIP_DATABASE . "`.`logbook_mandatory_objectives`\n\t\t\t\t\t\t\tWHERE `rotation_id` = " . $db->qstr($rotation ? $rotation : ($ROTATION_ID ? $ROTATION_ID : 0)) . "\n\t\t\t\t\t\t\tAND `grad_year_min` <= " . $db->qstr($grad_year) . "\n\t\t\t\t\t\t\tAND (`grad_year_max` = 0 OR `grad_year_max` >= " . $db->qstr($grad_year) . ")\n\t\t\t\t\t\t\tGROUP BY `objective_id`"; $required_objectives = $db->GetAll($query); if ($required_objectives) { foreach ($required_objectives as $required_objective) { $objectives_required += $required_objective["required"]; $number_required[$required_objective["objective_id"]] = $required_objective["required"]; $query = "SELECT COUNT(a.`objective_id`) AS `recorded`\n\t\t\t\t\t\t\t\t\t\tFROM `" . CLERKSHIP_DATABASE . "`.`logbook_entry_objectives` AS a\n\t\t\t\t\t\t\t\t\t\tJOIN `" . CLERKSHIP_DATABASE . "`.`logbook_entries` AS b\n\t\t\t\t\t\t\t\t\t\tON a.`lentry_id` = b.`lentry_id`\n\t\t\t\t\t\t\t\t\t\tAND b.`entry_active` = '1'\n\t\t\t\t\t\t\t\t\t\tAND b.`proxy_id` = " . $db->qstr($ENTRADA_USER->getID()) . "\n\t\t\t\t\t\t\t\t\t\tWHERE a.`objective_id` = " . $db->qstr($required_objective["objective_id"]) . "\n\t\t\t\t\t\t\t\t\t\tGROUP BY a.`objective_id`"; $recorded = $db->GetOne($query); if ($recorded) {
<input type="hidden" id="dstamp" name="dstamp" value="<?php echo $DATE_START; ?> " /> </form> <?php } else { $NOTICE++; $NOTICESTR[] = "There are no entries in the Clerkship schedule for the <strong>" . html_encode($department_title) . "</strong> department in <strong>" . html_encode($DATE_INFO["month"] . " " . $DATE_INFO["year"]) . "</strong>.<br /><br />If you believe there is a problem, please contact the Undergrad office for more information."; echo display_notice(); } } if ($ENTRADA_ACL->amIAllowed('clerkship', 'read')) { // Display Clerkship Schedule for Mandatory rotations if (isset($rotation_id) && (int) $rotation_id) { $rotation = clerkship_get_rotation($rotation_id); /* // Get the core blocks for this rotation for this class year via 'categories' table $query = " SELECT `category_name`, `category_start`, `category_finish` FROM `".CLERKSHIP_DATABASE."`.`categories` WHERE `category_parent` IN (SELECT a.`category_id` FROM `".CLERKSHIP_DATABASE."`.`categories` a, `".CLERKSHIP_DATABASE."`.`category_type` b WHERE a.`category_type` = b.`ctype_id` and b.`ctype_name` like 'Rotation' and a.`category_parent` IN (SELECT `category_type` FROM `".CLERKSHIP_DATABASE."`.`categories` WHERE `category_name` like 'Class of 2010') and `rotation_id` = ".$db->qstr($rotation["id"]).") Order by category_start"; $blocks = $db->GetAll($query); if (!$blocks) { $query = " SELECT `category_name`, `category_start`, `category_finish` FROM `".CLERKSHIP_DATABASE."`.`categories` WHERE `category_parent` IN ( SELECT `category_id` FROM `".CLERKSHIP_DATABASE."`.`categories` WHERE `category_name` like 'Class of 2010'
<script type="text/javascript"> document.observe('dom:loaded',function(){ $$(".setting-tooltip").each(function (e) { new Control.Window($(e.id),{ position: 'relative', hover: true, offsetLeft: 125, width: 250, className: 'setting-tooltip-box' }); }); }); </script> <?php $grad_year = get_account_data("grad_year", $PROXY_ID); $clinical_rotation = clerkship_get_rotation($rotation_id); $fullname = $db->GetOne("SELECT CONCAT_WS(' ', `firstname`, `lastname`) FROM `" . AUTH_DATABASE . "`.`user_data` WHERE `id` = " . $db->qstr($PROXY_ID)); echo "<h1>" . $clinical_rotation["title"] . " Rotation Patient Encounters Report</h1>\n"; echo "<h2 style=\"border: none;\">For: " . $fullname . "</h2>"; if ($SUCCESS) { echo display_success(); } if ($NOTICE) { echo display_notice(); } if ($ERROR) { echo display_error(); } // Collect objectives seen within the rotation: 1 indicates mandatories, 2 indicates non mandatories $LOCATIONS = array(); $show_legend = false;