Date Time Format change

Hello Friends,

I'm working on an android app that interacts with DHIS2. It is a government
project. This is one of the projects that Health officials are really
concerned about. They are looking forward to demo this next week.

Recently we have downloaded the new #124 build of dhis.war. Our well tested
and app seamed crashing on retrieving Events from Events API and we did a
thorough investigation since that part of the code was tested by several
hundreds of users and approved.

Our findings are as below.

-* previous Format*

"programStage": "wS2i9c9hXXz",
      "orgUnit": "cRv4S3vBoIK",
      "program": "MmGml1Gyb7K",
      "trackedEntityInstance": "yNSwSLV7zlN",
      "enrollment": "iclnhtQ00gr",
      "enrollmentStatus": "ACTIVE",
      "href": "http:///nss/api/events/FWvWE950yZf
<http://dhis.pgim.cmb.ac.lk/nss/api/events/FWvWE950yZf&gt;&quot;,
      "event": "FWvWE950yZf",
      "status": "ACTIVE",
      *"eventDate": "2016-01-13T18:30:00.000+0000",*
      "orgUnitName": "Ambagahawella",
      "created": "2016-03-14T13:36:03.956+0000",
      "lastUpdated": "2016-03-14T13:36:03.956+0000",
      "followup": false,
      "dataValues":

-* Current Format*

"programStage": "wS2i9c9hXXz",
      "orgUnit": "cRv4S3vBoIK",
      "dueDate": "2016-06-15T16:08:01.665",
      "program": "MmGml1Gyb7K",
      "trackedEntityInstance": "luBswqwIXi0",
      "enrollment": "gyEbBkDubZb",
      "enrollmentStatus": "ACTIVE",
      "href": "http://l/nss/api/events/Tq1eNtA7l6R
<http://lankanets.info:8080/nss/api/events/Tq1eNtA7l6R&gt;&quot;,
      "event": "Tq1eNtA7l6R",
      "status": "ACTIVE",
     * "eventDate": "2016-06-15T16:02:33.455",*
      "orgUnitName": "Ambagahawella",
      "attributeCategoryOptions": "ZJyvKtqS7Kx",
      "created": "2016-06-15T16:08:01.683",
      "lastUpdated": "2016-06-15T16:08:01.683",
      "followup": false,
      "coordinate": {
        "latitude": 0.0,
        "longitude": 0.0
      },
      "dataValues":

Please note that the older version and latest version has a difference when
it comes to DateTime formats such as *eventDate*. This change seams to be
deadly to us. Our app has so many time based dependencies.

How can we address these kind of sudden changes? Specially when we don't
have a development team, we may not be able to customize these builds once
apps finished.

Please provide your valuable thoughts.

Thank you all in advance. Appreciate the efforts on this great course as
well.

Sam

Dear Sam,

Quick fix is to reformat the date-time string to your own format e.g yyyy-mm-dd hh-mm-ss

Alex

···

On Sunday, August 28, 2016, Sampath Jayasinghe sampathgayani@gmail.com wrote:

Hello Friends,

I’m working on an android app that interacts with DHIS2. It is a government project. This is one of the projects that Health officials are really concerned about. They are looking forward to demo this next week.

Recently we have downloaded the new #124 build of dhis.war. Our well tested and app seamed crashing on retrieving Events from Events API and we did a thorough investigation since that part of the code was tested by several hundreds of users and approved.

Our findings are as below.

-** previous Format**

“programStage”: “wS2i9c9hXXz”,

“orgUnit”: “cRv4S3vBoIK”,

“program”: “MmGml1Gyb7K”,

“trackedEntityInstance”: “yNSwSLV7zlN”,

“enrollment”: “iclnhtQ00gr”,

“enrollmentStatus”: “ACTIVE”,

“href”: “http:///nss/api/events/FWvWE950yZf”,

“event”: “FWvWE950yZf”,

“status”: “ACTIVE”,

“eventDate”: “2016-01-13T18:30:00.000+0000”,

“orgUnitName”: “Ambagahawella”,

“created”: “2016-03-14T13:36:03.956+0000”,

“lastUpdated”: “2016-03-14T13:36:03.956+0000”,

“followup”: false,

“dataValues”:

-** Current Format**

“programStage”: “wS2i9c9hXXz”,

“orgUnit”: “cRv4S3vBoIK”,

“dueDate”: “2016-06-15T16:08:01.665”,

“program”: “MmGml1Gyb7K”,

“trackedEntityInstance”: “luBswqwIXi0”,

“enrollment”: “gyEbBkDubZb”,

“enrollmentStatus”: “ACTIVE”,

“href”: “http://l/nss/api/events/Tq1eNtA7l6R”,

“event”: “Tq1eNtA7l6R”,

“status”: “ACTIVE”,

“eventDate”: “2016-06-15T16:02:33.455”,

“orgUnitName”: “Ambagahawella”,

“attributeCategoryOptions”: “ZJyvKtqS7Kx”,

“created”: “2016-06-15T16:08:01.683”,

“lastUpdated”: “2016-06-15T16:08:01.683”,

“followup”: false,

“coordinate”: {

“latitude”: 0.0,

“longitude”: 0.0

},

“dataValues”:

Please note that the older version and latest version has a difference when it comes to DateTime formats such as eventDate. This change seams to be deadly to us. Our app has so many time based dependencies.

How can we address these kind of sudden changes? Specially when we don’t have a development team, we may not be able to customize these builds once apps finished.

Please provide your valuable thoughts.

Thank you all in advance. Appreciate the efforts on this great course as well.

Sam


Alex Tumwesigye

Technical Advisor - DHIS2 (Consultant),
Ministry of Health/AFENET | HISP Uganda

Kampala

Uganda
+256 774149 775, + 256 759 800161

Skype ID: talexie

IT Consultant (Servers, Networks and Security, Health Information Systems - DHIS2, Disease Outbreak & Surveillance Systems) & Solar Consultant

"I don’t want to be anything other than what I have been - one tree hill "

Hi Sam

Yes, this was done a few weeks ago, I’m sorry if it causes issues on your end. This was done as we have seen a lot of TZ related issues lately, and because of the way TZ is stored internally (i.e. its not stored) this meant that the output from the API was not always correct. So this fix simply give out what was given in.

That said, for your particular issue… the string itself is still ISO 8601 (just without TZ), how are you parsing the dates? Maybe someone from our Android team can tell you about how they handle this? (it didn’t affect their code)

To make your app future proof, I would suggest supporting these 2 formats:

yyyy-MM-dd’T’HH:mm:ss.SSSZ

yyyy-MM-dd’T’HH:mm:ss.SSS

We are planing to have a big overhaul of the way TZ works internally in 2.26 (basically properly storing TZ, and adding back timezone info). If you support these 2 formats, you should have no issues.

···

On Sun, Aug 28, 2016 at 4:08 PM, Alex Tumwesigye atumwesigye@gmail.com wrote:

Dear Sam,

Quick fix is to reformat the date-time string to your own format e.g yyyy-mm-dd hh-mm-ss

Alex

On Sunday, August 28, 2016, Sampath Jayasinghe sampathgayani@gmail.com wrote:

Hello Friends,

I’m working on an android app that interacts with DHIS2. It is a government project. This is one of the projects that Health officials are really concerned about. They are looking forward to demo this next week.

Recently we have downloaded the new #124 build of dhis.war. Our well tested and app seamed crashing on retrieving Events from Events API and we did a thorough investigation since that part of the code was tested by several hundreds of users and approved.

Our findings are as below.

-** previous Format**

“programStage”: “wS2i9c9hXXz”,

“orgUnit”: “cRv4S3vBoIK”,

“program”: “MmGml1Gyb7K”,

“trackedEntityInstance”: “yNSwSLV7zlN”,

“enrollment”: “iclnhtQ00gr”,

“enrollmentStatus”: “ACTIVE”,

“href”: “http:///nss/api/events/FWvWE950yZf”,

“event”: “FWvWE950yZf”,

“status”: “ACTIVE”,

“eventDate”: “2016-01-13T18:30:00.000+0000”,

“orgUnitName”: “Ambagahawella”,

“created”: “2016-03-14T13:36:03.956+0000”,

“lastUpdated”: “2016-03-14T13:36:03.956+0000”,

“followup”: false,

“dataValues”:

-** Current Format**

“programStage”: “wS2i9c9hXXz”,

“orgUnit”: “cRv4S3vBoIK”,

“dueDate”: “2016-06-15T16:08:01.665”,

“program”: “MmGml1Gyb7K”,

“trackedEntityInstance”: “luBswqwIXi0”,

“enrollment”: “gyEbBkDubZb”,

“enrollmentStatus”: “ACTIVE”,

“href”: “http://l/nss/api/events/Tq1eNtA7l6R”,

“event”: “Tq1eNtA7l6R”,

“status”: “ACTIVE”,

“eventDate”: “2016-06-15T16:02:33.455”,

“orgUnitName”: “Ambagahawella”,

“attributeCategoryOptions”: “ZJyvKtqS7Kx”,

“created”: “2016-06-15T16:08:01.683”,

“lastUpdated”: “2016-06-15T16:08:01.683”,

“followup”: false,

“coordinate”: {

“latitude”: 0.0,

“longitude”: 0.0

},

“dataValues”:

Please note that the older version and latest version has a difference when it comes to DateTime formats such as eventDate. This change seams to be deadly to us. Our app has so many time based dependencies.

How can we address these kind of sudden changes? Specially when we don’t have a development team, we may not be able to customize these builds once apps finished.

Please provide your valuable thoughts.

Thank you all in advance. Appreciate the efforts on this great course as well.

Sam


Alex Tumwesigye

Technical Advisor - DHIS2 (Consultant),
Ministry of Health/AFENET | HISP Uganda

Kampala

Uganda
+256 774149 775, + 256 759 800161

Skype ID: talexie

IT Consultant (Servers, Networks and Security, Health Information Systems - DHIS2, Disease Outbreak & Surveillance Systems) & Solar Consultant

"I don’t want to be anything other than what I have been - one tree hill "


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org