$patient_id = $_REQUEST['patient_id']; $test_result_list = array(); $patient = get_patient_by_id($patient_id); if ($patient == null) { // can't find patient infomation echo LangUtil::$generalTerms['PATIENT_ID'] . " {$patient_id} " . LangUtil::$generalTerms['MSG_NOTFOUND']; } else { $record_list = get_records_to_print($lab_config, $patient_id); foreach ($record_list as $value) { $test = $value[0]; $specimen = $value[1]; // get columns required for visualization $id = $test->testTypeId; $patient_name = $patient->name; $test_name = get_test_name_by_id($test->testTypeId); $test_date = get_test_date_by_id($test->testTypeId); $result = ""; if (trim($test->result) == "") { $result = ""; } else { if ($report_config->useMeasures == 1) { $result = $test->decodeResultWithoutMeasures(); } else { $result = $test->decodeResult(); } } // cleaning up results $result = str_replace(" ", " ", $result); $result = str_replace("<br><br>", ", ", $result); $result = str_replace("<br>", ", ", $result); $result = str_replace("<b>", "", $result);
function get_test_names_and_costs_from_ids($id_array) { $name_array = array(); $cost_array = array(); $ids = array(); if (!empty($id_array)) { foreach ($id_array as $id) { $test_type_id = get_test_type_id_from_test_id($id); $ids[] = $test_type_id; $name_array[] = get_test_name_by_id($test_type_id); $date = get_test_date_by_id($test_type_id); $cost = get_latest_cost_of_test_type($test_type_id); $cost_array[] = $cost; } } $ret_array = array(); $ret_array['costs'] = $cost_array; $ret_array['names'] = $name_array; return $ret_array; }