function editable_money_to_functional_number($string) { $delimiter = get_currency_delimiter_from_lab_config_settings(); $values = explode($delimiter, $string); $dollars = $values[0]; $cents = $values[1]; $numeric_cents = get_cents_from_whole_number($cents); // turn (CC).0 into 0.(CC) $numeric_dollars = intval($dollars); // force dealing with an int to ensure no type problems arise. return $numeric_dollars + $nuermic_cents; }
# Add new test category to catalog $new_cat_name = $_REQUEST['new_category']; $new_cat_id = add_test_category($new_cat_name); $cat_code = $new_cat_id; } $updated_entry = new TestType(); $updated_entry->testTypeId = $_REQUEST['tid']; $updated_entry->name = addslashes($_REQUEST['name']); $updated_entry->description = $_REQUEST['description']; $updated_entry->clinical_data = $_REQUEST['clinical_data']; $updated_entry->hide_patient_name = $_REQUEST['hidePatientName']; $updated_entry->prevalenceThreshold = $_REQUEST['prevalenceThreshold']; $updated_entry->targetTat = $_REQUEST['targetTat']; $updated_entry->testCategoryId = $cat_code; $cost_cents_initial = $_REQUEST['cost_to_patient_cents']; $cost_cents = get_cents_from_whole_number($cost_cents_initial); $newCostToPatient = $_REQUEST['cost_to_patient_dollars'] + $cost_cents; $oldCostToPatient = $_REQUEST['costToPatient_old']; # Update tests measures and ranges $is_panel = false; $added_measures_list = array(); if ($_REQUEST['ispanel'] == 1) { # Panel test. Collect all selected measures $is_panel = true; $measure_list = get_measures_catalog(); foreach ($measure_list as $measure_id => $measure_name) { if (isset($_REQUEST['m_' . $measure_id])) { # Track the measure ID (key) $added_measures_list[] = $measure_id; } }