当前位置: 首页>>代码示例>>PHP>>正文


PHP DbUtil::switchToLabConfigRevamp方法代码示例

本文整理汇总了PHP中DbUtil::switchToLabConfigRevamp方法的典型用法代码示例。如果您正苦于以下问题:PHP DbUtil::switchToLabConfigRevamp方法的具体用法?PHP DbUtil::switchToLabConfigRevamp怎么用?PHP DbUtil::switchToLabConfigRevamp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DbUtil的用法示例。


在下文中一共展示了DbUtil::switchToLabConfigRevamp方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_discrete_value_test_types

function get_discrete_value_test_types($lab_config)
{
    # Returns test type IDs for tests that have explicit P/N results
    $saved_db = DbUtil::switchToLabConfigRevamp($lab_config->id);
    $retval = array();
    $query_string = "SELECT DISTINCT test_type_id FROM test_type " . "WHERE test_type_id IN ( " . "SELECT test_type_id FROM lab_config_test_type " . "WHERE lab_config_id={$lab_config->id} " . " ) AND disabled=0";
    $resultset = query_associative_all($query_string, $row_count);
    foreach ($resultset as $record) {
        $test_type_id = $record['test_type_id'];
        $query_string2 = "SELECT DISTINCT ttm.test_type_id FROM test_type_measure ttm " . "WHERE ttm.measure_id IN ( " . "SELECT measure_id FROM measure " . "WHERE ( " . "range LIKE '%/N%' OR range LIKE '%N/%' OR " . "range LIKE '%/negative%' OR range LIKE '%negative/%' OR " . "range LIKE '%/negatif%' OR range LIKE '%negatif/%' OR " . "range LIKE '%/négatif%' OR range LIKE '%négatif/%' " . " ) " . " ) " . "AND ttm.test_type_id={$test_type_id}";
        $record2 = query_associative_one($query_string2);
        if ($record2 == null) {
            continue;
        }
        $retval[] = $record2['test_type_id'];
    }
    DbUtil::switchRestore($saved_db);
    return $retval;
}
开发者ID:nchopra,项目名称:C4G-BLIS,代码行数:19,代码来源:stats_lib.php

示例2: getById

 public static function getById($measure_id)
 {
     # Returns a test measure by ID
     $saved_db = DbUtil::switchToLabConfigRevamp();
     if ($measure_id == null || $measure_id < 0) {
         return null;
     }
     $query_string = "SELECT * FROM global_measures WHERE measure_id={$measure_id} LIMIT 1";
     $record = query_associative_one($query_string);
     DbUtil::switchRestore($saved_db);
     return GlobalMeasure::getObject($record);
 }
开发者ID:nchopra,项目名称:C4G-BLIS,代码行数:12,代码来源:db_lib.php

示例3: getSpecimenTypesCountryLevel

	public function getSpecimenTypesCountryLevel() {
		# Returns specimen types available for aggregation 
		$saved_db = DbUtil::switchToLabConfigRevamp();
		$user_id = $_SESSION['user_id'];
		$query = "SELECT * FROM specimen_mapping where user_id =".$user_id;
		$resultset = query_associative_all($query, $count);
		
		if( count($resultset) > 0 ) { ?>
			<table class='hor-minimalist-b'>
			<tbody>
			<th>#</th>
			<?php echo "<th>".LangUtil::$generalTerms['NAME']."</th>"; 
			foreach($resultset as $record) {
				echo "<tr><td>".$record['specimen_id']."</td><td>".$record['specimen_name']."</td></tr>";
			}
			?>
			</tbody>
			</table>
		<?php }
		else {
			echo "No Specimens Currently Added";
		}
		DbUtil::switchRestore($saved_db);
	}
开发者ID:jfurlong,项目名称:BLIS,代码行数:24,代码来源:page_elemsdff.php

示例4: remarks_db2xml

function remarks_db2xml($langdata_path, $lab_config_id)
{
    # Creates XML file from existing test measures (indicators) in catalog
    global $VERSION;
    $new_version = $VERSION;
    $handle = fopen($langdata_path . "remarks.xml", "w");
    $string_data = <<<EOF
<?xml version="1.0"?>
<measures version="{$new_version}">

EOF;
    fwrite($handle, $string_data);
    $saved_db = DbUtil::switchToLabConfigRevamp($lab_config_id);
    $query_string = "SELECT * FROM measure";
    $resultset = query_associative_all($query_string, $row_count);
    foreach ($resultset as $record) {
        $curr_measure = Measure::getObject($record);
        $id = $curr_measure->measureId;
        $descr = $curr_measure->name;
        $string_data = <<<EOF
\t<measure id="{$id}" descr="{$descr}">

EOF;
        fwrite($handle, $string_data);
        $range_type = $curr_measure->getRangeType();
        $range_values = $curr_measure->getRangeValues();
        if ($range_type == Measure::$RANGE_NUMERIC) {
            $lower_bound = htmlspecialchars($range_values[0]);
            $upper_bound = htmlspecialchars($range_values[1]);
            $string_data = <<<EOF
\t\t<range>
\t\t\t<key>{$range_values['0']}:{$range_values['1']}</key>
\t\t\t<value></value>
\t\t</range>

EOF;
            fwrite($handle, $string_data);
        } else {
            if ($range_type == Measure::$RANGE_OPTIONS) {
                foreach ($range_values as $range_value) {
                    $range_value_xml = htmlspecialchars($range_value);
                    $string_data = <<<EOF
\t\t<range>
\t\t\t<key>{$range_value_xml}</key>
\t\t\t<value></value>
\t\t</range>

EOF;
                    fwrite($handle, $string_data);
                }
            }
        }
        $string_data = <<<EOF
\t</measure>

EOF;
        fwrite($handle, $string_data);
    }
    $string_data = <<<EOF
</measures>

EOF;
    fwrite($handle, $string_data);
    fclose($handle);
    DbUtil::switchRestore($saved_db);
}
开发者ID:caseyi,项目名称:BLIS,代码行数:66,代码来源:lang_xml2php.php

示例5: query_associative_all

		"AND t.result <> ''";
	$test_records = query_associative_all($query_tests, $test_count);
	foreach($test_records as $test_record)
	{
		$test_entry = Test::getObject($test_record);
		$result_value = $test_entry->result.$patient_hash;
		$query_update =
			"UPDATE test SET result='$result_value' ".
			"WHERE test_id=$test_entry->testId";
		query_update($query_update);
	}
}*/
$saved_db = DbUtil::switchToLabConfigRevamp(127);
$query_string = "ALTER TABLE `blis_revamp_127`.`measure` CHANGE COLUMN `range` `range` VARCHAR(1000) NOT NULL";
mysql_query($query_string);
DbUtil::switchRestore($saved_db);
$saved_db = DbUtil::switchToLabConfigRevamp(128);
$query_string = "ALTER TABLE `blis_revamp_128`.`measure` CHANGE COLUMN `range` `range` VARCHAR(1000) NOT NULL";
mysql_query($query_string);
DbUtil::switchRestore($saved_db);
$saved_db = DbUtil::switchToLabConfigRevamp(129);
$query_string = "ALTER TABLE `blis_revamp_129`.`measure` CHANGE COLUMN `range` `range` VARCHAR(1000) NOT NULL";
mysql_query($query_string);
DbUtil::switchRestore($saved_db);
$saved_db = DbUtil::switchToLabConfigRevamp(131);
$query_string = "ALTER TABLE `blis_revamp_131`.`measure` CHANGE COLUMN `range` `range` VARCHAR(1000) NOT NULL";
mysql_query($query_string);
DbUtil::switchRestore($saved_db);
# Delete update.txt
unlink($update_txt);
$_SESSION['no_updates'] = 1;
开发者ID:caseyi,项目名称:BLIS,代码行数:31,代码来源:update_old.php


注:本文中的DbUtil::switchToLabConfigRevamp方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。