本文整理汇总了PHP中LabConfig类的典型用法代码示例。如果您正苦于以下问题:PHP LabConfig类的具体用法?PHP LabConfig怎么用?PHP LabConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LabConfig类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:caseyi,项目名称:BLIS,代码行数:60,代码来源:date_lib.php
示例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);
}
开发者ID:jfurlong,项目名称:BLIS,代码行数:17,代码来源:worksheet_config_generate.php
示例3: updateDatabase
function updateDatabase()
{
global $labConfigId, $DB_HOST, $DB_USER, $DB_PASS;
$country = strtolower(LabConfig::getUserCountry($labConfigId));
$saved_db = DbUtil::switchToCountry($country);
$currentDir = getcwd();
$mainBlisDir = substr($currentDir, $length, strpos($currentDir, "htdocs"));
//$blisLabBackupFilePath = "\"".$mainBlisDir.$backup_folder."\blis_".$lab_config_id."\blis_".$lab_config_id."_backup.sql\"";
$sqlFilePath = "\"" . $mainBlisDir . "htdocs\\export\\temp.sql\"";
$mysqlExePath = "\"" . $mainBlisDir . "server\\mysql\\bin\\mysql.exe\"";
$dbname = "blis_" . $country;
$command = $mysqlExePath . " -h {$DB_HOST} -P 7188 -u {$DB_USER} -p{$DB_PASS} {$dbname} < {$sqlFilePath}";
$command = "C: &" . $command;
//the C: is a useless command to prevent the original command from failing because of having more than 2 double quotes
echo $command;
system($command, $return_var);
if ($return_var == 0) {
echo "true";
} else {
echo "false";
}
DbUtil::switchRestore($saved_db);
}
开发者ID:caseyi,项目名称:BLIS,代码行数:23,代码来源:updateCountryDatabase.php
示例4: 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>
开发者ID:jfurlong,项目名称:BLIS,代码行数:31,代码来源:get_import_file_info.php
示例5: 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;
}
开发者ID:caseyi,项目名称:BLIS,代码行数:48,代码来源:stats_lib.php
示例6: 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;
开发者ID:nchopra,项目名称:C4G-BLIS,代码行数:31,代码来源:ofield_update.php
示例7: getById
public static function getById($lab_config_id)
{
$saved_db = DbUtil::switchToGlobal();
global $con;
//$lab_config_id = mysql_real_escape_string($lab_config_id, $con);
$query_config = "SELECT * FROM lab_config WHERE lab_config_id = {$lab_config_id} LIMIT 1";
$record = query_associative_one($query_config);
DbUtil::switchRestore($saved_db);
return LabConfig::getObject($record);
}
开发者ID:nchopra,项目名称:C4G-BLIS,代码行数:10,代码来源:db_lib.php
示例8: 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) {
开发者ID:jfurlong,项目名称:BLIS,代码行数:31,代码来源:tat_ttype_monthly.php
示例9: performBackup
public static function performBackup($lab_config_id, $currentDir, $include_langdata = true)
{
# Performs backup of current data for a lab
global $SERVER, $ON_ARC;
if ($SERVER == $ON_ARC) {
# System on arc2 server: Do not allow backup option
return false;
}
$file_list1 = array();
$file_list2 = array();
$file_list3 = array();
$DB_HOST = localhost;
$DB_USER = root;
$DB_PASS = blis123;
$mainBlisDir = substr($currentDir, $length, strpos($currentDir, "htdocs"));
$mysqldumpPath = "\"" . $mainBlisDir . "server\\mysql\\bin\\mysqldump.exe\"";
$dbname = "blis_" . $lab_config_id;
$backupLabDbFileName = "blis_" . $lab_config_id . "_backup.sql";
$count = 0;
$command = $mysqldumpPath . " -B -h {$DB_HOST} -P 7188 -u {$DB_USER} -p{$DB_PASS} {$dbname} > {$backupLabDbFileName}";
system($command, $return);
$file_list1[] = $backupLabDbFileName;
$dbname = "blis_revamp";
$backupDbFileName = "blis_revamp_backup.sql";
$command = $mysqldumpPath . " -B -h {$DB_HOST} -P 7188 -u {$DB_USER} -p{$DB_PASS} {$dbname} > {$backupDbFileName}";
system($command, $return);
$file_list2[] = $backupDbFileName;
$dir_name3 = "../../local/langdata_" . $lab_config_id;
if ($handle = opendir($dir_name3)) {
while (false !== ($file = readdir($handle))) {
if ($file === "." || $file == "..") {
continue;
}
$file_list3[] = $dir_name3 . "/{$file}";
}
}
$lab_config = LabConfig::getById($lab_config_id);
db_close();
$site_name = str_replace(" ", "-", $lab_config->getSiteName());
$destination = "../../blis_backup_" . $site_name . "_" . date("Ymd-Hi") . "/";
@mkdir($destination);
@mkdir($destination . "blis_revamp/");
@mkdir($destination . "blis_" . $lab_config_id . "/");
@mkdir($destination . "langdata_" . $lab_config_id . "/");
chmod($destination, 777);
foreach ($file_list1 as $file) {
$file_name_parts = explode("/", $file);
$target_file_name = $destination . "blis_" . $lab_config_id . "/" . $file_name_parts[count($file_name_parts) - 1];
$ourFileHandle = fopen($target_file_name, 'w') or die("can't open file");
fclose($ourFileHandle);
if (!copy($file, $target_file_name)) {
//echo "Error: $file $destination.$file <br>";
return false;
}
}
foreach ($file_list2 as $file) {
$file_name_parts = explode("/", $file);
if (!copy($file, $destination . "blis_revamp/" . $file_name_parts[count($file_name_parts) - 1])) {
//echo "Error: $file $destination.$file <br>";
return false;
}
}
foreach ($file_list3 as $file) {
$file_name_parts = explode("/", $file);
if (!copy($file, $destination . "langdata_" . $lab_config_id . "/" . $file_name_parts[count($file_name_parts) - 1])) {
//echo "Error: $file $destination.$file <br>";
return false;
}
}
# All okay
return true;
}
开发者ID:caseyi,项目名称:BLIS,代码行数:72,代码来源:backup_lib.php
示例10: 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
}
//.........这里部分代码省略.........
开发者ID:jfurlong,项目名称:BLIS,代码行数:101,代码来源:page_elemsdff.php
示例11: category
<?php
#
# Returns <option> tags for list of test types by category (section) and site
# Called via Ajax from reports.php
#
include "../includes/db_lib.php";
include "../includes/page_elems.php";
LangUtil::setPageId("general");
$page_elems = new PageElems();
$selvalue = $_REQUEST['type'];
?>
<option value='0'><?php
echo LangUtil::$generalTerms['ALL'];
//
?>
</option>
<?php
$lab_config = LabConfig::getById($_SESSION['lab_config_id']);
if ($selvalue == "p") {
$custom_field_list = $lab_config->getPatientCustomFields();
foreach ($custom_field_list as $custom_field) {
echo "<option value='p_" . $custom_field->id . "'>" . $custom_field->fieldName . "</option>";
}
} elseif ($selvalue == "s") {
$custom_field_list = $lab_config->getSpecimenCustomFields();
foreach ($custom_field_list as $custom_field) {
echo "<option value='s_" . $custom_field->id . "'>" . $custom_field->fieldName . "</option>";
}
}
开发者ID:caseyi,项目名称:BLIS,代码行数:30,代码来源:getcustomfields.php
示例12: explode
<?php
#
# Returns <option> tags for list of locations available for selection for a particular test
# Called via Ajax from reports.php
#
include "../includes/db_lib.php";
$selectValues = $_REQUEST['l'];
$labIdTestIdArr = explode(';', $selectValues);
$checkBoxName = $_REQUEST['checkBoxName'];
echo "<input type='checkbox' name='{$checkBoxName}' value='0'>" . LangUtil::$generalTerms['ALL'] . "</input>";
for ($i = 0; $i < count($labIdTestIdArr); $i++) {
$labIdTestId = explode(':', $labIdTestIdArr[$i]);
$labId = $labIdTestId[0];
$testId = $labIdTestId[1];
$lab_config = new LabConfig();
$record = $lab_config->getById($labId);
echo "<br><input type='checkbox' name='{$checkBoxName}' value={$labId}>{$record->name}</input>";
}
开发者ID:caseyi,项目名称:BLIS,代码行数:19,代码来源:locations_bytests.php
示例13: 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']); ?>
//.........这里部分代码省略.........
开发者ID:jfurlong,项目名称:BLIS,代码行数:101,代码来源:page_elems.php
示例14: 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
}
}
}
开发者ID:caseyi,项目名称:BLIS,代码行数:97,代码来源:page_elems_copy.php
示例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
//.........这里部分代码省略.........
开发者ID:caseyi,项目名称:BLIS,代码行数:101,代码来源:reports_print.php
示例16: 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);
//.........这里部分代码省略.........
开发者ID:jfurlong,项目名称:BLIS,代码行数:101,代码来源:report_prevalence_agg.php
示例17: 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);
}
}
开发者ID:caseyi,项目名称:BLIS,代码行数:11,代码来源:reports_infection.php
示例18: 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
|
请发表评论