The maximum plausible prescription length in months
method
Either 'truncate' or 'remove'. See details
Value
A data frame of the same structure as the input, possibly with some elements of the duration column changed
Details
The method 'truncate' causes any duration longer than max_months to
be replaced with the value of max_months (albeit converted to days).
The method 'remove' causes such durations to be replaced with NA.
There is no explicit 'ignore' method, but if you want to 'do nothing', simply
set max_months to an arbitrarily high number.
By default, the maximum is infinite, so nothing should happen.
(Of course, you could also just not run the function...)