Age in the format year-month-day in LB forms

k2c-supp wrote on Monday, December 14, 2015:

I would like age calculated from the DOB in an Layout Based Form to display as Year-Month-Day. I am using the “A” option with text-date data type and have the globals_locale set to display YMD. The global doesn’t seem to affect calculated age in an LBF. I get age in years returned to the form. What can I do to get age in the YMD fomat in an LBF

fsgl wrote on Monday, December 14, 2015:

Options A & B provide age in years & gestational age in weeks & days respectively. See this.

For age in YMD, code change will be required. See GitHub link provided by Rod.

To display YMD in Patient Summary, see attached.

k2c-supp wrote on Monday, December 14, 2015:

Thank you fsgl,

Did Rod provide a commit for that code change?

Do you know which .php file determines the age calculation? I’d like to change option B to return age in YMD instead of gestational.

sunsetsystems wrote on Monday, December 14, 2015:

The code is in library/options.inc.php. But don’t re-use option B, add a new option… that way you can contribute your change instead of solving just one person’s problem in a way that has to re-applied after every upgrade.

Rod
http://www.sunsetsystems.com/

k2c-supp wrote on Monday, December 14, 2015:

OK. I’ll have a go at it and send you what I come up with!