zhhealthcare wrote on Wednesday, September 15, 2010:
We have coded the Brady’s comments and various bugs were fixed.
It is put in the testing mode.As soon as the testing is finished the code will be submitted.
The action per comment is explained below.
1. No need to encircle all your additions with Z&H (this is done automatically when you commit it).Better to focus on providing some succinct documentation.
Z&H labels are removed.A short note is put in each function,explaining what it does.Documentation is done at places which are not so obvious.
2. Need to incorporate your database changes in sql/database.sql and sql/3_2_0-to-3_3_0_upgrade.sql.
Database changes are incorporated.
3. Jquery provides very simple one liner ajax functionality. No need to recreate this mechanism (in common_functions.js).
The ajax drop down is now replaced with Jquery library.Sample Ajax was found in the ACL section.Implemented it in New Payment.But conflict occured in the Search Payment.Both, edit popup(uses file==>jquery.fancybox-1.2.6.js) & ajax(uses file==>jquery.livequery101.js) were using differet libraries based on Jquery.Resolved it by implementing ajax withe core ajax file(jquery121.js).One more challenge was that,2 ajaxes(patient and insurance) were needed at the same text box.With minimum duplication it is coded.Testing is done in the 3 browsers(Chrome,Internet Explorer & Mozilla firefoz).
4. Do not do raw sql calls on ‘list_options’ tables to create your selection list.Instead, this can all be done in one line with function generate_select_list() in library/options.inc.php. Grep the fucntion to see examples of it in use. You need to use this function to support internationalization and it also has xss/sql-injection prevention built into it.
In 7 places the generate_select_list() function is used.One place(Payment Category in new and edit screen) does extra functionality with the drop down.A similar function generate_list_payment_category() is written and used, which uphelds the standanrds.The function generate_print_field() of the library is used to just display a list data.
5. Consider wrapping all output that goes to screen that a user can touch (including the xl() calls) with the htmlspecialchars() function to stop xss attacks:
This is described in item number 4 in this wiki section: http://www.openmedsoftware.org/wiki/Active_Projects#PLAN . See the links to commit examples in this wiki section to get an idea of what I mean. Don’t worry about items 1-3; that would be way too extensive, and you’ve made good use of the formData function. In the future, though, when you make new script(s) (again, do not do for this project), I’d rec using the technique outlined there (then you no longer need the confusing formData function(s), and sql-injection is stopped with the sql binding).
xl() calls,echo to input controls and listing of data from database are all passed through the htmlspecialchars() function.
Item No:4 in the wiki section: http://www.openmedsoftware.org/wiki/Active_Projects#PLAN is used.
6. Confused by the DateToYYYYMMDD() function and changing calendar to $DateFormat. I’m not saying it’s bad or anything, but can you clarify what this stuff is for?
For the 3 supported date format,the javascript code also should be twicked to display the date as per it.Output of DateFormatRead() function is given to ‘ifFormat’ parameter of the ‘Calendar.setup’.This will show the date as per the global settings.Second, in database the date can be stored only in the yyyy-mm-dd format. DateToYYYYMMDD() function accepts a date in any of the 3 formats, and as per the global setting, converts it to the yyyy-mm-dd format.
7. Do not include special characters (such as \n) within xl() functions. If really needs the newline, then need to separate into two separate xl() calls. I’d rec just removing the \n and keeping it one xl() since your lines are not too long. (Note the xl() function actually will remove the \n anyways; the problem is these special characters in the constants will confuse the translators).
For the short lines the \n is removed.For lengthy lines separate xl() calls are used in New and Edit payment screens.
8. Do edit_payment.php and new_payment.php have basically the same code? If so, then could consider placing same code in one file and including this in both (so easier to maintain).
Combined common parts of edit and new payment screens.Following is the new file structure.
\interface\billing\payment_master.inc.php========>(New Page.Check/cash details are entered here.Used in New Payment and Edit Payment screen.)
\interface\billing\payment_pat_sel.inc.php========>(New Page.Patient ajax section and listing of charges.Used in New Payment and Edit Payment screen.)
\library\payment.inc.php========>(New Page.This section handles payment related php functios.Add, Search and Edit screen uses these functions.)
\library\payment_jav.inc.php========>(New Page.This section handles payment related javascript functios.Add, Search and Edit screen uses these functions.)
\library\ajax\payment_ajax.php========>(New Page.This section handles ajax for insurance,patient and for encounters.)
\library\ajax\payment_ajax.js========>(New Page.This section handles ajax functions for insurance,patient and for encounters.)
\interface\billing\new_payment.php========>(New Payment screen.)
\interface\billing\edit_payment.php========>(Edit Payments Screen.)
SPECIFIC FILES:
interface/billing/billing_process.php:
–No issues.
This is billing section.The files are not needed for payment.
Wrongly submitted.
interface/billing/billing_report.php:
–No issues.
This is billing section.The files are not needed for payment.
Wrongly submitted.
interface/billing/edit_payment.php:
–Translate New Payment, Search Payment, ERA Posting
Translated the labels
–Watch out with the is_resource call. Note the library/sql.inc functions can return a resource or a recordSet depending on whether binding is used(at some point all pertinent code will be using binding, so your call will make harder to upgrade in the future). I’d rec using another way to see if there is any data returned by the sql call.
is_resource call is removed.Used ‘if statement’ using sqlFetchArray and instead of ‘while loop’ used ‘do-while’.
interface/billing/era_payments.php:
–Several strings/alerts are not getting translated
Strings/alerts are translated
–Translate New Payment, Search Payment, ERA Posting
Translated the labels
interface/billing/new_payment.php:
–Translate New Payment, Search Payment, ERA Posting
Translated the labels
interface/billing/search_payments.php:
–Translate New Payment, Search Payment, ERA Posting
Translated the labels
interface/billing/sl_eob_process.php:
–Translate Check Number along with other strings/warnings
Translated the strings/warnings
–Don’t use htmlentities(); use htmlspecialchars() instead. htmlentities is not compatible with UTF-8 encoding.
Replaced htmlentities() with htmlspecialchars() in 2 places.
interface/main/left_nav.php:
–Don’t remove the bottom screen when click the Payments links.
Bottom frame is not removed when the Payment link is clicked.
–Consider putting the Payments link in the Fees folder
Payment link is put in the Fees folder.
–Do Encounter History and New Encounter need to be translated?? (I’m just asking, since not sure what the code is doing)
This section is of the GUI Interface we created.This code is not needed for payment.We will not submit this in the new version.
interface/pic/Delete.gif:
–No issues.
No Action Needed
library/common_functions.js:
–Some useful common functions here, but need to separate the specific functions into other specific library files. I think we have a common.js library already, which is better to place the commonly useful function (I’m not sure about this though)
This file no longer exist.Separated the specific functions into other specific library files.The files are
\library\ajax\payment_ajax.js========>(New Page.This section handles ajax functions for insurance,patient and for encounters.)
\library\payment_jav.inc.php========>(New Page.This section handles payment related javascript functios.Add, Search and Edit screen uses these functions.)
\library\js\common.js========>(Common Function=>PreventIt)
library/common_functions.php:
–Lots of untranslated strings in the ajax stuff
Translated the strings in the ajax stuff
–Again, need to organize these functions into other pertinent files or new files.
This file no longer exist.Separated the specific functions into other specific library files.The files are
\library\formatting.inc.php========>(Date formating functions are stored here.)
\library\ajax\payment_ajax.php========>(New Page.This section handles ajax for insurance,patient and for encounters.)
library/parse_era.inc.php:
–No issues (although this stuff is way over my head).
No Action Needed
library/sl_eob.inc.php:
–Some debug statements left in there
Unwanted statements are removed
thanks,
Paul,