sunsetsystems wrote on Thursday, January 07, 2010:
This is to let folks know that I’ve changed the Patient Add/Search feature.
One change was to modify the way searching is used. Fields with default values were a problem, since the searching was being done on those values even when you didn’t type anything in there. So I fixed it so that when you click (focus) on a field, it changes its background color to yellow. Only the yellow fields are used for searching, so you can easily control and see what you’re searching on, and default values do not get searched unless you click on them to cause that.
Re-focusing on a yellow field changes it back to white.
A second change was to add an option for a “short” version of the form, where only mandatory fields appear and layout group names are omitted. See globals.php for the revised description of $GLOBALS.
Third, I fixed some problems with duplication checking.
One of these was a race condition… it was using AJAX calls to check for dups when a field loses focus, however AJAX calls are (as the name suggests) *asynchronous*. So for example if you enter some field and then click Submit, the checking starts at submit time and doesn’t get a chance to finish before the submit is complete. I fixed this by rearranging the logic to start the check at submit time, but to do the actual submit from the AJAX callback function.
The second problem with duplication checking is that it was not checking in a very helpful way. For example if the patient name and SSN matched but the DOB did not, that was fine. Not. So I replaced the code in the invoked PHP script to do specific tests that I thought were sensible.
Changed files are:
interface/globals.php
interface/new/new_comprehensive.php
library/ajax/find_patients.php
All of this was done in the main branch. I hope everyone is OK with this, if not let me know. Thanks.