Exemple #1
0
 public static function getById($patient_id)
 {
     # Returns patient record by ID
     $query_string = "SELECT * FROM patient WHERE patient_id={$patient_id}";
     $record = query_associative_one($query_string);
     //return 1;
     return Patient::getObject($record);
 }
#
# Returns a list of similar patient names
# To aid/help during new patient registration
#
include "../includes/db_lib.php";
LangUtil::setPageId("new_patient");
$q = $_REQUEST['q'];
$query_string = "SELECT * FROM patient " . "WHERE name LIKE '%{$q}%' ";
$resultset = query_associative_all($query_string, $row_count);
if (count($resultset) == 0 || $resultset == null) {
    return;
}
$patient_list = array();
foreach ($resultset as $record) {
    $patient_list[] = Patient::getObject($record);
}
?>
<table class='hor-minimalist-c' style='width:450px;'>
	<thead>
		<tr valign='top'>
			<th>
				<span style='background-color:#FFCC66'><?php 
echo LangUtil::$pageTerms['SIMILAR_NAMES'];
?>
</span>
			</th>
			<?php 
if ($_SESSION['pid'] != 0) {
    ?>
				<th><?php 
Exemple #3
0
            $testId = $labIdTestIdsSeparated[1];
            $testIds[$labId] = $testId;
        }
        foreach ($testRecords as $testRecord) {
            if ($testIds[$labConfigId] == $testRecord->testTypeId) {
                $testRecord->testTypeId = $testIds[$importLabConfigId];
            }
        }
    }
}
DbUtil::switchRestore($saved_db);
$saved_db = DbUtil::switchToLabConfig($importLabConfigId);
$querySelect = "SELECT * FROM patient " . "WHERE patient_id={$importPatientId}";
$record = query_associative_one($querySelect);
$patientName = $record['name'];
$patient = Patient::getObject($record);
$patient->createdBy = $_SESSION['user_id'];
DbUtil::switchRestore($saved_db);
add_patient($patient, true);
/*
$querySelect =
	"SELECT patient_id FROM patient ".
	"WHERE name like '$patientName' ";
$record = query_associative_one($querySelect);
$newPatientId = $record['patient_id'];
*/
/* Create New Specimen & Test Records */
$i = 0;
foreach ($specimenRecords as $specimenRecord) {
    $saved_db = DbUtil::switchToLabConfig($importLabConfigId);
    $querySelect = "SELECT * FROM test " . "WHERE specimen_id={$specimenRecord->specimenId}";