tmccormi wrote on Wednesday, December 26, 2012:
Two examples:
This patient is 2 years old, so OpenEMR should plot her growth chart on the charts for kids 2 years and older so we can see her BMI. Instead, it plots height and weight on the chart for kids under two (just a little to the right of the 24 month mark). The pt DOB is 12/09/2010, but the system calculates her age in months as 24 even, instead of 24 months + days past the DOB day. This means the chart won’t be right until next month.
In a similar calculation there is a patient that reports as 15 months old, but is a few day past the DOB day, it should now be reporting 16 months, or at the very least 15 months + so many days…
These are important to pediatricians.
I looked at the patient.inc calcutions for age and they are not adequate, there are some examples of calculations that will return Years, Months, Days, Hrs. These are the funtions that should be replaced with one more comprehensive function:
getPatientAge($dobYMD, $nowYMD=null)
getPatientAgeInDays($dobYMD, $nowYMD=null)
It is unclear why you would ever overide $NOW in a dob calculation, but we could keep that. I suggest we make them one:
getPatientAge($dobYMD, $nowYMD=null) but return an array of:
AgeInYears - Total Whole Years
AgeInMonths - Total Whole Number of Months since DOB
MonthsPastDOBMonth - Number of whole Months past the DOB Month (ie: 4 yrs + 3 Mons)
AgeinDays - Total Whole Number of Days since DOB
DaysPastDOBDay - Number of days past the DOB day date (ie: 4 yrs + 3 Mon + 4 days)
I suggest we display Month + Days on anyone < 24 months old, There may be a reason to display Years + Months old up to some age max as well.
-Tony