Code to fix referring/primary provider issues

bradymiller wrote on Sunday, May 06, 2012:

Hi,

Here is code to fix the ambiguous provider field in the patient demographics that is used in OpenEMR as both the main provider and the referring provider in different parts of the OpenEMR codebase:
http://github.com/bradymiller/openemr/commits/referring-prov-add_1

This bug is described in more detail on the wiki here:
http://open-emr.org/wiki/index.php/Active_Projects#Assigned_Provider_ID_and_Referring_Provider_ID_conflict_bug

See the commit comments for details also. I think this method goes about fixing this bug in the safest way:
1. A new field for referring provider is created
2. This referring provider field is populated by the provider field (for upgraders)
3. This referring provider field is utilized in the billing code where a referring provider is requested.

Some may initially think that populating the referring provider field from the provider field during the upgrade is flawed. But, the current provider field is now being used for both, so creating a new field and populating it with this data will maintain the functionality and provide the option for upgraders to now take advantage of having different fields for main vs referring providers.

-brady
OpenEMR

bradymiller wrote on Tuesday, May 08, 2012:

Hi,
Committed this to sourceforge.
-brady
OpenEMR