cost_iv_administration: Cost of administration for an intravenous treatment

Description Usage Arguments Details Value Examples

View source: R/convenience.R

Description

Cost of administration for an intravenous treatment

Usage

1
2
cost_iv_administration(iv_time, cost_first_unit, cost_addl_units,
  prorate_first = FALSE)

Arguments

iv_time

The infusion time, in units compatible with the costs

cost_first_unit

cost for the first time unit

cost_addl_units

cost for the second time unit

prorate_first

can we charge for less than 1 unit of time? See details.

Details

Simple formula: cost for the first time unit (prorated if total time is less than one unit and prorate_first == TRUE) plus the prorated cost for additional units.

If prorate_first == FALSE, then the smallest time that can be charged is one time unit. For example, if time = 0.5 and prorate_first == TRUE, the function will charge for one half of a time unit. If time = 0.5 and prorate_first == FALSE, the function will charge for a full time unit.

Value

the cost

Examples

1
2
3
4
cost_iv_administration(0.5, 100, 20, prorate_first = TRUE) # = 50
cost_iv_administration(1.5, 100, 20, prorate_first = TRUE) # = 110
cost_iv_administration(0.5, 100, 20, prorate_first = FALSE) # = 100
cost_iv_administration(1.5, 100, 20, prorate_first = FALSE) # = 110

MattWiener/heemodFits documentation built on May 19, 2019, 8:21 a.m.