
    SHA-I CORPORATION, a Delaware Corp., Plaintiff-Appellee, Cross-Appellant, v. CITY AND COUNTY OF SAN FRANCISCO, a Municipal Corp., Defendant-Appellant, Cross-Appellee.
    Nos. 77-2858, 77-2884.
    United States Court of Appeals, Ninth Circuit.
    Feb. 6, 1980.
    
      Nathaniel M. Gorton, Powers & Hall, Boston, Mass., Steven A. Diaz, Robert T. Fries, San Francisco, Cal., for plaintiff-ap-pellee, cross-appellant.
    John Sullivan Kenny, Thomas M. O’Con-nor, San Francisco, Cal., for defendant-appellant, cross-appellee.
    Before ELY and HUG, Circuit Judges, and TAYLOR, District Judge.
    
      
      The Honorable Fred M. Taylor, Senior United States District Judge for the District of Idaho, sitting by designation.
    
   ELY, Circuit Judge:

The root of the present controversy is a contract between SHA-I Corporation (formerly Automated Health Systems, Inc.), a Delaware corporation with its principal place of business in Massachusetts, and the City and County of San Francisco (“the City”). The basis of federal jurisdiction is the diversity of the parties’ residency and the requisite amount of money involved.

Automated Health Systems (“AHS”) agreed to design and install a computer system at the clinical laboratory of a hospital, operated by the City, in three successive phases described as the “PDP-12 Basic System,” “PDP-12 Advanced Systems,” and the “PDP-15 System.” After installation, each system was to be subjected to a 30-day acceptance test, and if the system performed at “an effectiveness level of 95%,” as defined in the contract, the City was to accept the system and pay for it. Installation, acceptance, and payment for the PDP-12 Basic and Advanced Systems occurred in line with the terms of the contract, but the contract collapsed in its third phase. Although the PDP — 15 System was installed, the City, having decided that it was unsatisfactory, refused to pay for that installation.

The District Court found that after some delay to which AHS and the City agreed, a successful acceptance test was conducted as to the PDP-15 System, the third phase. The City rejected the PDP-15 System and all its parts. Accordingly, the City refused to make any of the monthly payments provided by the contract in respect to the third phase. Thus, held the trial court, the City was liable to AHS for $433,842 only. This sum did not include the maintenance charges for which the City would have been responsible had the contract been in effect for the entire 6-year term. Nor did it include payment for that documentation that AHS had not carried out or payment for the microbiology section of the PDP-15, which had not been implemented, which, implementing the terms of the contract, was not a prerequisite to the obligation to pay for the installation of the first two phases. The trial court also declined to award AHS any of the several million dollars in other damages it claimed to have suffered as a result of the City’s alleged breach. Both parties now appeal. We affirm.

The City raises essentially two claims. First, it argues that, contrary to the finding of the District Court, it was never obliged to pay for the PDP-15 system. Second, it argues that even if the obligation did arise, it was not required to pay the entire amount it would have owed had it kept the system in operation for the whole 6-year term of the contract.

I.

The “PDP-15 System,” the center of the dispute, involves the use of a PDP-15 computer owned by AHS and certain other computer hardware owned by the City. AHS’s principal function was to create more than “700” computer programs, which, in combination with the existing hardware, would provide the San Francisco General Hospital with a clinical laboratory information system. The PDP-15 System design was based on a similar clinical laboratory system at Massachusetts General Hospital, but the San Francisco System was more advanced. AHS was willing to devote a rather large portion of its resources to the project with the City. It was looking for a “live lab” in which to create and promote its product. It hoped that by successfully installing the system in the San Francisco facility, it could market the system to other hospitals. The San Francisco General Hospital, on the other hand, would have acquired one of the “most advanced clinical laboratory systems in the world.” For reasons that are disputed by the parties, by late 1973, six months after the acceptance test was run, the City’s hospital ceased to rely on the system that AHS had installed. The City argues, initially, that because AHS never developed a fully operational clinical laboratory and because, in fact, the defects in performance were so pervasive as to defeat the object which the parties hoped to accomplish, no obligation, on the part of the City, to commence payments ever arose.

The contract explicitly dealt with the standards AHS was required to meet before the City’s obligation to pay for the system arose. The trial court found, on the basis of the written contract and the facts surrounding its creation, that the City’s obligation to pay for the system arose automatically when a 30-day acceptance test, as contractually defined in elaborate detail, was performed at the level of 95% effectiveness. The court further found that such a test was run in March and April of 1973. .In reaching its conclusion, the court resolved conflicts in the evidence and carefully weighed the credibility of various witnesses when testimony was conflicting. The court’s findings are not clearly erroneous; therefore we cannot, consciously, object to them. F.R.Civ.P. 52.

It is therefore irrelevant that, subsequent to the test, the system may have developed problems and ceased to operate satisfactorily. In creating state-of-the-art data processing systems, there is, of course, a risk that the system will not function as originally hoped. Other things being equal, however, the parties are free to allocate this risk in their contract as they mutually choose. There, AHS assumed the risk that its system would not be able to pass the acceptance test. But once the system passed the test, as the trial court concluded, the City bore the risk and became obliged to pay the contract price and suffer the consequences if the system did not perform to expectations.

The City also argues that even if it did breach the contract by failing to begin monthly payments to AHS, it cannot be held liable for all the monthly payments it might have been required to make over the entire 6-year term of the contract. First, the contract itself contained a cancellation clause that clearly appears to have given the City the right to cancel the contract on 6-months’ notice. Thus, it argues, even if it breached the contract, the measure of its obligation under the appropriate forum law, California, is the amount of money it would have been required to pay had it exercised its option to terminate. Pecarovich v. Becker, 113 Cal.App.2d 309, 317, 248 P.2d 123, 129 (1952). The meaning of the cancellation provision is, however, colored by the facts surrounding its creation. In concluding that the City was obliged to pay the full amount, the trial court must have determined that in accordance with the statement of undisputed facts submitted by AHS before trial, the provision was merely intended to satisfy certain budgetary requirements of the City and was not intended to give the City a right to cancel the contract at will.

The City also argues that because AHS became insolvent in October, 1973, AHS was incapable of performing further under the contract and that this incapacity excused the City from further payments. Apart from the fact that AHS’s collapse was due, in large part, to the City’s failure to accept the system and pay for it, the City does not distinguish payments that the City would have paid AHS for servicing the system during the 6-year term of the agreement and the payments for the computer programming that AHS had already furnished to the City. The maintenance charges are not the subject of the litigation. As to the second type of payment, which under the terms of the contract was also to be paid over a 6-year period, AHS’s insolvency could not amount to a failure of performance. This is because AHS had fully performed this part of the contract when the acceptance test was satisfied. Moreover, the City’s breach excused further performance on the part of AHS and gave AHS the right to damages for those costs it had already incurred.

II.

AHS contends that it was error for the trial court to fail to award AHS damages for three particular items. The court’s rejection of other claims of damage, amounting to several million dollars, is not contested on this appeal. We shall separately discuss each of the three claims that are here argued.

The Quantum Meruit Claim. AHS compiled a list of programming changes that it made at the request of the City, changes not required by the contract. It calculated the amount of programmer time it took to make these changes, which occurred both before and after the April, 1973 acceptance tests, and valued each of these changes accordingly. In addition, it claimed damages for some costs it incurred in substituting equipment demanded by the City but not required by the contract. The District Court found that AHS had agreed to provide these extra programming services and equipment at no extra cost to the City, its motivation being that the new features were worthwhile additions to the system because they would enhance the marketability of the entire system. The court reached this finding after resolving conflicts in the evidence. This finding is not clearly erroneous; thus, the finding of consent by AHS cannot be disturbed.

AHS’s principal contention, however, is that the City’s conduct toward it in extracting these extra programming features and equipment changes constituted economic duress. AHS emphasized that it was not necessary for it to prove, in order to establish economic “duress,” that the City threatened to commit a crime or a tort upon AHS when it requested the additional programming features. Leeper v. Beltrami, 53 Cal.2d 195, 347 P.2d 12 (1959); see also, 13 Williston on Contracts (3d ed. 1970) § 1617, at 705-06. Nevertheless, AHS had the burden of showing, at the very least, that the City, in requesting the additional features, violated its contractual duty of good faith and fair dealing. See Restatement (Second) of Contracts § 318, Comment e (Tent. Draft No. 12, 1977). We are satisfied, as was the District Court, that the City’s conduct did not violate this duty.

Although the City could not ultimately justify its refusal to pay for the system, AHS did not objectively demonstrate that the City was acting in bad faith when it requested extra programming features. In the aggregate, AHS may have found all the additional requests burdensome, but AHS does not dispute that these changes arose out of discussions in which both it and the City participated. Some of the programmers making the changes were at the hospital working on other problems that had arisen in the system. Dr. Greenes, who for a time was the head of AHS, himself testified that the requested changes were not capricious or irrational and that they, in fact, enhanced the value and the marketability of the system. Because so many of the changes were in the long term interests of both parties, we cannot reverse the trial court substituting our opinion that the City extracted the changes in bad faith. In reaching this conclusion we rely in part on the finding of the trial court that some conflicting interests between employees of the City and AHS did not result in any demonstrable harm.

Lost Profit on Contracts with Third Parties. Under California law, AHS could have recovered lost profits, if it had been able to prove that the breach of contract by the City proximately caused such loss. Nelson v. Reisner, 51 Cal.2d 161, 331 P.2d 17 (1958); Hunt Foods, Inc. v. Phillips, 248 F.2d 23, 34 (9th Cir. 1957); Gerwin v. Southeastern California Association of Seventh Bay Adventists, 14 Cal.App.3d 209, 221, 92 Cal.Rptr. 111, 119 (1971). The question whether the City’s breach of contract was the proximate cause of AHS’s inability to install systems in other hospitals is primarily one for the fact finder. The trial court concluded that AHS could have pursued its contracts with others, independent of its contract with the City. After carefully examining the record, we are convinced that this finding was not clearly erroneous.

Lost Investment. At trial, AHS offered evidence that its majority stockholder invested $338,000 in AHS between the time of the successful acceptance test and the ultimate collapse of the company in October. AHS appears to argue that Cooper Laboratories was forced to invest this amount of money in AHS because of the City’s failure to begin it’s monthly payments on the contract. AHS did not carry its burden of showing a causal nexus between this expenditure and the damage caused by the City’s alleged breach. Further, AHS does not explain how this expenditure evidences damages that are different from the other direct and consequential damages that it also argues were caused by the breach. The trial court, as are we, was unable to perceive a causal link between this expenditure and damages from the breach.

The judgment of the District Court is, in all respects,

AFFIRMED. 
      
      . The parties shall bear, respectively, the costs that they incurred in connection with the appeal and the cross-appeal.
     