Implement new security model in LBF forms.
[openemr.git] / custom / readme_search.txt
blob0a93a302363efa33152e4de18baecc523872e6e3
1 Submitted by Medical Information Integration, LLC July 2009
3 Enhanced Search and Facility based Filters
5 Changes:
7 - Added enhanced search filter
8 This enhancement adds two selections to the left_nav.php "Find" tool.
9 1) Any - entering data in the search text field and clicking 'Any' will match what's has been entered against
10 any field in the patient data table it not listed as 'unused' in the layout table
11 2) Filter - entering date in the search text field and clicking 'Filter' brings up a popup window with a list
12 fields in the patient data table that are not listed as 'unused' in the layout table.  The user can then select
13 one or more fields that the search should compare to and the result will be filtered down to that.
15 - Added patient search restriction to support multiple facilities using the same database instance but needing some
16 light restrictions on visibility.  Mostly this keeps clinic A from having to look at Clinic B's patient when
17 doing a name lookup, so it's easier to make sure they get the right patient.  
18 * The current patient_data table does not have an inherent way to assign a patient to a facility, so we used a configurable
19 user defined field (userlist3 in the example).  Then we created a cross reference using the "Lists" tool that has a map
20 of the facility id and name.  This allowed us to limit the selections to a subset of what is in the facility table.
21 We used the facility record ID as the List ID and entered an short title to match the internal clinic name.
22 * Search restrictions apply only to the default Name search at this time
23 * Facility is matched between the custom field identified below and the users default facility in the users table.
24 * Patients records that do not have a clinic ID in the indentified custom field are not restrictied
26 - TO DO 
27 * It could be enhanced to be more secure by adding a gacl role for access by user default facility.
28 * Filter check boxes should be persistent during a user session and ajax might be prettier than the popup window.
29 * Filter Search could use a "whole words only" option.  Right now a search for 'male' will match both males and females.
30 * Admin restrictions are based solely on the user name 'admin'.  This should be based on the gacl role of "administrator"
32 Manual steps:
33 - To activate patient search restriction, you must add the following lines to interface/globals.php:
35 // If these options are omitted, patient searches will not be restricted.
36 $GLOBALS['pt_restrict_field'] = "userlist3"; // Custom map to assigned facility ID#
37 $GLOBALS['pt_restrict_admin'] = true;        // Should the admin user be restricted as well
38 $GLOBALS['pt_restrict_by_id'] = false;       // Should lookup by ID (pubpid) be restricted