COOL-cohort / COOL

the source code of the COOL system
https://www.comp.nus.edu.sg/~dbsystem/cool/
Apache License 2.0
44 stars 15 forks source link

Age in month and year are not equivalent to fixed-day interval #140

Open hugy718 opened 1 year ago

hugy718 commented 1 year ago

Problem

The current age calculation for week/month/year is based on translation to the fixed day interval: https://github.com/COOL-cohort/COOL/blob/80070ff893b3101fe8c4f53f531ffc179e6026b3/cool-core/src/main/java/com/nus/cool/core/cohort/utils/DateUtils.java#L70-L75

Needs to use the date object to generate the difference directly and add tests to cover these cases.

This is related to issue #134, PR #135