
928 P.2d 766 (1996)
Abel TREVINO, Plaintiff-Appellant,
v.
HHL FINANCIAL SERVICES, INC., a Delaware corporation; and University Hospital, a Colorado non-profit corporation, Defendants-Appellees.
No. 94CA2138.
Colorado Court of Appeals, Div. IV.
April 4, 1996.
As Modified on Denial of Rehearing May 9, 1996.
Certiorari Granted November 18, 1996.
*767 Thomas D. McFarland, Littleton, for Plaintiff-Appellant.
Machol, Johannes & Vanstrom, P.C., Jacques A. Machol, III, Denver, for Defendant-Appellee HHL Financial Services, Inc.
Sabey, Johns, Ordelheide & Smith, P.C., Melvin B. Sabey, Ann E. Edelman, Denver, for Defendant-Appellee University Hospital.
Opinion by Chief Judge STERNBERG.
Plaintiff, Abel Trevino, appeals a summary judgment entered in favor of defendants, HHL Financial Services, Inc., a collection agency (HHL), and University Hospital. We affirm.
Trevino was injured in a slip-and-fall accident at an apartment complex on December 31, 1992, and was admitted to University Hospital for treatment. Upon his admission, he signed an "Admission Agreement" promising *768 to pay for the costs of his care as well as costs of collection, including attorney fees, should University Hospital be required to pursue any action to collect payment.
Trevino retained an attorney to represent him in his claim against the owner of the apartment complex, who was represented by his liability insurer, Hartford Insurance Company. In the meantime, Trevino applied for and was granted indigency status under the hospital's indigent discount program. That program requires that available third-party resources be exhausted prior to acquiring an indigency rating and that the rating may be reversed if third-party resources are later found. Trevino did not notify the hospital at that time of his claim against Hartford or of the third-party resources available from that source.
The hospital billed Trevino for his medical care under several different accounts, with the largest being for the amount of $13,703.97. When the hospital's effort to collect proved unsuccessful, HHL sued on the account. HHL's counterclaim alleged the claim had been assigned to it by the hospital; Trevino's reply does not deny this allegation, and no issue is raised on appeal of the authority of HHL to sue. Indeed, the appellant's brief in this court repeatedly refers to HHL as "assignee." In October 1993, HHL filed a hospital lien authorized under § 38-27-101, C.R.S. (1995 Cum.Supp.) on behalf of University Hospital against any amount that Trevino might recover from a third party. The only account that University Hospital had not assigned for collection was one for $512.02.
Hartford settled Trevino's claim in January 1994 for $80,000, and paid the proceeds in two separate checks. The first was in the amount of the $13,703.97 hospital lien, and was made jointly payable to HHL, Trevino, and Trevino's attorney. The second check was for the balance of the settlement and was made payable jointly to Trevino and his attorney.
Trevino's attorney advised HHL of the settlement, but sought to reduce the amount payable against the hospital lien by a proportional share of his attorney fees. He also sought to reduce further the amount due by asserting that Trevino had been 50% comparatively negligent in his slip-and-fall accident, even though that determination had never been litigated. For these reasons, Trevino proposed to pay HHL only $4,562.16 of the $13,703.97 hospital lien check in satisfaction of all outstanding obligations of Trevino to University Hospital.
In March 1994, after HHL refused the proposal, Trevino sent a restrictively endorsed check to the hospital for $512.02, the amount still owed directly to the hospital after it had assigned Trevino's largest account to HHL. The hospital negotiated that check. Trevino claimed the payment satisfied all of his accounts with the hospital.
Finally, Trevino filed suit against HHL and University Hospital in April 1994, seeking a declaratory judgment establishing relative rights and responsibilities of the parties with regard to the $13,703.97. The defendants counterclaimed against Trevino for enforcement of the statutory hospital lien and for breach of the Admission Agreement contract.
The trial court dismissed Trevino's claim, granted summary judgment in favor of HHL and the hospital on their counterclaims, and awarded attorney fees and costs against Trevino. This appeal followed.

I.
At the outset, contrary to Trevino's contention, we hold that the hospital did not discharge its claim when it negotiated the restrictively endorsed check.
At the time Trevino tendered the $512.02 check in April 1994, he knew that the hospital had assigned its claim for the $13,703.97 to HHL and that HHL had filed a hospital lien for that amount. The record shows that he had attempted to negotiate the amount due on that lien with HHL in January 1994.
These circumstances make the following principle dispositive of Trevino's contention. After notice of a valid assignment, payment to the assignor or any person other than the assignee is at the debtor's peril and does not discharge him from liability to the assignee. Mid-States Sales Co. v. Mountain *769 Empire Dairymen's Ass'n., 741 P.2d 342 (Colo.App.1987). See also § 4-9-318(3), C.R.S. (1992 Repl.Vol. 2) (debtor may pay the assignor until he receives notification that the account has been assigned and that he is to make payment to the assignee.)

II.
The principal question presented by this appeal is whether the equitable "common fund" doctrine should apply to a hospital lien situation so that the hospital would have to pay a proportionate share of Trevino's attorney fees. We agree with the trial court that application of this doctrine is precluded as a matter of law.
The "common fund" doctrine is a basic rule of equity that permits an apportionment of attorney fees under circumstances in which a party has been successful in creating a fund from which other passive beneficiaries derive monetary advantage. The rationale behind the doctrine is prevention of unjust enrichment by requiring the beneficiaries to bear a fair share of the costs of litigation. County Workers Compensation Pool v. Davis, 817 P.2d 521 (Colo.1991); Castellari v. Partners Health Plan of Colorado, Inc., 860 P.2d 593 (Colo.App.1993). See also Osborne v. State Farm Mutual Automobile Insurance Co., 923 P.2d 304 (Colo.App.1996).
Colorado cases applying the common fund doctrine have thus far done so only in class actions or in circumstances in which a subrogation relationship existed amongst the parties. For example, in County Workers Compensation Pool v. Davis, supra, the supreme court held that if an injured employee's tort claim against a third party is settled for an amount greater than the insurer's subrogation claim for workers' compensation benefits, and the insurer has not actively participated in the tort litigation, the insurer may be ordered to pay a reasonable share of the attorney fees and court costs incurred by the employee in the tort litigation. And, in a class action suit involving several volunteer firefighters, Agee v. Trustees of Pension Board, 33 Colo.App. 268, 518 P.2d 301 (1974), a division of this court held that when many persons have an interest in a fund that is enhanced or preserved in litigation sponsored by an individual, a court of equity will award attorney's fees out of the fund.
In subrogation and class action cases, application of the common fund doctrine is appropriate because of the likelihood that there are passive, but co-equal, parties to the litigation. In contrast, a hospital's lien is not co-equal with an injured plaintiff's claim of the right to settlement proceeds, even though the hospital may benefit from the efforts of plaintiff's attorney's creation of the settlement fund. Rather, the lien results from a debtor-creditor relationship between the plaintiff/patient and the hospital.
Courts of most states that have addressed the issue have held that hospitals are not unjustly enriched in these circumstances and that there is no need to expand the common fund doctrine to hospital liens. The rationale for this position was stated in Maynard v. Parker, 54 Ill.App.3d 141, 11 Ill.Dec. 898, 901, 369 N.E.2d 352, 355 (1977), as follows:
[T]he benefit to the hospital resulting from [the attorney's] services was merely incidental to the primary purpose of obtaining compensation for plaintiff's injuries. The hospital's position is analogous to that of [a] prior judgment creditor ... not to that of [a] subrogee ... in that the hospital's right to payment of its claim is not dependent upon plaintiff's recovery against a third party but rather involves an ordinary debtor-creditor relationship.... We cannot justify extending the common fund doctrine to require a mortgagee or a furniture store or any other creditor of a plaintiff to contribute to the fees of the plaintiff's attorney if the funds recovered by litigation are used to satisfy the plaintiff's obligations.
Accord Harlow v. Lloyd, 15 Kan.App.2d 497, 809 P.2d 1228 (1991) (distinguishing hospital lien case from subrogation cases on the basis that the obligation of a subrogation insurer to share in the costs of recovery from a third-party tortfeasor arises because the insurer occupies the position of the insured with coextensive rights and liabilities with no creditor-debtor relationship existing between them); Sisters of Charity v. Nichols, 157 Mont. 106, 483 P.2d 279 (1971) (a hospital's *770 lien is based upon a debt owed the hospital by its patient in whose shoes it does not stand for any purpose, with the debt existing irrespective of the patient's rights against a third-party wrongdoer). See also Mitchell v. Huntsville Hospital, 598 So.2d 1358 (Ala. 1992); Public Health Trust v. O'Neal, 348 So.2d 377 (Fla.App.1977); Broadlawns Polk County Hospital v. Estate of Major, 271 N.W.2d 714 (Iowa 1978); State Department of Human Services v. Allstate Insurance Co., 744 P.2d 186 (Okla.1987); Bashara v. Baptist Memorial Hospital System, 685 S.W.2d 307 (Tex.1985); Lynch v. Deaconess Medical Center, 113 Wash.2d 162, 776 P.2d 681 (1989).
Trevino cites one case in support of extending the common fund doctrine to hospital liens, West Nebraska General Hospital v. Farmers Insurance Exchange, 239 Neb. 281, 475 N.W.2d 901 (1991). In that case, the Nebraska supreme court stated that a hospital's lien served to transfer to the hospital the patient's interest in sums obtained in judgment or settlement of his claims, up to the value of the services provided by the hospital less a reasonable portion of the costs of recovery, including attorney fees. Because recovery of attorney fees from the hospital's lien was not an issue on appeal in that case, as it is here, we construe the court's remarks on this issue to be dicta.

Martinez v. St. Joseph Healthcare System, 117 N.M. 357, 871 P.2d 1363 (1994) does apply the doctrine to hospital liens; however, we find more persuasive the reasoning of the courts that have declined to apply the common fund doctrine to hospital liens.

III.
Next, Trevino argues that the language of the hospital lien statute, which gives an attorney lien "superiority" over a hospital lien, prevents a hospital from collecting all of its claim without payment to a patient's attorney. We disagree.
Section 12-5-119, C.R.S., (1991 Repl.Vol. 5A), which provides for attorney liens, states: "[A]ll attorneys- and counselors-at-law shall have a lien on any money, property, choses in action, or claims and demands in their hands, on any judgment they may have obtained or assisted in obtaining...."
The hospital lien statute references attorney liens by providing that "the lien of attorneys and counselors at law created by section 12-5-119, C.R.S., shall have precedence over and be senior to the lien created under this section." Section 38-27-101, C.R.S. (1982 Repl.Vol. 16A).
Trevino contends that this language means that his attorney's compensation may be deducted from both of the checks issued by Hartford. This would result in Trevino and University Hospital sharing the expense of the attorney fees. However, Trevino misconstrues the effect of the attorney lien's seniority.
Trevino's attorney worked on Trevino's behalf to obtain a total settlement of $80,000. Because § 12-5-119, C.R.S. (1991 Repl.Vol. 5A) authorizes a lien on any money or property that an attorney assists in obtaining, and because the hospital lien is inferior, the attorney lien attaches to Trevino's entire $80,000 settlement. Absent a contractual arrangement otherwise between Trevino and his attorney, the effect of the statute is that Trevino's attorney is compensated "off the top," before Trevino receives his share of the proceeds. After the attorney lien is satisfied, the hospital lien has next priority for satisfaction out of Trevino's remaining proceeds.
The fact that Hartford issued two separate checks, one for the benefit of Trevino and one for the benefit of the hospital, does not alter the result. Trevino's attorney is not entitled to his compensation percentage from each individual check written without regard to who the payee is; rather, the total compensation due him must be satisfied out of the proceeds that are due his client. If, as here, there are any proceeds remaining after the attorney is compensated, any other lienholders are to be paid in the order of their priority. Sisters of Charity v. Nichols, supra; State Department of Human Services v. Allstate Insurance Co., supra.

IV.
Next, Trevino contends that, because of his own comparative negligence, Hartford did not fully compensate him for his injuries.
*771 Thus, he argues that the hospital should not be able to reduce further his partial compensation by being paid in full on its lien. This argument is without merit.
In support of this theory, Trevino cites Martinez v. St. Joseph Hospital, 878 P.2d 13 (Colo.App.1993), a workers' compensation case. There, the State Compensation Insurance Authority (SCIA) intervened in a negligence action brought by a volunteer fireman to whom it had previously paid workers' compensation benefits for a slip and fall injury. The fireman sought noneconomic damages from the defendant, and SCIA intervened to pursue recovery of monies it had expended for the fireman's economic damages. The court held that when SCIA assumed the position of plaintiff as subrogee, it became subject to the limitations, restrictions, and defenses to which the plaintiff was also subject and that, because the fireman was limited in his recovery by the statutory offset of comparative negligence, SCIA was likewise limited.
Here, however, the hospital did not have a subrogor relationship with Trevino. As noted above, cases involving subrogated parties are not analogous to the present facts concerning a hospital lien between a debtor and creditor.

V.
Trevino also argues that the lien is invalid under the provisions of § 38-27-101. He urges that, under § 38-27-101, only a duly licensed hospital can create a lien and thus, since HHL is not a duly licensed hospital, he concludes that the lien it seeks to enforce is not valid. We are not persuaded.
The hospital lien statute provides that every duly licensed hospital which has furnished services to any person injured as a result of the negligent acts of another "shall... have a lien" for the reasonable charges for hospital care. However, there is no language in the statute prohibiting an assignment of a hospital's right to file a lien, nor do we read the statute to say that only a duly licensed hospital can create the lien. Rather, the statute mandates that hospitals have a statutory claim to a lien upon furnishing services. See West Nebraska General Hospital v. Farmers Insurance Exchange, supra (agreeing with other courts that have interpreted statutes with the mandatory language "shall" that the lien attaches upon admission of the patient to the hospital for treatment).
The lien takes effect when it is filed in compliance with the requirements in § 38-27-102, C.R.S. (1995 Cum.Supp.). Further, under § 38-27-105, C.R.S. (1995 Cum.Supp.): "[A]ny party claiming a lien under the provisions of this article may assign, in writing, his claim and lien to any other party, who shall thereafter have all the rights and remedies of the assignor." Here, University Hospital made a valid assignment to HHL of the hospital's claim to a lien which had attached upon Trevino's admission for treatment. Therefore, HHL's role as collection agency and assignee in filing the lien does not render the lien invalid.
Judgment affirmed.
MARQUEZ and KAPELKE, JJ., concur.
