Ejemplo n.º 1
0
    public function getSearchFieldsCheckboxes($lab_config_id = null)
    {
        # Returns a set of checkboxes with existing fields types checked.
        $lab_config = get_lab_config_by_id($lab_config_id);
        if ($lab_config == null && $lab_config_id != "") {
            ?>
			<div class='sidetip_nopos'>
			ERROR: Lab configuration not found
			</div>
			<?php 
            return;
        }
        # Fetch all specimen types
        //if($lab_config_id == "")
        //$specimen_list = get_specimen_types_catalog();
        //else
        //$specimen_list = get_search_fields($lab_config_id);
        $sfields = get_search_fields($lab_config_id);
        //"SELECT pid, p_addl, daily_num, pname, age, sex, dob FROM lab_config WHERE lab_config_id=$lab_config_id";
        //$current_specimen_list = array();
        //if($lab_config_id != "")
        //	$current_specimen_list = get_lab_config_specimen_types($lab_config_id);
        # For each specimen type, create a check box. Check it if specimen already in lab configuration
        ?>
		<table class='hor-minimalist-b' style='width:700px;'>
			<tbody>
			<tr>
				<td><input type='checkbox' class='sfields_entry' name='sfields_pid' id='sfields_pid' value='1'
				<?php 
        if ($sfields['pid'] != 0) {
            echo " checked ><span class='clean-ok'>Patient ID</span>";
        } else {
            echo ">Patient ID";
        }
        ?>
				</input></td>
				
			</tr>
                        
                        <tr>
				<td><input type='checkbox' class='sfields_entry' name='sfields_daily_num' id='sfields_daily_num' value='1'
				<?php 
        if ($sfields['daily_num'] != 0) {
            echo " checked ><span class='clean-ok'>Patient Number</span>";
        } else {
            echo ">Patient Number";
        }
        ?>
				</input></td>
				
			</tr>
                        
                        <tr>
				<td><input type='checkbox' class='sfields_entry' name='sfields_p_addl' id='sfields_p_addl' value='1'
				<?php 
        if ($sfields['p_addl'] != 0) {
            echo " checked ><span class='clean-ok'>Additional ID (patient)</span>";
        } else {
            echo ">Additional ID (patient)";
        }
        ?>
				</input></td>
				
			</tr>
                        
                        <tr>
				<td><input type='checkbox' class='sfields_entry' name='sfields_pname' id='sfields_pname' value='1'
				<?php 
        if ($sfields['pname'] != 0) {
            echo " checked ><span class='clean-ok'>Patient Name</span>";
        } else {
            echo ">Patient Name";
        }
        ?>
				</input></td>
				
			</tr>
                        
                        <tr>
				<td><input type='checkbox' class='sfields_entry' name='sfields_age' id='sfields_age' value='1'
				<?php 
        if ($sfields['age'] != 0) {
            echo " checked ><span class='clean-ok'>Patient's Age</span>";
        } else {
            echo ">Patient's Age";
        }
        ?>
				</input></td>
				
			</tr>
                        
                        <tr>
				<td><input type='checkbox' class='sfields_entry' name='sfields_sex' id='sfields_sex' value='1'
				<?php 
        if ($sfields['sex'] != 0) {
            echo " checked ><span class='clean-ok'>Patient's Gender</span>";
        } else {
            echo ">Patient's Gender";
        }
        ?>
				</input></td>
				
			</tr>
                        
                        <tr>
				<td><input type='checkbox' class='sfields_entry' name='sfields_dob' id='sfields_dob' value='1'
				<?php 
        if ($sfields['dob'] != 0) {
            echo " checked ><span class='clean-ok'>Patient's Date of Birth</span>";
        } else {
            echo ">Patient's Date of Birth";
        }
        ?>
				</input></td>
				
			</tr>
                        
                       
                        
			</tbody>
		</table>
		<?php 
    }
Ejemplo n.º 2
0
        public function getSearchFieldsCheckboxes($lab_config_id=null)
	{
		# Returns a set of checkboxes with existing fields types checked.
		
		$lab_config = get_lab_config_by_id($lab_config_id);
		if($lab_config == null && $lab_config_id != "")
		{
			?>
			<div class='sidetip_nopos'>
			ERROR: Lab configuration not found
			</div>
			<?php
			return;
		}
		# Fetch all specimen types
		//if($lab_config_id == "")
			//$specimen_list = get_specimen_types_catalog();
		//else
			//$specimen_list = get_search_fields($lab_config_id);
                        $sfields = get_search_fields($lab_config_id);
                        $ssfields = get_lab_config_settings_search();
                       //"SELECT pid, p_addl, daily_num, pname, age, sex, dob FROM lab_config WHERE lab_config_id=$lab_config_id";

		//$current_specimen_list = array();
		//if($lab_config_id != "")
		//	$current_specimen_list = get_lab_config_specimen_types($lab_config_id);
		# For each specimen type, create a check box. Check it if specimen already in lab configuration
		?>
		<table class='hor-minimalist-b' style='width:700px;'>
			<tbody>
			
                        <tr>
				<td><input type='checkbox' class='sfields_entry' name='sfields_daily_num' id='sfields_daily_num' value='1'
				<?php
					if($sfields['daily_num'] == 12 || $sfields['daily_num'] == 11 || $sfields['daily_num'] == 10)
					{
						echo " checked ><span class='clean-ok'>Patient Number</span>";
					}
					else
                                        {
						echo ">Patient Number";
                                        }
				?>
				</input></td>
                                <br>
                                <td><input type='checkbox' class='sfields_entry' name='sfields_age' id='sfields_age' value='1'
				<?php
					if($sfields['age'] == 12 || $sfields['age'] == 11 || $sfields['age'] == 10)
					{
						echo " checked ><span class='clean-ok'>Patient's Age</span>";
					}
					else
                                        {
						echo ">Patient's Age";
                                        }
				?>
				</input></td>
				
			</tr>
                       
                        
			</tbody>
		</table>
                <br><br>
                Number of Results Per Page: 
                                <?php 
                                echo "<select name='sfields_resultsPerPage' id='sfields_resultsPerPage'>";
                                $i = 1;
			while($i < 101) 
                        {
                            if($ssfields['results_per_page'] == $i)
				echo "<option selected value='".$i."'>".$i."</option>";
                            else
                                echo "<option value='".$i."'>".$i."</option>";
                            $i++;
			}
			echo "</select>";?>
                        
		<?php
	}
Ejemplo n.º 3
0
    function get_attribute_values($attribute_value_type = '', $attribute = array())
    {
        $result = '';
        if (!empty($attribute)) {
            $attribute_id = $attribute['attribute_id'];
            $this_attribute_group_type = $attribute['attribute_group_type'];
            $this_attribute_value_type = $attribute['attribute_value_type'];
            $attribute_values = array();
            if (!empty($attribute['attribute_values'])) {
                $attribute_values = $attribute['attribute_values'];
            }
            if ($attribute_value_type == 'PC') {
                $counter = 0;
                $id = $attribute_id . '_PC_value';
                $class = $attribute_id . '_value';
                $result .= '	<div class="form_field attributes ' . $class . '" id="' . $id . '">
										<div class="form_title">Contact:</div>
										<ul class="form_input picklist_contacts">';
                if ($this_attribute_value_type == 'PC' && !empty($attribute_values)) {
                    foreach ($attribute_values as $attribute_value) {
                        $result .= get_contact_fields($attribute_id, $counter, $attribute_value);
                        $counter++;
                    }
                } else {
                    $result .= get_contact_fields($attribute_id, $counter);
                }
                $result .= '		</ul>
									</div>';
            } elseif ($attribute_value_type == 'PD') {
                $counter = 0;
                $id = $attribute_id . '_PD_value';
                $class = $attribute_id . '_value';
                $result .= '	<div class="form_field attributes ' . $class . '" id="' . $id . '">
										<div class="form_title">Date Field:</div>
										<ul class="form_input picklist_dates">';
                if ($this_attribute_value_type == 'PD' && !empty($attribute_values)) {
                    foreach ($attribute_values as $attribute_value) {
                        $result .= get_date_fields($attribute_id, $counter, $attribute_value);
                        $counter++;
                    }
                } else {
                    $result .= get_date_fields($attribute_id, $counter);
                }
                $result .= '		</ul>
									</div>';
            } elseif ($attribute_value_type == 'PT') {
                $counter = 0;
                $id = $attribute_id . '_PT_value';
                $class = $attribute_id . '_value';
                $result .= '	<div class="form_field attributes ' . $class . '" id="' . $id . '">
										<div class="form_title">Text Field:</div>
										<ul class="form_input picklist_texts">';
                if ($this_attribute_value_type == 'PT' && !empty($attribute_values)) {
                    foreach ($attribute_values as $attribute_value) {
                        $result .= get_text_fields($attribute_id, $counter, $attribute_value);
                        $counter++;
                    }
                } else {
                    $result .= get_text_fields($attribute_id, $counter);
                }
                $result .= '		</ul>
									</div>';
            } elseif ($this_attribute_group_type == 'M' || $attribute_value_type == 'SF') {
                $counter = 0;
                $id = $attribute_id . '_SF_value';
                $class = $attribute_id . '_value';
                $result .= '	<div class="form_field attributes ' . $class . '" id="' . $id . '">
										<div class="form_title">Search String:</div>
										<ul class="form_input search_fields">';
                if ($this_attribute_value_type == 'SF' && !empty($attribute_values)) {
                    foreach ($attribute_values as $attribute_value) {
                        $result .= get_search_fields($attribute_id, $counter, $attribute_value);
                        $counter++;
                    }
                } else {
                    $result .= get_search_fields($attribute_id, $counter);
                }
                $found_value = isset($attribute['client_attribute_found_value']) ? $attribute['client_attribute_found_value'] : '';
                $not_found_value = isset($attribute['client_attribute_not_found_value']) ? $attribute['client_attribute_not_found_value'] : '';
                $found_id = 'attribute_value_found_' . $attribute_id;
                $not_found_id = 'attribute_value_not_found_' . $attribute_id;
                $found_data = array('name' => 'data[attribute_found_value_SF_' . $attribute_id . ']', 'size' => '50', 'maxlength' => '255', 'id' => $found_id);
                $not_found_data = array('name' => 'data[attribute_not_found_value_SF_' . $attribute_id . ']', 'size' => '50', 'maxlength' => '255', 'id' => $not_found_id);
                $result .= '		</ul>
										<div class="form_field found_value first">
											<div class="form_title">Found Value:</div>
											<div class="form_input">
												' . form_input($found_data, $found_value) . '
											</div>
										</div>
										<div class="form_field found_value">
											<div class="form_title">Not Found Value:</div>
											<div class="form_input">
												' . form_input($not_found_data, $not_found_value) . '
											</div>
										</div>
									</div>';
            }
        }
        return $result;
    }