The Museum of HP Calculators

HP Forum Archive 16

[ Return to Index | Top of Index ]

Need help using solver on HP 19BII
Message #1 Posted by Kim Ragone on 3 July 2006, 12:03 a.m.

I hate to admit this, but I'm really getting rusty in my math skills. If anyone could help me out it would be greatly appreciated.

I would like to program my HP's solve function so my better half could use it on her work at the local hospital.

Here's a sample scenario:

A patients procedure comes to $1,200 and there's a 50% discount on that procedure to the insurance company which then comes to $600. The patient have a deductible of $250 which leaves 350.00. The insurance co. portion is 80% which leaves $70 plus the deductible of $250 for a total patient payment of $320.00

Sometimes the deductible has been meet which leaves it out of the equation.

I have tried and tried, but can't seem to come up with a formula that works. Any help would be appreciated.

Kim

      
Re: Need help using solver on HP 19BII
Message #2 Posted by Karl Schneider on 3 July 2006, 3:49 a.m.,
in response to message #1 by Kim Ragone

Kim --

I have the HP-17B, -17BII, and -27S, which utilize the same solve function, to my understanding.

Why not incorporate into the equation a binary variable (which takes a value 0 or 1) as a multiplier of the deductible?

-- KS

            
Re: Need help using solver on HP 19BII
Message #3 Posted by Kim Ragone on 3 July 2006, 12:11 p.m.,
in response to message #2 by Karl Schneider

Karl, I'm a total novice and wouldn't know how to do that. I appreciate you trying to help me though.

Kim

      
Re: Need help using solver on HP 19BII
Message #4 Posted by Hal on 3 July 2006, 8:46 a.m.,
in response to message #1 by Kim Ragone

Hello Kim,
I'm no expert on the 19BII specifically, but it seems to me that the equation you need would be the simple sum of a list of variables, with some of those variables modified by a percentage, etc. You could have variables such as: PT TOTAL (patient total due),INS TOTAL (insurance total) PROCEDURE COST, INS DISCOUNT, DEDUCTABLE, DED AMNT COVERED (amount of deductable already covered), and INS PERCENT (amount of procedure covered by insurance).
The equation would arrive at the patient cost by subtracting the amount covered by the insurance from the discounted cost of the procedure, and also subtracting the deductable already covered (if any).The equation would look something like this...
PT TOTAL=(PROCEDURE COST x INS DISCOUNT /100)-(((PRODEDURE COST x INS DISCOUNT / 100)-DEDUCTABLE) x (INS PERCENT /100))-DED AMT COVERED

Plug amounts in for everything except PT TOTAL and solve for PT TOTAL, and it should work. (I put the RPN version of the equation into my HP97 and ran it (I used registers for the variables) and the numbers came out right).


Hope this helps.
Best regards, Hal

            
Re: Need help using solver on HP 19BII
Message #5 Posted by Kim Ragone on 3 July 2006, 12:55 p.m.,
in response to message #4 by Hal

Hi Hal, I greatly appreciate you help in this matter. I plugged your numbers in on my HP, but have a couple of problems. If the INS DISCOUNT is 20% (making it a more expensive procedure) it comes up with a lower total than when using 50% Also, shouldn't I add the DED AMT COVERED back in rather than subtracting it? Would I have to input the deductible amoung twice?

Thanks,

Kim

                  
Re: Need help using solver on HP 19BII
Message #6 Posted by Hal on 4 July 2006, 1:15 p.m.,
in response to message #5 by Kim Ragone

Good catch Kim,

You're right, my formula had a bug...I needed to subtract the insurance discount from 100 before applying it to the cost of the procedure (ie, a 20% discount means 80% of the cost is billed). So the corrected formula is:

PT TOTAL=(PROCEDURE COST x (100-INS DISCOUNT) /100)-(((PRODEDURE COST x (100-INS DISCOUNT) / 100)-DEDUCTABLE) x (INS PERCENT /100))-DED AMT COVERED

As for the deductable amount already covered, that needs to be subtracted from what the patient owes to make the numbers work in this equation. Using your scenario, when I plugged 250 in for DED AMT COVERED, I got the patient owing $70, which works out right.
This will work on any programmable machine, using registers to store the variables (5 registers). Where you have named variable capability on your 19BII, that's even more elegant.

I see you already have a solution, but I'll post this anyway. If you want the actual RPN keystroke sequence for entering the equation, let me know and I'll post it.
Best regards, Hal

      
Re: Need help using solver on HP 19BII
Message #7 Posted by Tom Sherman on 3 July 2006, 8:32 p.m.,
in response to message #1 by Kim Ragone

Kim,

The following should work for you:

MEDCOST: PAY=(COST*(1-DISC/100))*(1-IPER/100)+(DUCT*IPER/100)

where DISC is the % discount, IPER is the % covered by insurance, and DUCT is the patient deductible.

As wonderful as the HP Solver and the HP-19BII are, I think that for applications such as this, a BASIC program is less prone to operator mistakes (such as forgetting to enter a variable, or forgetting to clear the data from a previous case). The following program is for the HP-71B, but by omitting the first line, it would run on most handheld calculator/computers that have BASIC.

10 DESTROY ALL @ FIX 2 @ DELAY 8

20 INPUT "PROCEDURE COST =";C

30 INPUT "% INSURER DISCOUNT =";D

40 N=C*(1-D/100)

50 INPUT "PATIENT'S DEDUCTIBLE =";P

60 INPUT "% INSURER COVERS =";I

70 A=(N-P)*I/100

80 B=N-A

90 PRINT "INSURER PAYS =";A

100 PRINT "PATIENT PAYS =";B

110 END

I hope you get something worked out to your satisfaction.

Cheers, Tom

            
Re: Need help using solver on HP 19BII
Message #8 Posted by Kim Ragone on 4 July 2006, 3:38 a.m.,
in response to message #7 by Tom Sherman

Tom, you did it!!! Thank you so much for your help. When I first set out to try to do this, I figured it would be somewhat simple, but I kept running into problems. After seeing your formula, there is no way I would have made it without your help. Thanks again,

Kim

                  
Re: Need help using solver on HP 19BII
Message #9 Posted by Tom Sherman on 6 July 2006, 9:43 a.m.,
in response to message #8 by Kim Ragone

Kim,

It was a pleasure thinking about this problem. On further thought, I realized that a situation could arise which should be noted.

If the patient's deductible is greater than the discounted cost of the procedure, then the patient pays the whole discounted cost and the insurance is not involved at all. The formula will still handle this case, but only if the IPER (insurance percentage) is given a value of zero. If any other IPER value is entered, the formula will give a wrong value when the discounted cost is less than the deductible.

The HP-19BII allows for a conditional statement to be added which would prevent such a possible error. The entire Solver statement would then read:

MEDCOST: PAY=IF (COST*(1-DISC/100)>DUCT: (COST*(1-DISC/100))*(1-IPER/100)+(DUCT*IPER/100): COST*(1-DISC/100))

In this form, if the statement following the IF is true, the Solver equates PAY to the first formula after the colon, and if it is false, it equates it to the second formula. That way, the operator doesn't have to make sure that the IPER value is zero when the deductible is greater than the discounted cost.

You may not want to bother with this, but it adds a flourish to the Solver statement!

Cheers, Tom


[ Return to Index | Top of Index ]

Go back to the main exhibit hall