本文整理汇总了PHP中get_specimen_by_id函数的典型用法代码示例。如果您正苦于以下问题:PHP get_specimen_by_id函数的具体用法?PHP get_specimen_by_id怎么用?PHP get_specimen_by_id使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_specimen_by_id函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_records_to_print
function get_records_to_print($lab_config, $patient_id)
{
global $date_from, $date_to;
$retval = array();
if (isset($_REQUEST['ip']) && $_REQUEST['ip'] == 0) {
# Do not include pending tests
$query_string = "SELECT t.* FROM test t, specimen sp " . "WHERE t.result <> '' " . "AND t.specimen_id=sp.specimen_id " . "AND sp.patient_id={$patient_id} ";
if (isset($_REQUEST['yf'])) {
$query_string .= "AND (sp.date_collected BETWEEN '{$date_from}' AND '{$date_to}') ";
}
$query_string .= "ORDER BY sp.date_collected DESC";
} else {
# Include pending tests
$query_string = "SELECT t.* FROM test t, specimen sp " . "WHERE t.specimen_id=sp.specimen_id " . "AND sp.patient_id={$patient_id} ";
if (isset($_REQUEST['yf'])) {
$query_string .= "AND (sp.date_collected BETWEEN '{$date_from}' AND '{$date_to}') ";
}
$query_string .= "ORDER BY sp.date_collected DESC";
}
$resultset = query_associative_all($query_string, $row_count);
if (count($resultset) == 0 || $resultset == null) {
return $retval;
}
foreach ($resultset as $record) {
$test = Test::getObject($record);
$hide_patient_name = TestType::toHidePatientName($test->testTypeId);
if ($hide_patient_name == 1) {
$hidePatientName = 1;
}
$specimen = get_specimen_by_id($test->specimenId);
$retval[] = array($test, $specimen, $hide_patient_name);
}
return $retval;
}
示例2: get_records_to_print
function get_records_to_print($lab_config, $patient_id)
{
$retval = array();
# Include pending tests
$query_string = "SELECT t.* FROM test t, specimen sp " . "WHERE t.specimen_id=sp.specimen_id " . "AND sp.patient_id={$patient_id} ";
$resultset = query_associative_all($query_string, $row_count);
if (count($resultset) == 0 || $resultset == null) {
return $retval;
}
foreach ($resultset as $record) {
$test = Test::getObject($record);
$specimen = get_specimen_by_id($test->specimenId);
$retval[] = array($test, $specimen);
}
return $retval;
}
示例3: get_records_to_print
function get_records_to_print($lab_config, $patient_id, $specimen_id)
{
$retval = array();
$query_string = "SELECT * FROM test,specimen " . "WHERE specimen.specimen_id={$specimen_id} and test.specimen_id=specimen.specimen_id and specimen.patient_id={$patient_id}";
$resultset = query_associative_one($query_string);
if ($resultset == null) {
echo "hiral";
}
$test = Test::getObject($resultset);
$hide_patient_name = TestType::toHidePatientName($test->testTypeId);
if ($hide_patient_name == 1) {
$hidePatientName = 1;
}
$specimen = get_specimen_by_id($test->specimenId);
$retval[] = array($test, $specimen, $hide_patient_name);
return $retval;
}
示例4: foreach
echo "<td><br><br></td>";
}
if ($report_config->useVerifiedBy == 1) {
echo "<td><br><br></td>";
}
if ($report_config->useStatus == 1) {
echo "<td><br><br></td>";
}
?>
</tr>
<?php
}
} else {
foreach ($test_list as $test_entry) {
$specimen_id = $test_entry->specimenId;
$specimen = get_specimen_by_id($specimen_id);
$patient = Patient::getById($specimen->patientId);
$test = $test_entry;
?>
<tr valign='top'>
<?php
if ($report_config->usePatientId == 1) {
?>
<td><?php
echo $patient->getSurrogateId();
?>
</td>
<?php
}
if ($report_config->usePatientAddlId == 1) {
?>
示例5: getSpecimenInfo
public function getSpecimenInfo($sid)
{
# Returns HTML table displaying specimen info
$specimen = get_specimen_by_id($sid);
if($specimen == null)
{
?>
<div class='sidetip_nopos'>
<?php echo LangUtil::$generalTerms['ERROR'].": ".LangUtil::$generalTerms['SPECIMEN_ID']." ".LangUtil::$generalTerms['MSG_NOTFOUND']; ?>
</div>
<?php
return;
}
?>
<table class='hor-minimalist-b'>
<tbody>
<tr>
<td><u><?php echo LangUtil::$generalTerms['TYPE']; ?></u></td>
<td><?php echo get_specimen_name_by_id($specimen->specimenTypeId); ?></td>
</tr>
<?php
if($_SESSION['sid'] != 0)
{
?>
<tr valign='top' style='display:none;'>
<td><u>DB Key</u></td>
<td><?php echo $specimen->specimenId; ?></td>
</tr>
<?php
}
if($_SESSION['s_addl'] != 0)
{
?>
<tr>
<td><u><?php echo LangUtil::$generalTerms['SPECIMEN_ID']; ?></u></td>
<td><?php $specimen->getAuxId(); ?></td>
</tr>
<?php
}
if($_SESSION['dnum'] != 0)
{
?>
<tr>
<td><u><?php echo LangUtil::$generalTerms['PATIENT_DAILYNUM']; ?></u></td>
<td><?php echo $specimen->getDailyNum(); ?></td>
</tr>
<?php
}
?>
<tr valign='top'>
<td><u><?php echo LangUtil::$generalTerms['ACCESSION_NUM']; ?></u></td>
<td><?php echo $specimen->sessionNum; ?></td>
</tr>
<tr>
<td><u><?php echo LangUtil::$generalTerms['PATIENT']; ?></u></td>
<td>
<?php
$patient = Patient::getById($specimen->patientId);
echo $patient->getName()." (".$patient->sex." ".$patient->getAge().")";
?>
<a href='patient_profile.php?pid=<?php echo $specimen->patientId?>' title='Click to go to Patient Profile'>Profile</a>
</td>
</tr>
<tr>
<td><u><?php echo LangUtil::$generalTerms['R_DATE']; ?></u></td>
<td>
<?php echo DateLib::mysqlToString($specimen->dateRecvd); ?>
</td>
</tr>
<tr>
<td><u><?php echo LangUtil::$generalTerms['REGD_BY']; ?></u></td>
<td><?php echo get_username_by_id($specimen->userId); ?></td>
</tr>
<?php
if($_SESSION['comm'] != 0)
{
?>
<tr>
<td><u><?php echo LangUtil::$generalTerms['COMMENTS']; ?></u></td>
<td><?php echo $specimen->getComments(); ?></td>
</tr>
<?php
}
?>
<tr valign='top'>
<td><u><?php echo LangUtil::$generalTerms['TESTS']; ?></u></td>
<td><?php echo $specimen->getTestNames(); ?></td>
</tr>
<?php
if($_SESSION['doctor'] != 0)
{
?>
<tr>
<td><u><?php echo LangUtil::$generalTerms['DOCTOR']; ?></u></td>
<td>
<?php
if(trim($specimen->doctor) == "")
{
echo "-";
//.........这里部分代码省略.........
示例6: get_records_to_print
function get_records_to_print($lab_config, $patient_id)
{
global $date_from, $date_to, $LIS_DOCTOR;
$retval = array();
if (isset($_REQUEST['ip']) && $_REQUEST['ip'] == 0) {
# Do not include pending tests
$labsection = 0;
if (isset($_REQUEST['labsection'])) {
$labsection = $_REQUEST['labsection'];
}
if ($labsection == 0) {
$query_string = "SELECT t.* FROM test t, specimen sp " . "WHERE t.result <> '' " . "AND t.specimen_id=sp.specimen_id " . "AND sp.patient_id={$patient_id} ";
} else {
$query_string = "SELECT distinct t.* FROM test t, specimen sp, test_type tt, test_category tc " . "WHERE t.specimen_id=sp.specimen_id " . "AND t.result <> '' " . "AND sp.patient_id={$patient_id} " . "AND t.test_type_id = tt.test_type_id " . "AND tt.test_type_id in (select test_type_id from test_type where test_category_id = {$labsection})";
}
#Taking care of removal tests cases
$query_string .= " AND t.test_id not in (select distinct r_id from removal_record where `status` = 1) ";
if (isset($_REQUEST['yf'])) {
$query_string .= "AND (sp.date_collected BETWEEN '{$date_from}' AND '{$date_to}') ";
}
$query_string .= "ORDER BY sp.date_collected DESC";
} else {
# Include pending tests
$labsection = 0;
if (isset($_REQUEST['labsection'])) {
$labsection = $_REQUEST['labsection'];
}
if ($labsection == 0) {
$query_string = "SELECT t.* FROM test t, specimen sp " . "WHERE t.specimen_id=sp.specimen_id " . "AND sp.patient_id={$patient_id} ";
} else {
$query_string = "SELECT distinct t.* FROM test t, specimen sp, test_type tt, test_category tc " . "WHERE t.specimen_id=sp.specimen_id " . "AND sp.patient_id={$patient_id} " . "AND t.test_type_id = tt.test_type_id " . "AND tt.test_type_id in (select test_type_id from test_type where test_category_id = {$labsection})";
}
#Taking care of removal tests cases
$query_string .= " AND t.test_id not in (select distinct r_id from removal_record where `status` = 1) ";
if (isset($_REQUEST['yf'])) {
$query_string .= "AND (sp.date_collected BETWEEN '{$date_from}' AND '{$date_to}') ";
}
$query_string .= "ORDER BY sp.date_collected DESC";
}
$resultset = query_associative_all($query_string, $row_count);
if (count($resultset) == 0 || $resultset == null) {
return $retval;
}
foreach ($resultset as $record) {
$test = Test::getObject($record);
if ($_SESSION['user_level'] == $LIS_DOCTOR) {
if ($test->verifiedBy == 0) {
continue;
}
}
$hide_patient_name = TestType::toHidePatientName($test->testTypeId);
if ($hide_patient_name == 1) {
$hidePatientName = 1;
}
$specimen = get_specimen_by_id($test->specimenId);
$retval[] = array($test, $specimen, $hide_patient_name);
}
return $retval;
}
示例7: getSpecimenInfo
public function getSpecimenInfo($sid)
{
# Returns HTML table displaying specimen info
$specimen = get_specimen_by_id($sid);
//print_r($rem_specs);
if($specimen == null)
{
?>
<div class='sidetip_nopos'>
<?php echo LangUtil::$generalTerms['ERROR'].": ".LangUtil::$generalTerms['SPECIMEN_ID']." ".LangUtil::$generalTerms['MSG_NOTFOUND']; ?>
</div>
<?php
return;
}
$rem_recs = get_removed_specimens($_SESSION['lab_config_id'], "specimen");
$rem_specs = array();
$rem_remarks = array();
foreach($rem_recs as $rem_rec)
{
$rem_specs[] = $rem_rec['r_id'];
$rem_remarks[] = $rem_rec['remarks'];
}
?>
<script type="text/javascript">
function retrieve_deleted(sid, category){
var params = "item_id="+sid+"&ret_cat="+category;
$.ajax({
type: "POST",
url: "ajax/retrieve_deleted.php",
data: params,
success: function(msg) {
if(msg.indexOf("1")> -1){
location.href = location.href;
} else {
$("#target_div_id_del").html("Specimen cannot be Retrieved");
}
}
});
}
</script>
<table class='hor-minimalist-b'>
<tbody>
<tr>
<td><u><?php echo LangUtil::$generalTerms['TYPE']; ?></u></td>
<td><?php echo get_specimen_name_by_id($specimen->specimenTypeId); ?></td>
</tr>
<?php
if($_SESSION['sid'] != 0)
{
?>
<tr valign='top' style='display:none;'>
<td><u>DB Key</u></td>
<td><?php echo $specimen->specimenId; ?></td>
</tr>
<?php
}
if($_SESSION['s_addl'] != 0)
{
?>
<tr>
<td><u><?php echo LangUtil::$generalTerms['SPECIMEN_ID']; ?></u></td>
<td><?php $specimen->getAuxId(); ?></td>
</tr>
<?php
}
if($_SESSION['dnum'] != 0)
{
?>
<tr>
<td><u><?php echo LangUtil::$generalTerms['PATIENT_DAILYNUM']; ?></u></td>
<td><?php echo $specimen->getDailyNum(); ?></td>
</tr>
<?php
}
?>
<tr valign='top'>
<td><u><?php echo LangUtil::$generalTerms['ACCESSION_NUM']; ?></u></td>
<td><?php echo $specimen->sessionNum; ?></td>
</tr>
<tr>
<td><u><?php echo LangUtil::$generalTerms['PATIENT']; ?></u></td>
<td>
<?php
$patient = Patient::getById($specimen->patientId);
echo $patient->getName()." (".$patient->sex." ".$patient->getAge().")";
?>
<a href='patient_profile.php?pid=<?php echo $specimen->patientId?>' title='Click to go to Patient Profile'>Profile</a>
</td>
</tr>
//.........这里部分代码省略.........
示例8: get_specimen
public function get_specimen($specimen_id)
{
$spec = get_specimen_by_id($specimen_id);
if (count($spec) > 0) {
$ret = $spec;
} else {
$ret = 0;
}
return $ret;
}
示例9: add_results_random
function add_results_random($user_list = array())
{
# Adds random result entries for scheduled specimen
global $NUM_SPECIMENS, $F_PENDING, $SPECIMEN_ID_START;
$lab_config_id = $_SESSION['lab_config_id'];
//$specimens_to_handle = floor($NUM_SPECIMENS * (1-$F_PENDING));
$saved_db = DbUtil::switchToLabConfig($lab_config_id);
$num_specimens2 = query_num_rows("specimen");
DbUtil::switchRestore($saved_db);
$specimens_to_handle = floor($num_specimens2 * (1 - $F_PENDING));
//echo $specimens_to_handle." / ".$num_specimens2."<br>";
$count = 0;
$specimen_id_count = $SPECIMEN_ID_START;
while ($count < $specimens_to_handle) {
# Fetch random specimen
//$specimen_id = rand($SPECIMEN_ID_START, $SPECIMEN_ID_START + $NUM_SPECIMENS);
$specimen_id = $specimen_id_count;
//echo $specimen_id."<br>";
$specimen = get_specimen_by_id($specimen_id);
if ($specimen == null) {
# TODO:
}
$result_entry_ts = get_random_ts($specimen->dateCollected);
if ($specimen == null) {
# Specimen does not exist
//echo "Specimen does not exist<br>";
//$count++;
$specimen_id_count++;
continue;
}
$saved_db = DbUtil::switchToLabConfig($_SESSION['lab_config_id']);
$status_code = get_specimen_status($specimen_id);
DbUtil::switchRestore($saved_db);
if ($status_code == Specimen::$STATUS_DONE) {
# Results already entered
//echo "Results already entered<br>";
$count++;
$specimen_id_count++;
continue;
}
# Fetch tests scheduled for this specimen
$test_list = get_tests_by_specimen_id($specimen_id);
# For each test, fetch test measures and range from catalog
foreach ($test_list as $test) {
$measure_list = get_test_type_measures($test->testTypeId);
$result_entry = "";
foreach ($measure_list as $measure) {
$range = get_measure_range($measure);
# Select random result value
$result_val = get_random_range_value($range);
csv_append($result_val, $result_entry);
}
$test_id = $test->testId;
# Update result field in test entry
$saved_db = DbUtil::switchToLabConfig($lab_config_id);
# Select random technician as the one of entered this result
$user_id = 0;
if (count($user_list) != 0) {
$random_user_index = rand(1, count($user_list));
$random_user = $user_list[$random_user_index - 1];
$user_id = $random_user->userId;
}
add_test_result($test_id, $result_entry, "", "", $user_id, $result_entry_ts);
# Randomly this test result mark as verified or keep as unverified
# null or 0 => not verified, non-zero => verified.
if (with_probability(0.9)) {
$is_verified = 2;
$test->setVerifiedBy($is_verified);
}
DbUtil::switchRestore($saved_db);
}
$saved_db = DbUtil::switchToLabConfig($lab_config_id);
# Mark specimen as 'all tests done'
update_specimen_status($specimen_id);
# Randomly mark this specimen as reported or keep as unreported
if (with_probability(0.9)) {
$date_reported = date("Y-m-d H:i:s");
$specimen->setDateReported($date_reported);
}
DbUtil::switchRestore($saved_db);
# Update counters
$count++;
$specimen_id_count++;
}
}