Uploaded image for project: 'Webservices REST Module'
  1. Webservices REST Module
  2. RESTWS-644

ObsResource needs to support time zones and more date formats

    Details

    • Type: New Feature
    • Status: In Progress
    • Priority: Must
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Complexity:
      Low

      Description

      Background

      The obs resource in our REST API doesn't support posting datetimes with a timezone. This leads to end-user confusion like https://talk.openmrs.org/t/error-saving-datetime-obs/9883/6

      Tech Notes

      Currently ObsResource calls Obs.setValueAsString(String) to set values which doesn't support time zones and more date formats, this possibly needs to be fixed in core see TRUNK-5025. In the meantime we should have a work around in the REST module, the module already has a mechanism that converts from date strings of different time zones and formats to dates objects, the ObsResource should delegate to ConversionUtil.convert(Object object, Type toType) to convert the date value first and then call Obs.setValueDateTime(Date) or Obs.setValueDate() or Obs.setValueTime() based on the concept datatype to set the obs value.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mozzy Moses Mutesasira
                Reporter:
                wyclif Wyclif Luyima
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated: