Patient Note Writer Module

Mentor: Andreas Kollegger

Assigned to: Mohammad Shahiduzzaman

Background

Keeping important free-flow observations along with systematic patient data is important in some cases. The aim of this project is to enable saving and display of arbitrary rich text notes along with patient record. An suitable open source WYSIWYG editor will be used for the rich text input purpose. This project would have a generic form, so that note input can be integrated to any pages as per requirement.

Goal

The goal is to create a module to take, store and manipulate arbitrary notes and also notes associated with observations or encounters.

  • First phase goals

    • Create a new tab for the patient dashboard that would list existing notes for the patient.

    • Create a portlet to let someone add a new note under notes tab. The note editor will provide WYSIWYG ability using TinyMCE.Note will be added as complex observation without being related with any encounter.

    • Create a note handler that works within the new complex observation framework to store and render rich text documents.

  • Second phase goals

    • Notes are typed. Note types are determined according to provided concept set or all existing note concepts with a complex data type and note handler as handler.

    • Note can be added in the context of an encounter as a complex observation.

  • Long term goals

    • Use the Obs group to show a threaded view for a set of related notes.

Deliverables

  • Before Midterm

    • Add a tab to patient dashboard - which will show the existing notes along with links to add/edit note.

    • Integrate tinyMCE to enable rich text editing.

    • Save simple text notes to be entered into and retrieved from the system on a separate table.

    • Create a note handler using the new Complex obs support and save notes as a complex observation

  • After Midterm

    • Create a note handler using the new Complex obs support and save notes as a complex observation (continued).

    • Note will have types. User can select note type from provided concept sets or existing note types.

    • Note can be added in the context of an encounter as a complex observation.

    • Write test cases to verify the implementation.

    • Write appropriate documentation.

    • (If time permits) experiment the obs group feature to view related notes in a threaded view.

Note Handler Details

  • The note handler is named as RichTextHandler.

  • The note type will be determined like the following. It will take a concept set as parameter as a global property, if the user provided a concept set there, then it will be used to provide choices for note type. Otherwise all concepts with handler pointing to RichTextHandler will be given as choices for note type.

List<Concept> chocies = null; if (choiceSet) { // if the user defined a concept set choices = Context.getConceptService().getConceptsByConceptSet(choiceSet); } else { // Filter list to only concepts that use RichTextComplexObsHandler choices = Context.getConceptService().getConceptsByHandler(RichTextComplexObsHandler.class); }
  • For the above step, a new method need to be added to ConceptService - getConceptsByHandler.

  • The handler will only take care of rich text. formatted text without any uploaded image or files.

  • Initially notes will not be related with any encounter.

Implementation notes

  • I learned to pass extra model parameters to a portlet by extending the portlet controller. I failed to that for my note portlet in the patient dashboard. Later after mailing to the dev list, I found that extending the portlet controller and overriding the populateModel method will give you the chance to pass custom data required for your portlet.

  • After configuration, at first TinyMCE failed to show its icons. Later with the help of Ben, its found that there was a bug in the build script of basic module which corrupts the binary image files, its now fixed both in the basic module and in patientnotes module.

  • TinyMCE is easily configurable and light weight than FCK editor that's why I choose it, but recently I found a problem in it. By default TinyMCE supports only images over the Internet to be viewed in the note i.e. user can't upload image from his PC. Again FCKeditor supports this image uploading, but the problem is its weight and bulky configuration (changes needed in existing textareas). For an example - to use FCKeditor in jsp pages you need to use their provided tag library whereas for TinyMCE you just need to call the appropriate JavaScript function and all the textareas will be turned into rich text editing enabled textarea. There is possible workaround for this problem of tinyMCE - to use a separate file browser callback, currently there exists 2/3 such options like - Drupal's ICME browser, but those are more inclined to php rather than java/jsp.

  • I have left the question of image uploading for now and concentrate on writing the note handler. I guess letter I can integrate that using other GSoC students code who are working on image upload.

  • Along with working on the handler I am also facing some Hibernate problem, now also reading on that to get a better understanding with Hibernate.

  • Now I am giving the option to add note in a separate page, once the basic functionality is complete I will do it via javascript on the same page on note tab.

In progress screen shots

Comments and Suggestions

Feel free to include your comments here.