示例#1
0
	function getNewSpecimenForm($form_num, $pid, $dnum, $session_num, $doc="" ,$title ="Dr.")
	{
		# Returns HTML for new specimen form
		LangUtil::setPageId("new_specimen");
		$form_name = 'specimenform_'.$form_num;
		$form_id = $form_name; 
		$form_class = 'specimenform_class';
		$testbox_id = $form_id.'_testbox';
		$stype_id = $form_id.'_stype';
		$dnum_id = $form_id.'_dnum';
		$time_id = $form_id.'_ctime';
		$div_id = 'specimen_form_container_'.$form_num;
		$dialog_id = $div_id."_dialog";
		$specimen_id_div_id = 'specimen-id_'.$form_num;
		$specimen_err_div_id = 'specimen_msg_'.$form_num;
		$doc_row_id = 'doc_row_'.$form_num;
		$ref_out_row_id = 'ref_out_row_'.$form_num;
		$ref_out_check_id = 'ref_out_'.$form_num;
		$lab_config = LabConfig::getById($_SESSION['lab_config_id']);
		?>
		<div id='<?php echo $div_id; ?>'>
		<div class='pretty_box' style='width:530px;'>
		<form name='<?php echo $form_name; ?>' id='<?php echo $form_id; ?>' action='ajax/specimen_add.php?session_num=<?php echo $session_num ?>' method='post'>
			<input type='hidden' name='pid' value='<?php echo $pid; ?>' class='uniform_width'></input>
			<?php /*<input type='hidden' name='session_num' value='<?php echo get_session_number(); ?>' class='uniform_width'></input> */ ?>
			<table class='regn_form_table'>
			<tbody>
			<tr valign='top' <?php
				if(is_numeric($_SESSION['dnum']) && $_SESSION['dnum'] == 0)
				{
					# Hide if daily num not in use
					echo " style='display:none;' ";
				}
				?>
			>
				<td>
					<label for='dnum'><?php echo LangUtil::$generalTerms['PATIENT_DAILYNUM']; ?><?php $this->getAsterisk(); ?></label>
				</td>
				<td>   </td>
				<td>
					<input type="text" name="dnum" id="dnum" value=<?php echo $dnum; ?> size="20" class='uniform_width'> </input>
				</td>
			</tr>
			<tr valign='top'>				
				<td>
					<label for='stype'><?php echo LangUtil::$generalTerms['SPECIMEN_TYPE']; ?><?php $this->getAsterisk(); ?></label>
				</td>
				<td>   </td>
				<td>
					<select 
						name='stype' 
						id='<?php echo $stype_id; ?>' 
						onchange="javascript:get_testbox('<?php echo $testbox_id; ?>', '<?php echo $stype_id; ?>');" 
						class='uniform_width'
					>
						option value="">-<?php echo LangUtil::$generalTerms['CMD_SELECT']; ?>-</option>
						<?php $this->getSpecimenTypesSelect($_SESSION['lab_config_id']); ?>
					</select>
				</td>
			</tr>
			<tr valign='top'>
				<td>
					<label for='tests'><?php echo LangUtil::$generalTerms['TESTS']; ?> <?php $this->getAsterisk(); ?></label>
				</td>
				<td>   </td>
				<td>
					<span id='<?php echo $testbox_id; ?>' class='uniform_width'>
						-<?php echo LangUtil::$pageTerms['MSG_SELECT_STYPE']; ?>-
					</span>
				</td>
			</tr>
			<tr valign='top'<?php
			//if($_SESSION['sid'] == 0)
			if(true)
				echo " style='display:none;' ";
			?>>
				<td>
					<label for='sid'>DB Key 
					<?php if($_SESSION['sid'] == 2) $this->getAsterisk(); ?></label>
				</td>
				<td>   </td>
				<td>
					<!--
					<input type="text" name="specimen_id" id="<?php echo $specimen_id_div_id; ?>" value="" onblur="javascript:check_specimen_id('<?php echo $specimen_id_div_id; ?>', '<?php echo $specimen_err_div_id; ?>');" size="20" class='uniform_width'>
					</input>
					-->
					<input type='text' name='specimen_id' id='specimen_id' value="<?php echo $form_num; ?>" readonly="readonly" class='uniform_width'>
					</input>
					<br><span id='<?php echo $specimen_err_div_id; ?>'></span>
				</td>
			</tr>
			<tr valign='top' <?php
				if($lab_config->specimenAddl == 0)
					echo " style='display:none;' ";
			?>>
				<td>
					<label for='addlid'><?php echo LangUtil::$generalTerms['SPECIMEN_ID']; ?><?php if($_SESSION['s_addl'] == 2) $this->getAsterisk(); ?> </label>
				</td>
				<td>   </td>
				<td>
					<input type="text" name="addl_id" id="addl_id" value="" size="20" class='uniform_width'> </input>
				</td>
			</tr>
			<tr valign='top' <?php
			if($_SESSION['rdate'] == 0)
				echo " style='display:none;' ";
			?>>
				<td>
					<label><?php echo LangUtil::$generalTerms['R_DATE']; ?> <?php if($_SESSION['rdate'] == 2) $this->getAsterisk(); ?></label>
				</td>
				<td>  </td>
				<td>
					<?php
					$today = date("Y-m-d");
					$today_array = explode("-", $today);
					$name_list = array("receipt_yyyy", "receipt_mm", "receipt_dd");
					$id_list = array($form_id."_receipt_yyyy", $form_id."_receipt_mm", $form_id."_receipt_dd");
					$value_list = array($today_array[0], $today_array[1], $today_array[2]);
					$this->getDatePicker($name_list, $id_list, $value_list, true); 
					?>
				</td>
			</tr>
			<tr valign='top' style='display:none;'>
				<td>
					<label><?php echo LangUtil::$generalTerms['C_DATE']; ?></label>
				</td>
				<td>  </td>
				<td>
					<?php
					$today = date("Y-m-d");
					$today_array = explode("-", $today);
					$name_list = array("collect_yyyy", "collect_mm", "collect_dd");
					$id_list = array($form_id."_collect_yyyy", $form_id."_collect_mm", $form_id."_collect_dd");
					$value_list = array($today_array[0], $today_array[1], $today_array[2]);
					$this->getDatePicker($name_list, $id_list, $value_list, false); 
					?>
				</td>
			</tr>
			<tr valign='top' style='display:none;'>
				<td>
					<label><?php echo LangUtil::$generalTerms['C_TIME']; ?></label>
				</td>
				<td>
					<select name='ctime_hh' autocomplete="OFF">
					<?php
					$time = date("H:i");
					$time_parts = explode(":", $time);
					for($i = 0; $i < 24; $i++)
					{
						if($i < 10)
							$option = '0'.$i;
						else
							$option = $i;
						echo "<option value='$option' ";
						if($option == $time_parts[0])
						//if($option == 9)
							echo "selected ";
						echo ">$option</option>";
						
						
					}
					?>
					</select>
					:
					<select name='ctime_mm' autocomplete="OFF">
					<?php
					for($i = 0; $i < 60; $i++)
					{
						if($i < 10)
							$option = '0'.$i;
						else
							$option = $i;
						echo "<option value='$option' ";
						if($option == $time_parts[1])
						//if($option == "00")
							echo "selected ";
						echo ">$option</option>";
					}
					?>
					</select>
					&nbsp;&nbsp;hrs
				</td>
			</tr>
			<tr valign='top'<?php
			if($_SESSION['comm'] == 0)
				echo " style='display:none;' ";
			?>>
				<td>
					<label for='comments' valign='top'><?php echo LangUtil::$generalTerms['COMMENTS']; ?><?php if($_SESSION['comm'] == 2) $this->getAsterisk(); ?></label>
				</td><td>   </td>
				<td>
					<textarea name="comments" id="comments" class='uniform_width'></textarea>
				</td>
			</tr>
			<tr valign='top' style='display:none' <?php ## Disabled for now ?>>
				<td>
					<label for='report_to' valign='top'>Report To</label>
				</td>
				<td>  </td>
				<td>
					<select name='report_to' class='uniform_width'>
					<?php
					# Enable the following line if this field is to be used:
					echo " onchange=\"javascript:checkandtoggle(this, '$doc_row_id');\" ";
					?>
						<option value='1'>Patient</option>
						<option value='2'>Doctor/Hospital</option>
					</select>
				</td>
			</tr>
			<tr valign='top' id='<?php echo $doc_row_id; ?>' <?php
			if($_SESSION['doctor'] == 0)
				echo " style='display:none;' ";
			?>>
				<td><label for='doctor' valign='top'><?php echo LangUtil::$generalTerms['DOCTOR']; ?><?php if($_SESSION['doctor'] == 2) $this->getAsterisk(); ?></label></label>
				</td>
				<td> 
					<SELECT name='title' id='<?php echo $doc_row_id; ?>_title'>
					<?php
					$labtitlefieldoptions = get_custom_fields_labtitle(1);
					$lab_titles = explode("/",$labtitlefieldoptions);
					
					foreach($lab_titles as $option)
					{
						if(trim($option) == "")
							continue;
						echo "<option value='$option'";
						if($option == $field_value)
						{
							echo " selected ";
						}
						echo " >$option</option>";
					}
					?>
					</SELECT>
				</td>
				<td>
					<input type='text' name='doctor' id='<?php echo $doc_row_id."_input"; ?>'  value='<?php echo $doc; ?>' ></input>
				</td>
			</tr>
			<?php
			$custom_field_list = get_custom_fields_specimen();
			foreach($custom_field_list as $custom_field)
			{	if(($custom_field->flag)==NULL)
				{
				?>
				<tr valign='top'>
					<td><?php echo $custom_field->fieldName; ?></td>
					<td></td>
					<td><?php $this->getCustomFormField($custom_field); ?></td>
				</tr>
				<?php
				}
			}
			?>
			<tr valign='top'<?php
			if($_SESSION['refout'] == 0)
				echo " style='display:none;' ";
			?>>
				<td>
					<label for='ref_out' valign='top'><?php echo LangUtil::$generalTerms['REF_OUT']; ?>? <?php if($_SESSION['refout'] == 2) $this->getAsterisk(); ?></label>
				</td>
				<td>   </td>
				<td>
					<INPUT TYPE=RADIO NAME="ref_out" id='<?php echo $ref_out_check_id; ?>' VALUE="Y" onchange="javascript:checkandtoggle_ref('<?php echo $ref_out_check_id; ?>', '<?php echo $ref_out_row_id; ?>');"><?php echo LangUtil::$generalTerms['YES']; ?>
					<INPUT TYPE=RADIO NAME="ref_out" onchange="javascript:checkandtoggle_ref('<?php echo $ref_out_check_id; ?>', '<?php echo $ref_out_row_id; ?>');" VALUE="N" checked><?php echo LangUtil::$generalTerms['NO']; ?>
				</td>
			</tr>
			<tr valign='top' id='<?php echo $ref_out_row_id; ?>' style='display:none'>
				<td><?php echo LangUtil::$generalTerms['REF_TO']; ?></td>
				<td>
					<input name='ref_out_name' class='uniform_width'></input>
				</td>
			</tr>
			<?php
			if($form_num != 1)
			{
				?>
				<tr valign='top'>
					<td>
						<a href="javascript:show_dialog_box('<?php echo $div_id; ?>');"><?php echo LangUtil::$generalTerms['CMD_REMOVE']; ?></a>
					</td>
					<td>
					<?php
					$message = LangUtil::$pageTerms['MSG_SURETO_REMOVE'];
					$ok_function = "remove_specimenbox('$div_id')";
					$cancel_function = "hide_dialog_box('$div_id')";
					$this->getConfirmDialog($dialog_id, $message, $ok_function, $cancel_function, $width=200);
					?>
					</td>
				</tr>
				<?php
			}
			?>
			</tbody>
			</table>
		</form>
		</div>
		<small>
		<span style='float:right'>
			<?php $this->getAsteriskMessage(); ?>
		</span>
		</small>
		<br>
		</div>
		<?php
	}
示例#2
0
	function generate_doctors($doc_row_id, $doc=""){
		/* $doc_array= getDoctorList();
		$php_array= addslashes(implode("%", $doc_array));
		echo '<script type="text/javascript">$(document).ready(function(){';
			
		echo 'var data_string="'.$php_array;
		echo 'var data=data_string.split("%");
					
			$("#doc_row_1_input").autocomplete(data);
		}</script>';
 */
		if($_SESSION['user_level'] == 17) {
			if($doc =="") {
				$doc = $_SESSION['username'];
			}
		}
		echo "<tr valign='top' id='";
		echo $doc_row_id."'";
		if($_SESSION['doctor'] == 0)
				echo " style='display:none;' ";
		echo ">
				<td><label for='doctor' valign='top'>".LangUtil::$generalTerms['DOCTOR'];
			if($_SESSION['doctor'] == 2) 
				$this->getAsterisk(); 
		echo "</label></label>
				</td>
				<td>";
		$labtitlefieldoptions = get_custom_fields_labtitle(1);
		$lab_titles = explode("/",$labtitlefieldoptions);
		echo "<SELECT name='title' id='".$doc_row_id."_title'>";
		
		foreach($lab_titles as $option)
			{
				if(trim($option) == "")
					continue;
				echo "<option value='".$option."'";
				if($option == $field_value)
						{
							echo " selected ";
						}
						echo " >".$option."</option>";
			}
		echo "	</SELECT>
				</td>
				<td>
					<input type='text' name='doctor' class ='doctors_auto' id='".$doc_row_id."_input'  value='".$doc."' ></input>

				</td>
			</tr>";
	}