
461 So.2d 817 (1984)
Percy SMITH, Jr., and Eulalia Smith
v.
ALABAMA MEDICAID AGENCY.
Civ. 4450.
Court of Civil Appeals of Alabama.
November 7, 1984.
*818 J. Paul Whitehurst and Henley & Shirley, Northport, for appellant.
Charles A. Graddick, Atty. Gen., and Tom Wright, Spec. Asst. Atty. Gen., for appellee.
HOLMES, Judge.
This is a case involving the subrogation rights of the Alabama Medicaid Agency from a settlement agreement between the recipient and third parties.
The recipient of certain Medicaid benefits brought suit against third party tortfeasors for injuries that he had received. The suit was settled out of court, and the recipient later brought action to determine the amount that should be repaid to Medicaid.
The Circuit Court of Tuscaloosa County granted Medicaid's motion for summary judgment and allowed the agency to recoup 100% of the paid benefits.
The recipient contends that Medicaid should be awarded less than the full amount of expenditures made by the agency because the recipient, through settlement, received less than a full recovery from the third parties. We affirm the ruling of the trial court, in that Medicaid should be allowed to recover 100% of the benefits paid in this case.
However, we should not be understood to mean that, in every instance, based on Alabama Medicaid law, the agency should be fully reimbursed for amounts paid, as such a determination depends on the facts of a particular case.
The record in this case reveals that the recipient was injured when concrete steps collapsed as he was leaving his sister's home. The injury was to his left knee and required two operations.
The Alabama Medicaid Agency expended $6,887.55 on the recipient's behalf for the medical assistance that he received. Later, the recipient filed suit against several defendants for his injuries. Medicaid made *819 an agreement that the recipient's attorney would represent the agency in the suit and would be paid one-third of the agency's recovery.
The suit was subsequently settled on behalf of the recipient in an amount of $100,000. The recipient brought an action seeking to determine to what amount Medicaid was entitled. On motion by Medicaid, summary judgment was granted in favor of a 100% recovery by the agency, to wit, $6,887.55.
The statute that pertains to the recovery of medical assistance under the Alabama Medicaid program provides:
"(a) If medical assistance is provided to a recipient under the Alabama medicaid program for injuries, disease or sickness caused under circumstances creating a cause of action in favor of the recipient against any person, firm or corporation, then the state of Alabama shall be subrogated to such recipient's rights and shall be entitled to recover the proceeds that may result from the exercise of any rights of recovery which the recipient may have against any such person, firm or corporation to the extent of the actual amount of the medical assistance payments made by the Alabama medicaid program. The recipient shall execute and deliver instruments and papers to do whatever is necessary to secure such rights and shall do nothing after said medical assistance is provided to prejudice the subrogation rights of the state of Alabama."
Ala.Code (1975), § 22-6-6(a).
This statute was authorized under the Federal Medicaid program, which states in pertinent part:
"(C) that in any case where such a legal liability is found to exist after medical assistance has been made available on behalf of the individual and where the amount of reimbursement the State can reasonably expect to recover exceeds the costs of such recovery, the State or local agency will seek reimbursement for such assistance to the extent of such legal liability;"
42 U.S.C.A. § 1396(a)(25)(C) (West 1983).
As stated, the recipient contends that the full amount of benefits paid by Medicaid should not be reimbursed if a full recovery is not received from third parties. Medicaid, on the other hand, contends that the statute clearly authorizes and/or requires 100% recovery of benefits in every case.
Section 22-6-6 states that Medicaid "shall be subrogated to such recipient's rights and shall be entitled to recover the proceeds that may result from the exercise of any rights of recovery ... to the extent of the actual amount of the medical assistance payments made by the Alabama medicaid program." Medicaid states that "to the extent ... [of] payment" clearly means that the legislature intended 100% repayment of benefits without regard to the facts of the case.
This contention totally ignores the phrase "shall be subrogated." When a court determines legislative intent, a statute must be interpreted as a whole. Sparks v. Calhoun County, 415 So.2d 1104 (Ala.Civ.App.1982).
In Alabama, subrogation is not a matter of strict right but is an equitable principle that is dependent on the particular facts of a case. Zeigler v. Blount Brothers Construction Co., 364 So.2d 1163 (Ala. 1978). The theory behind the principle is to seek to prevent the unjust enrichment of one party at the expense of another through contribution. Liberty Mutual Insurance Co. v. Manasco, 41 Ala.App. 110, 123 So.2d 525 (Ala.Ct.App.1959), rev'd on other grounds, 271 Ala. 124, 123 So.2d 527 (1960).
When there is no special legislative intent or definition, statutory terms are to be viewed in light of their usual and ordinary meaning with consideration to the purpose and context of the statute where they are found. State v. Georgia-Florida-Alabama Equipment Co., 425 So.2d 472 (Ala.Civ.App.1982). Weight will be given to the practical effect that a proposed construction *820 will have. State v. AAA Motor Lines, Inc., 275 Ala. 405, 155 So.2d 509 (1963).
In White v. Sutherland, 92 N.M. 187, 585 P.2d 331 (N.M.Ct.App.1978), the court interpreted a very similar Medicaid statute that stated that the department "is subrogated... to the extent the department has made payment." The court held that subrogation was an equitable right that depends on the facts of the case and that 100% recovery was not required.
Some states that have interpreted similar statutes are in agreement, others are not, requiring a full recoupment. See State v. Cowdell, 421 N.E.2d 667 (Ind.Ct.App.1981); Coplien v. Department of Health and Social Services, 119 Wis.2d 52, 349 N.W.2d 92 (Wis.Ct.App.1984).
Here, it does not appear that the legislature intended any other definition of "subrogation," and, as such, a right of recovery by Medicaid is subject to equitable principles.
Because of the ordinary meaning given to the word "subrogation," we do not understand § 22-6-6 as requiring 100% recovery of medical assistance paid. Additionally, 42 U.S.C.A. § 1396(a)(25)(C) does not specifically require or even suggest 100% recovery. Rather, equitable principles should be applied to determine Medicaid's right of recovery and such would depend on the facts of each case.
In this case, the recipient made a settlement of his claim in an amount of $100,000 for the injury to his left knee. His medical expenses were $6,887.55, which is less than seven percent of his recovery. Based on these facts, the injury to the recipient, the settlement amount, medical expenses for the injury, and the absence of other facts as revealed by the record, we do not find that the trial court erred in determining Medicaid should receive the entire amount. The recipient is left with a recovery of over $93,000.
The recipient's attorney further contends that Medicaid is required to pay a reasonable attorney's fee for the attorney's effort in securing a recovery from the third parties.
The judgment of the trial court granting the motion for summary judgment did not specifically address the issue of attorney's fees which were claimed in the recipient's complaint. The trial court simply granted Medicaid's motion for summary judgment. As such, it appears that the trial court by implication has denied an attorney's fee.
In this state, "attorneys' fees are recoverable only when authorized by statute, when provided in a contract, or by special equity, such as in a proceeding where the efforts of an attorney create a fund out of which fees may be paid." Eagerton v. Williams, 433 So.2d 436, 450 (Ala.1983).
Here, there appears to be a written contract for fees and a "common fund." This court stated in Henley & Clarke v. Blue Cross-Blue Shield of Alabama, 434 So.2d 274 (Ala.Civ.App.1983), that in order to have a "common fund" there must be a "fund" from which to compensate the attorney, that the attorney's services must benefit that "fund," and the party that seeks the fee and the party that is to be charged with the fee must both have some interest in the "fund."
In this case, it appears the settlement agreement created a fund and the recipient's attorney benefited that fund. Medicaid cannot now say that it did not have an interest in the fund and was not benefited by the attorney's action.
Attorney's fees should have been awarded to the recipient's attorney by Medicaid and the trial court erred in not making such an award.
In summary, we cannot say that the facts in this case demand that Medicaid should recover less than 100% of the benefits paid, and the trial court did not err in granting summary judgment that awarded full recovery.
Attorney's fees, however, should have been awarded to the recipient's attorney, *821 and the denial by the trial court is due to be reversed.
AFFIRMED IN PART AND REVERSED AND REMANDED IN PART.
WRIGHT, P.J., and BRADLEY, J., concur.
