In Bahmni we are using complex obs to store uploaded images, with a simple handler that stores the URL of the uploaded image file in obs.value_complex.
Now, to improve the UX, we would like to store a bit more metadata, including letting the uploader give the image a title. So later when someone views a list of images they see the titles before deciding what image to open.
We would like to do something like setting obs.valueComplex to
{"title":"Chest X Ray", "url":"..."}
(or, if you don’t like JSON, it could just be
Chest X Ray | url
But the obs.value_complex is only varchar(255) so we don’t think we can reliably fit a small amount of user-entered text and the URL in that field.
Basically, we feel that obs.value_complex should be big enough to store both a reference to data and enough description to allow an end-user to decide if they want to make the expensive call to fetch that data.
The 255 character limit on obs.value_complex and obs.comments attributes was arbitrary (we wanted enough space for meaningful text, but worried too many large text fields would have adverse consequences on performance).
While I favor @lluismf’s suggestion (i.e., an obs_complex table), I’m assuming any effect on performance would be insignificant, so increasing the size from 255 to 1024 is fine with me too.
@padmavati, FYI we discussed this on yesterday’s OpenMRS design call, and we agree that it’s okay to increase the size of the obs.value_complex column to be ~1000 or so.
If that’s needed for the Bahmni card you’re working on, please create an OpenMRS ticket for it.