Handling photographic observations

OpenMRS Version: OpenMRS 2.2

Question: I have just started looking at OpenMRS with a view to holding photographic patient observations (of retina and lens) originating from an external system. It is very early in my exploration but I thought it would make sense to reach out to you to find out whether there are some obvious pointers.

Initial goal:

  1. Query/Create patients from another app
  2. Add observations from the app, including image information
  3. Ensure that the images can be viewed from within OpenMRS

What I’ve found so far:

  • I can define a Concept of class Finding with a Complex DataType and an ImageHandler.
  • I can define an HTML form to gather an observation of this concept
  • The image is displayed when the visit notes are viewd
  • There is a rich REST API with which I can readily query patients etc and should be able to add patients and observations


  • The image storage mechanism does not look as if it will scale well (all images in one directory with a suffix if names collide).
  • The REST API does not seem to support image upload.


  1. Are there existing features/best practice guides for managing this kind of thing?
  2. I suspect it would be best to images outside OpenMRS and store only image urls inside; is there a neat way to do this and have the images display in the visit notes? (Not hard with a bit of Javascript in the HTML form but I wonder if I have missed a “proper” way.)

Any pointers much appreciated.


I agree with your concerns about image storage – what you’re seeing is a simplistic initial implementation suitable for some purposes.

My suggestion would be to write a new ComplexObsHandler that behaves as you are describing. The API is meant to support alternate approaches like this. (And eventually we could include this handler in openmrs-core when it’s done).

1 Like

Useful feedback, Darius, thanks.

That sounds like a sensible approach for handing image storage. Do you have any view about the best approach to managing such observations from an external system?

Your help is much appreciated. Richard