The facts of this case are not in dispute. In August of 1984, John and Donna Davis incurred $35,535 in medical charges at the University of Utah Hospital in connection with the premature birth of their infant daughter. The Davises’ insurance paid $26,179.29 to the hospital which left an unpaid balance of $9,355.71.
The Davises applied to Jefferson County, Idaho for indigency funds and their application was approved. The hospital then submitted a claim to Jefferson County for $9,355.71. Jefferson County determined that, pursuant to I.C. § 31-3508, it was only liable for the difference between the established reimbursement amount (stipulated to be 78% of the total bill) and the amount paid by insurance, or $1,538.01.
The county determined its obligation as follows:
Total Bill..........................$ 35,535.00
Reimbursement rate..................78
Amount Liable.....................$ 27,717.30
Less Insurance Payment............$(26,179.29)
Total Liability ................ $ 1,538.01
The hospital contends that the county’s obligation should be determined as follows:
Total Bill..........................$ 35,535.00
Reimbursement rate................$_.78
Amount Liable.....................$ 27,717.30
Total Bill..................... $ 35,535.00
Less Insurance Payment............$(26,179.29)
Total Liability ................ $ 9,355.71
On February 28, 1985, the hospital filed this action in district court seeking to recover the unpaid balance. Jefferson County moved for summary judgment. The district court granted summary judgment to the county finding that it had applied the proper formula and that $1,538.01 was the total amount it was obligated to pay. The hospital has appealed.
*2The sole question for resolution on this appeal is the amount the county is obligated to reimburse the hospital for the Davis-es’ medical treatment pursuant to Idaho’s medical indigency statutes. Title 31, chapter 35 of the Idaho Code provides that the counties of this state are required to pay for the hospitalization of the indigent sick. An earlier version of I.C. § 31-3508 obligated the county for the entire amount of “regular hospital charges,” but in 1983 that section was amended to place a ceiling on the amount the county is required to pay. Act of April 13, 1983, 1983 Idaho Sess.Laws ch. 215, p. 594. I.C. § 31-3508 now reads: “The county responsible for payment of hospitalization of a medically indigent person shall pay an amount not to exceed the reimbursement rates to the hospital rendering such services.” I.C. § 31-3508. The reimbursement rate is defined as “the unadjusted medicaid rate of reimbursement for medical charges allowed pursuant to title XIX of the social security act, as amended.” I.C. § 31-3502(4). In this case, that rate was stipulated to be 78%.
It is the hospital’s position that the county is obligated to pay the balance of the total charges after the amount received from any other sources is deducted, up to the 78% reimbursement rate ceiling. The county, on the other hand, asserts that it is only obligated to pay the difference between the 78% ceiling and the amount paid by other sources.
It is the duty of a court in construing a statute to ascertain the legislative intent and to give effect thereto. See, e.g., Carpenter v. Twin Falls County, 107 Idaho 575, 582, 691 P.2d 1190, 1197 (1984). In order to accomplish this goal, all the sections of the applicable statutes must be read together. Umphrey v. Sprinkel, 106 Idaho 700, 706, 682 P.2d 1247, 1253 (1983). To reach the result urged upon us by the hospital would require that we read I.C. § 35-3508 in a vacuum, ignoring the provisions of both I.C. § 31-3509 and § 31-3510.
I.C. § 31-3509 requires hospitals making claims for medically indigent persons to make reasonable efforts to determine if there are any other available sources of payment before submitting the bill to the county for payment. It further provides that “[i]n the event any payments are thereafter received for charges which have been paid by a county ... said sum shall be paid over to such county.” Similarly, I.C. § 31-3510 provides that once a county has paid for the hospitalization of an indigent person, it “shall become subrogated to all the rights of the hospital and to all rights of the medically indigent person against any third parties who may be liable for such hospitalization.”
It is clear that from these provisions that had the county paid the full reimbursement rate of 78% of $35,535.00, or $27,717.30, before the insurance proceeds were received, it would then have been entitled to the $26,179.29 paid by the Davises’ insurance, resulting in a net payment by the county of $1,538.01, the exact sum the county asserts it owes in this case. For us to hold that the county was required to pay $9,355.71 rather than $1,538.01, simply because the insurance proceeds were received before the hospital submitted the bill to the county rather than after, would result in an unequal operation of the statute. Such an unreasonable interpretation is necessarily to be avoided. State ex rel. Evans v. Click, 102 Idaho 443, 448, 631 P.2d 414, 419 (1981), cert. denied, 457 U.S. 1116, 102 S.Ct. 2927, 73 L.Ed.2d 1328 (1982). We agree with the district court that there is nothing in the wording of the statute in question to suggest that the legislature intended such a result. It would be illogical for us to hold that the amount a county is obligated to reimburse a hospital for its treatment of indigent patients varies depending on the fortuitious circumstance of when an insurance company tenders its payment obligation.
The decision of the district court granting summary judgment to Jefferson County is affirmed.
Costs to respondent.
No attorney fees on appeal.
SHEPARD, BISTLINE, BAKES and HUNTLEY, JJ., concur.