var numMainMeasures = 0; var num_ranges = new Array(); for(var k = 0; k < 100; k++) { num_ranges[k] = 0; } $(document).ready(function(){ $('#new_category').hide(); $('#cat_code').attr("value", "<?php echo $testTypeMapping->testCategoryId; ?> "); <?php $specimen_list = get_compatible_specimens($test_type->testTypeId); foreach ($specimen_list as $specimen_type_id) { # Mark existing compatible specimens as checked ?> $('#s_type_<?php echo $specimen_type_id; ?> ').attr("checked", "checked"); <?php } ?> $('.range_select').change( function() { toggle_range_type(this); }); $('.new_range_select').change( function() { toggle_new_range_type(this);
public function getTestTypeInfo($test_name, $show_db_name=false) { # Returns HTML for displaying test type information $test_type = get_test_type_by_name($test_name); ?> <table class='hor-minimalist-b'> <tbody> <tr> <td><?php echo LangUtil::$generalTerms['NAME']; ?></td> <td> <?php if($show_db_name === true) echo $test_type->name; else echo $test_type->getName(); ?> </td> </tr> <tr> <td><?php echo LangUtil::$generalTerms['LAB_SECTION']; ?></td> <td><?php echo get_test_category_name_by_id($test_type->testCategoryId); ?></td> </tr> <tr valign='top'> <td><?php echo LangUtil::$generalTerms['DESCRIPTION']; ?></td> <td><?php echo $test_type->getDescription(); ?></td> </tr> <tr valign='top'> <td><?php echo LangUtil::$generalTerms['MEASURES']; ?></td> <td> <?php # Fetch all test measures $measure_id_list = get_test_type_measures($test_type->testTypeId); sort($measure_id_list); //print_r($measure_id_list); foreach($measure_id_list as $measure_id) { $measure = get_measure_by_id($measure_id); if($measure==NULL && count($meausre_id_list)==1 ) { echo "No Measures Found!"; break; } else if($measure!=NULL) { if(strpos($measure->getName(), "\$sub") !== false) { $decName = $measure->truncateSubmeasureTag(); echo "    ".$decName."<br>"; } else { echo $measure->getName()."<br>"; } } } ?> </td> </tr> <tr valign='top'> <td><?php echo LangUtil::$generalTerms['COMPATIBLE_SPECIMENS']; ?></td> <td> <?php # Fetch list of compatible specimens $compatible_specimens = get_compatible_specimens($test_type->testTypeId); if(count($compatible_specimens) == 0) { echo "-"; } else { foreach($compatible_specimens as $curr_specimen) { # Show test name $specimen_type = get_specimen_type_by_id($curr_specimen); echo $specimen_type->getName()."<br>"; } } ?> </td> </tr> <tr valign='top'> <td>Hide Patient Name in Report</td> <td><?php if( $test_type->hidePatientName == 0) { echo "No"; } else { echo "Yes"; } ?> </td> </tr> <tr valign='top'> <td>Prevalence Threshold</td> <td><?php echo $test_type->prevalenceThreshold; ?></td> </tr> <tr valign='top'> <td>Target TAT</td> <td><?php echo $test_type->targetTat; ?></td> </tr> <tr valign='top' <?php is_billing_enabled($_SESSION['lab_config_id']) ? print("") : print("style='display:none;'") ?>> <td>Cost To Patient</td> <td><?php print(format_number_to_money(get_latest_cost_of_test_type($test_type->testTypeId))); ?></td> </tr> </tbody> </table> <?php }
function update_test_type($updated_entry, $new_specimen_list, $lab_config_id) { global $con; $lab_config_id = mysql_real_escape_string($lab_config_id, $con); # Updates test type info in DB catalog $saved_db = DbUtil::switchToLabConfigRevamp(); $existing_entry = get_test_type_by_id($updated_entry->testTypeId); if ($existing_entry == null) { # No record found DbUtil::switchRestore($saved_db); return; } if ($lab_config_id == "128") { $query_string = "UPDATE test_type " . "SET name='{$updated_entry->name}', " . "description='{$updated_entry->description}', " . "test_category_id='{$updated_entry->testCategoryId}', " . "hide_patient_name='{$updated_entry->hide_patient_name}', " . "prevalence_threshold={$updated_entry->prevalenceThreshold}, " . "target_tat={$updated_entry->targetTat} " . "WHERE test_type_id={$updated_entry->testTypeId}"; } else { $query_string = "UPDATE test_type " . "SET name='{$updated_entry->name}', " . "description='{$updated_entry->description}', " . "clinical_data='{$updated_entry->clinical_data}', " . "test_category_id='{$updated_entry->testCategoryId}', " . "hide_patient_name='{$updated_entry->hide_patient_name}', " . "prevalence_threshold={$updated_entry->prevalenceThreshold}, " . "target_tat={$updated_entry->targetTat} " . "WHERE test_type_id={$updated_entry->testTypeId}"; } query_blind($query_string); # Delete entries for removed compatible specimens $existing_list = get_compatible_specimens($updated_entry->testTypeId); foreach ($existing_list as $specimen_type_id) { if (in_array($specimen_type_id, $new_specimen_list)) { # Compatible specimen not removed # Do nothing } else { # Remove entry from mapping table $query_del = "DELETE from specimen_test " . "WHERE test_type_id={$updated_entry->testTypeId} " . "AND specimen_type_id={$specimen_type_id}"; query_blind($query_del); } } # Add entries for new compatible specimens foreach ($new_specimen_list as $specimen_type_id) { if (in_array($specimen_type_id, $existing_list)) { # Entry already exists # Do nothing } else { # Add entry in mapping table $query_ins = "INSERT INTO specimen_test (specimen_type_id, test_type_id) " . "VALUES ({$specimen_type_id}, {$updated_entry->testTypeId})"; query_blind($query_ins); } } DbUtil::switchRestore($saved_db); }
public function getTestTypeInfo($test_name, $show_db_name = false) { # Returns HTML for displaying test type information $test_type = get_test_type_by_name($test_name); ?> <table class='hor-minimalist-b'> <tbody> <tr> <td><?php echo LangUtil::$generalTerms['NAME']; ?> </td> <td> <?php if ($show_db_name === true) { echo $test_type->name; } else { echo $test_type->getName(); } ?> </td> </tr> <tr> <td><?php echo LangUtil::$generalTerms['LAB_SECTION']; ?> </td> <td><?php echo get_test_category_name_by_id($test_type->testCategoryId); ?> </td> </tr> <tr valign='top'> <td><?php echo LangUtil::$generalTerms['DESCRIPTION']; ?> </td> <td><?php echo $test_type->getDescription(); ?> </td> </tr> <tr valign='top'> <td><?php echo LangUtil::$generalTerms['MEASURES']; ?> </td> <td> <?php # Fetch all test measures $measure_id_list = get_test_type_measures($test_type->testTypeId); foreach ($measure_id_list as $measure_id) { $measure = get_measure_by_id($measure_id); if ($measure == NULL && count($meausre_id_list) == 1) { echo "No Measures Found!"; break; } else { if ($measure != NULL) { echo $measure->getName() . "<br>"; } } } ?> </td> </tr> <tr valign='top'> <td><?php echo LangUtil::$generalTerms['COMPATIBLE_SPECIMENS']; ?> </td> <td> <?php # Fetch list of compatible specimens $compatible_specimens = get_compatible_specimens($test_type->testTypeId); if (count($compatible_specimens) == 0) { echo "-"; } else { foreach ($compatible_specimens as $curr_specimen) { # Show test name $specimen_type = get_specimen_type_by_id($curr_specimen); echo $specimen_type->getName() . "<br>"; } } ?> </td> </tr> <tr valign='top'> <td>Hide Patient Name in Report</td> <td><?php if ($test_type->hidePatientName == 0) { echo "No"; } else { echo "Yes"; } ?> </td> </tr> <tr valign='top'> <td>Prevalence Threshold</td> <td><?php echo $test_type->prevalenceThreshold; ?> </td> </tr> <tr valign='top'> <td>Target TAT</td> <td><?php echo $test_type->targetTat; ?> </td> </tr> </tbody> </table> <?php }