<PAGE>   1
                                                               Exhibit 10.4(vii)


                FIFTH AMENDMENT TO CREDIT AGREEMENT AND GUARANTY

                  FIFTH AMENDMENT TO CREDIT AGREEMENT AND GUARANTY dated as of
September 30, 1999 (the "Fifth 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 and the Fourth Amendment to Credit Agreement and Guaranty
dated as of July 15, 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:

                  ""Fifth Amendment" means the Fifth Amendment to Credit
Agreement and Guaranty dated as of September 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 December
                  30, 1999."; and

                  (c) Section 9.02. Minimum Consolidated Tangible Net Worth, is
hereby amended by replacing "October 1998, January 1999, April 1999, July 1999"
with
<PAGE>   2
"October 1998, January 1999, April 1999, July 1999, October 1999".

                  SECTION 2. Conditions of Effectiveness. This Fifth 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 Fifth 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 Fifth
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 Fifth 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 Fifth
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 Fifth 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 Fifth Amendment
are included herein for convenience of reference only and shall not constitute a
part of this Fifth Amendment for any other purpose.



                                       2
<PAGE>   3
                  SECTION 7. Counterparts. This Fifth 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 Fifth Amendment
by signing any such counterpart.





                                       3
<PAGE>   4
                  IN WITNESS WHEREOF, the parties hereto have caused this Fifth
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
<PAGE>   5
                                   HSA MANAGED CARE SYSTEMS, INC.



                                   By
                                     --------------------------------
                                     Name:
                                     Title:

                                   QUALITY STANDARDS IN MEDICINE, INC.



                                   By
                                     --------------------------------
                                     Name:
                                     Title:

                                   THE CHASE MANHATTAN BANK



                                   By
                                     --------------------------------
                                     Name:
                                     Title:










                                       5