Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Design updated to reflect current plan.

...

The ultimate purpose of this project is to create a new UI widget (and module) for OpenMRS that has the ability to return search results based on a text query and to make this widget available throughout the web application.  The initial steps towards this vision relate to creating the low level infrastructure to allow OpenMRS API services to register themselves as "searchable", and developing the basic API to perform searches across those services.  This This search bar would then be added initially to the web application header.

Domain Expert(s) / User(s)

Jeremy Keiper, Ben Wolfe, Darius Jazayeri, all implementers on the implementers mailing list :)

...

The search box should be a simple input box.   The controller that receives that input passes along the text to every registered serviceApache Lucene integrated with Hibernate Search is used to perform full text indexing on all registered entities

My The envisioned workflow:

  1. User types in "red"
  2. Controller loops over all registered services. (e.g. PatientServiceSearch and ConceptServiceSearch) (names can change)
  3. Controller calls PatientSearchService.search("red") which calls the normal PatientService.getPatients("red", null, null) and/or PatientSErvice.getPatients(null, "red", null)
    1. PatientSearchService returns all patients named red.  The service was registered also said any patient that comes back should link to /patient.form?patientId=XX
  4. Controller calls ConceptServiceSearch.search("red") which calls the normal ConceptService.findConcepts("red", null, null, null) All concepts with red in the names/descriptions are returned.  The results link to /dictionary/concept.form?conceptId=XXHoratio Hornblower"
  5. A query is created using Apache Lucene QueryParser to do a full text search on the database.
  6. Hibernate Search executes the query on the database.
  7. The results are returned and then interpreted to generate a results page. 
  8. The displayed jsp shows all results linking to the different locations in the webapp.

...

  1. .

...

The results can either be shown in a new page or search+results can be ajax and in a popup under the search box.  (The latter being preferred, but could introduced later if time is short)

...

  • Midterm - finalized design of workflow and service, and basic UI in place (one object type).
  • Final - registration functionality, extended search API, and multiple registered objects.

Resources