<PAGE>   1
                                                               Exhibit 10.17(ii)


                         HEALTH MANAGEMENT SYSTEMS, INC.



                                                              January 10, 2001

Mr. William F. Miller III
3618 Harvard
Dallas, Texas 75203


                       Restricted Stock Purchase Agreement

Dear Mr. Miller:

            This letter sets forth our entire agreement with respect to the
550,000 shares of Common Stock, $.01 par value, of Health Management Systems,
Inc., a New York corporation (the "Company"), being purchased by you as of the
date hereof from the Company. As used herein, such shares of Common Stock are
hereinafter collectively referred to as the "Shares".

            The total amount to be paid by you to the Company to purchase the
Shares is $721,875 or $1.3125 per Share. As payment in full for the Shares, you
are hereby delivering to the Company such sum which has been loaned to you by
the Company's subsidiary, Accelerated Claims Processing, Inc. ("ACP"). To
evidence such loan, you have delivered to ACP your promissory note in the form
of Exhibit A hereto (the "Note") in the aggregate principal amount of $721,875
payable to the order of ACP.

            1. Right and Option of Company to Repurchase Shares.

            (a) In the event that you cease to perform services for the Company
as a result of (i) your disability (as defined in your employment agreement with
the Company dated as of October 2, 2000) or (ii) the termination (as a result of
your resignation or termination by the Company with our without cause or
otherwise) of your position as President and Chief Executive Officer of the
Company, the Company shall thereupon have the right and option, but not the
obligation, to purchase from you all, or any part, of the Purchase Option Shares
(as hereinafter defined) held by you as of the date of such disability or
termination. The purchase price to be paid by the Company to purchase such
Purchase Option Shares under this Section 1(a) shall be an amount equal to the
amount paid by you pursuant to this Agreement to purchase such Purchase Option
Shares.

            (b) The Company may exercise the right and option set forth in
Section 1(a) above by giving you (or, in the case of your death, your legal
representative) a written notice of
<PAGE>   2
election to purchase at any time within 90 days after the termination of your
employment with the Company. The closing for the purchase by the Company of any
such Shares pursuant to the provisions of this Section 1 will take place at the
offices of the Company on the date specified in such written notice, which date
shall be a business day not later than 30 days after the date such notice is
given. At such closing, you will deliver such Shares, duly endorsed for
transfer, against payment of the purchase price therefor. Such purchase price
shall be payable to you by check payable to your order. To the extent the
Company chooses not to exercise such right and option under this Section 1 to
repurchase any Purchase Option Shares, such Purchase Option Shares shall
thereafter cease to be subject to the provisions of this Section 1.

            2. Purchase Option Shares.

            (a) As of the date hereof, fifty percent (50%) of the Shares (or
275,000 Shares) shall be subject to the Company's purchase option pursuant to
Section 1(a) (the "Purchase Option Shares") and fifty percent (50%) of the
Shares (or 275,000 Shares) shall not be so subject ("Unencumbered Shares"). The
Purchase Option Shares shall cease to be subject to the Company's purchase
option (and, thus, become Unencumbered Shares) on the first anniversary of the
date hereof as long as you shall be performing services for the Company as its
President and Chief Executive Officer on such anniversary.

            (b) The Board of Directors of the Company, in its sole discretion,
may at any time accelerate the time set forth in Section 2(a) above at which the
Shares shall cease to subject to the Company's purchase option.

            (c) In the event that (i) you die or (ii) a Change of Control
Transaction (as defined in your employment agreement with the Company dated as
of October 2, 2000) occurs, in either case during the period during which you
are providing services to the Company as described in this Agreement, then 100%
of the Shares shall cease to be subject to the Company's purchase option on and
as of the date of your death or the date of the Change of Control Transaction.

            3. Rights as a Stockholder. Subject to the provisions of Sections 1,
2, 4 and 5 hereof, you will have all rights of a stockholder with respect to all
Shares being purchased by you today, including the right to vote such Shares and
to receive any dividends paid thereon.


                                       2
<PAGE>   3
            4. Transfer Restrictions on Shares. Notwithstanding anything
contained in this Agreement to the contrary, you hereby agree with the Company
that you will not sell, assign, transfer, pledge, convey or otherwise dispose of
any Shares, or subject the same to any lien, encumbrance, mortgage or other
security interest of any kind whatsoever, (i) so long as the Note shall be
outstanding or (ii) prior to the date on which such Shares (or a portion
thereof) are no longer subject to repurchase by the Company pursuant to Section
2.

            5. Recording of Assignments. The Company shall not record any
assignment, transfer or other disposition of any Shares on its transfer books
unless the provisions of this Agreement shall have been fully complied with and
the Company shall have received satisfactory evidence thereof.

            6. Certain Tax Matters. You hereby acknowledge that you understand
the Federal, state and local income tax consequences of your purchase of the
Shares, the repurchase provisions relating to the Shares, and any subsequent
sale of the Shares, including, if applicable, the consequences of making (or not
making) a timely election under Section 83(b) of the Internal Revenue Code of
1986 with respect to the Shares. In addition, you fully understand that, at the
time that you realize any compensation income in respect of the Shares, the
Company will be required to withhold Federal, state and local taxes on the full
amount of the compensation income realized by you. Accordingly, at or prior to
the time that you realize any compensation income in respect of the Shares, you
hereby agree to provide the Company with cash funds equal to the total Federal,
state and local taxes required to be withheld by the Company in respect of such
compensation income, or make other arrangements satisfactory to the Company
regarding such payment. It is understood that all matters with respect to the
total amount of taxes to be withheld in respect of such compensation income
shall be determined by the Company in its sole discretion.

            7. Escrow Agent. In order to facilitate any repurchase of the Shares
by the Company under this Agreement, the stock certificates representing any
part of the Shares shall, for so long as such Shares are subject to repurchase
under any of the provisions of this Agreement (including any period during which
the Company has an option to repurchase and any period after the Company gives
notice of its election to repurchase but before the closing of such repurchase
has occurred), remain in the custody of the Company acting as escrow agent and
as custodian for your account. You agree to provide the Company, acting in such
custodial capacity, with a stock power or other instrument of transfer,
appropriately endorsed in blank, in respect of the Shares.

            8. Investment Representations. You hereby represent and warrant to
the Company that you are acquiring the Shares for your own account for
investment and not with a view to, or for sale in connection with, any
distribution thereof and that you understand that (i) the Shares are not being
registered with the Securities and Exchange Commission by reason

                                       3
<PAGE>   4
of their being issued in a transaction exempt from the registration requirements
of the Securities Act of 1933, and (ii) the Shares must be held indefinitely by
you unless a subsequent disposition thereof is registered under that Act or is
exempt from such registration.

            9. Legend on Stock Certificates. Each stock certificate representing
the Shares shall be conspicuously endorsed with the following legend written on
the face thereof:

            "THE SHARES REPRESENTED BY THIS CERTIFICATE HAVE NOT BEEN REGISTERED
            UNDER THE SECURITIES ACT OF 1933, AND THE RIGHTS OF THE HOLDER OF
            THE SHARES EVIDENCED BY THIS CERTIFICATE ARE SUBJECT TO AND LIMITED
            BY THE TERMS AND CONDITIONS OF A CERTAIN AGREEMENT DATED JANUARY 10,
            2001 BETWEEN THE COMPANY AND THE ORIGINAL HOLDER OF SUCH SHARES. A
            COPY OF SAID AGREEMENT, TO WHICH REFERENCE IS HEREBY MADE, IS ON
            FILE AND MAY BE EXAMINED AT THE OFFICES OF HEALTH MANAGEMENT
            SYSTEMS, INC."

            10. General Provisions.

            (a) The terms and provisions of this Agreement shall apply to any
shares of capital stock that may subsequently be issued to you in exchange for
or in addition to the Shares as a result of any recapitalization, stock
dividend, stock split, reclassification, merger, consolidation or similar
corporate transaction. All Share numbers herein shall be appropriately adjusted
to account for any of the foregoing.

            (b) Except as herein expressly provided, the respective rights and
obligations of you and the Company under this Agreement shall not be assignable
by either party without the prior written consent of the other party. Nothing
herein expressed or implied is intended to confer upon any person, other than
the parties hereto, any rights, remedies, obligations or liabilities under or by
reason of this Agreement.

            (c) Nothing contained in this Agreement shall confer upon you any
right to continue to provide services to the Company nor limit in any respect
the right of the Company to terminate your services to the Company at any time.

            (d) All notices and other communications to be given to any party
hereunder shall be in writing and shall be deemed given if delivered personally,
mailed by certified or registered mail, return receipt requested and postage
prepaid, sent via a nationally recognized


                                       4
<PAGE>   5
overnight courier or sent via facsimile confirmed in writing, to such party at
the following address (or at such other address for a party as shall be
specified by like notice):

            (i)   if to the Company:

                  Health Management Systems, Inc.
                  401 Park Avenue South
                  New York, New York  0016
                  Attention: Chief Financial Officer

            (ii)  if to you, at your address specified at the head of this
                  Agreement,

or in either case to such other address or addresses as such other party shall
have designated to the other from time to time.

            (e) This Agreement contains the entire agreement between the Company
and you, and supersedes all prior agreements and understandings, relating to the
subject matter hereof.

            (f) The transfer restrictions set forth in Section 4 hereof are in
addition to any and all restrictions on transfer of securities imposed pursuant
to any applicable Federal or state law or regulation or established by the
Company's board of directors with respect to sales by corporate insiders.

            (g) This Agreement may not be amended, changed or waived other than
by an instrument in writing signed by the party against which the enforcement of
the change, waiver or discharge is sought.

            (h) In the event any provision of this Agreement shall be held void
or unenforceable, the unaffected provisions hereof shall remain in full force
and effect.

            (i) This Agreement shall be governed by and construed in accordance
with the laws of the State of New York and shall be binding upon and inure to
the benefit of the parties hereto and their respective successors and assigns.

            If the foregoing is in accordance with our agreement, please sign
both copies of the Agreement in the space provided below and return one copy to
the Company, whereupon this letter shall become a binding agreement between us.



                                    HEALTH MANAGEMENT SYSTEMS, INC.

                                    By
                                       -----------------------------------

Agreed and Accepted as of
the date first above written:



-----------------------------------
       William F. Miller III



                                       5