<?php # # Adds result for a single test # Called via ajax from results_entry.php # include "../includes/db_lib.php"; include "../includes/user_lib.php"; LangUtil::setPageId("results_entry"); $test_id = $_REQUEST['test_id']; $test_name = get_test_name_by_id($test_id); $test = Test::getById($test_id); $test_type = TestType::getById($test->testTypeId); $specimen_id = $_REQUEST['specimen_id']; $specimen = Specimen::getById($specimen_id); $patient = Patient::getById($specimen->patientId); $comment = $_REQUEST['comments']; $comment_1 = $_REQUEST['comments_1']; $dd_to = $_REQUEST['dd_to']; $mm_to = $_REQUEST['mm_to']; $yyyy_to = $_REQUEST['yyyy_to']; if ($comment !== "" && $comment_1 != "") { $comments = $comment . " , " . $comment_1; } else { if ($comment == "" && $comment_1 != "") { $comments = $comment_1; } else { if ($comment != "" && $comment_1 == "") { $comments = $comment; } }
'><?php $tests = get_all_tests_for_patient_and_date_range($_SESSION['pid'], "January 1, 1969", "today"); if (!empty($tests)) { ?> <table class='tablesorter' id='billing_popup_table' style="border-collapse: separate; width: 700px;"> <thead> <tr valign='top'> <th id='billing_popup_date' style='width: 75px;'>Test Date</th> <th id='billing_popup_name'>Test Name</th> <th id='billing_popup_specimen_type'>Specimen Type</th> <th id='billing_popup_cost'>Test Cost</th> <th id='billing_popup_select' style='width: 110px;'>Select for Billing</th> </tr> </thead><?php foreach ($tests as $test) { $test = Test::getById($test['test_id']); // We only loaded an id and timestamp, and we want more information. $specimen = Specimen::getById($test->specimenId); $testHasBeenBilled = Bill::hasTestBeenBilled($test->testId, $_SESSION['lab_config_id']); if ($testHasBeenBilled) { $style_string = "style='background-color:grey; color:white;'"; } else { $style_string = ""; } $cost = get_cost_of_test($test); ?> <tr> <td <?php echo $style_string; ?> ><?php
?> </div> <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(); ?>
public function getCostOfTest() { $test = Test::getById($this->testId); $cost = get_cost_of_test($test); $cost = $cost['amount']; return floatVal($cost); }