Skip to content

Commit

Permalink
Fee sheet improvements. Can set default code type. take 3.
Browse files Browse the repository at this point in the history
Also changed fee_sheet to preserve selection of code_type between searches.
Added the default code_type search option to Globals/Features.
  • Loading branch information
kylenave authored and bradymiller committed Nov 10, 2015
1 parent 90d105a commit a401b35
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 5 deletions.
11 changes: 9 additions & 2 deletions custom/code_types.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
require_once(dirname(__FILE__)."/../library/csv_like_join.php");

$code_types = array();
$default_search_type = '';
$ctres = sqlStatement("SELECT * FROM code_types WHERE ct_active=1 ORDER BY ct_seq, ct_key");
while ($ctrow = sqlFetchArray($ctres)) {
$code_types[$ctrow['ct_key']] = array(
Expand All @@ -81,7 +80,15 @@
'problem'=> $ctrow['ct_problem'],
'drug'=> $ctrow['ct_drug']
);
if ($default_search_type === '') $default_search_type = $ctrow['ct_key'];
if(array_key_exists($GLOBALS['default_search_code_type'], $code_types)){
$default_search_type = $GLOBALS['default_search_code_type'];
}else
{
reset($code_types);
$default_search_type = key($code_types);
}


}

/** This array contains metadata describing the arrangement of the external data
Expand Down
2 changes: 1 addition & 1 deletion interface/forms/fee_sheet/new.php
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,7 @@ function setJustify(seljust) {
<?php
foreach ($nofs_code_types as $key => $value) {
echo " <option value='" . attr($key) . "'";
if ($key == $default_search_type) echo " selected";
if ($key == $search_type) echo " selected";
echo " />" . xlt($value['label']) . "</option>";
}
?>
Expand Down
14 changes: 14 additions & 0 deletions interface/super/edit_globals.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// of the License, or (at your option) any later version.

require_once("../globals.php");
require_once("../../custom/code_types.inc.php");
require_once("$srcdir/acl.inc");
require_once("$srcdir/formdata.inc.php");
require_once("$srcdir/globals.inc.php");
Expand Down Expand Up @@ -451,6 +452,19 @@ function validate_file(){
echo " </select>\n";
}

else if ($fldtype == 'all_code_types') {
global $code_types;
echo " <select name='form_$i' id='form_$i'>\n";
foreach (array_keys($code_types) as $code_key ) {
echo " <option value='" . attr($code_key) . "'";
if ($code_key == $fldvalue) echo " selected";
echo ">";
echo xlt($code_types[$code_key]['label']);
echo "</option>\n";
}
echo " </select>\n";
}

else if ($fldtype == 'm_lang') {
$res = sqlStatement("SELECT * FROM lang_languages ORDER BY lang_description");
echo " <select multiple name='form_{$i}[]' id='form_{$i}[]' size='3'>\n";
Expand Down
9 changes: 8 additions & 1 deletion library/globals.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,14 @@
'1', // default = true
xl('Enable amendments feature')
),

'default_search_code_type' => array(
xl('Default Search Code Type'),
'all_code_types', // data type
'ICD10', // default
xl('The default code type to search for in the Fee Sheet.')
),

),
// Report Tab
//
Expand Down Expand Up @@ -1711,7 +1719,6 @@
'/mnt/scan_docs', // default
xl('Location where scans are stored.')
),

),

// Portal Tab
Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// is a database change in the course of development. It is used
// internally to determine when a database upgrade is needed.
//
$v_database = 143;
$v_database = 144;

// Access control version identifier, this is to be incremented whenever there
// is a access control change in the course of development. It is used
Expand Down

0 comments on commit a401b35

Please sign in to comment.