Address Hierarchy Support is one of the important module needed for enhanced user experience and easier administration. OpenMRS implementations need a way to enter patient location through a hierarchical approach — e.g., select a district from a drop-down list, then pick a village from within the district, then a location within the village.
Create a module which will allow the admin from within OpenMRS to easily create a location and to define custom location hierarchies. And the user from within OpenMRS to easily create a patient details with the flowing location hierarchy.
- Create two new tables address_hierarchy_type and address_hierarchy_type_value. address_hierarchy_type is to store and maintain the hierarchy components and address_hierarchy_type_value is to store the hierarchy component values or simply locations.
- Adding a new column to the table person_address named location_attribute_type_value_id. Its function is explained clearly in the example below.
- Adding a page under the module which enables admin to create locations in a hierarchical order and the values are stored in address_hierarchy_type_value.
- Editing the newPatientForm.jsp and its dependencies for enabling users to create the patient’s location hierarchically and only the location_attribute_type_value_id of the last member in the hierarchy is copied from address_hierarchy_type_value table to location_attribute_type_value_id of person_address table.
- For a clear working picture of the module please see below.
- The code for the module page which allows admin to create locations interactively and saves the locations in the location_attribute_type_value table and the hierarchy components in the location_attribute_type table. This will be my delivery for the mid-term evaluation.
- The rest of the project i.e. Editing the newPatientForm.jsp and its dependencies will be done after the mid term which enables users to select the locations hierarchically.
For working example click here.
P.S: Please leave your comments and suggestions.