Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

Version 1 Next »

Description

FormFilter module adds the capability to restrict the list of available forms on form entry of patient dashboard.
This module depends on FormEntry module.
Currently FormFilter module restricts form list on patient dashboard mainly by 3 scenarios.
1)Patient , on whos dashboard the form is shown
2)User , who want to view form list on a patient dashboard
3)General , other factors.

Implementation

  • All filters implement FormFilterHandler interface and shouldDisplayForm(Patient p, User u) method which returns true or false based on filter properties.
/**
 * The contents of this file are subject to the OpenMRS Public License
 * Version 1.0 (the "License"); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License at
 * http://license.openmrs.org
 *
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific language governing rights and limitations
 * under the License.
 *
 * Copyright (C) OpenMRS, LLC.  All Rights Reserved.
 */
package org.openmrs.module.formfilter;

import org.openmrs.Patient;
import org.openmrs.User;

/**
 * This interface helps to create form filters.
 * @author goutham
 */
public interface FormFilterHandler {


 /**
  * This method holds the logic to return true or false for given 
  * Patient and User. 
  *  
  * @return True/False ,if filter properties satisfy provided condition.
  */
 public boolean shouldDisplayForm(Patient p, User u);

}
  • Data Model
    • Filter properties are stored in format of key value pair (Example : key1=value1&key2=value2 , similarly)

Note

  • Filtering is based on "Anding" i.e any one assigned filter fails its condition ,form fails to show on dashboard.

Filters

Based on the 3 categories currently  they are 6 filters.

  • No labels