function get_records_to_print($lab_config, $test_type_id, $date_from, $date_to) { $saved_db = DbUtil::switchToLabConfig($lab_config->id); $retval = array(); $query_string = "SELECT * FROM test WHERE test_type_id={$test_type_id} " . "AND specimen_id IN ( " . "SELECT specimen_id FROM specimen " . "WHERE date_collected BETWEEN '{$date_from}' AND '{$date_to}' " . ")"; $resultset = query_associative_all($query_string, $row_count); foreach ($resultset as $record) { $test = Test::getObject($record); $specimen = Specimen::getById($test->specimenId); $patient = Patient::getById($specimen->patientId); $retval[] = array($test, $specimen, $patient); } DbUtil::switchRestore($saved_db); return $retval; }
?> </th> <th><?php echo LangUtil::$generalTerms['CMD_SKIP']; ?> ?</th> <th><!-- Related Tests Column --></th> </tr> </thead> <tbody> <?php for ($i = 1; $i <= count($pending_tests); $i++) { ?> <tr valign='top'> <?php $specimen = Specimen::getById($pending_tests[$i - 1]->specimenId); $patient = Patient::getById($specimen->patientId); if ($worksheet_config->usePatientId != 0) { ?> <td><?php echo $patient->getSurrogateId(); ?> </td> <?php } if ($worksheet_config->useDailyNum != 0) { ?> <td><?php echo $specimen->getDailyNumFull(); ?> </td>
$specimen_list = search_specimens_by_session_exact($session_num); $all_done = true; foreach ($specimen_list as $specimen) { $test_list = get_tests_by_specimen_id($specimen->specimenId); foreach ($test_list as $test) { if (trim($test->result) == "" || $test->result == null) { # This test pending $all_done = false; } } } if ($all_done) { echo "<br><br>"; echo LangUtil::$pageTerms['MSG_RESULTSUBMITTEDALL']; echo "<br>"; $original_specimen = Specimen::getById($_REQUEST['specimen_id']); $today = $original_specimen->dateRecvd; $today_parts = explode("-", $today); $url_string = "reports_testhistory.php?patient_id=" . $patient->patientId . "&location=" . $_SESSION['lab_config_id'] . "&yf=" . $today_parts[0] . "&mf=" . $today_parts[1] . "&df=" . $today_parts[2] . "&yt=" . $today_parts[0] . "&mt=" . $today_parts[1] . "&dt=" . $today_parts[2] . "&ip=0"; ?> <a href='<?php echo $url_string; ?> ' target='_blank'><?php echo $LANG_ARRAY['reports']['MENU_PATIENT']; ?> »</a> <?php } echo "<br><br>"; ?>
public function getTestInfoRow($test) { # Returns HTML table row containing specimen info # Called by getSpecimenTestsTable() function ?> <tr valign='top'> <td> <?php echo get_test_name_by_id($test->testTypeId); ?> </td> <td> <?php if($test->isPending()) echo LangUtil::$generalTerms['PENDING_RESULTS']; else echo $test->decodeResult(); ?> </td> <td> <?php echo $test->getComments(); ?> </td> <td> <?php echo get_username_by_id($test->userId); ?> </td> <td> <?php echo $test->getVerifiedBy(); ?> </td> <?php $specimen_object=Specimen::getById($test->specimenId); $pid=$specimen_object->patientId; $sid=$test->specimenId; ?> <!--<td><a href="javascript:get_report(<?php echo $pid;?>,<?php echo $sid;?> )">Report</a> </td>--> </tr> <?php }
</th> <th><?php echo LangUtil::$generalTerms['RESULTS']; ?> </th> </tr> </thead> <tbody> <?php $count = 1; foreach ($activity_test as $entry) { echo "<tr valign='top'>"; echo "<td>{$count}</td>"; $timestamp_parts = explode(" ", $entry->timestamp); $time_parts = explode(":", $timestamp_parts[1]); $specimen = Specimen::getById($entry->specimenId); echo "<td>" . DateLib::mysqlToString($timestamp_parts[0]) . " {$time_parts['0']}:{$time_parts['1']}</td>"; echo "<td>"; $specimen->getAuxId(); echo "</td>"; echo "<td>" . get_specimen_name_by_id($specimen->specimenTypeId) . "</td>"; echo "<td>" . get_test_name_by_id($entry->testTypeId) . "</td>"; echo "<td>" . $entry->decodeResult() . "</td>"; echo "</tr>"; $count++; } ?> </tbody> </table> <?php }
public function getTestInfoRow($test) { # Returns HTML table row containing specimen info # Called by getSpecimenTestsTable() function ?> <tr valign='top'> <td> <?php echo get_test_name_by_id($test->testTypeId); ?> </td> <td> <?php if($test->isPending()) echo LangUtil::$generalTerms['PENDING_RESULTS']; else echo $test->decodeResult(); ?> </td> <td> <?php echo $test->getComments(); ?> </td> <td> <?php echo get_username_by_id($test->userId); ?> </td> <td> <?php echo $test->getVerifiedBy(); ?> </td> <td> <?php if(check_removal_record($_SESSION['lab_config_id'], $test->testId) && is_admin(get_user_by_id($_SESSION['user_id']))!=1){ echo "Test removed. Contact Lab admin"; } else if(check_removal_record($_SESSION['lab_config_id'], $test->testId) && is_admin(get_user_by_id($_SESSION['user_id']))==1){ ?> <a href='javascript:retrieve_deleted(<?php echo $test->testId;?>, "test")' title='Click to retrieve deleted Test'>Retrieve Test</a> <?php } else { ?> <a href="javascript:delete_test(<?php echo $test->testId ;?>)">Delete</a> <?php } ?> </td> <?php $specimen_object=Specimen::getById($test->specimenId); $pid=$specimen_object->patientId; $sid=$test->specimenId; ?> <!--<td><a href="javascript:get_report(<?php echo $pid;?>,<?php echo $sid;?> )">Report</a> </td>--> </tr> <?php }
<form id='payments_form' name='payments_form' action=''> <table class='tablesorter' id='bill_table' style="border-collapse: separate;"> <tr valign='top'> <th style="width: 75px;">Test Date</th> <th>Test Name</th> <th>Specimen Type</th> <th style="width: 80px;">Test Cost</th> <th>Discount Type</th> <th>Discount Amount</th> <th style="width: 80px;"></th> </tr> <?php foreach ($associations as $assoc) { $test = Test::getById($assoc->getTestId()); $testType = TestType::getById($test->testTypeId); $specimen = Specimen::getById($test->specimenId); ?> <tr> <td><?php echo date("Y-m-d", strtotime($test->timestamp)); ?> </td> <td><?php echo $testType->name; ?> </td> <td><?php echo $specimen->getTypeName(); ?> </td> <td id="calculated_cost_for_test_<?php
<th> <?php echo LangUtil::$generalTerms['CMD_VERIFY']; ?> ? <input type='checkbox' name='check_all' id='check_all' checked onchange='javascript:checkoruncheckall();'> </input> </th> </tr> </thead> <tbody> <?php $i = 1; foreach ($test_list as $test_entry) { $result_csv = explode(",", $test_entry->result); $specimen = Specimen::getById($test_entry->specimenId); $patient = Patient::getById($specimen->patientId); if ($patient != null) { ?> <tr valign='top'> <input type='hidden' name='specimen_id[]' value='<?php echo $test_entry->specimenId; ?> '></input> <?php if ($_SESSION['pid'] != 0) { ?> <td><?php echo $patient->getSurrogateId(); ?> </td>
$("#"+remarks_input_id).attr("value", msg) } }); */ var result_field_name = 'result_'+test_type_id+"_"+measure_id; var result_field_value = $("#"+result_field_name).val(); var comments_field_name = 'comments_'+test_type_id+"_"+measure_id; $("#"+comments_field_name).val(result_field_value); } </script> <br> <?php $tips_string = LangUtil::$pageTerms['TIPS_ENTRY']; $page_elems->getSideTip(LangUtil::$generalTerms['TIPS'], $tips_string); $specimen_id = $_REQUEST['sid']; $specimen = Specimen::getById($_REQUEST['sid']); ?> <b><?php echo LangUtil::$pageTerms['TITLE_ENTRY']; ?> </b> | <a href='javascript:history.go(-1);'><?php echo LangUtil::$generalTerms['CMD_CANCEL']; ?> </a> <br><br> <?php if ($specimen == null) { ?> <div class='sidetip_nopos'> <?php
public static function createBillForTests($tests, $lab_config_id) { # Create a new bill and associate all of the desired tests with it. // The way we call the bill constructor here is awkward and assumes that the tests are all for the same patient. // While that's true for now, it's not necessarily going to stay that way, so this may need to be revisited. -Robert. $bill = new Bill(Specimen::getById($tests[0]->specimenId)->patientId); $bill->create($lab_config_id); foreach ($tests as $test) { $association = new BillsTestsAssociationObject($bill->id, $test->testId); $association->create($lab_config_id); } return $bill; }
?> </th> <th><?php echo LangUtil::$generalTerms['SP_STATUS']; ?> </th> <th></th> </tr> </thead> <tbody> <?php for ($i = 0; $i < count($specimen_done_list); $i++) { $specimen_id = $specimen_done_list[$i]; $status = $status_list[$i]; $test_entry = $test_list[$i]; $specimen = Specimen::getById($specimen_id); $patient = Patient::getById($specimen->patientId); ?> <tr> <?php if ($_SESSION['pid'] != 0) { ?> <td><?php echo $patient->getSurrogateId(); ?> </td> <?php } if ($_SESSION['dnum'] != 0) { ?> <td><?php
$num_measures = $_REQUEST['num_measures']; $specimen_id_list = $_REQUEST['specimen_id']; $comments_list = $_REQUEST['comments']; $measure_list = array(); for ($i = 1; $i <= $num_measures; $i++) { $field_name = "measure_{$i}"; $measure_list[] = $_REQUEST[$field_name]; } for ($i = 0; $i < count($specimen_id_list); $i++) { if (isset($_REQUEST['verify_flag_' . ($i + 1)]) === false) { # Verify flag is unset. Skip. continue; } $test_entry = new Test(); $test_entry->specimenId = $specimen_id_list[$i]; $specimen = Specimen::getById($specimen_id_list[$i]); $patient = Patient::getById($specimen->patientId); $result_values = array(); for ($j = 0; $j < $num_measures; $j++) { $result_values[] = $measure_list[$j][$i]; } $test_entry->result = implode(",", $result_values) . ","; $test_entry->comments = $comments_list[$i]; $test_entry->verifiedBy = $_SESSION['user_id']; $test_entry->dateVerified = date("Y-m-d H:i:s"); # TODO: Add checking of valid ranges before committing verification verify_and_update($test_type_id, $test_entry, $patient->getHashValue()); } ?> <div class='sidetip_nopos'> Results marked a verified