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

ComplexObsHandlers should support complex data encoded as text

    XMLWordPrintable

Details

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

    Description

      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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                  Created:
                  Updated:
                  Resolved: