diff --git a/interface/new/new_comprehensive.php b/interface/new/new_comprehensive.php index ec2b9df4359..ae7255f2bec 100644 --- a/interface/new/new_comprehensive.php +++ b/interface/new/new_comprehensive.php @@ -637,7 +637,7 @@ function end_group() ?>
- +
diff --git a/interface/patient_file/summary/demographics_full.php b/interface/patient_file/summary/demographics_full.php index 0490e3e6b95..594f9f8460c 100644 --- a/interface/patient_file/summary/demographics_full.php +++ b/interface/patient_file/summary/demographics_full.php @@ -340,18 +340,15 @@ function InsSaveClose() { } // The ins_search.php window calls this to set the selected insurance. function set_insurance(ins_id, ins_name) { - var thesel = document.forms[0]['i' + insurance_index + 'provider']; - var theopts = thesel.options; // the array of Option objects - var i = 0; - for (; i < theopts.length; ++i) { - if (theopts[i].value == ins_id) { - theopts[i].selected = true; - return; - } - } - // no matching option was found so create one, append it to the - // end of the list, and select it. - theopts[i] = new Option(ins_name, ins_id, false, true); + thesel = $('#i' + insurance_index + 'provider'); + if ($(thesel).find("option[value='" + ins_id + "']").length) { + thesel.val(ins_id).trigger('change'); + } else { + // no matching option was found so create one, append it to the + // end of the list, and select it. + let newOption = new Option(ins_name, ins_id, true, true); + thesel.append(newOption).trigger('change'); + } } // This capitalizes the first letter of each word in the passed input @@ -637,7 +634,7 @@ function validate(f) {
- $iname) { @@ -1210,7 +1207,6 @@ class='text'>() width: 'resolve', }); - $("#value_id_text_postal_code").append( "' />"); diff --git a/interface/practice/ins_list.php b/interface/practice/ins_list.php index 23ebd3945cc..d5c7e976345 100644 --- a/interface/practice/ins_list.php +++ b/interface/practice/ins_list.php @@ -53,6 +53,9 @@ function addwhere($where, $colname, $value) $where = addwhere($where, 'a.zip', $_GET['form_zip']); $phone_parts = array(); +$area_code = null; +$prefix = null; +$digits = null; // Search by area code if there is one. if ( @@ -62,7 +65,8 @@ function addwhere($where, $colname, $value) $phone_parts ) ) { - $where = addwhere($where, 'p.area_code', $phone_parts[1]); + $area_code = $phone_parts[1]; + $where = addwhere($where, 'p.area_code', $area_code); } // If there is also an exchange, search for that too. @@ -73,7 +77,8 @@ function addwhere($where, $colname, $value) $phone_parts ) ) { - $where = addwhere($where, 'p.prefix', $phone_parts[1]); + $prefix = $phone_parts[1]; + $where = addwhere($where, 'p.prefix', $prefix); } // If the last 4 phone number digits are given, search for that too. @@ -84,27 +89,17 @@ function addwhere($where, $colname, $value) $phone_parts ) ) { - $where = addwhere($where, 'p.number', $phone_parts[1]); + $digits = $phone_parts[1]; + $where = addwhere($where, 'p.number', $digits); } $query = "SELECT " . "i.id, i.name, i.attn, " . - "a.line1, a.line2, a.city, a.state, a.zip "; - -$any_phone_numbers = sqlQuery("SELECT COUNT(*) AS count FROM phone_numbers"); -if ($any_phone_numbers['count'] > 0) { - $query .= ", p.area_code, p.prefix, p.number " . - "FROM insurance_companies as i, addresses AS a " . - ", phone_numbers AS p "; -} else { - $query .= "FROM insurance_companies AS i, addresses AS a "; -} - -$query .= "WHERE a.foreign_id = i.id "; - -if (!empty($phone_parts)) { - $query .= "AND p.foreign_id = i.id "; -} + "a.line1, a.line2, a.city, a.state, a.zip, " . + "p.area_code, p.prefix, p.number " . + "FROM insurance_companies i " . + "LEFT JOIN addresses a ON a.foreign_id = i.id " . + "LEFT JOIN phone_numbers p ON p.foreign_id = i.id WHERE 1=1 "; $query .= $where . " ORDER BY i.name, a.zip"; $res = sqlStatement($query); @@ -150,6 +145,9 @@ function setins(ins_id, ins_name) { _numOfRows)) { + echo " " . xlt('No matches found.') . ""; +} while ($row = sqlFetchArray($res)) { $anchor = ""; @@ -167,8 +165,8 @@ function setins(ins_id, ins_name) { echo " " . text($row['state']) . " \n"; echo " " . text($row['zip']) . " \n"; echo " " . $phone . "\n"; - echo " \n"; } +echo " \n"; ?>