本文整理汇总了PHP中LabConfig::getById方法的典型用法代码示例。如果您正苦于以下问题:PHP LabConfig::getById方法的具体用法?PHP LabConfig::getById怎么用?PHP LabConfig::getById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LabConfig
的用法示例。
在下文中一共展示了LabConfig::getById方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dobToAge
public static function dobToAge($dob)
{
# Converts date of birth to age in years/months
/*
$today = date("m-d-Y");
$dob_array = explode("-", $dob); # gives Y-m-d
$dob_formatted = $dob_array[1]."-".$dob_array[2]."-".$dob_array[0];
$diff = round(floor(DateLib::dateDiff("-", $today, $dob_formatted)/365), 0);
if($diff >= 2)
{
return $diff." ".LangUtil::$generalTerms['YEARS'];
}
else
{
$diff = round(floor(DateLib::dateDiff("-", $today, $dob_formatted)/30), 0);
if($diff >= 2)
{
return "$diff ".LangUtil::$generalTerms['MONTHS'];
}
else
{
$diff = round(floor(DateLib::dateDiff("-", $today, $dob_formatted)%31), 0);
return "$diff ".LangUtil::$generalTerms['DAYS'];
}
}
*/
$labConfig = LabConfig::getById($_SESSION['lab_config_id']);
$today = date('Y-m-d');
$diff = abs(strtotime($today) - strtotime($dob));
# explode below gives Y-m-d (Required, because the difference function to get years, months & days is approximate.
# Therefore if current day is same as dob day, do display days.
$dob_array = explode("-", $dob);
$today_array = explode("-", $today);
$value = "";
$years = floor($diff / (365 * 60 * 60 * 24));
if ($years >= $labConfig->ageLimit) {
$value .= $years . " " . LangUtil::$generalTerms['YEARS'];
} else {
$months = floor(($diff - $years * 365 * 60 * 60 * 24) / (30 * 60 * 60 * 24));
$days = floor(($diff - $years * 365 * 60 * 60 * 24 - $months * 30 * 60 * 60 * 24) / (60 * 60 * 24));
if ($years > 0) {
$value .= $years . " " . LangUtil::$generalTerms['YEARS'];
}
if ($months > 0) {
if ($years > 0) {
$value .= ", ";
}
$value .= $months . " " . LangUtil::$generalTerms['MONTHS'];
}
if ($dob_array[2] != $today_array[2]) {
if ($days > 0) {
if ($months > 0 || $years > 0) {
$value .= ", ";
}
$value .= $days . " " . LangUtil::$generalTerms['DAYS'] . " ";
}
}
}
return $value;
}
示例2: generate_worksheet_config
function generate_worksheet_config($lab_config_id)
{
$lab_config = LabConfig::getById($lab_config_id);
$test_ids = $lab_config->getTestTypeIds();
$saved_db = DbUtil::switchToLabConfig($lab_config_id);
foreach ($test_ids as $test_id) {
$test_entry = TestType::getById($test_id);
$query_string = "SELECT * FROM report_config WHERE test_type_id={$test_id} LIMIT 1";
$record = query_associative_one($query_string);
if ($record == null) {
# Add new entry
$query_string_add = "INSERT INTO report_config (" . "test_type_id, header, footer, margins, " . "p_fields, s_fields, t_fields, p_custom_fields, s_custom_fields " . ") VALUES (" . "'{$test_id}', 'Worksheet - " . $test_entry->name . "', '', '5,0,5,0', " . "'0,1,0,1,1,0,0', '0,0,1,1,0,0', '1,0,1,0,0,0,0,1', '', '' " . ")";
query_insert_one($query_string_add);
}
}
DbUtil::switchRestore($saved_db);
}
示例3: displayForbiddenMessage
<?php
#
# Updates options to use or hide non-mandatory fields for specimens and patients
# Called via Ajax from lab_config_home.php
#
include "../users/accesslist.php";
if (!(isAdmin(get_user_by_id($_SESSION['user_id'])) && in_array(basename($_SERVER['PHP_SELF']), $adminPageList)) && !(isSuperAdmin(get_user_by_id($_SESSION['user_id'])) && in_array(basename($_SERVER['PHP_SELF']), $superAdminPageList)) && !(isCountryDir(get_user_by_id($_SESSION['user_id'])) && in_array(basename($_SERVER['PHP_SELF']), $countryDirPageList))) {
displayForbiddenMessage();
}
$saved_session = SessionUtil::save();
$lab_config = LabConfig::getById($_REQUEST['lab_config_id']);
if ($lab_config == null) {
SessionUtil::restore($saved_session);
return;
}
# Patient related fields
$use_pid = 0;
$use_addl_id_patient = 0;
$mand_addl_id_patient = 0;
$use_daily_num = 0;
$mand_daily_num = 0;
$use_pname = 0;
$mand_pname = 0;
$use_sex = 0;
$use_age = 0;
$mand_age = 0;
$use_dob = 0;
$mand_age = 0;
$ageLimit = 5;
//$show_pname = 1;
示例4: getDiseaseTotal
}
}
}
}
}
#
# Disease Report related functions
# Called from report_disease.php
#
public static function getDiseaseTotal($lab_config, $test_type, $date_from, $date_to)
{
# Returns the total number of tests performed during the given date range
$query_string = "SELECT COUNT(*) AS val FROM test t, specimen sp " . "WHERE t.test_type_id={$test_type->testTypeId} " . "AND t.specimen_id=sp.specimen_id " . "AND t.result <> '' " . "AND (sp.date_collected BETWEEN '{$date_from}' AND '{$date_to}')";
$saved_db = DbUtil::switchToLabConfig($lab_config->id);
$resultset = query_associative_all($query_string, $row_count);
DbUtil::switchRestore($saved_db);
return $resultset[0]['val'];
}
public static function setDiseaseSetList($lab_config, $test_type, $date_from, $date_to, $multipleCount = 0)
{
# Initializes diseaseSetList for capturing params
if ($multipleCount == 0) {
StatsLib::$diseaseSetList = array();
}
$query_string = "SELECT t.result AS result_value, " . "p.sex AS patient_gender, " . "p.patient_id AS patient_id " . "FROM test t, specimen sp, patient p " . "WHERE t.specimen_id=sp.specimen_id " . "AND t.result <> '' " . "AND t.test_type_id={$test_type->testTypeId} " . "AND (sp.date_collected BETWEEN '{$date_from}' AND '{$date_to}') " . "AND sp.patient_id=p.patient_id";
$saved_db = DbUtil::switchToLabConfig($lab_config->id);
$resultset = query_associative_all($query_string, $row_count);
$measure_list = $test_type->getMeasureIds();
if (count($resultset) == 0 || $resultset == null) {
DbUtil::switchRestore($saved_db);
return;
}
foreach ($resultset as $record) {
$patient_id = $record['patient_id'];
$patient = Patient::getById($patient_id);
$current_set = new DiseaseSet();
$current_set->resultValues = array();
$result_csv_parts = explode(",", $record['result_value']);
# Build assoc list for result values
## Format: resultValues[measure_id] = result_value
for ($i = 0; $i < count($measure_list); $i++) {
$result_part = $result_csv_parts[$i];
if (trim($result_part) == "") {
continue;
}
$curr_measure_id = $measure_list[$i];
$current_set->resultValues[$curr_measure_id] = $result_part;
}
示例5: unset
$stat_lists[] = $stat_list;
unset($stat_list);
}
} else {
if ($test_type_id != 0 && count($lab_config_ids) == 1) {
$lab_config = get_lab_config_by_id($lab_config_id);
$test_type_id = $testIds[$lab_config->id];
$labName = $lab_config->name;
$namesArray[] = $labName;
$stat_list = StatsLib::getTatMonthlyProgressionStats($lab_config, $test_type_id, $date_from, $date_to, $include_pending);
ksort($stat_list);
$stat_lists[] = $stat_list;
} else {
if ($test_type_id != 0 && count($lab_config_ids) > 1) {
foreach ($lab_config_ids as $key) {
$lab_config = LabConfig::getById($key);
$test_type_id = $testIds[$lab_config->id];
$namesArray[] = $lab_config->name;
$stat_list = StatsLib::getTatMonthlyProgressionStats($lab_config, $test_type_id, $date_from, $date_to, $include_pending);
ksort($stat_list);
$stat_lists[] = $stat_list;
unset($stat_list);
}
}
}
}
}
}
}
$progressData = array();
foreach ($stat_lists as $stat_list) {
示例6: get_lab_config_test_types
function get_lab_config_test_types($lab_config_id, $to_global = false)
{
## Moved to LabConfig::getTestTypeIds();
global $con;
$lab_config_id = mysql_real_escape_string($lab_config_id, $con);
$lab_config = LabConfig::getById($lab_config_id);
return $lab_config->getTestTypeIds();
}
示例7: getPatientSearchAttribSelect
public function getPatientSearchAttribSelect($hide_patient_name=false)
{
$userrr = get_user_by_id($_SESSION['user_id']);
global $LIS_TECH_RO, $LIS_TECH_RW, $LIS_CLERK;
if
(
$_SESSION['user_level'] == $LIS_TECH_RO ||
$_SESSION['user_level'] == $LIS_TECH_RW ||
$_SESSION['user_level'] == $LIS_CLERK ||
$_SESSION['user_level'] == $LIS_PHYSICIAN
)
{
$lab_config = LabConfig::getById($_SESSION['lab_config_id']);
$patientBarcodeSearch = patientSearchBarcodeCheck();
if($hide_patient_name === false && $lab_config->pname != 0)
{
?>
<option value='1'><?php echo LangUtil::$generalTerms['PATIENT_NAME']; ?></option>
<?php
}
if($lab_config->dailyNum == 1 || $lab_config->dailyNum == 11 || $lab_config->dailyNum == 2 || $lab_config->dailyNum == 12)
{
?>
<option value='3'><?php echo LangUtil::$generalTerms['PATIENT_DAILYNUM']; ?></option>
<?php
}
if($lab_config->pid != 0)
{
?>
<option value='0'><?php echo LangUtil::$generalTerms['PATIENT_ID']; ?></option>
<?php
}
if($lab_config->patientAddl != 0)
{
?>
<option value='2'><?php echo LangUtil::$generalTerms['ADDL_ID']; ?></option>
<?php
}
if($patientBarcodeSearch != 0 && is_country_dir($userrr) != 1 && is_super_admin($userrr) != 1 )
{
?>
<option value='9'><?php echo 'Barcode Search'; ?></option>
<?php
}
}
else if(User::onlyOneLabConfig($_SESSION['user_id'], $_SESSION['user_level']))
{
# Lab admin
$lab_config_list = get_lab_configs($_SESSION['user_id']);
$lab_config = $lab_config_list[0];
$patientBarcodeSearch = patientSearchBarcodeCheck();
if($lab_config->pname != 0)
{
?>
<option value='1'><?php echo LangUtil::$generalTerms['PATIENT_NAME']; ?></option>
<?php
}
if($lab_config->dailyNum == 1 || $lab_config->dailyNum == 11 || $lab_config->dailyNum == 2 || $lab_config->dailyNum == 12)
{
?>
<option value='3'><?php echo LangUtil::$generalTerms['PATIENT_DAILYNUM']; ?></option>
<?php
}
if($lab_config->pid != 0)
{
?>
<option value='0'><?php echo LangUtil::$generalTerms['PATIENT_ID']; ?></option>
<?php
}
if($lab_config->patientAddl != 0)
{
?>
<option value='2'><?php echo LangUtil::$generalTerms['ADDL_ID']; ?></option>
<?php
}
if($patientBarcodeSearch != 0 && is_country_dir($userrr) != 1 && is_super_admin($userrr) != 1 )
{
?>
<option value='9'><?php echo 'Barcode Search'; ?></option>
<?php
}
}
else
{
$patientBarcodeSearch = patientSearchBarcodeCheck();
# Show all options
?>
<option value='1'><?php echo LangUtil::$generalTerms['PATIENT_NAME']; ?></option>
<option value='3'><?php echo LangUtil::$generalTerms['PATIENT_DAILYNUM']; ?></option>
<option value='0'><?php echo LangUtil::$generalTerms['PATIENT_ID']; ?></option>
<option value='2'><?php echo LangUtil::$generalTerms['ADDL_ID']; ?></option>
<?php
if($patientBarcodeSearch != 0 && is_country_dir($userrr) != 1 && is_super_admin($userrr) != 1 ){ ?>
<option value='9'><?php echo 'Barcode Search'; ?></option>
<?php } ?>
<?php
}
//.........这里部分代码省略.........
示例8: get_tat_data_per_test_per_lab_dir
function get_tat_data_per_test_per_lab_dir($test_type_id, $lab_config_id, $date_from, $date_to, $include_pending)
{
global $DEFAULT_PENDING_TAT;
# Default TAT value for pending tests (in days)
$lab_config = LabConfig::getById($lab_config_id);
date_default_timezone_set('UTC');
$saved_db = DbUtil::switchToLabConfig($lab_config->id);
$resultset = get_completed_tests_by_type($test_type_id, $date_from, $date_to);
# {resultentry_ts, specimen_id, date_collected_ts}
$progression_val = array();
$progression_count = array();
$cc = 1;
//$percentile_tofind = 90;
//$percentile_count = array();
//$goal_val = array();
# Return {week=>[avg tat, percentile tat, goal tat, [overdue specimen_ids], [pending specimen_ids]]}
echo "!" . $date_to . "!";
$from_e = explode('-', $date_from);
$to_e = explode('-', $date_to);
$start_ts = mktime(1, 1, 1, $from_e[1], $from_e[2], $from_e[0]);
$end_ts = mktime(1, 1, 1, $to_e[1], $to_e[2], $to_e[0]);
$week_start_ts = date("W", $start_ts);
$year_start_ts = date("Y", $start_ts);
$startingWeek = week_to_date2($week_start_ts, $year_start_ts);
$week_end_ts = date("W", $end_ts);
$year_end_ts = date("Y", $end_ts);
$endingWeek = week_to_date2($week_end_ts, $year_end_ts);
$weekDiff = mktime(1, 1, 1, 1, 1, 2000) - mktime(1, 1, 1, 1, 10, 2000);
$wc = 0;
$currentWeek = $startingWeek;
$currentTS = $startingWeek;
echo "sTS=" . $startingWeek;
echo "cTS=" . $endingWeek;
while ($currentWeek != $endingWeek) {
$wc++;
$currentTS = $currentTS + $weekDiff;
$week_currentTS = date("W", $currentTS);
$year_currentTS = date("Y", $currentTS);
$currentWeek = week_to_date2($week_currentTS, $year_currentTS);
$progression_count[$currentWeek] = 0;
$progression_val[$currentWeek] = 0;
$wc++;
}
echo "WC=" . $wc;
foreach ($resultset as $record) {
$date_collected = $record['date_collected'];
$week_collected = date("W", $date_collected);
$year_collected = date("Y", $date_collected);
$week_ts = week_to_date2($week_collected, $year_collected);
$week_ts_datetime = date("Y-m-d H:i:s", $week_ts);
$date_ts = $record['ts'];
$date_diff = $date_ts - $date_collected;
if ($date_diff < 0) {
$date_diff = 0;
}
//if(!isset($progression_val[$week_ts])) {
if ($progression_val[$week_ts] == 0) {
//$progression_val[$week_ts] = array();
$progression_val[$week_ts] = $date_diff;
//$percentile_count[$week_ts] = array();
//$percentile_count[$week_ts][] = $date_diff;
$progression_count[$week_ts] = 1;
//$goal_tat[$week_ts] = $lab_config->getGoalTatValue($test_type_id, $week_ts_datetime);
//$progression_val[$week_ts][3] = array();
//$progression_val[$week_ts][4] = array();
} else {
$progression_val[$week_ts] += $date_diff;
//$percentile_count[$week_ts][] = $date_diff;
$progression_count[$week_ts] += 1;
//$formattedValue = round($value[0],2);
//$formattedDate = bcmul($key,1000);
//ksort($stat_list);
}
}
if ($include_pending === true) {
$pending_tat_value = $lab_config->getPendingTatValue();
# in hours
# Update the above list {week=>[avg tat, percentile tat, goal tat, [overdue specimen_ids], [pending specimen_ids]]}
# For pending tests in this time duration
$resultset_pending = get_pendingtat_tests_by_type($test_type_id, $date_from, $date_to);
$num_pending = count($resultset_pending);
foreach ($resultset_pending as $record) {
$date_collected = $record['date_collected'];
$week_collected = date("W", $date_collected);
$year_collected = date("Y", $date_collected);
$week_ts = week_to_date2($week_collected, $year_collected);
$week_ts_datetime = date("Y-m-d H:i:s", $week_ts);
$date_ts = $record['ts'];
$date_diff = $pending_tat_value * 60 * 60;
if (!isset($progression_val[$week_ts])) {
//$progression_val[$week_ts] = array();
$progression_val[$week_ts] = $date_diff;
//$percentile_count[$week_ts] = array();
//$percentile_count[$week_ts][] = $date_diff;
$progression_count[$week_ts] = 1;
//$goal_tat[$week_ts] = $lab_config->getGoalTatValue($test_type_id, $week_ts_datetime);
//$progression_val[$week_ts][3] = array();
//$progression_val[$week_ts][4] = array();
} else {
if ($date_diff > 0) {
//.........这里部分代码省略.........
示例9: publishDates
}
} else {
if ($reportType == "Prevalence") {
publishDates($date_from, $date_to);
$stat_list = array();
$retval = array();
$existing_stat_list = array();
$testName = null;
for ($i = 0; $i < count($lab_config_id_array); $i++) {
$labIdTestTypeIdSeparated = explode(":", $lab_config_id_array[$i]);
$lab_config_id = $labIdTestTypeIdSeparated[0];
$test_type_id = $labIdTestTypeIdSeparated[1];
$retval = StatsLib::getDiscreteInfectionStatsAggregate($lab_config_id, $date_from, $date_to, $test_type_id);
$existing_stat_list = $stat_list;
$stat_list = array_merge($existing_stat_list, $retval);
$lab_config = LabConfig::getById($lab_config_id);
$labName = $lab_config->name;
$labNamesArray[] = $labName;
getWeeklyStats($lab_config, $test_type_id, $date_from, $date_to);
if (!$testName) {
$saved_db = DbUtil::switchToLabConfig($lab_config_id);
$testName = get_test_name_by_id($test_type_id);
DbUtil::switchRestore($saved_db);
}
if (count($stat_list) == 0) {
?>
<div class='sidetip_nopos'>
<?php
echo LangUtil::$pageTerms['TIPS_NODISCRETE'];
?>
</div>
示例10: get_last_import_date
if (is_numeric($file_name_parts[1])) {
$count++;
}
if (is_numeric($file_name_parts[1])) {
$last = get_last_import_date(intval($file_name_parts[1]));
if (isset($last)) {
$last = date('F j, Y g:i a', strtotime($last));
} else {
$last = 'Never';
}
} else {
$last = "Unknown";
}
$lname = "Unknown";
if (is_numeric($file_name_parts[1])) {
$lab_obj = LabConfig::getById(intval($file_name_parts[1]));
if (isset($lab_obj)) {
$lname = $lab_obj->name;
}
}
?>
<table>
<tr>
<td>File name: </td>
<td><?php
echo $file_name_and_extension[0];
?>
</td>
</tr>
<tr>
示例11: getPatientFieldsOrderForm
public function getPatientFieldsOrderForm()
{
global $SYSTEM_PATIENT_FIELDS;
?>
<table cellspacing='5px' class='smaller_font'>
<tr valign='top'>
<td><b><?php echo LangUtil::$generalTerms['PATIENT_FIELDS']?></b></td>
<td></td>
<td><b><?php echo LangUtil::$generalTerms['PATIENT_ORDERED_FIELDS']?></b></td>
<td></td>
</tr>
<?php # Patient main fields ?>
<tr valign='top'>
<td>
<input type="hidden" id="p_fields_left" name="p_fields_left" />
<input type="hidden" id="o_fields_left" name="o_fields_left" />
<select id="p_fields" name="p_fields" size="15" onchange="javascript:setSel(this);">
<?php
$combined_fields =$SYSTEM_PATIENT_FIELDS;
$lab_config = LabConfig::getById($_SESSION['lab_config_id']);
if( $lab_config ) {
$custom_field_list = $lab_config->getPatientCustomFields();
foreach($custom_field_list as $custom_field)
{
$custom_array = array ("p_custom_$custom_field->id" => $custom_field->fieldName);
$combined_fields = array_merge($combined_fields,$custom_array);
}
}
$record=Patient::getReportfieldsOrder();
if(!is_array($record))
{
foreach ($combined_fields as $field=>$text)
{?>
<option value="<?php echo $field ?>"><?php if(!stristr($field,"custom")) echo LangUtil::$generalTerms[$text]; else
echo $text;?></option>
<?php
}
}
else
{
$unordered=explode(",",$record['p_fields']);
foreach( $unordered as $field)
{
?>
<option value="<?php echo $field ?>"><?php
if(!stristr($field,"custom"))
echo LangUtil::$generalTerms[$combined_fields[$field]];
else
echo $combined_fields[$field];?></option>
<?php
}
}
?>
</select>
</td>
<td valign="middle">
<input type="button" name="AddOrder" id="AddOrder" value=">" disabled="disabled" onclick="javascript:setOrder();"/>
<input type="button" name="RemOrder" id="RemOrder" value="<" disabled="disabled" onclick="javascript:remOrder();" />
</td>
<td><select id="o_fields" name="o_fields" size="15" onchange="javascript:setSel(this);">
<?php
if(is_array($record))
{
$ordered=explode(",",$record['o_fields']);
foreach( $ordered as $field)
{
?>
<option value="<?php echo $field ?>"><?php
if(!stristr($field,"custom"))
echo LangUtil::$generalTerms[$combined_fields[$field]];
else
echo $combined_fields[$field];?></option>
<?php
}
}
?>
</select>
</td>
<td valign="middle">
<input type="button" id="o_up" name="o_up" value="ʌ" onclick="javascript:reorder('up');"/><br />
<input type="button" id="o_down" name="o_down" value="v" onclick="javascript:reorder('down');" />
</td>
</tr>
<tr>
<td> <br /> <input type='button' value='<?php echo LangUtil::$generalTerms['CMD_SUBMIT']; ?>' id='ordered_fields_submit' onclick='javascript:submit_ordered_fields_form();'>
</input><small>
<a href='lab_config_home.php?id=<?php echo $lab_config->id; ?>'>
<?php echo LangUtil::$generalTerms['CMD_CANCEL']; ?>
</a>
</small>
</td>
<td>
<span id='ordered_fields_submit_progress' style='display:none;'>
<?php $this->getProgressSpinner(LangUtil::$generalTerms['CMD_SUBMITTING']); ?>
//.........这里部分代码省略.........
示例12: getPatientSearchAttribSelect
public function getPatientSearchAttribSelect($hide_patient_name = false)
{
global $LIS_TECH_RO, $LIS_TECH_RW, $LIS_CLERK;
if ($_SESSION['user_level'] == $LIS_TECH_RO || $_SESSION['user_level'] == $LIS_TECH_RW || $_SESSION['user_level'] == $LIS_CLERK || $_SESSION['user_level'] == $LIS_PHYSICIAN) {
$lab_config = LabConfig::getById($_SESSION['lab_config_id']);
if ($hide_patient_name === false && $lab_config->pname != 0) {
?>
<option value='1'><?php
echo LangUtil::$generalTerms['PATIENT_NAME'];
?>
</option>
<?php
}
if ($lab_config->dailyNum != 0) {
?>
<option value='3'><?php
echo LangUtil::$generalTerms['PATIENT_DAILYNUM'];
?>
</option>
<?php
}
if ($lab_config->pid != 0) {
?>
<option value='0'><?php
echo LangUtil::$generalTerms['PATIENT_ID'];
?>
</option>
<?php
}
if ($lab_config->patientAddl != 0) {
?>
<option value='2'><?php
echo LangUtil::$generalTerms['ADDL_ID'];
?>
</option>
<?php
}
} else {
if (User::onlyOneLabConfig($_SESSION['user_id'], $_SESSION['user_level'])) {
# Lab admin
$lab_config_list = get_lab_configs($_SESSION['user_id']);
$lab_config = $lab_config_list[0];
if ($lab_config->pname != 0) {
?>
<option value='1'><?php
echo LangUtil::$generalTerms['PATIENT_NAME'];
?>
</option>
<?php
}
if ($lab_config->dailyNum != 0) {
?>
<option value='3'><?php
echo LangUtil::$generalTerms['PATIENT_DAILYNUM'];
?>
</option>
<?php
}
if ($lab_config->pid != 0) {
?>
<option value='0'><?php
echo LangUtil::$generalTerms['PATIENT_ID'];
?>
</option>
<?php
}
if ($lab_config->patientAddl != 0) {
?>
<option value='2'><?php
echo LangUtil::$generalTerms['ADDL_ID'];
?>
</option>
<?php
}
} else {
# Show all options
?>
<option value='1'><?php
echo LangUtil::$generalTerms['PATIENT_NAME'];
?>
</option>
<option value='3'><?php
echo LangUtil::$generalTerms['PATIENT_DAILYNUM'];
?>
</option>
<option value='0'><?php
echo LangUtil::$generalTerms['PATIENT_ID'];
?>
</option>
<option value='2'><?php
echo LangUtil::$generalTerms['ADDL_ID'];
?>
</option>
<?php
}
}
}
示例13: processWeeklyTrends
function processWeeklyTrends($lab_config_id, $test_type_id, $date_from, $date_to, $test_name = null)
{
global $namesArray;
global $stat_list;
# All Tests & All Labs */
if ($test_type_id == 0 && $lab_config_id == 0) {
$site_list = get_site_list($_SESSION['user_id']);
$userId = $_SESSION['user_id'];
$saved_db = DbUtil::switchToGlobal();
$query = "SELECT * FROM test_mapping WHERE user_id = {$userId}";
$resultset = query_associative_all($query, $row_count);
foreach ($resultset as $record) {
$labIdTestIds = explode(';', $record['lab_id_test_id']);
foreach ($labIdTestIds as $labIdTestId) {
$labIdTestId = explode(':', $labIdTestId);
$labId = $labIdTestId[0];
$testId = $labIdTestId[1];
$test_type_list_all[$labId][] = $testId;
$test_type_names[$labId][] = $record['test_name'];
}
}
DbUtil::switchRestore($saved_db);
foreach ($site_list as $key => $value) {
$lab_config = LabConfig::getById($key);
$test_type_list = array();
$test_type_list = $test_type_list_all[$key];
$testNames = $test_type_names[$key];
$saved_db = DbUtil::switchToLabConfig($lab_config->id);
$testCount = -1;
foreach ($test_type_list as $test_type_id) {
$query_string = "SELECT COUNT(*) AS count_val FROM test t, specimen s " . "WHERE t.test_type_id={$test_type_id} " . "AND t.specimen_id=s.specimen_id " . "AND result!=''" . "AND ( s.date_collected BETWEEN '{$date_from}' AND '{$date_to}' )";
$record = query_associative_one($query_string);
$count_all = intval($record['count_val']);
$testCount++;
if ($count_all == 0) {
continue;
}
$namesArray[] = $lab_config->name . " - " . $testNames[$testCount];
getWeeklyStats($lab_config, $test_type_id, $date_from, $date_to);
}
}
} else {
if ($test_type_id == 0 && count($lab_config_id) == 1) {
$lab_config = LabConfig::getById($lab_config_id[0]);
$test_type_list = get_discrete_value_test_types($lab_config);
foreach ($test_type_list as $test_type_id) {
$namesArray[] = get_test_name_by_id($test_type_id, $lab_config_id[0]);
getWeeklyStats($lab_config, $test_type_id, $date_from, $date_to);
}
} else {
if ($test_type_id == 0 && count($lab_config_id) > 1) {
$userId = $_SESSION['user_id'];
$saved_db = DbUtil::switchToGlobal();
$query = "SELECT * FROM test_mapping WHERE user_id = {$userId}";
$resultset = query_associative_all($query, $row_count);
foreach ($resultset as $record) {
$labIdTestIds = explode(';', $record['lab_id_test_id']);
foreach ($labIdTestIds as $labIdTestId) {
$labIdTestId = explode(':', $labIdTestId);
$labId = $labIdTestId[0];
$testId = $labIdTestId[1];
$test_type_list_all[$labId][] = $testId;
$test_type_names[$labId][] = $record['test_name'];
}
}
DbUtil::switchRestore($saved_db);
foreach ($lab_config_id as $key) {
$lab_config = LabConfig::getById($key);
$test_type_list = array();
$test_type_list = $test_type_list_all[$key];
$testNames = $test_type_names[$key];
$saved_db = DbUtil::switchToLabConfig($lab_config->id);
$testCount = -1;
foreach ($test_type_list as $test_type_id) {
$query_string = "SELECT COUNT(*) AS count_val FROM test t, specimen s " . "WHERE t.test_type_id={$test_type_id} " . "AND t.specimen_id=s.specimen_id " . "AND result!=''" . "AND ( s.date_collected BETWEEN '{$date_from}' AND '{$date_to}' )";
$record = query_associative_one($query_string);
$count_all = intval($record['count_val']);
$testCount++;
if ($count_all == 0) {
continue;
}
$namesArray[] = $lab_config->name . " - " . $testNames[$testCount];
getWeeklyStats($lab_config, $test_type_id, $date_from, $date_to);
}
}
} else {
/* Build Array Map with Lab Id as Key and Test Id as corresponding Value */
$labIdTestIds = explode(";", $test_type_id);
$testIds = array();
foreach ($labIdTestIds as $labIdTestId) {
$labIdTestIdsSeparated = explode(":", $labIdTestId);
$labId = $labIdTestIdsSeparated[0];
$testId = $labIdTestIdsSeparated[1];
$testIds[$labId] = $testId;
}
# Particular Test & All Labs
if ($test_type_id != 0 && $lab_config_id == 0) {
$site_list = get_site_list($_SESSION['user_id']);
foreach ($site_list as $key => $value) {
$lab_config = LabConfig::getById($key);
//.........这里部分代码省略.........
示例14: processWeeklyTrends
function processWeeklyTrends($lab_config_id, $test_type_id, $date_from, $date_to, $test_name = null)
{
global $namesArray;
global $stat_list;
$lab_config = LabConfig::getById($lab_config_id[0]);
$test_type_list = get_discrete_value_test_types($lab_config);
foreach ($test_type_list as $test_type_id) {
$namesArray[] = get_test_name_by_id($test_type_id, $lab_config_id[0]);
getWeeklyStats($lab_config, $test_type_id, $date_from, $date_to);
}
}
示例15: get_cumul_stats
function get_cumul_stats($lab_config_id, $test_type_id, $date_from, $date_to)
{
$lab_config = LabConfig::getById($lab_config_id);
$test_type = TestType::getById($test_type_id);
$measure_list = $test_type->getMeasures();
$site_settings = DiseaseReport::getByKeys($lab_config->id, 0, 0);
$age_group_list = $site_settings->getAgeGroupAsList();
?>
<table class='pretty_print' style='border-collapse: collapse;'>
<thead>
<tr valign='top'>
<th><?php
echo LangUtil::$generalTerms['TEST'];
?>
</th>
<th ><?php
echo LangUtil::$generalTerms['RESULTS'];
?>
</th>
<?php
if ($site_settings->groupByGender == 1) {
echo "<th >" . LangUtil::$generalTerms['GENDER'] . "</th>";
}
if ($site_settings->groupByAge == 1) {
echo "<th >" . LangUtil::$pageTerms['RANGE_AGE'] . "</th>";
for ($i = 1; $i < count($age_group_list); $i++) {
echo "<th >" . LangUtil::$pageTerms['RANGE_AGE'] . "</th>";
}
}
if ($site_settings->groupByGender == 1) {
echo "<th ></th>";
}
?>
<th ><?php
echo LangUtil::$pageTerms['TOTAL'];
?>
</th>
<th ><?php
echo LangUtil::$pageTerms['TOTAL_TESTS'];
?>
</th>
</tr>
<tr>
<th ></th>
<th ></th>
<?php
if ($site_settings->groupByGender == 1) {
echo "<th ></th>";
}
if ($site_settings->groupByAge == 1) {
foreach ($age_group_list as $age_slot) {
echo "<th>{$age_slot['0']}";
if (trim($age_slot[1]) == "+") {
echo "+";
} else {
echo " - {$age_slot['1']}";
}
echo "</th>";
}
}
if ($site_settings->groupByGender == 1) {
echo "<th >" . LangUtil::$pageTerms['TOTAL_MF'] . "</th>";
}
echo "<th ></th>";
echo "<th ></th>";
?>
<tr>
</thead>
<tbody>
<?php
StatsLib::setDiseaseSetList($lab_config, $test_type, $date_from, $date_to);
$measures = $test_type->getMeasures();
foreach ($measures as $measure) {
$male_total = array();
$female_total = array();
$cross_gender_total = array();
$curr_male_total = 0;
$curr_female_total = 0;
$curr_cross_gender_total = 0;
$disease_report = DiseaseReport::getByKeys($lab_config->id, $test_type->testTypeId, $measure->measureId);
if ($disease_report == null) {
# TODO: Check for error control
# Alphanumeric values. Hence entry not found.
//continue;
}
$is_range_options = true;
if (strpos($measure->range, "/") === false) {
$is_range_options = false;
}
$range_values = array();
if ($is_range_options) {
# Alphanumeric options
$range_values = explode("/", $measure->range);
} else {
# Numeric ranges: Fetch ranges configured for this test-type/measure from DB
$range_values = $disease_report->getMeasureGroupAsList();
}
?>
<tr valign='top'>
<td><?php
//.........这里部分代码省略.........