1 Exhibit 10.4(viii) SIXTH AMENDMENT TO CREDIT AGREEMENT AND GUARANTY SIXTH AMENDMENT TO CREDIT AGREEMENT AND GUARANTY dated as of December 30, 1999 (the "Sixth Amendment") among HEALTH MANAGEMENT SYSTEMS, INC. (the "Borrower"), ACCELERATED CLAIMS PROCESSING, INC. ("ACP"), QUALITY MEDI-CAL ADJUDICATION, INCORPORATED ("QMA"), HEALTH CARE MICROSYSTEMS, INC. ("HCM"), CDR ASSOCIATES INC. ("CDR"), HSA MANAGED CARE SYSTEMS, INC. ("HSA"), HEALTH RECEIVABLES MANAGEMENT, INC. (formerly QUALITY STANDARDS IN MEDICINE, INC.) ("HRM") and THE CHASE MANHATTAN BANK (the "Bank"). PRELIMINARY STATEMENT. The Borrower, ACP, QMA, HCM, CDR and the Bank have entered into a Credit Agreement and Guaranty dated as of July 15, 1996, as amended by First Amendment to Credit Agreement and Guaranty dated as of September 9, 1996, the Second Amendment to Credit Agreement and Guaranty dated as of April 16, 1997, the Third Amendment to Credit Agreement and Guaranty dated as of June 30, 1997, the Fourth Amendment to Credit Agreement and Guaranty dated as of July 15, 1999 and the Fifth Amendment to Credit Agreement and Guaranty dated as of September 30, 1999 (as so amended and as it may be further amended, supplemented or modified, the "Credit Agreement"). Any term used herein and not otherwise defined herein shall have the meaning assigned to such term in the Credit Agreement. The Borrower, ACP, QMA, HCM, CDR, HSA, HRM and the Bank have agreed to amend the Credit Agreement as hereinafter set forth. SECTION 1. Amendment to Credit Agreement. The Credit Agreement is, effective as of the date hereof and subject to the satisfaction of the condition precedent set forth in Section 2 hereof, hereby amended as follows: (a) The following definition shall be added in its proper alphabetical order: ""Sixth Amendment" means the Sixth Amendment to Credit Agreement and Guaranty dated as of December 30, 1999 among the Borrower, each of the Guarantors and the Bank."; (b) The definition of "Revolving Credit Facility Termination Date" is amended in full to read as follows: ""Revolving Credit Facility Termination Date" means February 15, 2000."; and (c) Section 9.02. Minimum Consolidated Tangible Net Worth, is hereby 2 amended by replacing "October 1998, January 1999, April 1999, July 1999" with "October 1998, January 1999, April 1999, July 1999, October 1999, January 2000". SECTION 2. Conditions of Effectiveness. This Sixth Amendment shall become effective as of the date on which each of the following conditions shall have been fulfilled: (a) the Borrower, ACP, QMA, HCM, CDR, HSA, HRM and the Bank shall each have executed and delivered this Sixth Amendment; and (b) the Bank shall have received a certificate signed by a duly authorized officer of the Borrower dated the date hereof (a) certifying that no Default or Event of Default has occurred and is continuing; and (b) with computations demonstrating compliance with the covenants contained in Article IX of the Credit Agreement. SECTION 3. Reference to and Effect on the Loan Documents. (a) Upon the effectiveness of Section 1 hereof, on and after the date hereof each reference in the Credit Agreement to "this Agreement", "hereunder", "hereof", "herein" or words of like import, and each reference in the other Loan Documents to the Credit Agreement, shall mean and be a reference to the Credit Agreement as amended hereby. (b) Except as specifically amended above, the Credit Agreement and all other Loan Documents shall remain in full force and effect and are hereby ratified and confirmed. (c) The execution, delivery and effectiveness of this Sixth Amendment shall not operate as a waiver of any right, power or remedy of the Bank under any of the Loan Documents, nor constitute a waiver of any provision of any of the Loan Documents, and, except as specifically provided herein, the Credit Agreement and each other Loan Document shall remain in full force and effect and are hereby ratified and confirmed. SECTION 4. Costs, Expenses and Taxes. The Borrower agrees to reimburse the Bank on demand for all out-of-pocket costs, expenses and charges (including, without limitation, all fees and charges of legal counsel for the Bank) incurred by the Bank in connection with the preparation, reproduction, execution and delivery of this Sixth Amendment and any other instruments and documents to be delivered hereunder. In addition, the Borrower shall pay any and all stamp and other taxes and fees payable or determined to be payable in connection with the execution and delivery, filing or recording of this Sixth Amendment and any other instruments and documents to be delivered hereunder, and agrees to save the Bank harmless from and against any and all liabilities with respect to or resulting from any delay in paying or omission to pay such taxes or fees. SECTION 5. Governing Law. This Sixth Amendment shall be governed by and construed in accordance with the laws of the State of New York. SECTION 6. Headings. Section headings in this Sixth Amendment are included herein for convenience of reference only and shall not constitute a part of this 2 3 Sixth Amendment for any other purpose. SECTION 7. Counterparts. This Sixth Amendment may be executed in any number of counterparts, all of which taken together shall constitute one and the same instrument, and any party hereto may execute this Sixth Amendment by signing any such counterpart. 3 4 IN WITNESS WHEREOF, the parties hereto have caused this Sixth Amendment to be duly executed as of the day and year first above written. HEALTH MANAGEMENT SYSTEMS, INC. By -------------------------------- Name: Title: ACCELERATED CLAIMS PROCESSING, INC. By -------------------------------- Name: Title: QUALITY MEDI-CAL ADJUDICATION, INCORPORATED By -------------------------------- Name: Title: HEALTH CARE MICROSYSTEMS, INC. By -------------------------------- Name: Title: CDR ASSOCIATES, INC. By -------------------------------- Name: Title: 4 5 HSA MANAGED CARE SYSTEMS, INC. By -------------------------------- Name: Title: HEALTH RECEIVABLES MANAGEMENT, INC. By -------------------------------- Name: Title: THE CHASE MANHATTAN BANK By -------------------------------- Name: Title: 5