The S&P 500 is within striking distance of setting new all-time highs after bouncing back from its recent sell-off related to concerns surrounding the omicron variant. Even so, there are still plenty of stocks out there that are buys at current levels.

Since healthcare companies are typically more resilient than most other industries because of the critical nature of the products and services they sell, investors would be wise to pay attention to the healthcare industry. Here are two quality healthcare stocks that respectively operate in the pharmaceutical and health insurance areas of the healthcare industry.

A doctor and patient meeting for an appointment.

Image source: Getty Images.

1. Amgen

The first stock is the pharma stock Amgen (AMGN 0.62%). At its current share price of $213, Amgen is trading just above its 52-week low and 23% below its 52-week high. Amgen's weak stock performance in recent months is more a concern surrounding the entire pharma industry than just about its stock. Investors worry that if the prescription drug pricing plan within the Build Back Better bill that would allow Medicare to negotiate lower drug prices were to become law, this would have a detrimental effect on the industry's profitability.

But it will be rather difficult to negotiate a bill that will garner enough support to pass both chambers of the U.S. Congress to be signed into law by the President. That's the first reason why I believe Amgen's significant stock underperformance of late is unjustified.

Second, the company is fundamentally doing well. Amgen reported that it grew its revenue through the first three quarters 1.8% year over year to $19.1 billion. Amgen's revenue growth was powered by recently launched drugs such as osteoporosis drug Evenity and cholesterol drug Repatha, which were partially offset by sales declines in legacy drugs like immunology drug Enbrel. This is despite the fact that patient visits to the doctor and diagnosis rates of the conditions the company's drugs treat (such as osteoporosis) are still below pre-pandemic levels year to date.

Higher revenue and a lower outstanding share count helped Amgen's year-to-date non-GAAP earnings per share (EPS) edge 1.1% higher year over year to $12.74. As the world learns to better handle COVID-19 moving forward and vaccination rates gradually increase, visits to the doctor should return to pre-COVID levels. Amgen's variety of drugs at differing stages of clinical trials and an eventual recovery in doctor visits have led analysts to forecast that the stock will grow its non-GAAP EPS at 6% annually over the next five years. 

And income investors can pick up the stock's safe and market-topping 3.8% dividend yield at a forward price-to-earnings (P/E) ratio of just 11.8. This makes Amgen a great stock to buy and hold for the next decade.

2. UnitedHealth Group

The second stock to buy and hold for the next decade is the leading health insurer UnitedHealth Group (UNH -0.47%). It's no secret that the cost of healthcare is consistently rising, and with more people being diagnosed with costly chronic conditions like diabetes and heart disease, health insurance will become an even more important safety net in the years to come. These factors are precisely why the market research company Allied Market Research projects that the global health insurance market will compound at a near 10% annual rate, from $1.9 trillion in 2020 to $4.1 trillion, by 2028.

With this knowledge, UnitedHealth Group's solid year-to-date operating results are arguably not a fluke. The company's total revenue through the first three quarters of this year grew 11.6% year over year to $213.8 billion, which was primarily due to double-digit growth in premiums received from health insurance members.

Aside from significantly higher medical costs due to COVID-19 claims and deferred elective procedures from last year being performed this year, UnitedHealth Group's year-to-date non-GAAP EPS still advanced 1.3% year over year to $14.54. As claims activity begins to normalize to pre-COVID levels and UnitedHealth Group continues to grow its membership base, analysts expect that the stock will deliver 14% annual earnings growth over the next five years. 

Despite above-average growth prospects compared to the S&P 500, UnitedHealth Group is trading essentially in line with the index. To this point, the stock's forward P/E ratio of 21.7 is only slightly higher than the S&P 500's forward P/E ratio of 21.3. UnitedHealth Group's combo of above-average growth at an average price is what makes the stock one to buy and hang onto for the long haul.