← Back to team overview

dhis2-devs team mailing list archive

Re: Timestamp returning date in web api call for datavlaue set

 

Hi Rajib

I think you should file it as a blueprint.

For the record I do also agree with you and Saptarshi that it should be a
timestamp string.  Following the late Jon Postel's principle we could
consider accepting either a timestamp or date (and cast accordingly) but
always produce a timestamp.  (Note we must be effectively downcasting
anyway as the underlying sql field is a timestamp).  That might mitigate
some of the potential external breakages Morten is predicting.  At least
half of them and that maybe the biggest half.

Regarding it not always being populated that is probably a characteristic
of the demo data.  In normal use the datavalues should always be
timestamped though it could and certainly does happen that people have
brought them in to the database directly without it.  Of course that is
easily prevented  with a schema constraint, but that really does have the
potential to break some legacy databases so people might be reluctant to do
it.  You could of course enforce the constraint on your own database to
prevent such problems (not a bad idea in my view).

Bob


On 26 November 2013 20:21, Rajib Sengupta <rajibs123@xxxxxxxxx> wrote:

> Hello All,
>
> Please let me know if this issue is identified to be fixed in the core
> DHIS2 and if yes, whether I need to do anything else (like report a bug
> etc. in a issue tracking system), so that I can follow the progress of this
> issue (such as, if anyone is assigned to this, any tentative timeline).
> Based on the timeline, we need to decide if we need to move forward with
> our own fix or wait for the core DHIS2 fix .
>
> Thanks,
> Rajib
>
>
>
>
>   On Wednesday, November 20, 2013 1:03 AM, Rajib Sengupta <
> rajibs123@xxxxxxxxx> wrote:
>  As Saptarshi mentioned it will be good to have the  timestamp as full
> ISO 8601 string for the web api calls for "Reading Large bulks of data
> value".
>
> http://apps.dhis2.org/demo/api/dataValueSets.xml?dataSet=pBOMPrpg1QX&dataSet=BfMAe6Itzgt&startDate=2013-01-01&endDate=2013-01-31&orgUnit=YuQRtpLP10I&orgUnit=vWbkYPRmKyS&children=true
>
> Here is an example
> <dataValue dataElement="z7duEFcpApd" period="201301" orgUnit="DiszpKrYNg8"
>  categoryOptionCombo="V6L425pT3A0" value="232" storedBy="system" timestamp
> ="2013-04-19" followUp="false"/>
>
> Also to be consistent this field should be populated for all the
> dataValue- here is one example which doesn't has the timestamp
> <dataValue dataElement="s46m5MS0hxu" period="201301" orgUnit="DiszpKrYNg8"
>  categoryOptionCombo="Prlt0C1RF0s" value="12" storedBy="admin" followUp="
> false"/>
>
> Thanks for prompt action
> Rajib
>
>
>
>   On Tuesday, November 19, 2013 5:13 PM, Saptarshi Purkayastha <
> sunbiz@xxxxxxxxx> wrote:
>  I feel it would be good as a full ISO 8601 string.
> 2013-11-19T14:01:54 with or without the timezone.
>
> Surprisingly, in the call that I pasted in my last email, for 3 datavalue
> there is no timestamp attribute.
> Also the link which Knut sent doesn't have timestamp attribute. It will be
> good if they are consistent and with timestamp.
>
> I like the lastupdated name instead of timestamp. This also allows to
> follow-up if the values have been changed or not since the last time they
> were read.
>
> ---
> Regards,
> Saptarshi PURKAYASTHA
>
> ------------------------------
> From: mortenoh@xxxxxxxxx
> Date: Tue, 19 Nov 2013 12:15:41 +0100
> Subject: Re: [Dhis2-devs] Timestamp returning date in web api call for
> datavlaue set
> To: sunbiz@xxxxxxxxx
> CC: knutst@xxxxxxxxx; rajibs123@xxxxxxxxx; dhis2-devs@xxxxxxxxxxxxxxxxxxx
>
> So what do we want here, a full timestamp as in numbers, or a full ISO
> 8601 string? We have had it likes this for several releases now, and it has
> the potential to break external users.
>
> I'm not too happy with the name "timestamp", but I guess that's minor..
>
> --
> Morten
>
>
> On Tue, Nov 19, 2013 at 12:08 PM, Saptarshi Purkayastha <sunbiz@xxxxxxxxx>wrote:
>
> Rajib probably meant for this Web API call.
> Trying out the Web API Call mentioned in the doc on "Reading Large bulks
> of data value"
>
> http://apps.dhis2.org/demo/api/dataValueSets.xml?dataSet=pBOMPrpg1QX&dataSet=BfMAe6Itzgt&startDate=2013-01-01&endDate=2013-01-31&orgUnit=YuQRtpLP10I&orgUnit=vWbkYPRmKyS&children=true
>
> Yes, I can see the timestamp lists only date and I agree would be good
> that its a full timestamp instead of date only.
>
> ---
> Regards,
> Saptarshi PURKAYASTHA
>
> ------------------------------
> From: knutst@xxxxxxxxx
> Date: Tue, 19 Nov 2013 10:13:57 +0100
> To: rajibs123@xxxxxxxxx
> CC: dhis2-devs@xxxxxxxxxxxxxxxxxxx
> Subject: Re: [Dhis2-devs] Timestamp returning date in web api call for
> datavlaue set
>
>
> Hi Rajib,
>
> Looking at the following query, there is in fact no dataelement
> lastupdated for dataValueSets, perhaps you are referring to completedDate?
>
>
> http://apps.dhis2.org/demo/api/dataValueSets.xml?dataSet=pBOMPrpg1QX&period=201201&orgUnit=DiszpKrYNg8
>
> Knut
>
>
> On Mon, Nov 18, 2013 at 1:28 PM, Rajib Sengupta <rajibs123@xxxxxxxxx>wrote:
>
> Hello,
> We are using DHIS2 2.13 as the backend system for Kolkata Medical
> Emergency System. The concept note of the project can be found here:
> http://www.missionarogya.org/p/kmes.html. The online portal is using the
> web-apis
>
> The datavaluesets web-api calls are returning the lastupdated timestamp
> for the dataelement. But it returns it as a date instead of a timestamp as
> following: timestamp="2013-10-16"
>
> Example calls from the demo:
>
> http://apps.dhis2.org/demo/api/dataValueSets?dataSet=pBOMPrpg1QX&period=201201&orgUnit=DiszpKrYNg8
>
>
> http://apps.dhis2.org/demo/api/dataValueSets?dataSet=pBOMPrpg1QX&startDate=2013-10-15&endDate=2013-10-17&orgUnit=DiszpKrYNg8&orgUnit=DiszpKrYNg8&children=false
>
> We will really appreciate if this can be solved.
>
> Thanks,
> Rajib
>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>
>
>
>
> --
> Knut Staring
> Dept. of Informatics, University of Oslo
> +4791880522
> http://dhis2.org
>
> _______________________________________________ Mailing list:
> https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.netUnsubscribe :
> https://launchpad.net/~dhis2-devs More help :
> https://help.launchpad.net/ListHelp
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to    : dhis2-devs@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help  : https://help.launchpad.net/ListHelp
>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to    : dhis2-devs@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help  : https://help.launchpad.net/ListHelp
>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>
>

References