Multi facility support

tmccormi wrote on Monday, April 20, 2009:

We have customers with multiple facilities.  They are sharing one instance of OpenEMR.

One requirement for both HIPAA and ease of use was to limit the patient access to just those patients that "belong" to a specific facility.

To do that Aron implemented some changes to the system that prevent the FIND/Search features from displaying patients use "Assigned Clinic" is not equal to the users facility default.

We added these options to the globals.php file:

// comment these params to avoid restricting patient search by user table attribute
$GLOBALS[‘pt_restrict_field’] = “userlist3”;
$GLOBALS[‘pt_restrict_admin’] = false;
$GLOBALS[‘pt_restrict_by_id’] = false;

Userlist3 has a map in the Lists table to the Facility ID in the facility table.  It would be better if the patient_data allowed for a facility choice just like the provider choice.

The other two options allow for the user=admin to be restricted or not and lookup by ID to be restricted or not.

The logic behind the ID restriction is to allow for a patient to go to the "other" clinic if necessary and then they can be looked up by ID if needed.

The limitations are superficial, but meet the need. 

Would the community be interested in this change?
Would the community consider added a standard field to patient_data for facility assignment?
Would it be better to enhance the ACL to handle this with real access limits down the road?

Tony

drbowen wrote on Monday, April 20, 2009:

There are quite a number of people over the years who have requested this feature.  It sometimes causes us to lose potential users.

I think that we need this feature.

But I did think that HIPPA requires a separate database?

Sam Bowen, MD

tmccormi wrote on Monday, April 20, 2009:

Large, proprietary systems that are in use at multi-facility clinics (and hospitals) share a common "database" more often than not.  I developed, sold and supported many of them. 

HIPAA requires you to protect the privacy of the patients, as far as I know, it does not dictate system design.  If it tries to, I guarantee, that it’s being ignored by all developers :slight_smile:

That would be a whole thread of it’s very own.
–Tony

whimmel wrote on Tuesday, April 21, 2009:

Our implementation of multi-facility is currently focused on the calendar: permitting providers to appear on more than one schedule and restricting regular users to one or more specific facilities.

We use a new table that joins between users and facility to permit multiple "Schedule Facilities" and this choice appears on the user admin just below the Default Facility.

Currently the entire patient population is accessible to anyone but our plan is to expand this similarly to join between patient_data and facility. This will allow a pt to be added to one or more locations by a user with sufficient rights.

Aside from the new table there are no other database changes. If there are no entries, the code falls back to the existing functionality using the Default Facility.  We hope to make this available to the community soon.

ideaman911 wrote on Thursday, April 23, 2009:

Folks;

My only comment from a usability perspective is that a patient of a multi-facility group should be capable of going to any of the facilities and being seen by any competent care provider, without having to create a new patient record, and all the HIPAA consents documentation.

That suggests that we want to avoid a need to assign a specific care provider to a specific facility, nor a patient to one provider, and limit only to that provider.

If allowing a patient to visit another facility will require “rights management” to allow the facilities who wish to isolate their clients EXCEPT in that case, then we should make the security access ability to do THAT able to be set by a front-office person as a normal part of their authorities.  Otherwise, your limited admin hours will be tied up on needless tedium.  I personally do not understand why a multi-facility would NOT want to have all patients accessible.  But that’s not my issue.

Joe Holzer    Idea Man
http://www.holzerent.com

tmccormi wrote on Friday, April 24, 2009:

>>I personally do not understand why a multi facility would NOT want to have all patients accessible.<<<

Just for clarity, the case I am dealing with is that the physical clinics are a co-op that runs kind of like a HMO and the patients are assigned to a specific clinic.  There is no need for  the other clinic staff to have to wade through the list of Mr Smiths that aren’t ever going to be seen at their clinic.  The clinics are physically very far away from each other as well as in under served areas, no cross over is likely.

–Tony

whimmel wrote on Tuesday, June 09, 2009:

Here’s a fairly large patch which includes our multi-facility enhancements.

http://home.whichfinger.net/~whimmel/PhyauraFacility.patch

It also requires this new table:
CREATE TABLE `users_facility` (
  `tablename` varchar(64) NOT NULL,
  `table_id` int(11) NOT NULL,
  `facility_id` int(11) NOT NULL,
  PRIMARY KEY  (`tablename`,`table_id`,`facility_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT=‘joins users or patient_data to facility table’

There’s a switch in globals.php that turns on more restrictive facility filtering for regular users. 

For providers, you set the "Schedule Facilities" (the above table) as well as the Default Facility in the User admin page.  The provider will appear on each of the selected schedules.

For regular users, the Schedule Facility is which ones they will be able to see.  If more than one is selected, then there will be a drop-down box on the calendar.

Several other facility-related things depend on what facility is chosen on the calendar.  Such as which address appears on a Patient Report. 

The facility is remembered in two ways… there is a $_SESSION[‘pc_facility’] as well as a cookie. The session variable makes it so every time you load the calendar it will revert to the previously chosen facility.

The cookie remembers the chosen facility between sessions. I didn’t store this in the user profile because a user (such as a provider) will work in more than one facility and use different computers.  The cookie will default their facility based on which computer they’re using.

Finally, we have customized some of the reports to be facility-specific as well.  If there’s interest, I’ll post them too.

I have a demo of OpenEMR installed with these facility changes where you can take a look without patching it yourself.

http://openemr.whichfinger.net  and admin/pass

(btw, the tablename in the users_facility table above is for future expansion linking patients to a particular facility.)