Example #1
0
	public function getSelectPatientHistory($pid)
	{
		# Returns HTML table displaying patient test history
                $admin = 0;
                if(is_admin(get_user_by_id($_SESSION['user_id']))) {
                    $admin = 1;}
                $rem_recs = get_removed_specimens($_SESSION['lab_config_id']);
                $rem_specs = array();
                $rem_remarks = array();
                foreach($rem_recs as $rem_rec)
                {
                    $rem_specs[] = $rem_rec['r_id'];
                    $rem_remarks[] = $rem_rec['remarks'];
                }
                
		$specimen_list = get_specimens_by_patient_id($pid);
		if(count($specimen_list) == 0)
		{
			?>
			<br>
			<div class='sidetip_nopos'><?php echo LangUtil::$generalTerms['TESTS']." - ".LangUtil::$generalTerms['MSG_NOTFOUND']; ?></div>
			<?php
			return;
		}
		?>
		<script type='text/javascript'>
		$(document).ready(function(){
			$('#test_history_table').tablesorter();
		});
		
		
		</script>
		<table class='tablesorter' id='test_history_table'>
			<thead>
				<tr valign='top'>
					<?php
					if($_SESSION['s_addl'] != 0)
					{
					?>
					<th><?php echo LangUtil::$generalTerms['SPECIMEN_ID']; ?></th>
					<?php
					}
					?>
					<th><?php echo LangUtil::$generalTerms['TYPE']; ?></th>
					<th><?php echo LangUtil::$generalTerms['R_DATE']; ?></th>
					<th><?php echo LangUtil::$generalTerms['SP_STATUS']; ?></th>
					<th></th>
					<th></th>
				</tr>
			</thead>
			<tbody>
			<?php
			foreach($specimen_list as $specimen)
			{
                            if($admin == 0)
                            {
                                if(in_array($specimen->specimenId, $rem_specs))
                                    continue;
                            }
                            
				$this->getSelectSpecimenInfoRow($specimen, $rem_specs, $admin); 
			}
			?>
			</tbody>
		</table>
		<?php
		# TODO: Add paging to this table
	}
Example #2
0
# Main page for showing patient profile, test history,
# and options like updating profile, registering new specimen
#
include "redirect.php";
include "includes/header.php";
LangUtil::setPageId("patient_profile");
$pid = $_REQUEST['pid'];
$script_elems->enableJQueryForm();
$script_elems->enableDatePicker();
$script_elems->enableTableSorter();
$script_elems->enableLatencyRecord();
$admin = 0;
if (is_admin_check(get_user_by_id($_SESSION['user_id']))) {
    $admin = 1;
}
$rem_recs = get_removed_specimens($_SESSION['lab_config_id'], "test");
foreach ($rem_recs as $rem_rec) {
    $rem_specs[] = $rem_rec['r_id'];
    $rem_remarks[] = $rem_rec['remarks'];
}
$labsection = 0;
if (isset($_REQUEST['labsection'])) {
    $labsection = $_REQUEST['labsection'];
}
//print_r($rem_specs);
?>
<script type='text/javascript'>
function toggle_profile_divs()
{
	$('#profile_div').toggle();
	$('#profile_update_div').toggle();
Example #3
0
	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().")";
						?>
						&nbsp;&nbsp;
						<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 "-";
						}
						else
						{
							echo  $specimen->doctor;
						}
						?>
						</td>
					</tr>
					<?php
				}
				?>
				<?php
				# Custom fields here
				$custom_data_list = get_custom_data_specimen($specimen->specimenId);
				foreach($custom_data_list as $custom_data)
				{
					$field_name = get_custom_field_name_specimen($custom_data->fieldId);
					if(stripos($field_name ,"^^")==NULL)
					{
					$field_value = $custom_data->fieldValue;
					?>
					<tr>
						<td><u><?php echo $field_name; ?></u></td>
						<td><input type="text" value="<?php echo $custom_data->getFieldValueString($_SESSION['lab_config_id'], 1); ?>" /></td>
					</tr>
					<?php
					}
				}
				if($_SESSION['refout'] != 0)
				{
				# Show referred-out hospital name if specimen was referred out and/or returned back
				if
				(
					$specimen->statusCodeId == Specimen::$STATUS_REFERRED ||
					$specimen->statusCodeId == Specimen::$STATUS_RETURNED
				)
				{
					if(strlen(trim($specimen->referredToName)) > 0){
					?>
					
					<tr>
						<td><u><?php echo LangUtil::$generalTerms['REF_TO']; ?></u></td>
						<td>
						<?php
						if(trim($specimen->referredToName) == "")
						{
							echo "Not Known";
						}
						else
						{
							echo $specimen->referredToName;
						}
						?>
						</td>
					</tr>
					<?php } 
					if(strlen(trim($specimen->referredFromName)) > 0){
					?>
					<tr>
						<td><u><?php echo "Referred From "; ?></u></td>
						<td>
						<?php
						if(trim($specimen->referredFromName) == "")
						{
							echo "Not Known";
						}
						else
						{
							echo $specimen->referredFromName;
						}
						?>
						</td>
					</tr>
					<?php
						}
				}
				}
				?>
				<tr>
					<td><u><?php echo LangUtil::$generalTerms['SP_STATUS']; ?></u></td>
					<td>
					<?php
					if(in_array($specimen->specimenId, $rem_specs) && is_admin(get_user_by_id($_SESSION['user_id']))!=1){
						echo "Specimen Removed. Contact lab admin";
					} else if(in_array($specimen->specimenId, $rem_specs) && is_admin(get_user_by_id($_SESSION['user_id']))==1){
					?> <a href='javascript:retrieve_deleted(<?php echo $specimen->specimenId;?>, "specimen")' title='Click to retrieve deleted Specimen'>Retrieve Specimen</a>
					<?php 
					} else {
					echo $specimen->getStatus();
					$result1="Completed";
					$result= $specimen->getStatus();
					?> <a href='specimen_result.php?sid=<?php echo $specimen->specimenId;?>'
					<?php if(strcmp($result,$result1)==0 || $_SESSION['user_level'] == 17){ ?> style='display:none;' <?php }?>
					title='Click to Enter result values for this Specimen'><?php echo LangUtil::$generalTerms['ENTER_RESULTS']; ?></a>
					<?php }
					?>					
					</td>
				</tr>				
			</tbody>
		</table>
		<?php
	}