Logo GenPRES

AgeValue Module

Creates an age in years, months, weeks and days, converts the age to and from days, compares ages and returns the age type.

Nested modules

Modules Description

Dto

Holds the Dto of an age and converts an age to and from the Dto. Returns a validation error for a part outside the allowed bounds.

Operators

Holds the comparison operators for two ages, which compare the ages in days.

Optics

Holds a getter and setter pair for the years, the months, the weeks and the days of an age.

SetGet

Gets and sets the years, months, weeks and days of an age, also as plain integers that read 0 for a missing part.

Validation

Holds the validators and the options for the years, months, weeks and days of an age, with at most 120 years.

Functions and values

Function or value Description

comp op a1 a2

Full Usage: comp op a1 a2

Parameters:
Returns: 'a
Type parameters: 'a
op : int<MeasureProduct<day, MeasureOne>> -> int<MeasureProduct<day, MeasureOne>> -> 'a
a1 : AgeValue
a2 : AgeValue
Returns: 'a

create years months weeks days

Full Usage: create years months weeks days

Parameters:
Returns: AgeValue
years : int<MeasureProduct<year, MeasureOne>> option
months : int<MeasureProduct<month, MeasureOne>> option
weeks : int<MeasureProduct<week, MeasureOne>> option
days : int<MeasureProduct<day, MeasureOne>> option
Returns: AgeValue

eighteen

Full Usage: eighteen

Returns: AgeValue
Returns: AgeValue

fromAgeType _arg1

Full Usage: fromAgeType _arg1

Parameters:
Returns: AgeValue
_arg1 : AgeType
Returns: AgeValue

fromBirthDate now bd

Full Usage: fromBirthDate now bd

Parameters:
Returns: AgeValue

Returns the age at a date of a patient born on the birth date, from the whole days between the two dates, split by fromDays. Raises an argument exception for a birth date after the date.

now : DateTime
bd : BirthDate
Returns: AgeValue

fromDays days

Full Usage: fromDays days

Parameters:
Returns: AgeValue

Splits a number of days into years of 365 days, months of 30 days (at most 11), weeks and days. getAgeInDays of the result returns the same number of days.

days : int<MeasureProduct<day, MeasureOne>>
Returns: AgeValue

fromValueUnit vu

Full Usage: fromValueUnit vu

Parameters:
Returns: AgeValue

A time value as an age value, rounded down to whole days.

vu : ValueUnit
Returns: AgeValue

get arg1

Full Usage: get arg1

Parameters:
Returns: int<MeasureProduct<year, MeasureOne>> option * int<MeasureProduct<month, MeasureOne>> option * int<MeasureProduct<week, MeasureOne>> option * int<MeasureProduct<day, MeasureOne>> option

getAgeInDays av

Full Usage: getAgeInDays av

Parameters:
Returns: int<MeasureProduct<day, MeasureOne>>

none

Full Usage: none

Returns: AgeValue
Returns: AgeValue

one

Full Usage: one

Returns: AgeValue
Returns: AgeValue

oneMonth

Full Usage: oneMonth

Returns: AgeValue
Returns: AgeValue

sixteen

Full Usage: sixteen

Returns: AgeValue
Returns: AgeValue

ten

Full Usage: ten

Returns: AgeValue
Returns: AgeValue

three

Full Usage: three

Returns: AgeValue
Returns: AgeValue

toAgeType a

Full Usage: toAgeType a

Parameters:
Returns: AgeType
a : AgeValue
Returns: AgeType

toString av

Full Usage: toString av

Parameters:
Returns: string
av : AgeValue
Returns: string

toValueUnit av

Full Usage: toValueUnit av

Parameters:
Returns: ValueUnit

The age in days as a time value in days.

av : AgeValue
Returns: ValueUnit

zero

Full Usage: zero

Returns: AgeValue
Returns: AgeValue

Type something to start searching.