#!/usr/bin/perl # script: wcmedicalinterest.pl # Copyright (C) 2003 J. William Snyder, Jr. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA use strict; use CGI qw/:standard/; use POSIX; my $versiondate = "July 31, 2003"; my $doihmon; my $doihday; my $doihyear; my $doihraw; my $dopmon; my $dopday; my $dopyear; my $dopraw; my $interesttotal; my @provider; my @dosmon; my @dosday; my @dosyear; my @dosraw; my @charge; my @interest; my $intratedaily = 0.08 / 364; # 8% per annum reduced to a daily rate my $entries = 25; my $n; sub legalbackground { print hr; print ""; print "This program calculates the interest due on medical "; print "compensation awarded by the NCIC full Commission pursuant to N.C."; print "Gen. Stat. Sec. 97-86.2, which mandates that an employer that "; print "is ordered to pay compensation pursuant to an award of the full "; print "Commission pay interest on the award at the legal rate "; print "prescribed by N.C. Gen. Stat. Sec. 24-1. The rate prescribed by N.C."; print "Gen. Stat. Sec. 24-1 is \"eight \(8\%\) per annum\."; print "Although the statutes are silent about whether simple or "; print "compound interest is to be paid, the Commission in Tracy "; print "W. Moore v. Standard Mineral Company, I.C. File No. "; print "177919 (March 19, 1998) held that 8% simple interest "; print "(Math formula: Interest = Principal X Rate X Time) is to "; print "be paid unless the plaintiff can prove that s/he could "; print "have obtained a greater return than 8% simple interest on "; print "the compensation awarded. The Court of Appeals held in "; print "Childress v. Trion, 125 N.C. App. 588, 481 S.E.2d 697, "; print "disc. rev. denied, 346 N.C. 276, 487 S.E.2d 541 (1997), "; print "that interest is due not only on indemnity compensation "; print "awarded by the full Commission but also on medical "; print "compensation awarded as well. The method used by this "; print "program is modeled after the method used by Commissioner "; print "Thomas Bolch to calculate the interest on indemnity "; print "compensation due in Robert "; print "Moore v. Foam Ex, I.C. File No. 241740 (April 1, 1999). "; print "This program assumes 1. a charge for medical services "; print "rendered is due and payable on the date of service, 2. 1 "; print "year = 364 days for purposes of determining the daily rate "; print "of interest from 8% per annum, 3. interest on medical "; print "expenses rendered before the date of the hearing is "; print "calculated from the date of the hearing to the date of "; print "payment, and 4. interest on medical expenses rendered "; print "after the date of the hearing is calculated from the "; print "date of service to the date of payment. The program "; print "produces a total of the interest on the medical expenses "; print "entered."; print "
"; print ""; print "
This version of the program was released on $versiondate.
"; print ""; print hr; } if (!param()) { print header; print "\n"; print "
"; print "

NCIC full Commission award interest on medical compensation calculation program: data entry form

"; print "
"; &legalbackground; print startform("GET","","application/x-www-form-urlencoded"); print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; for ($n=1; $n<=$entries; $n++) { print ""; print ""; print ""; print ""; print ""; } print "
"; print "Date of initial hearing (MM/DD/YYYY): "; print ""; print textfield('doihmon','',2,2), "/", textfield('doihday','',2,2),"/", textfield('doihyear','',4,4); print "
"; print "Date of payment (MM/DD/YYYY): "; print ""; print textfield('dopmon','',2,2), "/", textfield('dopday','',2,2), "/", textfield('dopyear','',4,4); print "
"; print "Name of Provider"; print ""; print "Date of service (MM/DD/YYYY)"; print ""; print "Charge"; print "
"; print textfield("provider$n",'',75,75); print ""; print textfield("dosmon$n",'',2,2), "/", textfield("dosday$n",'',2,2), "/", textfield("dosyear$n",'',4,4); print ""; print "\$"; print textfield("charge$n",'',10,10); print "
"; print br; print submit("Run interest calculations"); print " "; print reset("Clear Form"); print end_form; print hr; } if (param()) { $doihmon = param('doihmon') - 1; $doihday = param('doihday'); $doihyear = param('doihyear') - 1900; $doihraw = POSIX::mktime(0, 0, 0, $doihday, $doihmon, $doihyear); $dopmon = param('dopmon') - 1; $dopday = param('dopday'); $dopyear = param('dopyear') - 1900; $dopraw = POSIX::mktime(0, 0, 0, $dopday, $dopmon, $dopyear); for ($n=1; $n<=10; $n++) { $provider[$n] = param("provider$n"); $dosmon[$n] = param("dosmon$n") - 1; $dosday[$n] = param("dosday$n"); $dosyear[$n] = param("dosyear$n") - 1900; $dosraw[$n] = POSIX::mktime(0, 0, 0, $dosday[$n], $dosmon[$n], $dosyear[$n]); $charge[$n] = param("charge$n"); if (POSIX::difftime($dopraw, $doihraw) < POSIX::difftime($dopraw, $dosraw[$n])) { $interest[$n] = $charge[$n] * $intratedaily * (POSIX::difftime($dopraw, $doihraw) / (60 * 60 * 24)); $interesttotal += $interest[$n]; } else { $interest[$n] = $charge[$n] * $intratedaily * (POSIX::difftime($dopraw, $dosraw[$n]) / (60 * 60 * 24)); $interesttotal += $interest[$n]; } } print header; print "\n"; print "
"; print "

NCIC full Commission award interest on medical compensation calculation program

"; print "
"; &legalbackground; print "
"; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; for ($n=1; $n < $entries; $n++) { if ($dosraw[$n] != 0) { print ""; print ""; print ""; print ""; print ""; print ""; } else { print " "; } } print ""; print ""; print ""; print ""; print "
"; print "Date of initial hearing: "; print ""; print strftime "%B %d, %Y", localtime($doihraw); print "
"; print "Date of payment: "; print ""; print strftime "%B %d, %Y", localtime($dopraw); print "
"; print "Name of Provider"; print ""; print "Date of service"; print ""; print "Charge"; print ""; print "Interest"; print "
"; print $provider[$n]; print ""; print strftime "%B %d, %Y", localtime($dosraw[$n]); print ""; print "\$"; printf "%.2f", "$charge[$n]"; print ""; print "\$"; printf "%.2f", $interest[$n]; print "
"; print "Total interest:"; print ""; print "\$"; printf "%.2f", $interesttotal; print "
"; print "
"; print ""; print "Results generated by wcmedicalinterest.pl, written by J. William Snyder, Jr. (jwsnyder\@jwsnyder.com) $versiondate.
"; print "Date this calculation was generated: "; print strftime "%A, %B %d, %Y", localtime(time); print ". "; print "The calculations produced by this program are render \"AS IS\" with no warranty of any kind whatsoever, even if the calculation turns out to be inaccurate. The user of this program assumes all responsibility and risk for the use of the figures generated by this program."; print "
"; print "
"; print ""; print ""; }