Postal code lookup with add

teryhill wrote on Friday, March 27, 2015:

I just uploaded this (if any one is interested). It will help with keying errors and does allow the user to skip the city and state fields. Thanks to Sam Likins for the Ajax schooling.

Thanks
Terry

PS I am working on some more stuff (like a guarantor)

fsgl wrote on Friday, March 27, 2015:

Excellent idea.

Old PMS had same concept. Input: 95814. Bam! Output: Sacramento, CA. Some municipalities share the same zip code, so there would be a drop down for the user to choose.

Front Desk said “thank you”.

cmswest wrote on Friday, March 27, 2015:

well done terry, i just tested it out and it works nicely

teryhill wrote on Friday, March 27, 2015:

Thank you very much that means a lot. Did you get the error checking and translate fixes.

bradymiller wrote on Saturday, March 28, 2015:

Hi Terry,

Rebased most recent code and reviewed it here(also tested it here):


(search for bradymiller to see comments)

This is really nice code for this purpose, but I am at a bit of a loss how to get it into OpenEMR codebase in a friendly fashion. I placed some thoughts on the review; hopefully others can also chime in.

-brady
OpenEMR

teryhill wrote on Monday, March 30, 2015:

I made those changes and removed the documentation ( i will get a more professional version posted soon) I think I want to add country code to the population of the data.

Terry

teryhill wrote on Monday, March 30, 2015:

This is a more complete guide to setting up the current version of the postal code look-up code.

Terry

mdsupport wrote on Monday, March 30, 2015:

We had similar requirements from users. Although we chose to leverage Select2, some features that can be homegrown as well are:

  1. Create common generic library so you can provide suggestions for any text box with minimal code.

  2. Let mysql query provide values rather than creating lists. This means first few entries will have fewer options but it allows list to be ordered by COUNT rather than description.

  3. Pre-populate TOP n values until first 2-3 characters are entered and then switch to dynamic look ups.

cmswest wrote on Monday, March 30, 2015:

just dreaming here but there is potential address validation with the usps lookup tool

teryhill wrote on Monday, March 30, 2015:

Not far off. I have all the us zips in text files that will take very little effort to place them in a database. then the code will need to hit that database when the zip is entered.

Terry

teryhill wrote on Monday, March 30, 2015:

That is very interesting. Would you send me the code? terry@lillysystems.com

Terry

mdsupport wrote on Tuesday, March 31, 2015:

Our code is geared for Select2. So a simplified/generic version of db interface is attached as select2_lookup.php. This gets called from select2_call_sample code fragment script. In production, the ajaxcombo is also a library function. As a result we can convert text box to combo box with a single line.

teryhill wrote on Tuesday, March 31, 2015:

Thanks I will look at the code you sent and see what improvements can be made.

Terry

mdsupport wrote on Tuesday, March 31, 2015:

Could you consider using existing data to derive valid/most likely values? This can be done by simple json lookups and javascript. A suggestion would be:

When any address field is updated, a json call returns city+state+zip array ordered by COUNT DESC. Script then converts other textboxes to combo by adding datalist in HTML5 or standard HTML4 trick.

Granted first few entries will be unguided but it eliminates need for any lists/tables. Same approach can be reused for addresses in user and insurance tables.

On a related note, in your current code is there any reason why anyone would want to turn off this helpful functionality?

teryhill wrote on Tuesday, March 31, 2015:

what happens when current data is incorrect (people do miss key stuff).

As for turning the code off… Well There are those who resist change.

I will be looking at these suggestions but it is community code and if the community wants to change it they have my blessings and support.

Terry

mdsupport wrote on Tuesday, March 31, 2015:

Assumption here is that data is being entered from verbal source (e.g. over phone) or written form (email, registration info etc.). If ‘Seal Beach’ zip is incorrectly entered as 91740, later documents will be entered as 90740 and have higher count - so 90740 will rise to the top of list.

USPS/FedEx/UPS are good at taking care of minor errors. Users, specifically MDs, just want some magic to speed up data entry - not just in addresses but all fields with recurring data.

teryhill wrote on Tuesday, March 31, 2015:

I agree the best way is to allow the data to be stored and retrieved from one place. The best situation is to allow patient postal codes to stored and retrieved from the patient data file , insurance from insurance etc. I haven’t had a chance to look at the code and information that you sent but it sounds to me like you already do most of this. Sam was a big help in getting what I have here he gave me a lot of help with the comet… I mean Ajax stuff. Thanks again Sam.

Terry