1 Exhibit 10 THIRD AMENDMENT TO CREDIT AGREEMENT AND GUARANTY THIRD AMENDMENT TO CREDIT AGREEMENT AND GUARANTY dated as of June 30, 1997 (the "Third Amendment") among HEALTH MANAGEMENT SYSTEMS, INC. (the "Borrower"), ACCELERATED CLAIMS PROCESSING, INC. ("ACP"), QUALITY MEDICAL ADJUDICATION, INCORPORATED ("QMA"), HEALTH CARE MICROSYSTEMS, INC. ("HCM"), CDR ASSOCIATES INC. ("CDR"), HSA MANAGED CARE SYSTEMS, INC. ("HSA"), QUALITY STANDARDS IN MEDICINE, INC. ("QSM") 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, as further amended by Second Amendment to Credit Agreement and Guaranty dated as of April 16, 1997 (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. Borrower hereby advises the Bank that HSA and QSM are each a new wholly-owned subsidiary of the Borrower. In order to be in compliance with the terms and provisions of the Credit Agreement, including but not limited to Section 7.10, New Subsidiaries, Borrower shall satisfy each condition so that HSA and QSM shall each become a Guarantor. The Borrower, ACP, QMA, HCM, CDR, HSA, QSM 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 conditions precedent set forth in Section 3 hereof, hereby amended as follows: (a) The following definitions shall be added in their proper alphabetical order: "Third Amendment" means the Third Amendment to Credit Agreement and Guaranty dated as of June 30, 1997 among the Borrower, each of the Guarantors and the Bank. "HSA" means HSA Managed Care Systems, Inc., a Delaware corporation. 2 "QSM" means Quality Standards in Medicine, Inc., a Delaware corporation. (b) The definition of "Guarantor" is amended in full to read as follows: ""Guarantor" means each of ACP, QMA, HCM, CDR, HSA, QSM and each other entity which becomes a guarantor under this Agreement in accordance with Section 7.10." (c) The definition of "Guarantors" is amended in full to read as follows: ""Guarantors" means, collectively, ACP, QMA, HCM, CDR, HSA, QSM and each other entity which becomes a guarantor under this Agreement in accordance with Section 7.10." (d) The definition of "Revolving Credit Facility" is amended in full to read: ""Revolving Credit Facility" means Thirty Million Dollars ($30,000,000) less the principal amount of indebtedness outstanding under the promissory note dated April 16, 1997 made by Robert V. Nagelhout in favor of the Bank." (e) The Note referenced in Section 2.05, Note, shall be replaced by an Amended and Restated Note in the form of Exhibit A to this Third Amendment. (f) The definition of "Subscription Agreement", Section 6.14, Subscription Agreement, subsection (7) of Section 8.06, Investments, Section 8.11, Subscription Agreement and subsection (9) of Section 10.01, Events of Default are each deleted in their entirety. (g) Section 9.02., Minimum Consolidated Tangible Net Worth, is hereby amended by replacing "$65,000,000 and $70,000,000" with "$60,000,000 and $65,000,000". SECTION 2. Additional Guarantors. HSA and QSM each agree to be and are, effective as of the date hereof, and subject to the satisfaction of the conditions precedent set forth in Section 3 hereof, a Subsidiary and Guarantor under the Credit Agreement and, as such, agree to be bound by the terms and provisions of the Credit Agreement applicable to a Subsidiary and Guarantor. In addition, 2 3 Borrower, each other Guarantor and the Bank also agree that HSA and QSM are each a Subsidiary and a Guarantor. SECTION 3. Condition of Effectiveness. This Third Amendment shall become effective as of the date on which each of the following conditions have been fulfilled: (1) Third Amendment. The Borrower, ACP, QMA, HCM, CDR, HSA, QSM and the Bank shall each have executed and delivered this Third Amendment; (2) Amended and Restated Note. The Borrower shall have executed and delivered the Amended and Restated Note; (3) Evidence of Due Organization of HSA and QSM. Delivery of certified copies, dated the date hereof, of the Certificate of Incorporation and By-Laws of each of HSA and QSM and all amendments thereto; (4) Evidence of All Corporate Action of HSA and QSM. Delivery of certified copies, dated the date hereof, of all corporate action taken by HSA and QSM, respectively, including resolutions of their respective Board of Directors, authorizing the execution, delivery and performance of this Third Amendment; (5) Incumbency and Signature Certificate of HSA and QSM. Delivery of a certificate, dated the date hereof, of the Secretary or Assistant Secretary of HSA and QSM, respectively, certifying the names and true signatures of the respective officers of HSA and QSM, authorized to sign this Third Amendment and any other documents to be delivered pursuant to this Third Amendment; (6) Good Standing Certificates. Delivery of a certificate, dated within ten (10) days of the date hereof, from the Secretary of State (or other appropriate official) of the jurisdiction of incorporation of HSA and QSM, respectively, certifying as to the due incorporation and good standing of HSA and QSM and certificates, dated within ten (10) days of the date hereof, from the Secretary of State (or other appropriate official) of each other jurisdiction where HSA and/or QSM is required to be qualified to conduct business, certifying that HSA or QSM, as applicable, is duly qualified to do such business and is in good standing in such state; (7) Opinion of Counsel. Delivery of a favorable opinion of Coleman & Rhine, LLP, counsel for HSA and QSM; (8) Officer's Certificate. The following statements shall be true and the Bank shall have received a certificate signed by a duly authorized officer of Borrower 4 4 dated the date hereof stating that, after giving effect to this Third Amendment and the transactions contemplated hereby: (a) The representations and warranties contained in each of the Loan Documents are correct on and as of the date hereof as though made on and as of such date; and (b) No Default or Event of Default has occurred and is continuing or could result from the execution and delivery of this Third Amendment. (9) Other Documents. The Bank shall have received such other approvals, opinions or documents as the Bank may reasonably request. SECTION 4. 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 Third 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 5. 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 Third 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 Third Amendment and the 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 4 5 from any delay in paying or omission to pay such taxes or fees. SECTION 6. Governing Law. This Third Amendment shall be governed by and construed in accordance with the laws of the State of New York. SECTION 7. Headings. Section headings in this Third Amendment are included herein for convenience of reference only and shall not constitute a part of this Third Amendment for any other purpose. SECTION 8. Counterparts. This Third 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 Third Amendment by signing any such counterpart. [INTENTIONALLY LEFT BLANK.] 5 6 IN WITNESS WHEREOF, the parties hereto have caused this Third 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: HSA MANAGED CARE SYSTEMS, INC. By______________________________________ Name: Title: 6 7 QUALITY STANDARDS IN MEDICINE, INC. By______________________________________ Name: Title: THE CHASE MANHATTAN BANK By______________________________________ Name: Title: 7