MEMORANDUM OF DECISION FINDING THAT THE PRINCIPLE OF EQUITABLE RECOUPMENT ENTITLED THE STATE OF CALIFORNIA TO WITHHOLD CERTAIN POST-PETITION PAYMENTS OWED TO THE DEBTOR TO RECOVER PRE-PETITION DEBT
Ernest M. Robles, United States Bankruptcy JudgeAt issue is whether the principle of equitable recoupment permits the State of California to withhold a percentage of Medi-Cal payments and supplemental hospital quality assurance payments owed to the Debtor, for the purpose of recovering unpaid hospital quality assurance fees that the Debtor was required to pay to the State under the Medi-Cal Hospital Reimbursement Improvement Act of 2013.1 Because the Debtor’s and the State’s respective obligations arise from the same transaction or occurrence, the Court finds that the State’s withholding was a permissible recoupment.
I. Facts
The Medicaid and Medi-Cal Programs
Under the Medicaid program, the cost of providing healthcare to low-income people is shared between the state and federal governments. States administer the Medicaid program through their own specific plans. In California, Medicaid benefits are administered through the California Medical Assistance Program, more commonly *791known as Medi-Cal. The California Department of Healthcare Services (the “DHCS”) administers Medi-Cal. Cal. Code Regs. tit. 22, § 50004(b) (West 2017).
California is generally entitled to be reimbursed by the federal government for 50% of Medi-Cal costs. 42 U.S.C.A. § 1396b(a) (West 2016). To help cover its share of Medi-Cal costs, California enacted the Medi-Cal Hospital Reimbursement Improvement Act of 2013 (the “Reimbursement Improvement Act” or “Act”), codified at Cal. Welf. & Inst. Code §§ 14169.50-14169.76 (West 2017). The Act requires most general acute care hospitals to pay a quarterly Hospital Quality Assurance Fee (an “HQA Fee”),2 which is assessed regardless of whether the hospital participates in the Medi-Cal program. Cal. Welf. & Inst. Code § 14169.52(a) (imposing the HQA Fee upon “each general acute care hospital that is not an exempt facility”). The HQA Fee allows California to obtain more healthcare funds from the federal government, which generally matches state Medi-Cal contributions dollar-for-dollar.
The HQA Fee is calculated using a complex formula based primarily upon a hospital’s “patient days,” a term best defined by example. “One Medi-Cal day” means that a hospital treated one patient under the Medi-Cal program for one day; “two Medi-Cal days” means either that a hospital treated two patients under the MediCal program for one day each, or treated one patient under the Medi-Cal program for two days. The formula for calculating the HQA Fee takes into consideration a hospital’s annual fee-for-service days,3 annual managed care days,4 and annual Medi-Cal days.5 Id. at § 14169.51(as). The exact formula varies -depending upon whether the hospital is owned by a nonprofit public benefit corporation. Id.
After the HQA Fees are collected and augmented by federal matching funds, they are redistributed to the hospitals by the DHCS through various types of quality assurance payments, including:
1) direct grants to public hospitals in support of health care expenditures, id. at § 14169.58(a)(1);
*7922) supplemental quality assurance payments to private hospitals, id. at § 14169.54-55;
3) increased capitation payments6 to hospitals providing treatment pursuant to Medi-Cal managed health care plans, id. at § 14169.56; and
4) payments for children’s health care, id. at § 14169.53(b)(1)(B).
The formulas under which the HQA Fees are assessed differ from the formulas under which the HQA Fees and associated federal matching funds are distributed. As a result, some hospitals receive more money on account of their HQA Fee payments than others. Therefore, in addition to allowing California to receive more federal matching funds, the Reimbursement Improvement Act performs a redistributive function.
The Reimbursement Improvement Act is only one component of a complex statutory scheme governing Medi-Cal’s funding and administration. In addition to receiving various types of payments under the Act, hospitals are also reimbursed for providing Medi-Cal services primarily through two systems: a fee-for-service system and a managed care system.7 In the fee-for-service system, hospitals enter into contracts with DHCS to provide services to Medi-Cal beneficiaries, and DHCS makes direct payments to the hospitals. See generally id. at § 14132 et seq. (delineating the types of Medi-Cal benefits provided through the fee-for-service system). In the managed care system, managed care plans enter into agreements with DHCS to provide healthcare services to Medi-Cal beneficiaries. See generally id. at 14087.3 et seq. (setting forth standards governing agreements between DHCS and managed care providers); Cal. Code Regs, tit. 22, § 51190.5 (defining a “managed care plan” under Medi-Cal). The fee-for-service and managed care systems allow hospitals to receive a baseline reimbursement on account of the Medi-Cal services they provide. The Reimbursement Improvement Act supplements that baseline reimbursement — at least for hospitals that are eligible to receive payments under the Act.
DHCS’ Withholding from Payments Owed to the Debtor
On November 20, 2014, the Debtor entered into a Medi-Cal Provider Agreement (the “Provider Agreement”) with DHCS. As “a condition for participation ... as a provider in the Medi-Cal program,” the Debtor agreed to comply with all applicable provisions of Cal. Welf. & Inst. Code §§ 14000-14499.77 — including the requirement to pay HQA Fees, which is imposed by Cal. Welf. & Inst. Code § 14169.52(a). Provider Agreement at p. 1 [Ex. 1, Doc. No. 835], The Debtor provided healthcare to Medi-Cal beneficiaries on a fee-for-service basis, and as a result was entitled to receive Medi-Cal fee-for-service payments (the “Medi-Cal Payments”). Medi-Cal Payments are computed in accordance with the Medi-Cal fee schedule, based on the types of services that the Debtor provided. See generally Cal. Welf. & Inst. Code §§ 14131 et seq. (setting forth the types of healthcare services covered by Medi-Cal and the reimbursement schedule for those services). The Debtor was also entitled to receive supplemental quality assurance payments (the “Supplemental HQA Payments”) on account of certain services provided to Medi-Cal beneficiaries. The Supplemental HQA Payments *793are computed according to formulas set forth in the Reimbursement Improvement Act.
On March 2, 2015, the Debtor stopped paying its quarterly HQA Fees. As of June 6, 2016, the date of the filing of the petition, the Debtor’s unpaid HQA Fees equaled $699,173.15. To recover the unpaid prepetition HQA Fees, DHCS began withholding, subsequent to the petition, 20% of the Medi-Cal Payments owed to the Debt- or, and an unspecified percentage of the Supplemental HQA payments owed to the Debtor.8
By July 18, 2016, DHCS had recovered the $699,173.10 in prepetition HQA Fee debt as a result of the withholding. However, DHCS continued the withholding because the Debtor failed to pay the HQA Fees that came due post-petition. Throughout the course of this ease, DHCS has withheld a total of $4,306,426.18 from Supplemental HQA Payments and MediCal Payments owed the Debtor, and has applied the withheld funds to unpaid HQA Fees. DHCS contends that, even after the withholding, the Debtor’s HQA Fee delinquency is $2,550,667.39.
The Debtor argues that DHCS’ withholding was a setoff, that DHCS has willfully violated the automatic stay by failing to obtain stay-relief before effectuating the setoff, and that DHCS could not have effectuated the setoff even if it had obtained stay-relief because the Bankruptcy Code does not permit post-petition obligations to be setoff against pre-petition debt. The Debtor seeks an order compelling the return of the approximately $4.3 million in funds that DHCS withheld. DHCS argues that it was authorized to withhold the funds absent stay-relief under the equitable doctrine of recoupment, on the grounds that the HQA Fees, Supplemental HQA Payments, and Medi-Cal Payments all arise from the same transaction. In response, the Debtor argues that its HQA Fee obligation does not arise from the same transaction as its reimbursement entitlement, because the Debtor’s HQA Fee liability exists regardless of whether it participates in the Medi-Cal program, and because the HQA Fee liability and reimbursement entitlements are calculated using different formulas.
II. Discussion
Under certain circumstances, § 5539 permits a creditor holding a claim against a debtor to setoff that claim against debt that the creditor owes to the debtor. As the leading treatise explains:
Setoff is a right of equitable origin designed to facilitate the adjustment of mutual obligations. Its central premise is an ancient one well-grounded in practical logic: If A is indebted to B, and B is likewise indebted to A, it makes sense simply to apply one debt in satisfaction of the other rather than require A and B to satisfy their mutual liabilities separately.
Alan N. Resnick & Henry J. Sommer, 5 Collier on Bankruptcy ¶ 553.01 (16th ed. 2017).
To exercise setoff rights, a creditor must first obtain relief from the automatic stay. See § 362(a)(7) (providing that the filing of the petition “operates as a stay, applicable to all entities, of the setoff of any debt owing to the debtor that arose before the commencement of the case un*794der this title against any claim against the debtor”).
Recoupment is similar to setoff, but differs in important respects:
[Recoupment is an equitable doctrine that ‘exempts a debt from the automatic stay when the debt is inextricably tied up in the post-petition claim.’ Unlike setoff, recoupment is not limited to pre-petition claims and thus may be employed to recover across the petition date. The limitation of recoupment that balances this advantage is that the claims or rights giving rise to recoupment must arise from the same transaction or occurrence that gave rise to the liability sought to be enforced by the bankruptcy estate.
Sims v. U.S. Dep’t of Health and Hum. Servs. (In re TLC Hosps., Inc.), 224 F.3d 1008, 1011 (9th Cir. 2000) (internal citation omitted).
For recoupment purposes, a transaction “may include ‘a series of many occurrences, depending not so much upon the immediateness of their connection as upon their logical relationship,’” id. at 1012 (internal citation omitted), provided that the “logical relationship” test is not “applied so loosely that multiple occurrences in any one continuous commercial relationship would constitute one transaction ...Id. “Under the ‘logical relationship’ test, the word ‘transaction’ is given a liberal and flexible construction.” Aetna U.S. Healthcare, Inc. v. Madigan (In re Madigan), 270 B.R. 749, 755 (9th Cir. BAP 2001). In the recoupment context, courts use the same definition of “transaction or occurrence” as is used to determine whether a counterclaim is compulsory:
The common-law claim for recoupment is analogous to a “compulsory counterclaim interposed solely to defeat or diminish plaintiffs recovery.” The “logical relationship test” is applied under Fed.R.Civ.P. 13(a) to determine a compulsory counterclaim, i.e., whether the claim “arises out of the transaction or occurrence that is the subject matter of the opposing party’s claim.”
A logical relationship exists when the counterclaim arises from the same aggregate set of operative facts as the initial claim, in that the same operative facts serve as the basis of both claims or the aggregate core of facts upon which the claim rests activates additional legal rights otherwise dormant in the defendant.
In applying this standard,' “courts have permitted a variety of obligations to be recouped against each other, requiring only that the obligations be sufficiently interconnected so that it would be unjust to insist that one party fulfill its obligation without requiring the same of the other party.”
Id. at 755 (internal citations omitted).
In addition, “[although an express contract is not necessary for the application of recoupment, courts often find that the ‘same transaction’ requirement is satisfied when corresponding liabilities arise under a single contract.” Id. at 758.
Under the Doctrine of Recoupment, DHCS Was Entitled to Withhold Supplemental HQA Payments Owed to the Debtor for the Purpose of Recovering Unpaid HQA Fees
Applying these standards to the present case, the Court finds that the Debtor’s obligation to pay HQA Fees to DHCS is logically related to DHCS’ obligation to make Supplemental HQA Payments to the Debtor. The HQA Fees and Supplemental HQA Payments therefore arise from the same transaction or occurrence, meaning that DHCS was entitled to recoup the unpaid HQA Fees from the *795postpetition Supplemental HQA Payments that it owed to the Debtor.
A major purpose of the Reimbursement Improvement Act, which provides for the levy of HQA Fees, is to enable California to obtain additional federal matching funds for its Medi-Cal program. That purpose is explicitly articulated in the Act:
The Legislature continues to recognize the essential role that hospitals play in serving the state’s Medi-Cal beneficiaries. To that end, it has been, and remains, the intent of the Legislature to improve funding for hospitals and obtain all available federal funds to make supplemental Medi-Cal payments to hospitals ....
It is the intent of the Legislature to impose a quality assurance fee to be paid by hospitals, which would be used to increase federal financial participation in order to make supplemental Medi-Cal payments to hospitals, and to help pay for health care coverage for low-income children.
Cal. Welf. & Inst. Code § 14169.50(a)-(d).
The logical relationship is present because without the federal matching funds facilitated by the Act, DHCS would not have the revenue to make Supplemental HQA Payments to hospitals such as the Debtor.
The Debtor argues that there is no logical relationship between its HQA Fee liabilities and the Supplemental HQA Payments it is owed, because the Debtor’s fee liabilities and payment entitlements are calculated using different formulas. By assuming a definition of “transaction” that is far too narrow, the Debtor’s'argument disregards the fact that Ninth Circuit courts have given the term “transaction” a “liberal and flexible construction, ... requiring only that the obligations be sufficiently interconnected so that it would be unjust to insist that one party fulfill its obligation without requiring the same of the other party.” Madigan, 270 B.R. at 755. At bottom, the Reimbursement Improvement Act is a means for California to obtain more federal funds to be paid out to hospitals for treating Medi-Cal patients. It is certainly true that there is nothing simple or straightforward about the Act’s formulas governing the collection and distribution of funds10; in this respect, the Act bears a similarity to the federal Medicare and Medicaid statutes, described by one court as “among the most completely impenetrable texts within human experience.” Rehab. Ass’n of Virginia, Inc. v. Kozlowski, 42 F.3d 1444, 1450 (4th Cir. 1994). But the Act’s complex formulas — an inevitable byproduct of its redistributive function — do not sever the fundamental logical connection between hospitals’ HQA Fee payments and the reimbursements those hospitals receive for providing MediCal services. Without the HQA Fee payments, DHCS would not collect sufficient federal matching funds to reimburse the hospitals. Nor is this logical relationship diminished by the fact that the Act proves a far better deal for some hospitals than others, depending upon the type of hospital or its patient mix.
The Debtor makes much of the fact that certain types of hospitals are eligible to receive various types of payments under *796the Act even though they are exempt from paying the corresponding HQA Fees. According to the Debtor, the fact that some hospitals are exempt means that there is no logical relationship between the Debt- or’s HQA Fee liability and its entitlement to receive Supplemental HQA Payments. The Debtor places undue emphasis upon the Act’s exemptions, which are necessary to accomplish. its redistributive function. The Legislature exempted certain hospitals — such as rural hospitals and long term care hospitals — from paying the HQA Fee as a way of redistributing healthcare funds to the exempt hospitals. Redistribution is a core component of almost all healthcare financing and delivery. Most insurance plans, for example, redistribute funds from younger, healthier patients to older, sicker ones. The redistributive component of the Act does not change the reality that if hospitals, such as the Debtor, that are required to pay the HQA Fees did not do so, funding for the various payments made to hospitals under the Act would dry up. Accordingly, the Debtor’s HQA Fee liabilities are logically related to its entitlement to receive Supplemental HQA Payments.
The Doctrine of Recoupment Also Entitled DHCS to Withhold Medi-Cal Payments from the Debtor for the Purpose of Recovering Unpaid HQA Fees
Although the relationship between the Debtor’s HQA Fee liability and its entitlement to receive Medi-Cal Payments is somewhat more attenuated than the relationship between the Debtor’s HQA Fee liability and its entitlement to receive Supplemental HQA Payments, the Court nonetheless holds that under the Ninth Circuit’s “liberal and flexible” construction of the logical relationship test, Madigan, 270 B.R. at 755, DHCS was entitled to recoup unpaid HQA Fees from the Medi-Cal Payments it owed the Debtor.
To become entitled to receive Medi-Cal Payments for providing treatment to Medi-Cal beneficiaries, the Debtor was required to enter into a Provider Agreement with DHCS. See Provider Agreement at p. 1 (“Execution of this Provider Agreement between an Applicant or Provider ... and the [DHCS] .... is.mandatory for participation or continued participation as a provider in the Medi-Cal program ....”). The Provider Agreement states that “[a]s a condition for participation ... in the Medi-Cal program, Provider agrees to comply with all of the following terms and conditions ....” Id. Those terms and conditions include an obligation to comply with applicable law:
Provider agrees to comply with all applicable provisions of Chapters 7 and 8 of the Welfare and Institutions Code (commencing with Sections 14000 and 14200), and any applicable rules or regulations promulgated by DHCS pursuant to these Chapters. Provider further agrees that if it violates any of the provisions of Chapters 7 and 8 of the Welfare and Institutions Code, or any other regulations promulgated by DHCS pursuant to these Chapters, it may be subject to all sanctions or other remedies available to DHCS.
Id. at ¶ 2.
Cal. Welf. & Inst. Code § 14169.52(h) ■provides that “[w]hen a hospital fails to pay all or part of the quality assurance fee on or before the date that payment is due, the [DHCS] may immediately begin to deduct the unpaid assessment and interest from any Medi-Cal payments owed to the hospital .,.By agreeing to comply with applicable provisions of the California Welfare and Institutions Code in the Provider Agreement, the Debtor agreed that if it failed to pay its HQA Fees, DHCS could recover those fees from the Medi-Cal Payments owed the Debtor. The Debtor’s eli*797gibility to participate in the Medi-Cal program was conditioned on its agreement to this term of the Provider Agreement. Consequently, the Provider Agreement creates a sufficient logical relationship between the Debtor’s HQA Pee liability and its Medi-Cal Payment entitlements to enable DHCS to avail itself of the doctrine of recoupment.
The Debtor argues that the terms in the Provider Agreement requiring compliance with applicable law cannot create the requisite logical relationship between its HQA Fee liabilities and Medi-Cal Payment entitlements. The Debtor’s theory is that an agreement to comply with applicable law is a gratuitous promise, since the Debtor has an obligation to comply with the law in any event. Such a gratuitous promise, the Debtor asserts, cannot establish the logical relationship sufficient to allow DHCS to assert recoupment rights.
The Debtor is correct that an agreement to comply with applicable law is a gratuitous promise which does not provide the consideration necessary to make a contract enforceable. See, e.g., Auerbach v. Great W. Bank, 74 Cal. App. 4th 1172, 1185, 88 Cal.Rptr.2d 718, 727 (Cal. Ct. App. 1999) (“In contractual parlance, for example, doing or promising to do something one is already legally bound to do cannot constitute the consideration needed to support a binding contract.”). However, the issue here is not the enforceability of the Provider Agreement; it is whether the Provider Agreement creates a logical relationship between the Debtors’ HQA Fee liability and its entitlement to Medi-Cal Payments. There is no dispute that if the Debtor had refused to agree to the terms of the Provider Agreement requiring it to comply with applicable law, it simply would not have been allowed to enroll as a Medi-Cal provider. Thus, had it not agreed to be subject to DHCS’ recoupment rights, the Debtor would never have been eligible to perform the services entitling it to the Medi-Cal Payments. This fact compels the conclusion that the Debtor’s -HQA Fee debt “is inextricably tied up” in the Debt- or’s claim for the Medi-Cal Payments, such that recoupment applies. TLC Hosps., Inc., 224 F.3d at 1011.
The Debtor next argues that its obligation to pay HQA Fees is based on its licensure as an acute care hospital, that it would be required to pay HQA Fees regardless of whether it participated in the Medi-Cal program, and that accordingly no logical relationship exists between the Debtor’s HQA Fee liability and its entitlement to Medi-Cal Payments. It is true that the Debtor would be subject to HQA Fees regardless of whether it acted as a Medi-Cal provider. Howevér, the Debtor’s argument neglects to account for the point made above — namely that the Debtor never could have become a Medi-Cal provider without agreeing that its Medi-Cal Payment entitlements were subject to recoupment. The Debtor’s agreement that unpaid HQA Fees could be recovered from its Medi-Cal Payment entitlements is more than sufficient to establish a logical relationship between the HQA Fees and MediCal Payments.
Madigan is not to the contrary. In Ma-digan, the court considered whether insurer Aetna was entitled to recoup from long-term disability payments owed the debtor an overpayment that Aetna had made to the debtor in connection with a previous disability claim. Madigan, 270 B.R. at 751-53, In determining that recoupment did not apply, the court emphasized that the disability insurance policy at issue provided for the separate administration of multiple disability claims if the claims were separated by more than six months of active work. Id. at 759, The court noted that claims that were separately adminis*798tered required a different reimbursement agreement for each claim, and therefore founfl that the “separate disability periods were memorialized in separate contractual agreements ... with a different set of rights and obligations per eligibility period.” Id. Based on this finding, the court concluded that claims associated with separate disability periods could not be viewed as arising from the same transaction. Id. at 759-61.
Here, the Debtor executed a single Provider Agreement which governed the obligations of the Debtor and DHCS over the entire period of the parties’ relationship. Unlike in Madigan, there was not a succession of different Provider Agreements varying the parties’ rights and obligations. Consequently, Madigan does not apply.
The Debtor relies upon In re Saint Catherine Hosp. of Indiana, LLC, 511 B.R. 117, 127 (S.D. Ind. 2014), rev’d on other grounds, Saint Catherine Hosp. of Indiana, LLC v. Indiana Family & Soc. Servs. Admin., 800 F.3d 312 (7th Cir. 2015) for the proposition that the HQA Fees and Medi-Cal Payments are not part of the same transaction for recoupment purposes. St. Catherine involved an Indiana statute requiring hospitals to pay a Hospital Assurance Fee (“HAF”), a fee similar to the HQA Fee at issue here. 511 B.R. at 120. To recover the HAF that the debtor-hospital had failed to pay, Indiana withheld funds from the Medicaid reimbursement payments that it owed the hospital. Id. at 120-21. The St. Catherine court rejected Indiana’s argument that the withholding was a permissible recoupment. Id. at 126-28. The court found that the “HAF is distinct from the ‘ongoing stream of services, advances, and reconciliations’ that exists between [Indiana] and [the hospital] as a Medicaid provider.” Id. at 127 (internal citation omitted). The court reasoned that the HAF was a tax debt of the hospital that was unrelated to the hospital’s contract with Indiana to provide Medicaid services. Id. In reaching this conclusion, the court emphasized that the hospital’s Medicaid contract could have, but did not, contain “a provision expressly entitling the state to set off any taxes the hospital owed it against any Medicaid payments that it owed the hospital ....” Id. The court further noted that the parties had not identified any Indiana statute permitting the state to withhold Medicaid payments to recover the HAF. Id. at n. 9.
In contrast to St. Catherine, here the Provider Agreement did contain a provision entitling DHCS to recoup unpaid HQA Fees from Medi-Cal Payments. Specifically, the Debtor agreed in the Provider Agreement that it would be subject to applicable provisions of the California Welfare and Institutions Code — including the provision set forth in Cal. Welf. & Inst. Code § 14169.52(h) allowing DHCS to recoup unpaid HQA Fees. Further, the St. Catherine court reljed on the absence in Indiana law of any provision entitling the state to recoup unpaid HAF fees from Medicaid payments. In view of these differences, St. Catherine is inapposite.
The Debtor argues that St. Catherine still applies notwithstanding the Provider Agreement’s provision entitling DHCS to recoup unpaid HQA Fees. According to the Debtor, the fact that the Provider Agreement incorporated DHCS’ recoupment rights by reference to the statute— as opposed to setting forth the recoupment provisions in full — means that DHCS cannot exercise its recoupment rights. The Debtor’s theory is that a provision incorporating the statute by reference is not the type of express provision giving rise to recoupment that the St. Catherine court had in mind.
Debtor cites no authority for the proposition that terms incorporated into an *799agreement by reference somehow have less force than terms specifically set out in the agreement. Invalidating terms incorporated by reference, as proposed by the Debtor, would be illogical and unworkable. The DHCS Medi-Cal provider agreements, being unable to rely upon the shorthand of incorporation by reference, would swell in length from ten pages to hundreds of pages.
The Debtor contends that DHCS waived its ability to recoup the unpaid HQA Fees by failing to assert its recoupment rights in its proof of claim. The Debtor’s argument ignores the distinction between setoff and recoupment. Assuming without deciding that a creditor must assert its setoff rights in a proof of claim in order to preserve those rights, it does not follow that recoupment rights are waived if not asserted in a proof of claim. Setoff differs from recoupment in that the exercise of setoff rights is subject to the supervision of the Bankruptcy Court — a secured creditor must obtain stay-relief before effecting a setoff, § 362(a)(7). By contrast, a creditor may exercise recoupment rights free of Bankruptcy Court supervision. Since recoupment is an equitable doctrine that does not depend upon anything in the Bankruptcy Code, it is not necessary for creditors to take affirmative action, such as filing a proof of claim, to preserve their recoupment rights.
Finally, pointing to cases holding that obligations imposed by the same contract are more likely to be considered to arise from the same transaction for recoupment purposes,11 the Debtor argues that the Provider Agreement is not a contract, but is instead a license to receive reimbursement payments under the Medi-Cal program.12 The Court finds that, regardless of whether the Provider Agreement is considered a license or contract, the Debtor’s HQA Fee liability and entitlement to Medi-Cal Payments would still arise from the same transaction or occurrence. As discussed previously, the Debtor’s acknowledgment in the Provider Agreement that unpaid HQA Fees could be withheld from its Medi-Cal Payments establishes the necessary logical relationship between the Debtor’s fee liabilities and its payment entitlements. That logical relationship exists whether the Provider Agreement is classified as a license or a contract.. The Debtor’s reliance upon cases outside the Ninth Circuit for the proposition that the doctrine of recoupment cannot apply where the claim and debt arise under statute rather than contract is misplaced.13 In TLC Hospitals, the Ninth Circuit held that the doctrine of recoupment was applicable in the Medicare context, even though Medicare reimbursements are dictated by statute, not by contract. TLC Hospitals, 224 F.3d at 1013.
*800III. Conclusion
The doctrine of equitable recoupment allowed DHCS to withhold a percentage of the Supplemental HQA Payments and Medi-Cal Payments it owed to the Debtor, for the purpose of recovering unpaid HQA Pees. Accordingly, the Debtor’s motion to compel DHCS to turnover the withheld funds is denied.
. This Court has jurisdiction pursuant to 28 U.S.C. §§ 157 and 1334 and General Order No. 13-05 of the U.S. District Court for the Central District of California.
. The following types of hospitals are exempt from the HQA Fee: (1) hospitals owned by a local health care district, (2) hospitals designated as a specialty hospital, (3) hospitals satisfying the Medicare criteria to be a long-term care hospital, and (4) small and rural hospitals, as defined by Cal. Health & Safety Code § 124840. Cal. Welf. & Inst. Code § 14169.51(1).
. “Fee-for-service days” means “inpatient hospital days as reported on the days data source where the service type is reported as ‘acute care,’ 'psychiatric care,’ or 'rehabilitation care,’ and the payer category is reported as ‘Medicare traditional,’ ‘county indigent programs-traditional,’ 'other third parties-traditional,' 'other indigent,’ or 'other payers,' for purposes of the Annual Financial Disclosure Report submitted by hospitals to the Office of Statewide Health Planning and Development.” Id. at § 14169.51(o).
. "Managed care days” means “inpatient hospital days as reported on the days data source where the service type is reported as 'acute care,’ ‘psychiatric care,’ or ‘rehabilitation care,’ and the payer category is reported as 'Medicare managed care,’ ‘county indigent programs-managed care,’ or 'other third parties-managed care,’ for purposes of the Annual Financial Disclosure Report submitted by hospitals to the Office of Statewide Health Planning and Development.” Id. at § 14169.5 l(z).
. "Medi-Cal days” means “inpatient hospital days as reported on the days data source where the service type is reported as ‘acute care,’ 'psychiatric care,' or 'rehabilitation care,' and the payer category is reported as ‘Medi-Cal traditional’ or 'Medi-Cal managed care,’ for purposes of the Annual Financial Disclosure Report submitted by hospitals to the Office of Statewide Health Planning and Development.” Id. at § 14169.5l(ac). I
. A capitation payment is a per-month, per-person reimbursement on account of treatment provided to patients enrolled in managed care plans.
. This is a simplified description of how Medi-Cal services are funded and administered; a comprehensive description is beyond the scope of this opinion.
, The record reflects only the total amounts withheld by DHCS, and does not specify the amounts withheld from Supplemental HQA Payments versus the amounts withheld from Medi-Cal Payments.
. Unless otherwise indicated, all statutory references are to the Bankruptcy Code, 11 U.S.C. §§ 101-1532.
. The Act is so complicated that even DHCS, which is charged with its administration, does not know the exact amount of Supplemental HQA Payments that were made to the Debtor. See Declaration of John Beshara at ¶ 8 [Doc. No. 835] ("The [DHCS] collects the managed care plan quality assurance fees for the health plan but does not know the quality assurance payment amounts that were distributed by health plan to the Debtor. However, the model managed care quality assurance payment amounts were created by [the] Safety Finance Division, and amount to estimates of [the] amounts paid.”).
. See, e.g., Lee v. Schweiker, 739 F.2d 870, 875 (3d Cir. 1984) (“In bankruptcy, the re-coupment doctrine has been applied primarily where the creditor’s claim against the debt- or and the debtor’s claim against the creditor arise out of the same contract.”).
. For a discussion of whether Medicare Provider Agreements (which are similar in many respects to the Medi-Cal Provider Agreement at issue here) are licenses or contracts, see Samuel R. Maizel and Jody A. Bedenbaugh, The Medicare Provider Agreement: Is It a Contract or Not? And Why Does Anyone Care?, 71 Bus. Law. 1207 (2016).
. See, e.g., Tavenner v. U.S. (In re Vance), 298 B.R. 262, 267 (Bankr. E.D. Va. 2003) (“In order for the doctrine [of recoupment] to apply, two threshold issues must be satisfied. First, the source of the defendant’s claim must be a contract, as opposed to a government entitlement program. Second, the claims must arise out of the same contract.”); Delta Air Lines v. Bibb (In re Delta Air Lines), 359 B.R. 454, 465 (Bankr. S.D.N.Y. 2006) ("The right of recoupment arises only in the context of a single contract or a series of transactions constituting a single, integrated transaction or contract.”).