← Back to team overview

dhis2-devs team mailing list archive

Re: dueDate in Tracker Capture

 

Hi there Shivee,
As you might now, the dueDate basically represents which date the event was supposed to take place at. For events that has actually taken place, you would also fill in the eventDate of the event that is posted, and the dueDate would not be that important anymore. 

When creating events, Tracker Capture suggests due dates automatically based on config parameters like you mention. If you want to implement the whole or parts of the same logic that applies in tracker capture, you can have a look at the functions getEventDueDate and getEventDueDatePeriod in the EventUtils service in tracker capture(scripts/services.js).

Each app is however free to post due dates that makes sense in their own functional scenario. In some cases it might be enough to always use the same dueDate as eventDate - if you do not specifically need to handle the dates separately.

Best regards, 
Markus

> 17. mai 2016 kl. 13.25 skrev Shivee Gupta <shiveegpt77@xxxxxxxxx>:
> 
> Hello Devs! 
> 
> I am working on an app using the d2 APIs related to tracker capture. I have successfully registered and enrolled the new trackedEntityInstances to the selected orgUnit and Program.
> 
> Now what I want to do is add events, for which I have to POST a payload containing dueDate for the event. My doubt is, how do I calculate due date ? The program stage model gives me info like 'minDaysFromStart', 'lastUpdated' but I do not see 'dueDate' anywhere. Is it a separately calculated value ? 
> 
> Should, dueDate = createdOn + minDaysFromStart ? 
> 
> Regards,
> Shivee
> _______________________________________________
> 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


Follow ups

References