Skip to content

Commit

Permalink
Click option: Title and code added
Browse files Browse the repository at this point in the history
When a clickoption is selected, if it has a code associated with it, the code is added to the "diagnosis" field on the form.
  • Loading branch information
ophthal authored and bradymiller committed Mar 12, 2016
1 parent 651531c commit 8cad823
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion interface/patient_file/summary/add_edit_issue.php
Original file line number Diff line number Diff line change
Expand Up @@ -409,13 +409,16 @@ function ActiveIssueCodeRecycleFn($thispid2, $ISSUE_TYPES2) {
var aitypes = new Array(); // issue type attributes
var aopts = new Array(); // Option objects
<?php
$i = 0;
$i = 0;
foreach ($ISSUE_TYPES as $key => $value) {
echo " aitypes[$i] = " . attr($value[3]) . ";\n";
echo " aopts[$i] = new Array();\n";
$qry = sqlStatement("SELECT * FROM list_options WHERE list_id = ?",array($key."_issue_list"));
while($res = sqlFetchArray($qry)){
echo " aopts[$i][aopts[$i].length] = new Option('".attr(trim($res['option_id']))."', '".attr(xl_list_label(trim($res['title'])))."', false, false);\n";
if ($res['codes']) {
echo " aopts[$i][aopts[$i].length-1].setAttribute('data-code','".attr(trim($res['codes']))."');\n";
}
}
++$i;
}
Expand Down Expand Up @@ -519,6 +522,7 @@ function newtype(index) {
function set_text() {
var f = document.forms[0];
f.form_title.value = f.form_titles.options[f.form_titles.selectedIndex].text;
f.form_diagnosis.value = f.form_titles.options[f.form_titles.selectedIndex].getAttribute('data-code');
f.form_titles.selectedIndex = -1;
}

Expand Down

0 comments on commit 8cad823

Please sign in to comment.