The sale price reflects a 13-times multiple of CarePort's trailing-12-month revenue.
The division's solutions help hospitals and post-acute-care facilities manage patients as they make transitions to different levels of care.
CarePort, employing 200, represents about 6% of Allscripts' consolidated revenue.
The agreement "unlocks significant value for our shareholders, enables us to increase our focus on our core business and brings our CarePort customers the benefit of continued investment under new and very strong ownership," Allscripts Chief Financial Officer Rick Poulton said in a statement.
Allscripts, Chicago, provides information-technology services to healthcare organizations in the U.S., Canada and internationally.
WellSky, the Overland Park, Kan., provider of health-care software and services, is held by the private-equity firms TPG Capital of San Francisco and Leonard Green & Partners of Los Angeles.
"Through this agreement, we’re ensuring our clients have the intelligent technology they need to do right by their patients, collaborate with payers, and succeed in value-based care models," said WellSky Chief Executive Bill Miller.
The companies expect to close the deal this year, subject to conditions including regulatory clearances.
Allscripts said it expected to use the after-tax proceeds to invest in operations, pare debt and support “significant” share buybacks.
William Blair and JPMorgan were financial advisers to Allscripts on the sale.
Allscripts shares at last check were up 33% at $11.08. The stock is approaching its 52-week high near $12, set last November.