public function getSelectPatientHistory($pid) { # Returns HTML table displaying patient test history $admin = 0; if(is_admin(get_user_by_id($_SESSION['user_id']))) { $admin = 1;} $rem_recs = get_removed_specimens($_SESSION['lab_config_id']); $rem_specs = array(); $rem_remarks = array(); foreach($rem_recs as $rem_rec) { $rem_specs[] = $rem_rec['r_id']; $rem_remarks[] = $rem_rec['remarks']; } $specimen_list = get_specimens_by_patient_id($pid); if(count($specimen_list) == 0) { ?> <br> <div class='sidetip_nopos'><?php echo LangUtil::$generalTerms['TESTS']." - ".LangUtil::$generalTerms['MSG_NOTFOUND']; ?></div> <?php return; } ?> <script type='text/javascript'> $(document).ready(function(){ $('#test_history_table').tablesorter(); }); </script> <table class='tablesorter' id='test_history_table'> <thead> <tr valign='top'> <?php if($_SESSION['s_addl'] != 0) { ?> <th><?php echo LangUtil::$generalTerms['SPECIMEN_ID']; ?></th> <?php } ?> <th><?php echo LangUtil::$generalTerms['TYPE']; ?></th> <th><?php echo LangUtil::$generalTerms['R_DATE']; ?></th> <th><?php echo LangUtil::$generalTerms['SP_STATUS']; ?></th> <th></th> <th></th> </tr> </thead> <tbody> <?php foreach($specimen_list as $specimen) { if($admin == 0) { if(in_array($specimen->specimenId, $rem_specs)) continue; } $this->getSelectSpecimenInfoRow($specimen, $rem_specs, $admin); } ?> </tbody> </table> <?php # TODO: Add paging to this table }
public function getSelectPatientHistory($pid) { # Returns HTML table displaying patient test history $specimen_list = get_specimens_by_patient_id($pid); if (count($specimen_list) == 0) { ?> <br> <div class='sidetip_nopos'><?php echo LangUtil::$generalTerms['TESTS'] . " - " . LangUtil::$generalTerms['MSG_NOTFOUND']; ?> </div> <?php return; } ?> <script type='text/javascript'> $(document).ready(function(){ $('#test_history_table').tablesorter(); }); </script> <table class='tablesorter' id='test_history_table'> <thead> <tr valign='top'> <?php if ($_SESSION['s_addl'] != 0) { ?> <th><?php echo LangUtil::$generalTerms['SPECIMEN_ID']; ?> </th> <?php } ?> <th><?php echo LangUtil::$generalTerms['TYPE']; ?> </th> <th><?php echo LangUtil::$generalTerms['R_DATE']; ?> </th> <th><?php echo LangUtil::$generalTerms['SP_STATUS']; ?> </th> <th></th> <th></th> </tr> </thead> <tbody> <?php foreach ($specimen_list as $specimen) { $this->getSelectSpecimenInfoRow($specimen); } ?> </tbody> </table> <?php # TODO: Add paging to this table }
include "includes/db_lib.php"; include "includes/script_elems.php"; include "includes/page_elems.php"; include "includes/header.php"; LangUtil::setPageId("reports"); $script_elems->enableFlotBasic(); $script_elems->enableFlipV(); $script_elems->enableTableSorter(); $lab_config_id = $_SESSION['lab_config_id']; $pid = $_REQUEST['pid']; $cn = 1; $remarks_var = "remarks"; putUILog('retrieve_specimens', 'X', basename($_SERVER['REQUEST_URI'], ".php"), 'X', 'X', 'X'); //$specimen_del= array(); //$specimen_del = explode(",",$_REQUEST['specimen_array']); $specimen_list = get_specimens_by_patient_id($pid); $rem_recs = get_removed_specimens($_SESSION['lab_config_id'], "specimen"); $rem_specs = array(); $rem_remarks = array(); foreach ($rem_recs as $rem_rec) { $rem_specs[] = $rem_rec['r_id']; $rem_remarks[] = $rem_rec['remarks']; } ?> <a href='select_test_profile.php?pid=<?php echo $pid; ?> '>« <?php echo LangUtil::$generalTerms['CMD_BACK']; ?>
function getDoctorNamesForPatients($patient, $lab_config_id, $lab_section, $reported) { //$query = $specimen_list = get_specimens_by_patient_id($patient->patientId, $lab_section); $doctors = array(); if ($reported == 1) { // reported foreach ($specimen_list as $specimen) { $test = Test::getTestBySpecimenID($specimen->specimenId); if ($test != null && $test->result != "") { array_push($doctors, $specimen->doctor); } } } else { // unreported foreach ($specimen_list as $specimen) { $test = Test::getTestBySpecimenID($specimen->specimenId); //echo "Test ".$test->specimenId; if ($test != null && $test->result == "") { array_push($doctors, $specimen->doctor); } } } return array_unique($doctors); }