Document:

<PAGE>   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
<PAGE>   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
<PAGE>   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
<PAGE>   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
<PAGE>   5
                                  HSA MANAGED CARE SYSTEMS, INC.

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

                                  HEALTH RECEIVABLES MANAGEMENT, INC.

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

                                  THE CHASE MANHATTAN BANK

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

                                       5<PAGE>   1
                                                                 Exhibit 10.16

                              AMENDED AND RESTATED
                                 PROMISSORY NOTE
                                 (SECURED LOAN)

         Reference is made to the $500,000 Promissory Note dated October 29,
         1998 of Paul J. Kerz and payable to HSA Managed Care Systems, Inc. (the
         "Original Note"). To the extent that this Amended and Restated
         Promissory Note amends the Original Note, the Original Note is amended.
         To the extent this Amended and Restated Promissory Note restates the
         Original Note, the Original Note is restated.

Date of Note:     October 19, 1999

Amount of Note:   $500,000

Borrower:         Paul J. Kerz

Interest Rate:    5.9686% per annum

         1. Borrower's Promise to Pay. In return for a loan (the "Loan") that I
have received, I promise to pay, in one lump sum payment on the maturity date
(defined below), U.S. $500,000 (this amount is hereinafter called the
"principal"), plus interest, to the order of the Lender. The "Lender" is HSA
MANAGED CARE SYSTEMS, INC. The Lender or anyone who takes this Note by transfer
and who is entitled to receive payments under this Note is called the "Note
Holder".

         2. Interest. Interest will be charged on the principal until the full
amount of the principal has been paid. I will pay interest at a yearly rate as
described above.

         The interest rate required by this Section 2 is the rate I will pay
both before and after any default described in Section 6(b) of this Note.

         3.  Payments.

         Time and Place of Payments. I will pay interest semi-annually by making
payments on the last day of April and October of each year and on December 31,
2001.
<PAGE>   2
         I will make my first semi-annual payment of interest on April 30, 2000.
I will continue to make these payments every six months until I have paid all of
the principal and interest and any other charges described below that I may owe
under this Note. My semi-annual payments will be applied to interest before
principal. I will pay all of the unpaid principal of the Loan along with any
accrued and unpaid interest related thereto on December 31, 2001 (the "Maturity
Date").

         4. Borrower's Right to Prepay. I have the right to make payments of
principal at any time before they are due. Any such payment of principal is
hereinafter called a "prepayment". When I make a prepayment, I will notify the
Note Holder in writing of such prepayment.

         I may make a full prepayment or partial prepayment without paying any
prepayment charge. The Note Holder will use all of my prepayments to reduce the
amount of principal that I owe under this Note. If I make a partial prepayment,
there will be no changes in the due date of my semi-annual payments unless the
Note Holder agrees in writing to those changes. Any amounts of the Loan prepaid
may not be reborrowed.

         5. Loan Charges. If a law, which applies to this Loan and which sets
maximum loan charges, is finally interpreted so that the interest or other loan
charges collected or to be collected in connection with this Loan exceed the
permitted limits, then: (i) any such loan charge shall be reduced by the amount
necessary to reduce the charge to the permitted limit; and (ii) any sums already
collected from me which exceeded permitted limits will be refunded to me. The
Note Holder may choose to make this refund by reducing the principal I owe under
this Note or by making a direct payment to me. If a refund reduces principal,
the reduction will be treated as a partial prepayment.

         6. Borrower's Failure to Pay as Required.

         (a) Late Charge for Overdue Payments. Any amount of principal or
interest which is not paid when due, whether at stated maturity, by
acceleration, or otherwise, shall bear interest from the date when due until
said principal or interest amount is paid in full, payable on demand, at the
prime commercial lending rate announced from time to time by The Chase Manhattan
Bank at its principal office in New York City.

                                       2
<PAGE>   3
         (b) Default. If I do not pay the full amount of each semi-annual
payment on the date it is due, I will be in default.

         (c) Notice of Default. If I am in default, the Note Holder may send me
a written notice telling me that if I do not pay the overdue amount, the Note
Holder may require me to pay immediately the full amount of principal which has
not been paid and all the interest that I owe on that amount. That date must be
at least fifteen (15) days after the date on which the notice is delivered or
mailed to me.

         (d) No Waiver By Note Holder. Even if, at a time when I am in default,
the Note Holder does not require me to pay immediately in full as described
above, the Note Holder will still have the right to do so if I am in default at
a later time.

         (e) Payment of Note Holder's Costs and Expenses. If the Note Holder has
required me to pay immediately in full as described above, the Note Holder will
have the right to be paid back by me for all of its costs and expenses in
enforcing this Note to the extent not prohibited by applicable law. Those
expenses include reasonable attorneys' fees.

         7. Giving of Notices. Unless applicable law requires a different
method, any notice that must be given to me under this Note will be given by
delivering it or by mailing it by first class mail to me at 126 East 65th
Street, New York, New York 10021, or at a different address if I give the Note
Holder a notice of my different address.

         Any notice that must be given to the Note Holder under this Note will
be given by delivering it or mailing it by first class mail to the Note Holder
at: HSA Managed Care Systems, Inc., c/o Health Management Systems, Inc., 401
Park Avenue South, New York, New York 10016, Attention: Alan L. Bendes, or at a
different address if I am given a notice of that different address.

         8. Waivers. I and any other person who has obligations under this Note
waive the rights of presentment and notice of dishonor. "Presentment" means the
right to require the Note Holder to demand payment of amounts due. "Notice of
dishonor" means the right to require the Note Holder to give notice to other
persons that amounts due have not been paid.

                                       3
<PAGE>   4
         9. Secured Note. In addition to the protections given to the Note
Holder under this Note, the Security Agreement which I have entered into with
the Lender dated as of October 29, 1998 (the "Security Agreement") protects the
Note Holder from possible losses which might result if I do not keep the
promises which I make in this Note.

         10. Events of Default. Notwithstanding anything to the contrary
provided herein, the occurrence of any one or more of the following shall be an
"Event of Default" hereunder and upon the occurrence of an Event of Default, any
and all principal and interest due hereunder shall be immediately due and
payable:

         (a) if I shall fail to pay when due and payable any obligations owing
under this Note or another note of even date herewith (the "Unsecured Loan
Note") I executed in favor of the Lender in connection with an unsecured loan
made to me by the Lender (the "Unsecured Loan");

         (b) if I cease to be actively involved in the management of the Lender
or its parent company, Health Management Systems, Inc. ("HMS");

         (c) if the Security Agreement ceases to be in full force and effect;

         (d) if an Event of Default has occurred under the Unsecured Loan;

         (e) if I shall file a petition in bankruptcy or for an arrangement or
for reorganization pursuant to the Federal Bankruptcy Act or any similar law,
federal or state, or if, by decree of a court of competent jurisdiction, I shall
be adjudicated a bankrupt, or be declared insolvent, or shall make an assignment
for the benefit of creditors, or shall admit in writing my inability to pay my
debts generally as they become due, or shall consent to the appointment of a
receiver or receivers of all or any part of my property;

         (f) if any of my creditors shall file a petition in bankruptcy against
me or for my reorganization pursuant to the Federal Bankruptcy Act or any
similar law, federal or state, and if such petition shall not be discharged or
dismissed within sixty (60) days after the date on which such petition was
filed;

         (g) if I shall fail to observe or perform any covenant, condition or
agreement in this Note, the Security Agreement or

                                       4
<PAGE>   5
in any other document that I shall have executed or delivered in connection with
this Loan; or

         (h) if any representation or warranty made by me in this Note, the
Security Agreement or in any other document that I shall have executed or
delivered in connection with this Loan shall prove to have been incorrect in any
material respect on or as of the date made.

                                       5
<PAGE>   6
         IN WITNESS WHEREOF, I have executed and delivered this Note on the day
and year first above written.

                                          PAUL J. KERZ

                                       6

Source: [{"source": "alea-institute/alea-institute/kl3m-data-edgar-agreements/train-00000-of-00352.parquet"}, [{"source": "alea-institute/alea-institute/kl3m-data-edgar-agreements/train-00000-of-00352.parquet"}]]