EXHIBIT 4.9 STOCKHOLDERS AGREEMENT STOCKHOLDERS AGREEMENT, dated as of July 17, 1998, between MEDIC COMPUTER SYSTEMS, INC., a North Carolina corporation (together with its affiliates, the "Investor"), WELSH, CARSON, ANDERSON & STOWE V, L.P., a Delaware limited partnership ("WCAS V"), WELSH, CARSON, ANDERSON & STOWE VI, L.P., a Delaware limited partnership ("WCAS VI"), WCAS CAPITAL PARTNERS II, L.P., a Delaware limited partnership ("WCAS CP II"), WILLIAM BLAIR CAPITAL PARTNERS V, L.P., a Delaware limited partnership ("WBCP V"), and WILLIAM BLAIR LEVERAGED CAPITAL FUND LIMITED PARTNERSHIP, a Delaware limited partnership ("WBLCF") (WCAS V, WCAS VI, WCAS CP II, WBCP V and WBLCF each a "Stockholder" and together, the "Stockholders"). Capitalized terms are defined in the text or in Section 12. RECITALS WHEREAS, the Issuer desires that the Investor enter into an ongoing commercial relationship with the Issuer and that the Investor participate in the development of the Issuer's business on an ongoing basis. WHEREAS, the Issuer wishes to issue to the Investor, and the Investor wishes to accept, the Warrant. WHEREAS, the Stockholders are existing stockholders of the Issuer. WHEREAS, the Investor and each of the Stockholders desire to make certain arrangements among themselves and to declare their mutual intentions with respect to the matters set forth herein. NOW THEREFORE, in consideration of the foregoing and the respective representations, warranties, covenants and agreements hereinafter set forth, and for other good and valuable consideration the receipt and sufficiency of which are hereby acknowledged by the parties hereto, the parties hereto, intending to be legally bound hereby, agree as follows: 1. Representations and Warranties of the Stockholders. Each of the Stockholders severally represents and warrants to the Investor as of the date hereof as follows: (a) Authority. Such Stockholder has the power and authority to execute, deliver and perform its obligations under, and to consummate the transactions contemplated by, this Agreement, and has taken all necessary action to authorize the execution, delivery and performance by such Stockholder of, and consummation by such Stockholder of the transactions contemplated by, this Agreement. This Agreement has been duly and validly executed and delivered by such Stockholder and constitutes the valid and binding obligation of such Stockholder, enforceable against such Stockholder in accordance with its terms, subject, as to enforcement of remedies, to applicable bankruptcy, insolvency, moratorium and other similar laws and to general principles of equity. (b) No Conflicts. Neither the execution, delivery nor performance by such Stockholder of this Agreement, nor compliance by such Stockholder with the terms and provisions hereof, nor the consummation by such Stockholder of the transactions contemplated herein, will (a) contravene any applicable provision of any law, statute, rule or regulation. or any applicable order, writ, injunction or decree of any court or governmental instrumentality, (b) conflict with or result in any material breach of any term, covenant, condition or other provision of, or constitute a material default under the terms of any contractual obligation to which such Stockholder is a party or by which it or any of its properties or assets are bound or to which they may be subject, or (c) violate or conflict with any provision of the constituent documents of such Stockholder. (c) The Subject Shares. Such Stockholder is the record and beneficial owner of the shares (the "Existing Shares") of common stock of the Issuer, par value $0.01 per share (the "Common Stock"), set forth opposite the name of such Stockholder on Schedule I hereto and, upon the consummation of the initial public offering of the Common Stock, will be the record and beneficial owner of the shares (the "Convertible Preferred Shares", and together with the Existing Shares, the "Shares") of Common Stock set forth opposite the name of such Stockholder on Schedule I hereto under the caption "Shares Underlying Convertible Preferred." Each Stockholder has (or in the case of the Convertible Preferred Shares, will have) good and marketable title to the Shares owned (or to be owned) by it, free and clear of any claims, liens, encumbrances and security interests whatsoever, and has (or will have) the sole right to vote such Shares, and none of such Shares is (or will be) subject to any voting trust or other agreement, arrangement or restrictions with respect to the voting of such Shares, except as contemplated by this Agreement. 2 2. Representations and Warranties of the Investor. The Investor represents and warrants to the Stockholders as of the date hereof as follows: (a) Authority. The Investor has the corporate power and authority to execute, deliver and perform its obligations under, and to consummate the transactions contemplated by, this Agreement, and has taken all necessary corporate action to authorize the execution, delivery and performance by the Investor of, and consummation by the Investor of the transactions contemplated by, this Agreement. This Agreement has been duly and validly executed and delivered by the Investor, and constitutes the valid and binding obligation of the Investor, enforceable against the Investor in accordance with its terms, subject, as to enforcement of remedies, to applicable bankruptcy, insolvency, moratorium and other similar laws and to general principles of equity. (b) No Conflicts. Neither the execution, delivery nor performance by the Investor of this Agreement, nor compliance by the Investor with the terms and provisions hereof, nor the consummation by it of the transactions contemplated herein, will (a) contravene any applicable provision of any law, statute, rule or regulation. or any applicable order, writ, injunction or decree of any court or governmental instrumentality, (b) conflict with or result in any material breach of any term, covenant, condition or other provision of, or constitute a material default under the terms of any contractual obligation to which the Investor is a party or by which it or any of its properties or assets are bound or to which it may be subject, or (c) violate or conflict with any provision of the constituent documents of the Investor. 3. Board Designee. In the event that the Issuer has nominated an Investor Designee to the Board pursuant to Section 4.1 of the Investment Agreement, or a stockholder vote is otherwise required to elect an Investor Designee to the Board in accordance with the terms of Section 4.1 of the Investment Agreement, each Stockholder shall, and, if applicable, shall use its best efforts to cause its affiliates to, vote all Shares then held by it (and its affiliates) in favor of the election of such Investor Designee. Any vote cast in accordance with this Section 3 shall be cast in such manner as will insure that such vote is duly counted for purposes of determining whether a quorum is present and for purposes of determining the result of such vote. 3 4. Optional Participation in Stock Sales. (a) If any Stockholder or Stockholders (for purposes of this Section 4, the "Selling Stockholders") shall at any time desire to transfer any Shares, the Investor shall be permitted, subject to subsection (e) of this Section 4, to participate in such transfer on the same terms and conditions applicable to such Selling Stockholders, at a price per share equal to the quotient obtained by dividing (x) the total consideration that a purchaser provides to purchase all of the Subject Shares that it is purchasing by (y) the total number of Shares (the "Subject Shares") being sold by the Selling Stockholders and the Investor. The terms of such transfer shall provide that the liability of the Investor and the Selling Stockholders shall be several, and not joint, in proportion to the proceeds received by each, and limited in the aggregate to the proceeds received by the Investor and each Selling Stockholder, respectively, in the transfer. (b) The Selling Stockholders intending to transfer Shares shall deliver to the Investor a written notice (a "Transfer Notice") of a proposed transfer subject to this Section 4 no later than 30 days prior to the proposed closing thereof. Such notice shall make reference to the Investor's rights hereunder and shall describe in reasonable detail (i) the total number of Subject Shares to be transferred by the Selling Stockholders, (ii) the person to whom such Subject Shares are proposed to be transferred and (iii) the terms and conditions of the transfer, including the con sideration to be paid therefor. (c) The Investor shall exercise its right to participate in a transfer of Shares pursuant to this Section 4 by delivering to the Selling Stockholders a written notice (a "Participation Notice") stating its election to do so and specifying the number of Shares held by it to be transferred no later than 15 days after receipt of the Transfer Notice. Failure to provide a Participation Notice within such 15-day period shall be deemed to constitute an election by the Investor not to exercise its rights pursuant to this Section 4, and the Selling Stockholders shall have 60 days following the expiration of such 15-day period in which to sell or otherwise dispose of not more than the number of Subject Shares described in the Transfer Notice, on terms not more favorable to such Selling Stockholders than were set forth in the Transfer Notice. If, at the end of the 60- day period following the expiration of such 15-day period, such Selling Stockholders have not completed the proposed transfer, such Selling Stockholders may not transfer such Subject Shares without again fully complying with the provisions of this Section 4. At any closing pursuant to this Section 4, the Investor shall be required to deliver the certificate or certificates representing the 4 Shares to be transferred by it, duly endorsed for transfer, and shall be entitled to receive the net proceeds allocable to the sale thereof, after deduction of the Investor's proportionate share of the reasonable expenses of sale, which share shall not exceed an amount proportionate to the amount of such expenses allocated to the Selling Stockholders. (d) The Investor shall have the right to sell an aggregate number of Shares in the same proportion to the total number of Shares being transferred as (i) the total number of Shares then beneficially owned by the Investor or subject to issuance upon exercise of the Warrant bears to (ii) the total number of Shares then owned by the Investor and the Stockholders or issuable upon the immediate exercise of the Warrant then owned by the Investor. If the Investor in its capacity as Warrantholder elects to exercise its right under this Section 4 to sell Shares, it shall only be required to exercise its Warrant upon, and only upon, the actual sale or disposition of the Shares to the buyer of such Shares. (e) The obligations of each Stockholder and the rights of the Investor pursuant to this Section 4 shall not apply (i) in the event that a Stockholder that is a limited partnership transfers Shares to its limited partners, (ii) to any transfer of Shares by a Stockholder to an affiliate and (iii) to any transfer of Shares pursuant to a registered public offering or a public distribution under Rule 144 under the Securities Act. 5. Mandatory Participation in Stock Sales. (a) In the event that any Stockholder proposes to transfer Shares in an arms'-length transaction, the Stockholder intending to transfer Shares shall have the right, subject to subsection (d) of this Section 5, to require the participation by the Investor in such transfer, in the manner set forth in this Section 5, on the same terms and conditions applicable to such Stockholder. The terms of such sale shall provide that the liability of the Investor and such Stockholder (or Stockholders, as the case may be) shall be several, and not joint, in proportion to the proceeds received by each, and limited in the aggregate to the proceeds received by the Investor and each Stockholder, respectively, in the sale. (b) The relevant Stockholder shall exercise its rights pursuant to this Section 5 by delivering to the Investor a written notice of such proposed transfer no later than 30 days prior to the proposed closing thereof. Such notice shall make reference to the obligations of the Investor hereunder and shall describe in reasonable detail (i) the number of Shares to be transferred by such Stockholder 5 (or Stockholders, as the case may be), (ii) the person to whom or which such Shares are proposed to be transferred, (iii) the terms and conditions of the transfer, including the consideration to be paid therefor, and (iv) the proposed date, time and location of the closing of the transfer. The Investor shall thereupon be required to deliver at such closing the certificate or certificates representing the Shares to be transferred by it, duly endorsed for transfer, and shall be entitled to receive the net proceeds allocable to the sale thereof, after deduction of the Investor's proportionate share of the reasonable expenses of sale, which share shall not exceed an amount proportionate to the amount of such expenses allocated to the Stockholders selling Shares pursuant to this Section 5. (c) The Investor shall be obligated to sell in a transfer subject to this Section 5 an aggregate number of Shares equal to the product of (i) the total number of Shares then beneficially owned by the Investor or subject to issuance upon exercise of the Warrant multiplied by (ii) a fraction, the numerator of which equals the number of Shares being sold by the Stockholders and the denominator of which equals the total number of Shares then owned by the Stockholders. The foregoing obligation shall include requiring the Investor in its capacity as a Warrantholder to exercise the Warrant. Notwithstanding the foregoing, the Investor shall in no event be obligated under this Section 5 to sell Shares in excess of the number of Shares owned by the Investor plus the number of Shares for which the Warrant is then exercisable, taking into account the application of the cashless exercise provisions of the Warrant. (d) The obligations of the Investor and the rights of each Stockholder pursuant to this Section 5 shall not apply (i) in the event that a Stockholder that is a limited partnership transfers Shares to its limited partners, or to a Competitor, (ii) to any transfer of Shares by a Stockholder to an affiliate and (iii) to any transfer of Shares pursuant to a registered public offering or a public distribution under Rule 144 under the Securities Act. 6. Further Assurances. (a) Each Stockholder will, from time to time, execute and deliver, or cause to be executed and delivered, such additional or further consents, documents and other instruments as the Investor may reasonably request for the purpose of effectively carrying out the transactions contemplated by this Agreement. 6 (b) The obligations of the Issuer contained in Section 3.5 of the Registration Rights Agreement shall apply equally to the Stockholders, mutatis mutandis. (c) In the event that a Stockholder, on the one hand, or the Investor, on the other hand, intends to transfer a 5% or greater equity interest in the Issuer (in a single transaction or a series of transactions), the Stockholder intending to effect such transfer or the Investor, as the case may be, shall use its best efforts to notify the Investor or the Stockholders, as the case may be, of such proposed transfer as soon as practicable. 7. Limited Right to Repurchase Shares. In the event the Transaction Processing Agreement is terminated by the Issuer pursuant to clause (iv), (vi) or (viii) of Section 18(a) thereof, then the Issuer shall have the right, exercisable within 30 days after the date of such termination, to repurchase all (but not less than all) shares of Common Stock issued to the Investor upon any prior exercises of the Warrant, to the extent that the Investor continues to hold such shares of Common Stock as of the date of termination. The per share purchase price for any such shares shall be the Warrant Price (as defined in the Warrant) at which such shares were purchased by the Investor. Upon delivery by the Issuer of the aggregate purchase price for such shares to the Investor, (i) the Investor will promptly return the certificate or certificates evidencing such shares, duly endorsed for transfer and (ii) regardless of whether or not such certificates are so returned, such shares shall be deemed to be no longer issued and outstanding. 8. Termination. This Agreement, and all rights and obligations of the parties hereunder shall terminate on the earlier to occur of (a) the mutual written consent of each of the Stockholders and the Investor, and (b) the date on which the Investor and its affiliates collectively no longer own any Registrable Securities (as defined in the Registration Rights Agreement). Further, this Agreement, and all rights and obligations of the parties hereunder shall terminate (x) with respect to WCAS V, WCAS VI and WCAS CP II (the "Welsh Carson Group") on the date on which the Welsh Carson Group no longer owns at least twenty percent (20%) of the fully diluted equity of the Issuer that it held as of the date hereof, and (y) with respect to WBCP V and WBLCF (the "William Blair Group") on the date on which the William Blair Group no longer owns at least twenty percent (20%) of the fully diluted equity of the Issuer that it held as of the date hereof. 7 9. General Provisions. (a) Amendments. This Agreement may not be amended except by an instrument in writing signed by each of the parties hereto. (b) Notice. All notices and other communications hereunder shall be in writing and shall be deemed given if hand delivered or sent by overnight courier (providing proof of delivery) to the Stockholders or the Investor at their respective addresses set forth below (or at such other address for a party as shall be specified by like notice): If to the Stockholders: If to the Investor: Welsh, Carson, Anderson & Stowe Medic Computer Systems, Inc. 320 Park Avenue 8601 Six Forks Road Suite 2500 Suite 300 New York, New York 10022-6815 Raleigh, North Carolina 27615 Telephone: (212) 893-9500 Facsimile: (212) 893-9575 Telephone: (919) 847-8102 Attention: Anthony de Nicola Facsimile: (919) 847-7110 Attention: Alan Winchester With a copy to: With a copy to: Reboul, MacMurray, Hewitt, Maynard & Kristol Misys plc 45 Rockefeller Plaza Burleigh House New York, New York 10111 Chapel Oak Telephone: (212) 841-5700 Salford Priors, England Facsimile: (212) 841-5725 Worcs WR11 5SH Attention: Mark J. Tannenbaum, Esq. Telephone: 011 44 1386 871-373 Facsimile: 011 44 1386 871-045 Attention: Ross Graham and: and: 8 William Blair & Company Debevoise & Plimpton 22 West Adams Street 875 Third Avenue Chicago, Illinois 60606 New York, New York 10022 Telephone: (312) 364-8250 Telephone: (212) 909-6000 Facsimile: (312) 236-1042 Facsimile: (212) 909-6836 Attention: Timothy M. Murray Attention: Paul H.Wilson,Jr.,Esq. (c) Interpretation. When a reference is made in this Agreement to Sections, such reference shall be to a Section to this Agreement unless otherwise indicated. The headings contained in this Agreement are for reference purposes only and shall not affect in any way the meaning or interpretation of this Agreement. Wherever the words "include", "includes" or "including" are used in this Agreement, they shall be deemed to be followed by the words "without limitation". (d) Counterparts. This Agreement may be executed in one or more counterparts, all of which shall be considered one and the same agreement, and shall become effective when one or more of the counterparts have been signed by each of the parties and delivered to the other party, it being understood that each party need not sign the same counterpart. (e) Entire Agreement; No Third-Party Beneficiaries. This Agreement (including the documents and instruments referred to herein) (i) constitutes the entire agreement and supersedes all prior agreements and understandings, both written and oral, among the parties with respect to the subject matter hereof and (ii) is not intended to confer upon any person other than the parties hereto any rights or remedies hereunder. (f) Governing Law. This Agreement shall be governed by and construed in accordance with the laws of the State of New York without regard to its rules of conflict of laws. Each of the Issuer and the Investor hereby irrevocably and unconditionally consents to submit to the exclusive jurisdiction of the courts of the State of New York and of the United States of America located in the State of New York (the "New York Courts") for any litigation arising out of or relating to this Agreement and the transactions contemplated hereby (and agrees not to commence any litigation relating thereto except in such courts), waives any objection to the laying of venue of any such litigation in the New York Courts and agrees not to plead or claim in any New York Court that such litigation brought therein has been brought in an inconvenient forum. 9 10. Assignability. The Investor may transfer its rights hereunder to any affiliate to which all or any portion of the Warrant has been transferred. 11. Enforcement. The parties agree that irreparable damage would occur in the event that any of the provisions of this Agreement were not performed in accordance with their specific terms or were otherwise breached. It is accordingly agreed that the parties shall be entitled to an injunction or injunctions to prevent breaches of this Agreement and to enforce specifically the terms and provisions of this Agreement in any New York Court, this being in addition to any other remedy to which they are entitled at law or in equity. 12. Definitions "Competitor" means (a) any entity that engages in any line of business, or is affiliated with any entity that engages in any line of business, that is in competition with the Investor's core business or (b) any entity that has publicly announced its intention, or is affiliated with any entity that has publicly announced its intention, to engage in any line of business that is in competition with the Investor's core business. "Investment Agreement" means that the Investment Agreement, dated as of the date hereof, between the Issuer and the Investor. "Investor" is defined in the first paragraph of this Agreement. "Issuer" means MedE American Corporation, a Delaware Corporation. "New York Courts" is defined in Section 10(f). "Participation Notice" is defined in Section 4(c). "Registrable Securities" is defined in the Registration Rights Agreement. "Registration Rights Agreement" means the Registration Rights Agreement, dated as of the date hereof, between the Issuer and the Investor. "Securities Act" means the Securities Act of 1933, as amended. "Selling Stockholders" is defined in Section 4. "Shares" is defined in Section 1(c). 10 "Stockholders" is defined in the first paragraph of this Agreement. "Subject Shares" is defined in Section 4(a). "Transaction Processing Agreement" means the Transaction Processing Agreement between the Issuer and the Investor, dated as of the date hereof. "Transfer Notice" is defined in Section 4(b). "Warrant" means the warrant issued by the Issuer to purchase 1,250,000 Shares, identical to the form attached as Exhibit C to the Investment Agreement. "WBCP V" is defined in the first paragraph of this Agreement. "WBLCF V" is defined in the first paragraph of this Agreement. "WCAS V" is defined in the first paragraph of this Agreement. "WCAS VI" is defined in the first paragraph of this Agreement. "WCAS CP II" is defined in the first paragraph of this Agreement. 11 IN WITNESS WHEREOF, this Stockholders Agreement has been duly executed and delivered as of the day and year first written above. MEDIC COMPUTER SYSTEMS, INC. By: ------------------------------------- Name: Title: WELSH, CARSON, ANDERSON & STOWE V, L.P. By: WCAS V Partners, General Partner By: ------------------------------------- General Partner WELSH, CARSON, ANDERSON & STOWE VI, L.P. By: WCAS VI Partners, L.P., General Partner By: ------------------------------------- General Partner WCAS CAPITAL PARTNERS II, L.P. By: WCAS CP II Partners, L.P., General Partner By: ------------------------------------- General Partner 12 WILLIAM BLAIR CAPITAL PARTNERS V, L.P. By: William Blair Capital Partners, LLC, General Partner By: ------------------------------------- Timothy M. Murray WILLIAM BLAIR LEVERAGED CAPITAL FUND LIMITED PARTNERSHIP By: William Blair & Company, LLC, General Partner By: ------------------------------------- Timothy M. Murray Acknowledged and confirmed with respect to Section 7 hereof, MEDE AMERICA CORPORATION By: ----------------------------- Name: Title: 13 STOCKHOLDERS AGREEMENT - SCHEDULE I Stockholder Pre-Split Common Post Split Shares - ----------- ---------------- ---------- ------ Common Underlying ------ ---------- Convertible ----------- Preferred --------- Welsh, Carson, Anderson & Stowe V 8,205,728 1,790,748 762,600 Welsh, Carson, Anderson & Stowe VI, L.P. 8,205,728 1,790,748 762,600 WCAS Capital Partners II, L.P. 1,700,000 370,993 William Blair Capital Partners V, L.P. 1,900,000 414,639 176,577 William Blair Leveraged Capital Fund Limited Partnership 998,662 217,939 92,805 NOTE: The Issuer expects to approve a one-for-4.5823 reverse stock split of its Common Stock. Accordingly, this Schedule reflects shares of Common Stock now owned by the Stockholders on a pre-split and post-split basis. The Shares underlying convertible preferred column reflects the post-split figures. 14