
    [No. C066397.
    Third Dist.
    Nov. 13, 2013.]
    SIM PICH et al., Plaintiffs and Appellants, v. WILL LIGHTBOURNE, as Director, etc., et al., Defendants and Respondents.
    
      Counsel
    Manatí, Phelps & Phillips, Benjamin G. Shatz, Michael M. Berger, Ronald S. Katz; Legal Services of Northern California, Stephen Goldberg, Jodie Berger; Western Center on Law and Poverty Inc., Robert D. Newman; Coalition of California Welfare Rights Organizations, Grace Galligher, Seth E. Blackmon; Bay Area Legal Aid, Robert P. Capistrano and Stephen Bingham for Plaintiffs and Appellants.
    Kamala D. Harris, Attorney General, Ismael A. Castro and Pauline Gee, Deputy Attorneys General, for Defendants and Respondents.
   Opinion

NICHOLSON, Acting P. J.

A new computer system changed the way public welfare benefits are administered. The system automatically terminates or reduces aid if the recipient fails to submit required eligibility reports within certain deadlines unless the caseworker inputs the required information upon the recipient’s ultimate submittal.

Plaintiffs alleged this feature of the computer system results in thousands of benefit recipients incorrectly losing their benefits or not receiving them within the time required by law. They sought a traditional writ of mandate compelling the state agency that supervises the administration of public welfare services by the state’s counties to exercise its supervisory mandate and alter the computer system, and the governing structure that oversees the system, to prevent the system from executing these automatic functions.

The trial court sustained general demurrers to plaintiffs’ first and second amended petitions without leave to amend. Disagreeing with plaintiffs’ appeal, we conclude the trial court did not err. Plaintiffs sought mandamus relief to compel the exercise of discretion in a particular manner, something a writ of mandate cannot do. Also, plaintiffs submitted exhibits which contradicted their factual claims that the state agency was not fulfilling its duty to supervise or that the counties were failing to comply with law on account of the computer system’s operation. We affirm.

BACKGROUND INFORMATION AND ALLEGED FACTS

Defendant State Department of Social Services (the Department) supervises the provision of public welfare services in the state. It is “designated as the single state agency with full power to supervise every phase of the administration of public social services . . . made by the state in order to secure full compliance with the applicable provisions of state and federal laws.” (Welf. & Inst. Code, § 10600.) Two of the social service programs the Department oversees are CalWORKs and CalFresh. Defendant Will Lightbourne is the Department’s current director.

The Department supervises the state’s 58 counties, which are charged with actually administering public social services within their boundaries. In the case of social services for which federal or state funds are provided, such as CalWORKs and CalFresh, counties are subject to the Department’s regulations and its control over the allocation of funds among the counties. (§ 10800; City and County of San Francisco v. State of California (1978) 87 Cal.App.3d 959, 966 [151 Cal.Rptr. 469].) Counties must comply with the Department’s regulations and abide by all of its lawful directives. (§ 10802.)

“Thus, the statutes establish an administrative hierarchy in which the [Department] exercises ultimate supervisory authority over the payment of welfare benefits and the county boards of supervisors, acting through the county welfare departments, function as agents of the [Department] in administering such payments.” (Ross v. Superior Court (1977) 19 Cal.3d 899, 907 [141 Cal.Rptr. 133, 569 P.2d 727].)

In 1997, the Legislature directed the Health and Welfare Data Center (now called the Office of Systems Integration (OSI)) to implement a “statewide automated welfare system” for a number of public social services programs, including CalWORKs and CalFresh. (§ 10823, subd. (a).) OSI was to implement this automated system through no more than four county consortia. (§ 10823, subd. (a).) However, nothing in this legislative mandate to OSI transferred the Department’s program policy responsibilities over CalWORKs and CalFresh to OSI. (§ 10823, subd. (b).)

The Welfare Client Data System Consortium (the consortium) is one of the four county consortia that implemented an automated system. (§ 10823, subd. (a)(5).) It developed the CalWIN (CalWORKs Information Network) computer system to administer the CalWORKs and CalFresh programs and other social service programs in its 18 member counties. It did so at a cost of $744 million, creating allegedly the largest program of its kind in the nation.

CalWIN is owned by the member counties and operated and maintained by the consortium. The consortium, in turn, contracts with a private company, Electronic Data Systems, to operate and maintain CalWIN on a day-to-day basis.

CalWIN automatically processes recipient information entered by a county caseworker and makes eligibility determinations. Those determinations include initial eligibility determinations, calculations of monthly benefit amounts based on eligibility factors, quarterly and annual redeterminations of eligibility, and other determinations of when a recipient’s benefits should be reduced or terminated.

CalWIN also generates notices of action which warn benefit recipients of possible termination or other adverse action if required eligibility reports and information are not timely submitted or are incomplete. If the required information is not received, CalWIN may automatically terminate benefits or impose a penalty.

The automatic termination function is a significant change from past practice. Prior to the use of CalWIN, if the existing system was not timely updated by a caseworker with a benefit recipient’s required information, eligibility continued until the caseworker took action to discontinue benefits. In CalWIN, the reverse is true. If CalWIN is not timely updated by the caseworker with the recipient’s required information, it will issue a notice to the recipient and eligibility will automatically be discontinued. The caseworker will have to take some affirmative action to reinstate benefits in those circumstances where the recipient ultimately provides the required information.

CalWIN allows county caseworkers to bypass its automatic processing and to issue benefits manually if circumstances require. This override operation is called non-system determined issuance (NSDI). Department regulations require counties to have in place procedures to issue benefits manually when necessary, and NSDI is one of those procedures.

Plaintiffs are five individuals who allege CalWIN at one time or another automatically and erroneously terminated, reduced, or delayed their Cal-WORKs and CalFresh benefits. All of them ultimately had their benefits fully restored through administrative appeals.

Nonetheless, in 2007, they filed a petition for writ of traditional mandate against the Department and its director. They alleged their experiences with CalWIN were indicative of those had by other benefit recipients. They alleged on information and belief that CalWIN had systemic programming flaws that caused erroneous and automatic benefit terminations, reductions, and delays to thousands of benefit recipients.

The Department filed a demurrer to the original petition. It also filed a motion for a protective order to stay discovery plaintiffs had demanded be completed before the hearing on the demurrer.

In January 2008, the trial court sustained the Department’s demurrer with leave to amend. It found plaintiffs’ individual contentions of harm did not support any contention of a systemic failure of CalWIN to perform in compliance with laws and regulations: “There is just no factual allegation that supports] that there is a systemic problem here.”

The court also granted the motion for protective order in part, but directed the parties to agree to a discovery schedule. Also, in light of its intention to be “reasonable but liberal” regarding discovery, the court placed no time limit on plaintiffs’ right to file an amended petition.

Plaintiffs filed their first amended petition in 2009. They alleged the same erroneous termination or reduction in their own benefits that they had alleged in the original complaint, with one plaintiff alleging an additional instance. They again alleged they had subsequently received the full amount of benefits owed to them.

They continued to allege on information and belief that their experiences and those of others whose experiences were documented in exhibits attached to the first amended petition were indicative of systemic programming flaws in CalWIN that resulted in CalWORKs and CalFresh benefits being terminated, delayed, or reduced in violation of state regulations in thousands of individual cases. They pleaded five causes of action that alleged separate systemic failures in CalWIN and the Department’s supervision of the counties using CalWIN.

In support of their allegations, plaintiffs attached 42 exhibits to the first amended petition which they had obtained through discovery. We will discuss the causes of action and relevant exhibits in greater detail below.

The Department again filed a demurrer, and in November 2009, the trial court sustained the demurrer without leave to amend as to all causes of action except one. The court granted leave to amend as to the second cause of action regarding the alleged lack of use and oversight of CalWIN’s NSDI function, the override function that allows caseworkers to issue benefits manually. The trial court determined the first amended petition pleaded “no clear, specific or direct factual allegations to support [plaintiffs’] claims that [the Department], as a single state agency, failed to supervise and oversee the 18 CalWIN counties and their implementation of the automated CalWIN computer system in violation of state and federal law or to support their claims that the CalWIN system is defectively programmed and operates in violation of law or regulations.” The court noted the exhibits attached to the first amended petition demonstrated the Department in fact monitored and supervised the counties, contrary to the first amended petition’s allegations.

The trial court stated there was nothing in the law that “prohibits [the Department] from delegating to the counties the operation of and the decision-making as to the functionality of an automated computer welfare system. The Court further finds there is no violation of law or regulation based on the manner in which the CalWIN computer system is programmed to operate under any of the counts where there are no facts showing any widespread violations of law or regulations. Any alleged failures of data entries by a county case worker in conjunction with the CalWIN computer system or outside of the CalWIN system do not constitute systematic automated CalWIN problems that have resulted in widespread violations of law or regulations under any of the five counts. What functions are to be performed by the computer and what functions are to be reserved for human action or input is an administrative and management decision, and are not contrary to law and regulations.”

The court granted leave to amend on the second cause of action based solely on counsel’s representations that two consortium counties had written policies prohibiting the use of NSDI when CalWIN erroneously did not issue benefits.

Plaintiffs filed a second amended petition in December 2009. This petition alleged the Department had violated its single state agency responsibilities by not determining whether any of the 18 member counties had a policy regarding the use of NSDI. It also alleged the Department had violated its responsibilities by failing to monitor whether CalWIN actually issued benefits timely when NSDI is used, and by failing to issue corrective instructions to counties on the proper use of NSDI. Plaintiffs sought a writ enjoining the Department to review county policies and monitor counties to ensure they require timely issuance of benefits through NSDI when CalWIN will not issue correct benefits. Plaintiffs attached a letter from the Department sent to counties reminding them of their need to use NSDI.

Once again, the Department filed a demurrer, and the trial court sustained the demurrer without leave to amend. The court found plaintiffs failed to allege any new or material facts to support their cause of action regarding NSDI policies. “There are no examples specifically pled that some CalWIN counties’ NSDI policies are causing any real problems of untimely or inaccurate benefits in violation of law or regulation.”

Plaintiffs appeal from the judgment of dismissal. They contend:

(1) The trial court applied the wrong standard of review by not accepting plaintiffs’ allegations as true for purposes of demurrer;

(2) The court erred by not enforcing the Department’s nondelegable duty as the single state agency to ensure timely issuance of benefits; and

(3) They pleaded sufficient facts showing the Department violated its duties as the single state supervising agency by allowing the consortium to make substantive policy, by allowing CalWIN’s automatic termination and reduction actions to continue in violation of due process, and by failing to ensure timely issuance of benefits.

In the alternative, plaintiffs assert the court erred by sustaining the demurrers without leave to amend, as they allegedly can cure any defects in their pleadings.

DISCUSSION

I

Standard of Review

“In reviewing the sufficiency of a complaint against a general demurrer, we are guided by long-settled rules. ‘We treat the demurrer as admitting all material facts properly pleaded, but. not contentions, deductions or conclusions of fact or law. [Citation.] We also consider matters which may be judicially noticed.’ (Serrano v. Priest (1971) 5 Cal.3d 584, 591 [96 Cal.Rptr. 601, 487 P.2d 1241].) Further, we give the complaint a reasonable interpretation, reading it as a whole and its parts in their context. (Speegle v. Board of Fire Underwriters (1946) 29 Cal.2d 34, 42 [172 P.2d 867].) When a demurrer is sustained, we determine whether the complaint states facts sufficient to constitute a cause of action. (See Hill v. Miller (1966) 64 Cal.2d 757, 759 [51 Cal.Rptr. 689, 415 P.2d 33].) And when it is sustained without leave to amend, we decide whether there is a reasonable possibility that the defect can be cured by amendment: if it can be, the trial court has abused its discretion and we reverse; if not, there has been no abuse of discretion and we affirm. (Kilgore v. Younger (1982) 30 Cal.3d 770, 781 [180 Cal.Rptr. 657, 640 P.2d 793]; Cooper v. Leslie Salt Co. (1969) 70 Cal.2d 627, 636 [75 Cal.Rptr. 766, 451 P.2d 406].) The burden of proving such reasonable possibility is squarely on the plaintiff. (Cooper v. Leslie Salt Co., supra, at p. 636.)” (Blank v. Kirwan (1985) 39 Cal.3d 311, 318 [216 Cal.Rptr. 718, 703 P.2d 58].)

Also, in testing a complaint against a demurrer, we may disregard allegations that are inconsistent with attached exhibits and matters judicially noticed. (Del E. Webb Corp. v. Structural Materials Co. (1981) 123 Cal.App.3d 593, 604 [176 Cal.Rptr. 824].)

To obtain a traditional writ of mandate, as plaintiffs seek here, plaintiffs must plead sufficient ultimate facts establishing three elements. First, they must demonstrate they seek to compel the Department to perform “an act which the law specially enjoins, as a duty resulting from an office, trust, or station,” and which the Department refuses to perform. (Code Civ. Proc., § 1085, subd. (a).) Such acts consist of ministerial actions or mandatory duties to exercise discretion. (California Assn. of Professional Scientists v. Department of Finance (2011) 195 Cal.App.4th 1228, 1236 [125 Cal.Rptr.3d 328]; Daily Journal Corp. v. County of Los Angeles (2009) 172 Cal.App.4th 1550, 1555 [92 Cal.Rptr.3d 219].)

Second, plaintiffs must plead they have a beneficial interest in the outcome of the proceedings. (Code Civ. Proc., § 1086.) Plaintiffs must have “ ‘ “a clear, present and beneficial right” ’ ” to the performance of the duty allegedly owed by defendants. (California Assn. of Medical Products Suppliers v. Maxwell-Jolly (2011) 199 Cal.App.4th 286, 302 [131 Cal.Rptr.3d 692].) A beneficial interest generally means plaintiffs have some special interest to be served or some particular right to be preserved or protected over and above the interest held in common with the public at large. (Save the Plastic Bag Coalition v. City of Manhattan Beach (2011) 52 Cal.4th 155, 166 [127 Cal.Rptr.3d 710, 254 P.3d 1005].) A citizen’s interest in having laws executed and public duties enforced may be sufficient to meet the beneficial interest requirement. (Green v. Obledo (1981) 29 Cal.3d 126, 144 [172 Cal.Rptr. 206, 624 P.2d 256].)

Third, plaintiffs must plead facts showing they have no other plain, speedy, or adequate remedy at law. (Code Civ. Proc., § 1086.) When plaintiffs are pursuing traditional mandate, “ ‘the exhaustion requirement speaks to whether there exists an adequate legal remedy. If an administrative remedy is available and has not yet been exhausted, an adequate remedy exists and the petitioner is not entitled to extraordinary relief.’ [Citation.]” (Eight Unnamed Physicians v. Medical Executive Com. (2007) 150 Cal.App.4th 503, 511 [59 Cal.Rptr.3d 100], quoting Unnamed Physician v. Board of Trustees (2001) 93 Cal.App.4th 607, 620 [113 Cal.Rptr.2d 309].)

The Department does not contend plaintiffs failed to plead they are beneficially interested parties. We thus turn to determine whether the pleadings sufficiently pled ultimate facts alleging the Department failed or refused to perform a ministerial duty or a duty to exercise discretion, and alleging plaintiffs have no other adequate remedy at law. Because we conclude plaintiffs have not, and cannot, plead the Department failed to perform a ministerial duty or to exercise discretion where required, we do not reach the issue of whether plaintiffs have no other adequate remedy at law.

II

Failure of Department to Perform an Act Enjoined by Law

Plaintiffs allege the Department has a statutory mandate to ensure counties timely and accurately deliver CalWORKs and CalFresh benefits to eligible recipients. Plaintiffs assert the Department violated this duty by allowing the consortium to control CalWIN, and by allowing CalWIN to perform its automatic functions at the risk of erroneously terminating, reducing, or denying benefits. In each of their causes of action, they seek a writ of mandate enjoining the Department to fulfill its statutory oversight duties and ensure that counties using CalWIN deliver benefits on a timely basis. They also seek writ relief to compel the Department to make changes in CalWIN and CalWIN’s governance by the consortium so that the system will no longer automatically terminate, reduce, or deny benefits to recipients.

We will review each of plaintiffs’ five causes of action to determine whether they state a claim for relief. But our discussion of the first cause of action also affects the relief sought in the third, fourth, and fifth causes of action, that of a writ compelling the Department to make changes in CalWIN and the consortium. We turn first to that cause of action. In short, we conclude plaintiffs cannot recover to the extent they seek an order compelling the Department to change the governance of the consortium and make changes to CalWIN. No law imposes such a ministerial duty on the Department.

We also conclude plaintiffs cannot recover on their remaining causes of action. The exhibits plaintiffs attached to their first and second amended petitions contradict plaintiffs’ allegations and demonstrate the Department is not failing to supervise the counties and that CalWIN does not suffer from systemic programming errors.

A. First cause of action

Plaintiffs’ first cause of action alleged the Department wrongfully ceded control of CalWIN to the consortium, such that the consortium independently ■ interpreted laws and regulations, resolved legal conflicts, and programmed CalWIN accordingly, even if the Department had requested otherwise. They also sought a writ declaring the Department has the authority to change the governance of CalWIN so that it may order changes to the system without approval from the consortium, and that the consortium cannot disregard the changes ordered by the Department. In their third, fourth, and fifth causes of action, as explained in more detail below, they also sought relief compelling the Department to make changes in CalWIN.

We conclude the Department’s duty to supervise the counties in their administration of CalWORKs and CalFresh does not include a ministerial or mandatory duty to control or change CalWIN. How the Department supervises the counties to ensure benefits are timely and correctly delivered is a matter of discretion, and mandamus does not lie to compel the exercise of discretion in a particular way. Plaintiffs thus cannot obtain the relief they seek in their first, third, fourth, and fifth causes of action as a matter of law.

To obtain their requested relief, plaintiffs must show the Department has a “clear, present, and ministerial duty” not only to supervise the counties to obtain full compliance with governing laws, but also to take control of CalWIN and make changes to it so that it can no longer automatically terminate, reduce, or deny benefits in the manner it is programmed to do. (Kavanaugh v. West Sonoma County Union High School Dist. (2003) 29 Cal.4th 911, 916 [129 Cal.Rptr.2d 811, 62 P.3d 54] (Kavanaugh).) Plaintiffs cannot show the Department is subject to such a ministerial duty.

A ministerial duty imposes on a public officer an obligation “ ‘to perform in a prescribed manner in obedience to the mandate of legal authority and without regard to his own judgment or opinion concerning such act’s propriety or impropriety, when a given state of facts exists.’ [Citation.]” (Kavanaugh, supra, 29 Cal.4th at p. 916.)

To be enforceable by writ of mandate, a statutory duty must “ ‘be obligatory, rather than merely discretionary or permissive, in its directions to the public entity; it must require, rather than merely authorize or permit, that a particular action be taken or not taken. [Citation.] It is not enough, moreover, that the public entity or officer have been under an obligation to perform a function if the function itself involves the exercise of discretion. [Citation.]’ [Citations.]” (Shamsian v. Department of Conservation (2006) 136 Cal.App.4th 621, 633 [39 CaI.Rptr.3d 62], original italics.)

No such legal mandate obligates the Department to take control of CalWIN or its governance to ensure the counties fully comply with governing law.

To be sure, the Department has “full power to supervise every phase of the administration of public social services ... in order to secure full compliance with the applicable provisions of state and federal laws.” (§ 10600.) In its supervisory role, the Department is required to “advise public officers regarding the administration of public social services by public agencies throughout the state, and shall supervise the administration of state public social services ... to all persons receiving or eligible to receive such state public social services. . . .” (§ 10603.)

However, how the Department supervises the counties and brings them into full compliance is a matter left to the Department’s discretion. The Department is authorized to exercise its discretion when fulfilling its supervisory duty, including when determining how to bring a noncompliant county into compliance.

Governing statutes vest discretion in the Department when it both supervises the counties and attempts to correct them. The Legislature has directed the Department, when supervising the counties, to be flexible, and to aid them, as opposed to direct them, in establishing their own methods of operation. Section 10615 states: “California’s 58 counties vary greatly in their welfare problems, and therefore they should not be treated alike in the supervision of welfare programs. The Legislature hereby declares its intent that the [Department examine the extent of state control needed over county operations, with a view toward eliminating excessive rigidity in procedure; the state should differentiate between those counties which need general direction as opposed to tight supervision.

“Within these guidelines, the [Department shall aid county departments in establishing economic, efficient, and effective methods of operation, including, but not limited to, advising and consulting with county departments with' regard to the introduction of electronic computer and data processing systems . . . .” (§ 10615, italics added.)

Thus, the Department is mandated only to aid counties in establishing systems such as CalWIN, and it retains significant discretion in determining how it supervises each county.

Similarly, the Department exercises discretion in enforcing governing laws. The Department is not directed to correct the counties every time an error is made. Section 10605 requires the Department to act if a county is “substantially failing” to comply with its legal obligations. Under that statute, if the Department’s director believes a county is “substantially failing” to comply with governing law or Department regulations, and if the director determines formal action may be necessary to secure compliance, only then does he have a mandatory duty to inform the county of its failure and provide the county with time to bring itself into compliance with the law. (§ 10605, subd. (a).)

If the county fails to correct its actions, the director has discretion to determine whether he will pursue additional remedies. He may seek injunctive or mandamus relief to secure immediate compliance, and he may also impose sanctions following an administrative hearing. (§ 10605, subds. (a), (b), (e).) The director may, as sanctions, either withhold state and federal funds, or he may temporarily assume administration of the county’s programs until the county assures the Department it will comply. (§ 10605, subd. (b).)

As can be seen, no law imposes on the Department the ministerial or mandatory obligation to respond to CalWIN’s alleged deficiencies by taking control of CalWIN or the consortium, or making changes to CalWIN. If the director determines counties are substantially failing to comply with the law as a result of their use of CalWIN, he can notify the county formally or informally of the need to bring their practices into compliance. Compliance in this instance could be achieved in more than one way, and the director and the counties have discretion to determine how best to achieve compliance. As plaintiffs admit, CalWIN’s allegedly erroneous automatic actions usually take place when a caseworker fails to enter updated or correct data into the system. As a result, compliance may be achieved by correcting and training against human error instead of, or as part of, correcting CalWIN’s operations. Because the law provides the director and the counties with this discretion, we cannot order the Department to exercise its discretion in any particular way, as plaintiffs would have us do. The trial court thus correctly sustained the Department’s demurrer to plaintiffs’ first cause of action without leave to amend. It also correctly sustained the demurrer to the third, fourth, and fifth causes of action without leave to amend to the extent they seek relief compelling the Department to make changes in CalWIN.

This conclusion does not end our analysis. We still must determine whether plaintiffs pleaded sufficient facts to recover under any theory. “ ‘[I]t is error for a . . . court to sustain a demurrer when the plaintiff has stated a cause of action under any possible legal theory.’ [Citation.]” (Fox v. Ethicon Endo-Surgery, Inc. (2005) 35 Cal.4th 797, 810 [27 Cal.Rptr.3d 661, 110 P.3d 914].)

Specifically, we must determine whether plaintiffs’ remaining causes of action pleaded sufficient facts alleging the Department is failing to supervise the CalWIN counties, or the CalWIN counties are substantially failing to comply with governing laws as a result of their use of CalWIN, thereby entitling plaintiffs to a writ of mandate compelling the Department to exercise its discretion to determine how best to supervise the counties or to determine whether informal or formal action may be necessary to obtain compliance and then to seek compliance accordingly.

Our standards governing this review are well established. “[T]he complaint need only allege facts sufficient to state a cause of action; each evidentiary fact that might eventually form part of the plaintiff s proof need not be alleged. [Citation.]” (C.A. v. William S. Hart Union High School Dist. (2012) 53 Cal.4th 861, 872 [138 Cal.Rptr.3d 1, 270 P.3d 699].) “[T]he complaint ordinarily is sufficient if it alleges ultimate rather than evidentiary facts. (Burks v. Poppy Construction Co. (1962) 57 Cal.2d 463, 473-474 [20 Cal.Rptr. 609, 370 P.2d 313]; Doheny Park Terrace Homeowners Assn., Inc. v. Truck Ins. Exchange (2005) 132 Cal.App.4th 1076, 1099 [34 Cal.Rptr.3d 157] [‘It has been consistently held that “ ‘a plaintiff is required only to set forth the essential facts of his case with reasonable precision and with particularity sufficient to acquaint a defendant with the nature, source and extent of his cause of action’ ” ’].) Moreover, ‘[p]laintiff may allege on information and belief any matters that are not within his personal knowledge, if he has information leading him to believe that the allegations are true.’ (Pridonoff v. Balokovich (1951) 36 Cal.2d 788, 792 [228 P.2d 6].)” (Doe v. City of Los Angeles (2007) 42 Cal.4th 531, 550 [67 Cal.Rptr.3d 330, 169 P.3d 559]; see Code Civ. Proc., § 425.10, subd. (a).)

“A complaint is adequate if its factual allegations are sufficient to support a cause of action on any available legal theory (whether specifically pleaded or not). [Citation.]” (Smith v. Wells Fargo Bank, N.A. (2005) 135 Cal.App.4th 1463, 1485 [38 Cal.Rptr.3d 653].) The complaint also need not particularize matters presumptively within the knowledge of the demurring defendant. (Smith v. Kern County Land Co. (1958) 51 Cal.2d 205, 209 [331 P.2d 645].)

However, the complaint must do more than plead general allegations, contentions, deductions, or conclusions of law. Although the distinction between conclusions of law and ultimate facts “ ‘is not at all clear and involves at most a matter of degree,’ ” the complaint must allege specific and sufficient facts to apprise the defendants of the basis upon which plaintiffs seek relief. (Perkins v. Superior Court (1981) 117 Cal.App.3d 1, 6 [172 Cal-Rptr. 427].)

B. Second cause of action

Plaintiffs’ second cause of action alleged the Department violated its duty to supervise and ensure full compliance with law by failing to require counties to utilize the NSDI process to issue benefits manually when Cal-WIN, for whatever reason, will not or when it incorrectly delays, reduces or terminates an individual’s benefits. They claim on information and belief that county caseworkers fail to use NSDI and counties inappropriately limit the use of NSDI. As a result, benefit recipients do not receive their benefits within the times required by Department regulations and in violation of their constitutional due process rights. Plaintiffs seek a writ requiring the Department to review the CalWIN counties’ policies to ensure they require timely issuance of benefits through the NSDI or other manual process when CalWIN will not timely issue correct benefits. They also seek a writ requiring the Department to monitor the counties’ compliance with their NSDI policies.

We conclude the trial court correctly sustained the Department’s demurrer to this cause of action without leave to amend. Exhibits both attached to the pleadings and judicially noticed contradict plaintiffs’ allegations and defeat their claim.

To support their allegations regarding NSDI, plaintiffs attached eight declarations that described the experiences of 11 benefit recipients who did not receive their aid timely. Plaintiffs allege these exhibits support their contentions that counties are not using NSDI to issue benefits timely when CalWIN refuses to do so.

Plaintiffs included additional attachments to their second amended petition to support their allegations regarding NSDI. They attached copies of the NSDI policies adopted by two CalWIN counties, Ventura County and San Diego County, they claimed limited the respective county caseworkers from utilizing the NSDI process when needed.

Other exhibits, however, contradict plaintiffs’ allegations. Plaintiffs attached to their second amended petition a letter issued by the Department in 2007 to all CalWIN counties. In the letter, the Department acknowledged receiving complaints of aid recipients not receiving their benefits in a timely and accurate manner. The Department had the consortium investigate 12 specific case examples advocates for recipients had forwarded to the Department. The consortium found that in each case, CalWIN had performed correctly, but the caseworkers had not. The consortium also found that in a number of the cases, caseworkers had in fact used the NSDI process to issue benefits manually, but had not always done so timely.

In response to these findings, the Department issued the following instruction to the CalWIN counties: “Given the importance of timely benefit issuance, in the event that a CalWIN county is unable to issue benefits within the defined state and federal timeframes, the County is required to use any means necessary, including the use of its NSDI process (which overrides functionality in CalWIN), to comply with the regulations. Counties will need to ensure that this requirement is reflected in their written policies and procedures to staff.”

The Department acknowledged that “the vast majority of applicants and recipients in CalWIN counties are receiving their benefits each month in a timely and accurate manner. [][] However, we need to ensure that the few impacted by these problems have their circumstances resolved in as timely a manner as possible. We anticipate that as workers gain more experience using the system, there will be fewer worker errors.”

This letter submitted by plaintiffs contradicts their allegations in their petitions and thus takes precedence over them. (Del E. Webb Corp. v. Structural Materials Co., supra, 123 Cal.App.3d at p. 604.) The letter indicates the Department in fact is supervising the CalWIN counties to ensure they use NSDI processes to comply with federal and state laws and issue all benefits timely. It required counties to use NSDI and to revise their policies if necessary to reflect the requirement to use NSDI. This is the exact relief plaintiffs seek with their second cause of action.

Indeed, the trial court judicially noticed updated versions of the Ventura and San Diego Counties NSDI policies, adopted after the Department’s letter, that order county caseworkers to use NSDI or any other available process when benefits determined by CalWIN are incorrect and at risk of not meeting regulatory time requirements.

The exhibit and the judicially noticeable facts defeat plaintiffs’ claim alleging the Department is not fulfilling its supervisory role in ensuring counties use NSDI processes when CalWIN incorrectly determines benefits, or that counties are limiting the use of NSDI. The trial court thus correctly sustained the demurrer to the second cause of action without leave to amend.

C. Third, fourth, and fifth causes of action

Plaintiffs’ remaining causes of action concern CalWIN’s ability to automatically terminate aid to recipients who fail to timely comply with reporting requirements. Each cause of action effectively asks us to determine the counties are substantially failing to comply with law (particularly laws governing the timely issuance of benefits) because CalWIN systemically and incorrectly terminates benefits, and the Department is failing to supervise the counties to correct these violations. We conclude the trial court correctly sustained demurrers to each cause of action, as exhibits submitted by plaintiffs contradict their allegations and demonstrate the Department is supervising the counties and CalWIN is not subject to systemic programming errors. We describe each cause of action in detail.

1. Third cause of action

The third cause of action concerns how CalWIN automatically terminates CalWORKs and CalFresh benefits when a recipient fails to file a quarterly eligibility report known as a “QR 7.” Per former section 11265.1, the QR 7 was due on the 11th day of the last month of the recipient’s quarterly reporting cycle. (Former § 11265.1, subd. (b).) If a recipient failed to submit a completed QR 7 by that day, his benefits did not terminate that day. Rather, the county must have notified the recipient that it would terminate his benefits at the end of the month if the QR 7 was not submitted by then. (Former § 11265.1, subd. (f).)

Prior to terminating benefits, however, the county must also have attempted to make personal contact with the recipient reminding him a completed QR 7 was due. If contact was not made, the county must have sent a reminder notice no later than five days before the end of the month. (Former § 11265.1, subd. (f).) The county must have rescinded the discontinuance notice if the recipient submitted a complete QR 7 by the first working day of the first month following the quarterly reporting cycle. (Ibid.)

At the county’s or the recipient’s request, the county “may [have] determine[d]” at any time prior to the last day of the calendar month following discontinuance of benefits for failure to submit a QR 7 that the recipient had good cause for failing to submit the QR 7. (Former § 11265.1, subd. (g).) If the county found the recipient had good cause, it must have rescinded the discontinuance notice and restored benefits. (Ibid.)

Plaintiffs allege in their third cause of action that CalWIN operates in violation of these QR 7 rules in three respects. First, they allege CalWIN wrongfully terminates a recipient’s benefits when he submits his QR 7 after the 11th day of the reporting month but before the first day of the next month. They claim if a recipient fails to submit a QR 7 prior to the 11th day of the month, or submits an incomplete QR 7, CalWIN places a recipient’s benefits in “hold” status. Unless a county worker affirmatively acts to release the hold, benefits automatically terminate, even if the recipient submits his QR 7 between the 11th day and the last day of the reporting month. Plaintiffs assert the automatic termination of benefits when a county worker fails to process a QR 7 submitted between the 11th and the last day of the reporting month violates their rights to timely receive benefits, and it effectively terminates their benefits as of the 11th day of the reporting month.

Second, plaintiffs allege CalWIN wrongfully terminates benefits without receiving verification that a county worker attempted to contact the recipient or sent a written notice before the termination would take effect. Although the attempted contact must be documented in the recipient’s file, CalWIN automatically terminates benefits without documentation from the worker that the attempted contact was made or written notice was sent.

Third, plaintiffs allege CalWIN wrongfully does not require a caseworker to evaluate whether good cause justified a recipient’s failure to timely submit his QR 7. They claim the failure to program CalWIN to require caseworkers to make a good cause evaluation whenever a QR 7 is submitted within the first month after the end of the reporting quarter denies recipients their right to good cause evaluations.

2. Fourth cause of action

Plaintiffs’ fourth cause of action concerns CalWIN’s automatic termination of CalWORKs benefits when a recipient fails to comply with annual recertification requirements timely. Counties must redetermine the continuing eligibility of benefit recipients annually, a process known as an “RRR.” (§ 11265.) If a recipient fails to timely submit the necessary information, benefits will be terminated.

Plaintiffs complain that CalWIN terminates benefits 11 days before the end of the month the RRR is due, in violation of Department regulations requiring discontinuance of benefits on account of ineligibility to be effective the last day of the month for which the last benefits were paid.

CalWIN determines, tracks, initiates, and maintains the RRR process for benefit recipients, but the caseworker is responsible for documenting the recipient’s progress through the RRR process into CalWIN. If, for whatever reason, the caseworker has not noted in CalWIN by the 11th day before the end of the month that the RRR process has been started or completed by the recipient, CalWIN will automatically discontinue the recipient’s benefits as of the end of the month. If at some time during the last 11 days of the month the recipient complies with all eligibility requirements, the caseworker must manually rescind the discontinuance and complete the RRR process in order to prevent the recipient’s benefits from being terminated. Plaintiffs claim this automatic termination process, when not corrected by a caseworker, results in benefits not being issued timely to eligible recipients.

3. Fifth cause of action

Plaintiffs’ fifth cause of action seeks to stop any other automatic termination or reduction of benefits that occur without caseworker action. CalWIN allegedly is programmed to impose penalties automatically when child support documentation, school attendance verifications, and proof of child immunizations are not submitted timely. The child support documentation penalty occurs even though the Department allegedly directed that CalWIN not impose it. CalWIN also automatically terminates benefits wherever a recipient misses an appointment with the county, even though there allegedly is no legal authority for automatically terminating benefits solely because the recipient missed an appointment.

4. Exhibits attached in support of the third, fourth, and fifth causes of action

Plaintiffs attached numerous exhibits to their second amended petition as facts to support their allegations that these actions by the counties and CalWIN were systemic, were harming thousands of benefit recipients in the state, were a failure to comply with governing laws, and demonstrated the Department was failing to supervise the counties. The exhibits resulted from discovery allowed by the trial court after it sustained the Department’s demurrer to plaintiffs’ original petition. From May to August 2008, the Department provided plaintiffs with approximately 10,300 pages of documents. The Department also provided plaintiffs with over three years of administrative hearing decisions involving alleged benefit terminations, reductions, and delays in the 18 counties that make up the consortium.

In addition, plaintiffs propounded third party subpoenas and public records requests to the member counties. They allegedly obtained “snapshots” of the counties’ problems with CalWIN over a single month, March 2008. They also noticed third party depositions, but after the Department sought a protective order, the parties agreed plaintiffs would not notice third party depositions until after they filed their first amended petition.

The snapshot evidence of one month’s operation of CalWIN consisted of tabulations from five CalWIN counties regarding the number of “trouble tickets” that were opened in March 2008. Plaintiffs allege trouble tickets are opened by caseworkers when they experience a problem with CalWIN and cannot resolve it through routine means. If the county cannot resolve the problem, they “escalate” the trouble ticket to the consortium for resolution. According to the exhibits, trouble tickets were reported in the following counties in March 2008:

County Tickets opened Tickets escalated

San Diego 973 82

San Luis Obispo 68 0

Santa Barbara 326 31

Ventura 545 45

San Francisco 273 156

(Some of San Francisco’s escalated tickets may have been opened prior to March 2008.)

Plaintiffs also alleged, without any supporting documentation, that a sixth CalWIN county, Sonoma County, opened 469 trouble tickets in March 2008. Of those, 449 were resolved at the county level, 40 were escalated to the consortium, and 20 were in progress at the county level (plaintiffs’ numbers).

From this information, plaintiffs allege “there could be more than 75,000 trouble tickets per year for all eighteen counties.” Plaintiffs assert this number reflects the number of individuals who are affected each year by erroneous calculations by CalWIN.

One of the plaintiffs alleged she had received notices of action warning her that her benefits would be terminated for failing to timely submit a QR 7, when in fact she had timely submitted the report.

Plaintiffs also supported their allegations regarding QR 7 terminations with eight different administrative hearing decisions made by the Department from 2005 into 2008. In each, the Department rescinded a county’s decision to terminate benefits for failure to timely submit a QR 7. In four of the decisions, the Department ruled the counties had failed to personally contact the recipient about the omission before terminating aid. In one of those four, and in three others, the Department credited the recipients’ testimony that they had in fact submitted their QR 7’s timely, even though the county had no record of timely receipt. In another, the county admitted it had received the QR 7 timely and agreed to restore benefits.

Plaintiffs also supported their allegations regarding QR 7 terminations with declarations by three benefit recipients who received notices of termination for failure to submit a QR 7 when they had allegedly submitted one.

Joni Halpem, an attorney who represents benefit recipients in San Diego County, declared that from June 2006 when the county implemented CalWIN until January 2009, she represented clients she claimed were adversely affected by CalWIN. She represented clients (she does not say how many) whose CalWORKs or CalFresh benefits were placed on hold when the clients filed their QR 7’s after the 11th day of the submit month but before the 1st of the following month, and vaguely claims CalWIN “was not responsive” to this information.

Halpem represented about 20 clients for whom she claims CalWIN denied CalWORKs benefits on the basis of immigration status, even though they were either United States citizens or qualified immigrants. She and others in her organization claim they represented at least 40 clients for whom CalWIN would not authorize CalFresh benefits. County workers allegedly could not override CalWIN in those instances.

Halpem also claims she noticed CalWIN on occasion would send out a notice of action untimely. She said she has seen “dozens of cases” where the negative action was to take place in the month preceding the date of the notice of action, thereby denying the client an opportunity to ask for an administrative hearing.

Halpem claimed that in all cases in which she asked for an administrative hearing to address a benefit termination or reduction allegedly caused by CalWIN not functioning correctly, the county stipulated to withdraw the notice of action and take corrective action. As a result, during 2007 and 2008, “not a single CalWIN problem [she] handled went to hearing, because they were all resolved by conditional withdrawal, and sometimes by withdrawal in cases where the benefits were fully authorized and issued before a hearing.”

The exhibits included 12 declarations by nonparties describing the difficulties they or their clients encountered when they, for example, responded to notices of action or attempted to file their QR 7 or redetermination applications. In each of the incidents, the loss or reduction of benefits was ultimately remedied.

The exhibits also include a few e-mail communications between county staff and Department staff regarding problems encountered with CalWIN. In one, cited repeatedly by plaintiffs, a county staff member complains to a Department staff member that “clients are getting burned left and right and they just keep saying the system is functioning as designed.”

However, other exhibits submitted by plaintiffs demonstrate the Department, the consortium, and the CalWIN counties have addressed plaintiffs’ concerns as a matter of supervision and training. They show the problems of which plaintiffs complain are not with CalWIN; they are with the caseworkers learning how to use CalWIN. They also show the governing agencies are systematically supervising and training those workers to correct the problems.

Many of the exhibits to the first amended complaint are policy statements and training materials produced by the Department and the various counties on how to implement CalWIN and even work around some of its glitches. Some of them clearly explain the change CalWIN introduced into the provision of social services. Regarding how CalWIN handles RRR, the annual redetermination process, a Department e-mail states: “The CalWIN process is different than the legacy system process. In the legacy process, if the system was not updated with the appropriate RRR information, eligibility continued. The worker had to take a positive action for benefits to discontinue. In CalWIN the reverse [is] true. If CalWIN is not updated with the appropriate RRR information on time, the client will be noticed and eligibility discontinued. The worker has to take positive action for benefits to continue. This is how CalWIN was designed and how similar systems are designed.”

The San Francisco Department of Human Services similarly wrote: “Cal-WIN has a number of automated actions. These are actions that CalWIN takes when certain data is not entered into the system by a certain time. . . . [f] Staff must take appropriate action to make sure CalWIN does not take an improper negative action on cases.”

Other training materials and communications inform county caseworkers it is their responsibility to timely enter the necessary information into CalWIN to prevent the system from incorrectly terminating benefits. Consortium training manuals instruct workers how to process QR 7 reports and RRR applications that are submitted after the first deadline so that aid is not automatically terminated. Other instructions by CalWIN counties provide similar instructions for caseworkers to avoid incorrect terminations due to lack of information on immunizations and school verification for six-year-old children, late filed QR 7’s, and where good cause exists for the recipient’s failure to keep an appointment.

Judith Levy Baker, a former appeals officer for the Alameda County Social Services Agency, declared the incorrect automatic terminations were caused by caseworkers. She worked as an appeals officer during CalWIN’s first year of operation in her county, 2005. She declared that during that time, she noticed an increase of appeals from recipients claiming their QR 7’s had been turned in timely but their benefits had been terminated anyway. However, she attributed the problem to caseworkers being overwhelmed by the demands of CalWIN. They were not answering phones or responding to messages from recipients who had received a notice of action. Clerical staff would often not accept forms from clients if the caseworker was not in, and when they did, the forms would not be reviewed or processed timely. Verification documents such as birth certificates and Social Security numbers often were not scanned into the system timely, resulting in a termination of benefits even though the client had filed the information. Even when the documents were scanned, caseworkers usually failed to check CalWIN to find the documentation before terminating benefits, or they did not know where to look for the documentation in the system. In addition, workers could not keep pace with the system’s requirements for data entry, so notices and deadlines issued by the system were being ignored.

Two other exhibits submitted by the plaintiffs and expressly relied upon by the trial court also demonstrate file Department was in fact supervising the counties and directing them to take corrective action on matters the Department believed were inconsistent with governing law. These exhibits, audit reports prepared by the Department, memorialized the Department’s findings after auditing the San Mateo and Alameda Counties welfare departments’ food stamp programs. In San Mateo County, the Department found that in fiscal year 2007, the county, among other things, was not timely processing 54 percent of its QR 7’s and 25 percent of its food stamp applications. The Department directed the county to prepare a response plan to address these deficiencies.

In fiscal year 2006, the Department found in Alameda County a welfare department staff that was struggling with the transition to CalWIN. The amount of errors had increased, quality controls had been reduced, and caseloads had significantly increased as resources were devoted to implementing CalWIN and a case imaging project. Staff members were “overwhelmed” with the challenges of implementing CalWIN. They were failing to issue correct payments and were unable to locate QR 7’s and other documents in the system. Many of the staff members felt their CalWIN training had been inadequate and had not prepared them to process cases in a timely and proficient manner.

To address these concerns, the Department advised the county to monitor the case screening project so that QR 7’s and other case documents were placed into the system in a timely manner, and to consider caseload reductions and management training. The Department also directed the county to provide “mandatory ongoing CAL-WIN training to ensure eligibility staff proficiency with the system.” As it did with San Mateo County, the Department ordered Alameda County to submit a response plan detailing how it would address the problems identified in the audit.

These latter exhibits conflict with many of plaintiffs’ allegations. They demonstrate CalWIN suffers from no systemic programming error. Rather, it is designed to terminate benefits when aid recipients fail to demonstrate their eligibility when required by law, and it requires human intervention to prevent any incorrect terminations. That it puts recipients’ eligibility in a “hold” status pending completion of filing requirements and caseworker intervention does not terminate benefits prematurely, as the termination does not become effective until the first day of the next month when benefits would otherwise be due. The system’s incorrect automatic terminations are the result of staff error, not CalWIN error.

The exhibits also demonstrate the Department has taken steps to supervise the counties’ use of CalWIN. In communications, training, and auditing, the Department has directed the counties to take corrective actions to ensure benefits are timely issued and not incorrectly terminated due to caseworker error. Because the facts contained in these exhibits contradict plaintiffs’ allegations, we disregard the latter. (Del E. Webb Corp. v. Structural Materials Co., supra, 123 Cal.App.3d at p. 604.)

Plaintiffs’ other allegations do not plead the counties are substantially failing to comply with law such that we could order the Department to exercise its discretion to address the violations. The evidence of trouble tickets does not support plaintiffs’ claims. Plaintiffs give us no idea what difficulty with CalWIN each trouble ticket represents. We cannot determine from their mere existence that CalWIN is incorrectly terminating benefits when caseworkers are using the system correctly and timely, that counties are substantially failing to comply with law, or that the Department is somehow not fulfilling its supervisory duties. Their use here adds nothing to plaintiffs’ claims.

Plaintiffs’ own allegations and the declarations by other benefit recipients and attorneys also do not support the allegations that the counties are substantially failing to comply with the law and the Department is not fulfilling its duty to supervise. At best, they show errors were made in individual circumstances, but in a system as large and complicated as CalWIN—allegedly the largest of its kind in the country—that assists in the administration of welfare benefits to 18 counties, they do not demonstrate the Department is failing to supervise the counties.

Because plaintiffs have already had two opportunities to plead sufficient facts and have failed to do so, and because the evidence submitted by plaintiffs demonstrates they cannot plead facts sufficient to demonstrate the Department is failing to perform a mandatory duty, we conclude the trial court did not abuse its discretion when it denied the third, fourth, and fifth causes of action without leave to amend.

DISPOSITION

The judgment is affirmed. Costs on appeal are awarded to defendants. (Cal. Rules of Court, rule 8.278(a).)

Hull, J., and Mauro, 1, concurred.

A petition for a rehearing was denied December 12, 2013, and appellants’ petition for review by the Supreme Court was denied January 29, 2014, S215458. 
      
       Undesignated section references are to the Welfare and Institutions Code.
     
      
       CalWORKs (California Work Opportunity and Responsibility to Kids; § 11200 et seq.) provides assistance to eligible low-income families with related children under 18 years of age whose parents cannot support them. (§ 11250; Barron v. Superior Court (2009) 173 Cal.App.4th 293, 299-300 [92 Cal.Rptr.3d 394].) CalFresh, formerly known as the Food Stamp Program, provides monthly benefits to low-income households that can be used for the purchase of food. (§ 18900 et seq.)
     
      
       The OSI is part of the California Health and Human Services Agency. (Gov. Code, § 12803.3.)
     
      
       The member counties are Alameda, Contra Costa, Fresno, Orange, Placer, Sacramento, San Diego, San Francisco, San Luis Obispo, San Mateo, Santa Barbara, Santa Clara, Santa Cruz, Solano, Sonoma, Tulare, Ventura, and Yolo Counties.
     
      
       Plaintiff Sim Pich alleged CalWIN wrongly terminated his CalWORKs benefits, notifying him incorrectly that he had reached the maximum time allowed to receive benefits. Plaintiff Maria Robles alleged CalWIN wrongly denied her aid while she pursued an administrative appeal. Plaintiff Monica Rowland alleged CalWIN denied her aid for failing to timely submit a quarterly eligibility report when she had in fact submitted it. Plaintiff Sharita Thomas alleged CalWIN wrongly denied her aid without accounting for her fluctuating income. Plaintiff Rachael Vejraska alleged CalWIN did not timely provide her with food stamps and incorrectly penalized her.
     
      
       Traditional mandate may also be used to correct a legislative abuse of discretion (Santa Clara County Counsel Attys. Assn. v. Woodside (1994) 7 Cal.4th 525, 539 [28 Cal.Rptr.2d 617, 869 P.2d 1142]), but plaintiffs do not allege that occurred here.
     
      
       The Department director’s duties include administering the laws regarding the administration of public social services, and adopting regulations and general policies affecting the purposes, responsibilities, and jurisdiction of the Department. (§ 10553.)
     
      
       At oral argument, counsel for plaintiffs accused the trial court of turning a hearing on demurrer into a summary judgment motion. It did no such thing. It granted plaintiffs generous time to conduct discovery to find facts to support further allegations, but it did not require them to attach that discovery to their petition.
     