Previous Topic

Next Topic

Book Contents

_NormalizeDateToMax(Date)

Normalizes a single date time value by replacing any parts that are UNKNOWN or EMPTY with the maximum value for that part.

Syntax

_NormalizeDateToMax(dateToNormalize)

Parameters

Parameters for _NormalizeDateToMax(Date)

Parameter

Definition

Data type

dateToNormalize

The date time to normalize.

PFDateTime

Returns

A new date time with all UNKNOWN or EMPTY parts replaced with their respective maximum values:

Notes

The _NormalizeDateToMax function accounts for leap years and returns the correct number of days in February of any year.

Example

The requirement in this example is to find the duration of a previous disease by subtracting the disease start date from the disease end date in the medical history. An unknown month and day are allowed for both start date and end date. An additional requirement is to substitute unknown date parts with the earliest number for start date and with the latest number for end date so that the longest possible duration of disease is assumed.

To accomplish this:

Send Feedback