Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-4964

ComplexObsHandlers should support complex data encoded as text



    • New Feature
    • Status: Closed
    • Must
    • Resolution: Won't Fix
    • None
    • Core 2.1.0
    • None
    • Medium
    • 2016-11-29 Platform 2.1.0


      ComplexObsHandler interface needs to support complex data encoded as text, this makes it possible to submit complex Obs data via text based transfer channels. A use case for this is to be able to submit a complex Obs via REST which only accepts JSON and XML text.

      Dev Notes

      • Add the new method below to ComplexObsHandler interface
        default Obs setComplexData(Obs obs, Object data) {
            return o;// subclasses should implement this method
      • The data is assumed to be uuencoded, Java has the UUDecoder class that you can use.
      • Update the handlers in core i.e ImageHandler, MediaHandler and BinaryDataHandler to implement this method which will decode and convert the passed in text data to its actual representation, the BinaryDataHandler handler handles data submitted as an InputStream or a byte array but we can skip dealing with InputStreams for this ticket and assume the encoded text has to be converted to a byte array. You could possibly introduce a base class that implements setComplexData(Obs obs, Object data) that is extended by these handlers to centralize the decoding logic.

      Gliffy Diagrams


          Issue Links



                raff Rafal Korytkowski
                wyclif Wyclif Luyima
                0 Vote for this issue
                5 Start watching this issue