
934 P.2d 270 (1997)
123 N.M. 76
EATON, MARTINEZ & HART, P.C., Plaintiff-Appellee,
v.
UNIVERSITY OF NEW MEXICO HOSPITAL and The Regents of the University of New Mexico, Defendants-Appellants.
Linda CRAWFORD and Renee Wright, Plaintiffs-Appellants,
v.
Joan F. SCULLY, Defendant-Appellee.
No. 23374.
Supreme Court of New Mexico.
February 7, 1997.
Sutin, Thayer & Browne, P.C., Suann Hendren, Albuquerque, Edward E. Triviz, Dan A. Gonzales, Las Cruces, for Appellants.
Eaton, Martinez & Hart, P.C., Gabrielle M. Valdez, Albuquerque, Reeves, Chavez, Greenfield, Acosta & Walker, P.A., Barney James Reeves, William R. Anderson, Las Cruces, for Appellees.
William H. Carpenter, Michael B. Browde, Albuquerque, for amicus curiae NMTLA.

OPINION
FRANCHINI, Chief Justice.
1. We address whether a public hospital is liable for attorney's fees and costs incurred by a patient in pursuing personal injury claims, where a hospital holds a lien to be paid from proceeds of a patient's claim, and where the claim proceeds are sufficient to pay attorney's fees and costs and the hospital lien in full. We hold that the plaintiffs in these cases are not entitled to deduct from a lien filed by a public hospital a proportionate share of attorney's fees and costs incurred in *271 obtaining a personal injury recovery to which the lien attaches.
2. Facts and proceedings. Jose Padilla was injured when he fell off an unfenced wall on a basketball court at a City of Albuquerque park in May 1993. Padilla was treated at the University of New Mexico Hospital (University Hospital), a public hospital. His hospital bill was $6,024.03. In June 1993, University Hospital recorded a Notice of Hospital Lien, in the amount of $5,457.53, pursuant to the Hospital Lien Act. NMSA 1978, §§ 48-8-1 to -7 (Repl.Pamp.1995). An addendum to that lien in the amount of $566.50 was filed in November 1993. Eaton Martinez & Hart, P.C., represented Jose on a one-third contingency-fee basis in connection with his claims against the City of Albuquerque. Padilla received a settlement from the City of Albuquerque in the amount of $25,000. The settlement proceeds were sufficient to pay attorney's fees and costs and the hospital lien. However, in concluding the case against the City and distributing the proceeds to Padilla, the Eaton firm agreed with Padilla to seek attorney's fees from University Hospital amounting to one-third of the amount of University Hospital's lien. The Hospital was paid $4,015.98 and the amount of $2,008.05 was deposited in an interest bearing account. The Eaton firm filed a Complaint for Declaratory Judgment against University Hospital and the Regents of the University of New Mexico for a proportionate share of attorney's fees and costs incurred in obtaining a personal injury recovery from the lien. Thereafter Josh Gibson, who recovered a judgment in another case also subject to a University Hospital lien, was allowed to intervene in the declaratory judgment action as a party plaintiff. The Second Judicial District Court awarded summary judgment for both Eaton and Gibson. University Hospital appealed the summary judgment with respect to Eaton to the Court of Appeals, but did not appeal with respect to Gibson.
3. In the consolidated case, Crawford v. Scully, Plaintiff Wright was injured while crossing the street when she was hit by a car driven by Scully. She was treated at Memorial Medical Center, which is a public hospital, and billed $14,144.92. Wright sued Scully and, following a jury trial, was awarded $120,000. This amount was reduced by fifty percent due to Wright's contributory negligence. Like Padilla's recovery, the amount recovered by Wright was sufficient to pay legal fees and costs and to satisfy the hospital lien. Wright paid the hospital lien in full, and then commenced suit against the hospital for a proportionate share of attorney's fees and costs. The Third Judicial District Court held that Plaintiff could not deduct attorney's fees and costs from a lien filed by Memorial Medical Center, and Wright appealed to the Court of Appeals.
4. The Court of Appeals consolidated these two cases and certified them to this Court because they raise a common issue of substantial public interest. NMSA 1978, § 34-5-14(C)(2) (Repl.Pamp.1996); Rule 12-606 NMRA 1997. We granted the New Mexico Trial Lawyers Association leave to file an amicus brief.
5. Gutierrez distinguished. The Hospital Lien Act allows a hospital to "assert a lien upon that part of the judgment, settlement or compromise going, or belonging to such patient, less the amount paid for attorneys' fees, court costs and other expenses necessary thereto in obtaining the judgment...." Section 48-8-1. Where a lien is asserted by a public hospital, the Hospital Lien Act must be read together with the New Mexico Constitution Article IV, Section 32 which provides that
[n]o obligation or liability of any person... owing to the state ... shall ever be exchanged, transferred, remitted, released, [or] postponed ... nor shall any such obligation or liability be extinguished except by the payment thereof into the proper treasury, or by proper proceeding in court.
Gutierrez v. Gutierrez, 99 N.M. 333, 334, 657 P.2d 1182, 1183 (1983). Because both University Hospital and Memorial Medical Center are public hospitals, we will consider the liens in these cases together with Article IV, Section 32.
6. We have said that Article IV, Section 32 forbids a public hospital from accepting "less than the full amount of an undisputed legal obligation." Gutierrez, 99 N.M. at 335, *272 657 P.2d at 1184. In Gutierrez plaintiffs sought to void or reduce hospital liens, asking the district court to equitably allocate the proceeds of their recovery. We affirmed the district court's finding that it "lacks equitable or discretionary power to void or reduce the amount" of a hospital's lien, holding that "the State cannot compromise the amount owed to it unless a good faith dispute exists as to the amount of indebtedness or liability." Id. at 334-35, 657 P.2d at 1183-84.
7. Wright and Amicus argue that Gutierrez involved a wholly different and much more general theory of recovery against the hospital. They distinguish the facts in Gutierrez from those in this case on the basis that the district court had been asked in that case to void or make an equitable reallocation of plaintiff's recovery.
8. We agree that the primary issue in Gutierrez was whether the district court had the power to require the University of New Mexico Hospital to accept less than the full amount it was owed. In Gutierrez we held that the district court lacked that power, because our state constitution precluded the hospital from "accepting payment of less than the full amount of an undisputed legal obligation." Id. at 335, 657 P.2d at 1184. However, we did not address other related questions, such as the hospital's liability for legal expenses incurred as a result of a written contract or as a consequence of theories of implied contract or quantum meruit or by application of the common-fund doctrine. We address those questions next.
9. Application of the common-fund doctrine to a public hospital. Eaton and Wright argue that any hospital should pay its proportionate share of legal expenses under the common-fund doctrine. See, e.g., Amica Mut. Ins. Co. v. Maloney, 120 N.M. 523, 903 P.2d 834 (1995) (holding the common-fund doctrine applicable to insurance cases where insured incurred attorney's fees to recover judgment benefitting subrogated insurer). They both contend that a hospital, whether public or private, should pay its proportionate share of legal expenses as a matter of fundamental fairness. We are sympathetic to the view that the principle of fundamental fairness ought to apply notwithstanding the status of a hospital as public or private. However, Eaton and Wright in effect ask us to apply equitable principles to a case for which the Legislature has provided by statute. For the following reasons, we conclude that the claims made by Eaton and Wright in effect are based on contract. The Legislature has imposed a statutory requirement that a contract claim must be supported by a writing in order for it to be enforceable against the State. NMSA 1978, § 37-1-23(A) (granting governmental immunity on contract actions, unless based on valid, written contract); Hydro Conduit Corp. v. Kemble, 110 N.M. 173, 793 P.2d 855 (1990). Eaton and Wright make no claim based on a writing and consequently, they make no enforceable claim.
10. In Martinez v. St. Joseph Healthcare System, we applied "principles of fundamental fairness" and held that a private "[h]ospital should be held liable for its portion of the legal expenses." 117 N.M. 357, 362, 871 P.2d 1363, 1368 (1994). In that case plaintiff was injured in a hit and run accident and treated at St. Joseph Medical Center, a private hospital. The amount recovered by plaintiff fell short of attorney's fees, costs and the hospital lien, and plaintiff's attorney "reduced their fees ... [k]nowing the settlement could not provide for plaintiff's minor daughter and cover all of the costs." Id. at 358, 871 P.2d at 1364. Martinez, plaintiff's personal representative, paid the hospital lien amount and then filed suit against St. Joseph Medical Center for a proportionate share of the attorney's fees and costs. Our decision that the hospital should pay its share of fees and costs was based on our belief
that in hospital lien cases the `common-fund' doctrine most appropriately defines the duties and liabilities of the parties and provides the most fundamental fairness. Under this doctrine, an attorney who creates a pool of funds for a group has the right to seek payment from the pool or seek proportional contribution from those who accept the benefits of the attorney's efforts.
Id. at 360, 871 P.2d at 1366. Eaton and Wright ask that we extend Martinez to public hospitals.
*273 11. In Martinez we specifically distinguished a public hospital from a private hospital, id. at 361, 871 P.2d at 1367, applying equitable principles only to a claim against a private hospital, id. at 362, 871 P.2d at 1368. We noted that the state constitution did not prohibit this Court from applying equitable principles on those facts. See id. at 361, 871 P.2d at 1367. We did not say that the constitution precluded the application of contract law to a public hospital nor that the Legislature could not authorize the application of equitable principles to a claim against a public entity. We take this opportunity to clarify our holding in Martinez and explain why we do not believe Article IV, Section 32 controls the issues raised in this case but that as a matter of statutory law we are not able to apply the common-fund doctrine or other equitable principles on which Wright and Eaton rely.
12. We noted in Martinez that because of unique language in the lien statutes of other jurisdictions we were not faced with the statutory issues of unjust enrichment, implied contract, or subrogation unsuccessfully asserted there. Id. at 360, 871 P.2d at 1366. However, we analogized to a situation in which a hospital might employ an attorney to obtain payment from a patient; the hospital "might recover the full amount of the payment but its net benefit would be reduced by legal fees that would not be reimbursed absent a statutory or contractual right to those fees." Id. at 362, 871 P.2d at 1368. We emphasize that Martinez's claim was based on liability in either quantum meruit, implied-in-law contract or unjust enrichment; therefore we utilized an analogy to contract principles in our reasoning. Because the State is immune from liability in quantum meruit, implied contract, or unjust enrichment, we cannot extend Martinez.
13. Conclusion. We hold that a public hospital cannot be held liable for attorney's fees and costs incurred by its patients, in pursuing personal injury claims, on the basis of quantum meruit, implied contract or unjust enrichment. We reverse the district court grant of summary judgment in favor of Eaton, Martinez & Hart, P.C. and grant summary judgment in favor of University Hospital. We affirm the district court decision in favor of Memorial Hospital in the consolidated case of Crawford v. Scully.
14. IT IS SO ORDERED.
RANSOM and MINZNER, JJ., concur.
