I'm not sure I agree with that Dave. If a Datetime widget were
presented to the user, and they chose midnight (or any other specific
time), I would agree. But if I say "Max Encounter Date" and you put in
"2011-07-11", the implication is that I mean _any time_ on that date or
before.
There has been somewhat recent work (within the last few releases) in
the reporting framework to handle this. The API tries to work in a way
that caters for both situations - when you want everything on or before
a particular date, or everything on or before a particular _time_ on a
date. It does this by inspecting the time element of whatever date is
passed in as a parameter value. If the passed date has a time of
midnight, it assumes you want any time on that date, and it adjusts the
query to use the last millisecond of the day rather than the first.
However, if the passed date has a non-midnight time component, it
assumes that you actually care about the time, and it uses it as is.
If this is unclear, you can have a look explicitly at what is happening
here:
http://svn.openmrs.org/openmrs-modules/reporting/trunk/src/org/openmrs/module/reporting/cohort/query/db/hibernate/HibernateCohortQueryDAO.java
Look for uses of DateUtil.getEndOfDayIfTimeExcludedwithin that class...
Mike
On 08/11/2011 12:22 PM, Dave Thomas wrote:
Hi. I think this is actually correct behavior, at least in OpenMRS
technical terms (maybe not great useability though, as bailly points
out).
When you enter a date, you're really entering an instantaneous point
in time: for example 25/07/2011 means '2011-07-25 00:00:000'. To fix
this the reporting framework would have to universally add a day to
every end date...
d
On 8/11/11, Michael Seaton<[email protected]> wrote:
Hi Bailly,
What Cohort Query are you using and what properties are you setting?
This has been addressed recently in many of the Cohort Queries - it is
possible that we didn't get all of them though...
If you could write a unit test demonstrating the failure, that would be
very welcome :)
Thanks!
Mike
On 08/11/2011 07:10 AM, Bailly Rurangirwa wrote:
Hi,
it seems the endDate we pass in as a parameter is not taken into account
when generating values for the reports !
If for example I want to get the number of patients who requested a
primary
care service from 20/07/2011 to 25/07/2011 ,
those who requested the service on 25/07/2011 will not be included. To
include them, I would have to increment endDate and use a greater value
like
26/07/2011.
And this is also true for simple cohort queries that require an endDate
parameter.
--
View this message in context:
http://openmrs-mailing-list-archives.1560443.n2.nabble.com/Reporting-module-end-date-is-not-included-when-calculating-values-for-reports-tp6675961p6675961.html
Sent from the Developers mailing list archive at Nabble.com.
_________________________________________
To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to
[email protected] with "SIGNOFF openmrs-devel-l" in the body
(not the subject) of your e-mail.
[mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l]
_________________________________________
To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to
[email protected] with "SIGNOFF openmrs-devel-l" in the body (not
the subject) of your e-mail.
[mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l]
_________________________________________
To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to
[email protected] with "SIGNOFF openmrs-devel-l" in the body (not
the subject) of your e-mail.
[mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l]
_________________________________________
To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to
[email protected] with "SIGNOFF openmrs-devel-l" in the body (not
the subject) of your e-mail.
[mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l]