Hi there!
I keep feeling like the way to do this is just within reach... and then I try and I still can't figure it out
What I want to have happen is to select one or more options from a dropdown (I've successfully made this part, at least! After this I'm stuck). Then, I'd like a numeric value (estimated cost of treatment) assigned to each option and plugged into a formula to calculate out of pocket cost using deductible, coinsurance, and maximum out of pocket values that are filled in according to the member's plan earlier in the snippet.
So if I've selected treatments "x" "y" and "z" from my dropdown, I want it to assign the approximate cost I will have put in to the selected treatments and plug it into a formula, using the first value occurring on the list to calculate out of pocket cost. So, "x" is assigned a value of $2,000,"y" is assigned $500, and "z" is assigned $1500. I've put in a deductible of $500, 10% coinsurance and $2,000 maximum out of pocket. So assuming all are billed in the order selected on the list, the patient could expect to pay their $500 deductible + 10% of the remaining $1500 for x. for y they'd have met their deductible and would only be responsible for the 10% coinsurance, so $50. Same for z - 10%, unless the out of pocket cost meets a maximum out of pocket amount that I entered earlier in the snippet - out of pocket cost is equal to maximum out of pocket, patient responsibility for anything else checked would be 0.
I hope that makes sense! If anyone can help me create the formula needed for that, I'd be so thankful!