- FormFilter module adds the capability of restricting form, which is listed under the form entry tab of patient dashboard.
- Steps to assign a filter to a form
- At present , FormFilter module restricts form by 3 aspects
1. Patient , on who's dashboard the form is shown.
2. User , who want to view the form on a patient dashboard.
3. General , other factors.
- All filters should implement FormFilterHandler interface. " boolean shouldDisplayForm(Patient p, User u) " method of filter returns true to show the form and false if not required.
- Data Model
Filter properties are stored in format of key value pair (Example : key1=value1&key2=value2 , similarly) in formfilter_filter_property.properties column.
- Filtering is based on "Anding" i.e if any one assigned filter returns false then form does not appear on the patient dashboard.
- Current Role Filter uses role inheritance behavior in filtering a form. We can switch between use/do not use role inheritance by setting "Use Role Inheritance Comparison" Settings value to yes/no.
All filters should have a single string parameter constructor which takes filter properties as input. This constructor can be used to initialize filter properties.
Based on the 3 categories mentioned above , currently they are 6 filters defined in form filter module.
1) Age Form Filter
Patient age should lie between the filter minimum and maximum age values.
Parameters: a) Minimum Age b) Maximum Age
Filter returns true if patient age is between 10(minimum age) and 30(maximum age).
2)Gender Form Filter
Patients gender should match with the assigned filter age.
Filter returns true if patient gender is Male.
3)Cohort Form Filter
Patient should be defined in the cohort.
Form is shown on dashboard if the patient is defined in "Male Cohort"
4)Date Form Filter
By default the date field in the form is compared with today's date.
Parameter: a) Date b) when to show "before" or "after".
Form is shown "before" 15/08/2012(date)
5)Role Form Filter
Form is shown if the user has any mentioned role.
Parameter: a) Role
Form is shown if user has "System Developer" or "Provider" role.
6)Privilege Form Filter
Form is shown if the user has mentioned privilege.
Form is shown if user has "Add Cohorts" or "Add Forms" privilege.