IF expenses > deductible sub_total = deductible + (coinsurance * (expenses - deductible)) + copayments ELSE sub_total = expenses + copayments IF sub_total > out_of_pocket_maximum total = out_of_pocket_maximum + annual_premium ELSE total = sub_total + annual_premium