setSpreadsheetKey('0AuPh9cI948YxdGkxdFMzQmdiamZKWnFQdW9ZbkFyUWc'); $query->setWorksheetId('od6'); $wsEntry = $service->getWorksheetEntry($query); } catch (Exception $e) { die('ERROR: ' . $e->getMessage()); } $glossary_php_last_updated = strtotime($wsEntry->updated); // Dynamic $glossary_html_last_updated = strtotime(date("F d Y H:i:s.", filemtime('glossary.html'))); // Static // Make sure no glossary user activated functions are called if (empty($study_set) && empty($checkedname) && empty($study_mode)) { // Redirect to previously generated static html page if no recent Google Spreadsheets update //if ($glossary_php_last_updated < $glossary_html_last_updated) { // header('Location: glossary.html'); // exit; //} // Else the rest of the php script below will run and overwrite glossary.html file } ?> setSpreadsheetKey("0AuPh9cI948YxdGkxdFMzQmdiamZKWnFQdW9ZbkFyUWc"); $query->setWorksheetId("od6"); } catch (Exception $e) { die('ERROR: ' . $e->getMessage()); } // Get a list of the 2nd, 3rd, and 4th rows (glossary_media, glossary_name, glossary_definition) and put into big arrays $query->setReturnEmpty(true); $query->setMinCol(2); $query->setMaxCol(4); $query->setMinRow(2); $cellFeed = $service->getCellFeed($query); // Populate the data_arrays to generate the Javascript data $array_counter = 1; $special_chars = array("\n"); $replace_special_chars = array("
"); foreach ($cellFeed as $cellEntry) { if ($array_counter == 1) { $glossary_medias[] = str_replace(" ", "", $cellEntry->getCell()->getText()); } elseif ($array_counter == 2) { $glossary_names[] = $cellEntry->getCell()->getText(); } elseif ($array_counter == 3) { $glossary_definitions[] = str_replace($special_chars, $replace_special_chars, $cellEntry->getCell()->getText()); } // Reset array counter when all of row data is entered $array_counter < 3 ? $array_counter++ : $array_counter = 1; } // Autocomplete search function echo " \n"; ///////////////////////////////////////////////////////////////////////////////////////////////// // SELECTION MODE ///////////////////////////////////////////////////////////////////////////////////////////////// // Show list of terms for comparison and put them in a horizontal table if ($checkedname && !$studymode) { echo "<< Back to Hematology Glossary
\n"; echo "

Selected Glossary Terms

\n"; echo "\n"; // Get all images, if any for ($i = 0; $i < count($checkedname); $i++) { $media_string = ''; if ($glossary_medias[array_search($checkedname[$i], $glossary_names)]) { // Check to see if any media links are associated with glossary name unset($media_list); $media_list = explode(",", $glossary_medias[array_search($checkedname[$i], $glossary_names)]); for ($z = 0; $z < count($media_list); $z++) { $media_string .= "
Figure " . ($z+1) . "


\n"; } $media_string = "

" . $media_string . "
\n"; } echo "\n"; } echo "
" . str_replace("_", " ", $checkedname[$i]) . "

" . "
" . str_replace("_", " ", $glossary_definitions[array_search($checkedname[$i], $glossary_names)]) . "
" . $media_string . "
\n"; print_footer(); exit; } ///////////////////////////////////////////////////////////////////////////////////////////////// // STUDY MODE ///////////////////////////////////////////////////////////////////////////////////////////////// // If selected, produce study mode for selected glossary terms if (($checkedname && $studymode) || $study_set) { ?> Back to Hematology Glossary
\n"; echo "

Study Mode: Selected Glossary Terms


\n"; if ($study_set) { ?>

Expand All | Close All


Expand All | Close All

\n"; if ($study_set) { // Set study terms into checkedname array switch ($study_set) { case "Neoplasms": break; case "Coagulation and Bleeding Disorders": break; case "Transfusion Medicine": break; case "CD markers": $checkedname = Array('CD','CD_Mnemonic','CD1a','CD2','CD3','CD4','CD5','CD7','CD8', 'CD10', 'CD11b', 'CD13', 'CD14', 'CD15', 'CD16', 'CD19','CD20', 'CD21', 'CD22', 'CD23'); break; case "Peripheral Blood Components": $checkedname = Array('Acanthocyte','Albumin','Band','Basophil','Blast','Blood','Dohle_bodies','Elliptocytes','Eosinophil','Erythrocyte','Fragmented red blood cells','Giant platelets','Granulocytes','Helmet cell','Howell-Jolly bodies','Hypersegmented neutrophils','Large granular lymphocytes','Leukocytes','Lymphoblast','Lymphocytes','Mast cells','Metamyelocyte','Monocyte','Myeloblasts','Myelocyte','Neutrophil','Normoblasts','Nucleated red blood cells','Ovalocytes','Pappenheimer bodies','Pelger-Huet anomaly','Plasma cell','Platelets','Polychromatophilic','Prolymphocytes','Promyelocyte','Reactive lymphocytes','Reticulocytes','Rouleaux formation (rouleaux RBCs)','Schistocytes','Segmented neutrophils','Spherocytes','Spur cell RBC','Stomatocytes','Target cells','Teardrop RBCs','Toxic granulation'); break; } } // Get all images, if any for ($i = 0; $i < count($checkedname); $i++) { $media_string = ''; if ($glossary_medias[array_search($checkedname[$i], $glossary_names)]) { // Check to see if any media links are associated with glossary name unset($media_list); $media_list = explode(",", $glossary_medias[array_search($checkedname[$i], $glossary_names)]); for ($z = 0; $z < count($media_list); $z++) { $media_string .= "
Figure " . ($z+1) . "


\n"; } $media_string = "

" . $media_string . "
\n"; } echo " " . str_replace("_", " ", $checkedname[$i]) . "
\n"; echo " Show ►

\n"; echo "

\n"; } echo "\n"; print_footer(); exit; } ?>

Hematology Glossary


Go To: A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z


or



\n"; $ALPHABET_COUNTER++; } // Alternating background row color $color == '#ffffff' ? $color = '#eeeeee' : $color = '#ffffff'; // Parse the definition for all glossary terms and set hyperlinks unset($str_link); // Reset the definition string for ($y = 0; $y < count($glossary_names); $y++) { // Loop through all glossary names if ($str_link == "") $str_link = $glossary_definitions[$x]; // Set initial definition string as original if (stripos($glossary_definitions[$x], $glossary_names[$y])) { // The name is found within the definition text, so continue //Check the case of the name in the original definition text against the array of terms that should always be alphabetized if (in_array($glossary_names[$y], $CAPITAL_TERMS)) { $fixed_glossary_name = str_replace("'", "'", $glossary_names[$y]); } else { $fixed_glossary_name = strtolower(str_replace("'", "'", $glossary_names[$y])); } // Build final string $replacement_str = "$fixed_glossary_name"; $str_link = str_replace_word($glossary_names[$y], $replacement_str, $str_link); } } // Extract media (possibly multiple), if any unset($media_string); if ($glossary_medias[$x]) { unset($media_list); $media_list = explode(",", $glossary_medias[$x]); $media_string = "
Back to top ^

" . $ARRAY_ALPHABET[$ALPHABET_COUNTER] . "


\n"; for ($z = 0; $z < count($media_list); $z++) { $media_string .= "\n"; if ($z == 3) $media_string .= ""; } $media_string .= "
  
Figure " . ($z+1) . "
\n"; $media_string = "

" . $media_string . "

\n"; } echo " " . str_replace("_", " ", $glossary_names[$x]) . " " . $str_link . $media_string . " \n"; } ?>