VPMS Web Application

Change aging syntax

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.5
  • Fix Version/s: 1.5
  • Component/s: Patient
  • Labels:
    None

Description

An adjustment to the way age is represented when calculating from DOB.

a) Change the age function so that if the difference between current date and birth date is < 180 days then display in Days or Weeks. Currently it is set at 90 days as of version 1.4.

b) Add the age of the animal as of the visit date to the visit description.

c) (Optional) Is it possible to have the months remainder expressed as part of the function if the age is greater then 1 year and the remainder is > 30 days? ie. 1 year and 10 days = 1 year old. 1 year and 32 days = 1 year 1 month.

Activity

Hide
Matt Costa added a comment -

Hi Tim,
Costing on this one ta
Matt C

Show
Matt Costa added a comment - Hi Tim, Costing on this one ta Matt C
Hide
Tim Anderson added a comment -

a) 1 hour
b) 2 hour
c) 1 hour

Is a) something that may be different across species or practices? Should it be customisable?

Show
Tim Anderson added a comment - a) 1 hour b) 2 hour c) 1 hour Is a) something that may be different across species or practices? Should it be customisable?
Hide
Matt Costa added a comment -

Hmmm,
I don't think it needs to be different across species.
As for practices, I think you may be right. The fact that the spec says "Days or Weeks" indicates there may be different requirements.
I wonder if being able to set the limits at which it changes from days or weeks per practice would be good?
ie.
<90 express as days
<180 express as weeks

If the user set the first limit at 0 then it would express as weeks from 0 - 180 days and then months, then years and months.

Show
Matt Costa added a comment - Hmmm, I don't think it needs to be different across species. As for practices, I think you may be right. The fact that the spec says "Days or Weeks" indicates there may be different requirements. I wonder if being able to set the limits at which it changes from days or weeks per practice would be good? ie. <90 express as days <180 express as weeks If the user set the first limit at 0 then it would express as weeks from 0 - 180 days and then months, then years and months.
Hide
Tim Anderson added a comment -

A customisable solution would involve the creation of rules which would be stored as lookups so they can be edited using standard editors.
This lookup would be associated with the practice.
E.g lookup.ageformats contains 1..N lookup.ageformat
Each lookup.ageformat would contain:

  • fromAge - the age that this format applies from
  • toAge - the age that this format applies to
  • boolean showMonths - if true show age in months
  • boolean showDays - if true show age in days

A lookup.ageformat of:

  • fromAge = 0 DAYS
  • toAge = 90 DAYS
  • showMonths = false
  • showDays = true

States that the format applies if the patient is between 0 and 90 days old inclusive and formats the age as "N days old"

A lookup.ageformat of:

  • fromAge = 1 YEAR
  • toAge = unset
  • showMonths = true
  • showDays = false

States that the format applies if the patient is >= 1 year old and formats the age as "N year M months"

Estimate this would take 8 hours.

Show
Tim Anderson added a comment - A customisable solution would involve the creation of rules which would be stored as lookups so they can be edited using standard editors. This lookup would be associated with the practice. E.g lookup.ageformats contains 1..N lookup.ageformat Each lookup.ageformat would contain:
  • fromAge - the age that this format applies from
  • toAge - the age that this format applies to
  • boolean showMonths - if true show age in months
  • boolean showDays - if true show age in days
A lookup.ageformat of:
  • fromAge = 0 DAYS
  • toAge = 90 DAYS
  • showMonths = false
  • showDays = true
States that the format applies if the patient is between 0 and 90 days old inclusive and formats the age as "N days old" A lookup.ageformat of:
  • fromAge = 1 YEAR
  • toAge = unset
  • showMonths = true
  • showDays = false
States that the format applies if the patient is >= 1 year old and formats the age as "N year M months" Estimate this would take 8 hours.
Hide
Matt Costa added a comment -

Do we need to have showWeeks as well?
It would have to be an OR option for showDays tho ie.Cant show both.

Show
Matt Costa added a comment - Do we need to have showWeeks as well? It would have to be an OR option for showDays tho ie.Cant show both.
Hide
Tim Anderson added a comment -

Yes - showWeeks would be required. The algorithm to format would look something like:

function formatAge(age: integer)
result = ""
If  showYears and age >= 365 then 
    result = result + (age / 365) + " Years "
    age = age mod 365
end if 
if showMonths and age >= 30 then
   result = result  + (age / 30) + " Months "
   age = age mod 30
end if
if  showWeeks and age >= 7 then
   result = result + (age / 7) + " Weeks "
   age = age mod 7
end if
if showDays and age > 0 then
   result = result + age + " Days "
end if
return result
Show
Tim Anderson added a comment - Yes - showWeeks would be required. The algorithm to format would look something like:
function formatAge(age: integer)
result = ""
If  showYears and age >= 365 then 
    result = result + (age / 365) + " Years "
    age = age mod 365
end if 
if showMonths and age >= 30 then
   result = result  + (age / 30) + " Months "
   age = age mod 30
end if
if  showWeeks and age >= 7 then
   result = result + (age / 7) + " Weeks "
   age = age mod 7
end if
if showDays and age > 0 then
   result = result + age + " Days "
end if
return result
Hide
Matt Costa added a comment -

Thanks Tim. Have listed for fund raising!

Show
Matt Costa added a comment - Thanks Tim. Have listed for fund raising!
Hide
Tim Anderson added a comment -

Changes applied to:

  • archetypes, revision 4230, 4232
  • vpms, revision 4231

To configure patient age formatting:

  • go to Administration -> Lookups
  • create a new Duration Formats
  • add one or more formats
  • go to Administration -> Organisation
  • edit the practice
  • select the previously created Duration Formats as the "Patient Age Format"

The duration formats work as follows:

  • the interval and units specify the formatting that is applied for a particular duration. E.g 7 days means that the format applies to all durations < 7 days
  • the Show Years flag indicates to that the duration should include the years, if any.
  • the Show Months flag indicates to that the duration should include the months, if any.
  • the Show Weeks flag indicates to that the duration should include the weeks, if any.
  • the Show Days flag indicates to that the duration should include the weeks, if any.
  • All combinations of the Show flags are supported

E.g given the following:

  • 12 Months, Show Months = true, Show Weeks = true
  • 13 Months, Show Years = true, Show Months = true

A patient < 12 months old will be displayed as "N Months, N Weeks"
A patient >= 12 months old will be displayed as "M Years, N Months"

If the practice has no patient age format specified, it defaults to the following:

  • 7 days, Show Days = true
  • 90 Days, Show Weeks = true
  • 23 Months, Show Months = true
  • 2 Years, Show Years = true

This means:

  • a patient < 7 days old will be displayed as "N Days"
  • a patient >= 7 days old and < 90 days old will be displayed as "N Weeks"
  • a patient >= 90 days old and < 23 months will be displayed as "N Months"
  • a patient >= 23 months will be displayed as "N Years"
Show
Tim Anderson added a comment - Changes applied to:
  • archetypes, revision 4230, 4232
  • vpms, revision 4231
To configure patient age formatting:
  • go to Administration -> Lookups
  • create a new Duration Formats
  • add one or more formats
  • go to Administration -> Organisation
  • edit the practice
  • select the previously created Duration Formats as the "Patient Age Format"
The duration formats work as follows:
  • the interval and units specify the formatting that is applied for a particular duration. E.g 7 days means that the format applies to all durations < 7 days
  • the Show Years flag indicates to that the duration should include the years, if any.
  • the Show Months flag indicates to that the duration should include the months, if any.
  • the Show Weeks flag indicates to that the duration should include the weeks, if any.
  • the Show Days flag indicates to that the duration should include the weeks, if any.
  • All combinations of the Show flags are supported
E.g given the following:
  • 12 Months, Show Months = true, Show Weeks = true
  • 13 Months, Show Years = true, Show Months = true
A patient < 12 months old will be displayed as "N Months, N Weeks" A patient >= 12 months old will be displayed as "M Years, N Months" If the practice has no patient age format specified, it defaults to the following:
  • 7 days, Show Days = true
  • 90 Days, Show Weeks = true
  • 23 Months, Show Months = true
  • 2 Years, Show Years = true
This means:
  • a patient < 7 days old will be displayed as "N Days"
  • a patient >= 7 days old and < 90 days old will be displayed as "N Weeks"
  • a patient >= 90 days old and < 23 months will be displayed as "N Months"
  • a patient >= 23 months will be displayed as "N Years"
Hide
Tim Anderson added a comment -

Part b) Add the age of the animal as of the visit date to the visit description.
has not been implemented

Show
Tim Anderson added a comment - Part b) Add the age of the animal as of the visit date to the visit description. has not been implemented
Hide
Tim Anderson added a comment -

Changes applied to:

  • archetypes, revision 4524
  • vpms, revision 4523
Show
Tim Anderson added a comment - Changes applied to:
  • archetypes, revision 4524
  • vpms, revision 4523

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved:

Time Tracking

Estimated:
Not Specified
Original Estimate - Not Specified
Remaining:
0h
Remaining Estimate - 0h
Logged:
8h
Time Spent - 8h