Represents the difference between two dates or date series (i.e. it is what you
get when you perform subtractions on DatePatientSeries
or DateEventSeries).
The value of the date difference in days (can be positive or negative).
The value of the date difference in whole weeks (can be positive or negative).
The value of the date difference in whole calendar months (can be positive or
negative).
The value of the date difference in whole calendar years (can be positive or
negative).
Represents a duration of time specified in days.
Example usage:
last_medication_date = medications.sort_by(medications.date).last_for_patient().date
start_date = last_medication_date - days(90)
end_date = last_medication_date + days(90)
Return True if other
has the same value and units, and False otherwise.
Hence, the result of weeks(1) == days(7)
will be False.
Return the inverse of ==
above.
If other
is a date or date series, add this duration to other
to produce a new date.
If other
is another duration with the same units, add the two durations
together to produce a new duration.
Subtract other
from this duration. other
must be a
duration in the same units.
Invert this duration, i.e. count the duration backwards in time
if it was originally forwards, and vice versa.
Return a list of time intervals covering the duration starting on
date
. Each interval lasts one unit.
Example usage:
weeks(3).starting_on("2000-01-01")
The above would return:
[
(date(2000, 1, 1), date(2000, 1, 7)),
(date(2000, 1, 8), date(2000, 1, 14)),
(date(2000, 1, 15), date(2000, 1, 21)),
]
Useful for generating the intervals
arguments to Measures
.
Return a list of time intervals covering the duration ending on
date
. Each interval lasts one unit.
Example usage:
weeks(3).ending_on("2000-01-21")
The above would return:
[
(date(2000, 1, 1), date(2000, 1, 7)),
(date(2000, 1, 8), date(2000, 1, 14)),
(date(2000, 1, 15), date(2000, 1, 21)),
]
Useful for generating the intervals
arguments to Measures
.
Represents a duration of time specified in calendar months.
Example usage:
last_medication_date = medications.sort_by(medications.date).last_for_patient().date
start_date = last_medication_date - months(3)
end_date = last_medication_date + months(3)
Consider using days()
or weeks()
instead -
see the section on Ambiguous Dates for more.
Return True if other
has the same value and units, and False otherwise.
Hence, the result of weeks(1) == days(7)
will be False.
Return the inverse of ==
above.
If other
is a date or date series, add this duration to other
to produce a new date.
If other
is another duration with the same units, add the two durations
together to produce a new duration.
Subtract other
from this duration. other
must be a
duration in the same units.
Invert this duration, i.e. count the duration backwards in time
if it was originally forwards, and vice versa.
Return a list of time intervals covering the duration starting on
date
. Each interval lasts one unit.
Example usage:
weeks(3).starting_on("2000-01-01")
The above would return:
[
(date(2000, 1, 1), date(2000, 1, 7)),
(date(2000, 1, 8), date(2000, 1, 14)),
(date(2000, 1, 15), date(2000, 1, 21)),
]
Useful for generating the intervals
arguments to Measures
.
Return a list of time intervals covering the duration ending on
date
. Each interval lasts one unit.
Example usage:
weeks(3).ending_on("2000-01-21")
The above would return:
[
(date(2000, 1, 1), date(2000, 1, 7)),
(date(2000, 1, 8), date(2000, 1, 14)),
(date(2000, 1, 15), date(2000, 1, 21)),
]
Useful for generating the intervals
arguments to Measures
.
Represents a duration of time specified in weeks.
Example usage:
last_medication_date = medications.sort_by(medications.date).last_for_patient().date
start_date = last_medication_date - weeks(12)
end_date = last_medication_date + weeks(12)
Return True if other
has the same value and units, and False otherwise.
Hence, the result of weeks(1) == days(7)
will be False.
Return the inverse of ==
above.
If other
is a date or date series, add this duration to other
to produce a new date.
If other
is another duration with the same units, add the two durations
together to produce a new duration.
Subtract other
from this duration. other
must be a
duration in the same units.
Invert this duration, i.e. count the duration backwards in time
if it was originally forwards, and vice versa.
Return a list of time intervals covering the duration starting on
date
. Each interval lasts one unit.
Example usage:
weeks(3).starting_on("2000-01-01")
The above would return:
[
(date(2000, 1, 1), date(2000, 1, 7)),
(date(2000, 1, 8), date(2000, 1, 14)),
(date(2000, 1, 15), date(2000, 1, 21)),
]
Useful for generating the intervals
arguments to Measures
.
Return a list of time intervals covering the duration ending on
date
. Each interval lasts one unit.
Example usage:
weeks(3).ending_on("2000-01-21")
The above would return:
[
(date(2000, 1, 1), date(2000, 1, 7)),
(date(2000, 1, 8), date(2000, 1, 14)),
(date(2000, 1, 15), date(2000, 1, 21)),
]
Useful for generating the intervals
arguments to Measures
.
Represents a duration of time specified in calendar years.
Example usage:
last_medication_date = medications.sort_by(medications.date).last_for_patient().date
start_date = last_medication_date - years(1)
end_date = last_medication_date + years(1)
Consider using days()
or weeks()
instead -
see the section on Ambiguous Dates for more.
Return True if other
has the same value and units, and False otherwise.
Hence, the result of weeks(1) == days(7)
will be False.
Return the inverse of ==
above.
If other
is a date or date series, add this duration to other
to produce a new date.
If other
is another duration with the same units, add the two durations
together to produce a new duration.
Subtract other
from this duration. other
must be a
duration in the same units.
Invert this duration, i.e. count the duration backwards in time
if it was originally forwards, and vice versa.
Return a list of time intervals covering the duration starting on
date
. Each interval lasts one unit.
Example usage:
weeks(3).starting_on("2000-01-01")
The above would return:
[
(date(2000, 1, 1), date(2000, 1, 7)),
(date(2000, 1, 8), date(2000, 1, 14)),
(date(2000, 1, 15), date(2000, 1, 21)),
]
Useful for generating the intervals
arguments to Measures
.
Return a list of time intervals covering the duration ending on
date
. Each interval lasts one unit.
Example usage:
weeks(3).ending_on("2000-01-21")
The above would return:
[
(date(2000, 1, 1), date(2000, 1, 7)),
(date(2000, 1, 8), date(2000, 1, 14)),
(date(2000, 1, 15), date(2000, 1, 21)),
]
Useful for generating the intervals
arguments to Measures
.