Image Import Module
From Humanitarian FOSS Summer Institute 2008
Contents |
Overview
The image import module is a module for OpenMRS that will add basic image import functionality. It is still in development.
Workflow
Admin Page
- The user selects upload image on the admin page, and an upload form loads, along with a patient picker and an encounter drop-down box.
- After clicking submit, a gallery of all images + the one the user uploaded is displayed with the option to edit the images.
- If "Edit" is clicked, the cropper UI loads and the user can drag a rectangle on the image, and click "Save" to save their changes.
- If an image is clicked, a full version of the image loads.
Patient Dashboard
- On the patient dashboard, if the "Images" tab is clicked, a gallery of that patient's complex observations loads.
- The user can click edit to load the cropper UI, or click on the image to view a full verison.
Requirements
A module to provide a way to upload clinical images for complex observations. It also needs to be able to perform basic image processing and keep track of image metadata.
- Associate an image with a complex observation, patient, and encounter
- Allow a user to specify an image file to upload through a link off the admin page
- Allow a user to record image metadata while uploading it
- Allow a user to crop or rotate the image after uploading it
- Display a small version of the image on the observation list, and allow a user to view a full version of the image by clicking on it
Specifications
- Requirement: Associate an image with a complex observation
- Specification: Use Brian McKown's complex obs support and possibly his image handler, plus the core OpenMRS API
- Requirement: Allow a user to specify an image file to upload through a link off the admin page
- Specification: Add a link to the admin page using AdminList.java, and write a controller + .jsp for the upload form
- Requirement: Allow a user to record image metadata while uploading it
- Specification: Add form fields to the .jsp and save the data somewhere undetermined as of yet.
- Requirement: Allow a user to crop or rotate the image after uploading it
- Specification: Save an original copy of the image, and then save metadata about any further edits to the image. When they need to be displayed, dynamically generate the images from the metadata. Use this lovely cropper UI to allow the user to specify bounds for the cropper, and possibly use the Jakarta image taglibs to rotate the image. The place to save the metadata is currently under debate on the OpenMRS dev list :)
- Requirement: Allow the user to view a list of images by patient
- Specification: Add a tab to the patient dashboard by writing a class to add to the extension point, and a portlet controller and .jsp to display the images
Download
- Download the module files - version 0.001 - 07/31/2008
Application
Demonstration
Upload Page
The user can specify a patient, encounter, date, concept--(it MUST be a complex concept) and an image. After submission of the form, the image file is saved in the complex_obs directory, and complex data (something like "JPG image |xray.jpg") is saved in the database. A thumbnail is also generated using a custom handler and saved in the same directory, with the name xray_thumbnail.jpg, depending on the filename of the original file.
Edit Page
Here, the user can drag a cropping rectangle around an area to crop, and pick a rotation. After submission of this form, an XML file is saved, that looks something like this:
<edits>
<obsId>186</obsId>
<filename>xray.jpg</filename>
<x>120</x>
<y>121</y>
<w>163</w>
<h>165</h>
<rotation>180</rotation>
</edits>
The actual image file is not saved. Rather, when a user wants to view an edited image, these XML files are read and the edits are applied dynamically via a servlet.
Image Viewer
This page simply displays a full size of the image along with data about the image--patient, date, etc. Links to edited/original versions are provided, as well.
Gallery
The gallery page displays a list of all images ever uploaded.
Patient Dashboard Tab
There is a link off each patient's summary page to all of their images. Also included are links to the edited and original versions of these images.
Progress
July 16th, 2008
Completed Requirements
- Associate an image with a complex observations
- Allow a user to specify the image file to upload through a link off the admin page
The patient dashboard tab is a work in progress--it displays the images, but looks pretty bad. Needs some UI work. The cropper UI works, but doesn't save any data yet. Rotation is not implemented at all, nor is image metadata.
July 31st, 2008
Completed Requirements
- Associate an image with a complex observations
- Allow a user to specify the image file to upload through a link off the admin page
- Allow a user to crop or rotate the image after uploading it
- Allow the user to view a list of images by patient
The user can crop and rotate images--but 90 and 270 degree rotations don't work. The patient dashboard tab is complete and working. I still need to implement a way to save image metadata (date, creator, etc), but need to figure out a place to store it. Viewing a thumbnail of the image on the observation list is also not implemented yet.







