From eb188d23a0eb4823f675bc6fe4f41a8c8893004e Mon Sep 17 00:00:00 2001 From: bradymiller Date: Tue, 10 Jan 2012 01:46:49 -0800 Subject: [PATCH] Bug fix for lists module to add codes to fee sheet - contributed by aaversa --- interface/super/edit_list.php | 70 +++++++++++++++++++++---------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/interface/super/edit_list.php b/interface/super/edit_list.php index c9d7f21f0..0f49f5756 100644 --- a/interface/super/edit_list.php +++ b/interface/super/edit_list.php @@ -485,28 +485,44 @@ function select_code(lino) { } // This is for callback by the find-code popup. -// For Fee Sheet administration. function set_related(codetype, code, selector, codedesc) { - var f = document.forms[0]; - var celem = f['opt[' + current_lino + '][codes]']; - var delem = f['opt[' + current_lino + '][descs]']; - var i = 0; - while ((i = codedesc.indexOf('~')) >= 0) { - codedesc = codedesc.substring(0, i) + ' ' + codedesc.substring(i+1); - } - if (code) { - if (celem.value) { - celem.value += '~'; - delem.value += '~'; + if (typeof(current_sel_name) == 'undefined') + { + // Coming from Fee Sheet edit + var f = document.forms[0]; + var celem = f['opt[' + current_lino + '][codes]']; + var delem = f['opt[' + current_lino + '][descs]']; + var i = 0; + while ((i = codedesc.indexOf('~')) >= 0) { + codedesc = codedesc.substring(0, i) + ' ' + codedesc.substring(i+1); + } + if (code) { + if (celem.value) { + celem.value += '~'; + delem.value += '~'; + } + celem.value += codetype + '|' + code + '|' + selector; + if (codetype == 'PROD') delem.value += code + ':' + selector + ' ' + codedesc; + else delem.value += codetype + ':' + code + ' ' + codedesc; + } else { + celem.value = ''; + delem.value = ''; } - celem.value += codetype + '|' + code + '|' + selector; - if (codetype == 'PROD') delem.value += code + ':' + selector + ' ' + codedesc; - else delem.value += codetype + ':' + code + ' ' + codedesc; - } else { - celem.value = ''; - delem.value = ''; + displayCodes(current_lino); + } + else + { + // Coming from Immunizations edit + var f = document.forms[0][current_sel_name]; + var s = f.value; + if (code) { + s = code; + } + else { + s = '0'; + } + f.value = s; } - displayCodes(current_lino); } // Called when a "default" checkbox is clicked. Clears all the others. @@ -546,22 +562,6 @@ function sel_cvxcode(e) { dlgopen('../patient_file/encounter/find_code_popup.php?codetype=CVX', '_blank', 500, 400); } -//This is for callback by the find-code popup. -//Appends to or erases the current list of diagnoses. -function set_related(codetype, code, selector, codedesc) { - var f = document.forms[0][current_sel_name]; - var s = f.value; - - if (code) { - s = code; - } - else { - s = '0'; - } - - f.value = s; -} - -- 2.11.4.GIT