Logo GenPRES

AgeWeeksDays Module

Converts an age in weeks and days to and from days, calculates the post-menstrual age and checks whether a gestational age is below term.

Nested modules

Modules Description

Dto

Holds the Dto of an age in weeks and days and converts the age to and from the Dto. Returns a validation error for weeks or days outside the bounds.

Operators

Holds the comparison operators for two ages in weeks and days.

Optics

Holds a getter and setter pair for the weeks and for the days of an age in weeks and days.

SetGet

Gets and sets the weeks and the days of an age in weeks and days.

Validation

Holds the validators and the options for a gestational age: 20 to 52 weeks and 0 to 6 days.

Functions and values

Function or value Description

comp op awd1 awd2

Full Usage: comp op awd1 awd2

Parameters:
    op : 'a -> 'b -> 'c
    awd1 : 'a
    awd2 : 'b

Returns: 'c
Type parameters: 'a, 'b, 'c
op : 'a -> 'b -> 'c
awd1 : 'a
awd2 : 'b
Returns: 'c

create w d

Full Usage: create w d

Parameters:
Returns: AgeWeeksDays

fromDays days

Full Usage: fromDays days

Parameters:
Returns: AgeWeeksDays

A number of days as weeks and days.

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

fromValueUnit vu

Full Usage: fromValueUnit vu

Parameters:
Returns: AgeWeeksDays

A time value as weeks and days, rounded down to whole days.

vu : ValueUnit
Returns: AgeWeeksDays

fromWeeks w

Full Usage: fromWeeks w

Parameters:
Returns: AgeWeeksDays

isPreterm awd

Full Usage: isPreterm awd

Parameters:
Returns: bool

Whether a gestational age is below term.

awd : AgeWeeksDays
Returns: bool

isPretermValue vu

Full Usage: isPretermValue vu

Parameters:
Returns: bool

Whether a gestational age given as a time value is below term.

vu : ValueUnit
Returns: bool

postMenstrualAge av ga

Full Usage: postMenstrualAge av ga

Parameters:
Returns: AgeWeeksDays

Returns the post-menstrual age in weeks and days: the age in days plus the gestational age.

av : AgeValue
ga : AgeWeeksDays
Returns: AgeWeeksDays

term

Full Usage: term

Returns: AgeWeeksDays

The gestational age at term: 37 weeks, where the FullTerm gestation type starts.

Returns: AgeWeeksDays

toDays awd

Full Usage: toDays awd

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

toGestation

Full Usage: toGestation

Returns: AgeWeeksDays -> GestationType

toString awd

Full Usage: toString awd

Parameters:
Returns: string
awd : AgeWeeksDays
Returns: string

toValueUnit awd

Full Usage: toValueUnit awd

Parameters:
Returns: ValueUnit

Weeks and days as a time value in days, the inverse of fromValueUnit.

awd : AgeWeeksDays
Returns: ValueUnit

Type something to start searching.