Doctors have access to all sorts of historical patient records, which help them make diagnoses and referrals. Now they are gaining access to a technology platform that analyzes all of that data to learn if the patient’s physiological symptoms are likely to be associated with―and possibly exacerbated by―a simultaneous mental health condition.

In the medical world, this is called comorbidity. For New York-based startup Quartet Health, it might soon be called a goldmine.

Quartet was launched in early 2014 by Arun Gupta, who at the time was working as a healthcare-focused private equity investor. What he saw was that behavioral health issues kept coming up at some of his firm’s portfolio companies, and that the discipline was rarely being addressed by applying basic technologies. At the same time, Gupta also was serving as an advisor to Palantir Technologies, a secretive Silicon Valley company known for applying big data analytics to seemingly intractable problems.

So Gupta got to work on a system that would leverage big data to help physicians identify comorbidity risks, connect patients with relevant mental health professionals and then coordinate care between the two providers.

“Some people close to me went through big issues in this space, and I think almost everyone has at least one loved one who has had similar struggles,” Gupta explains. “It doesn’t get talked about too much in society but, as I began developing this idea and getting out to market, I was surprised to see how receptive both medical professionals and investors were to it.

The New York-based startup soon raised $7 million in first-round venture capital funding, led by Oak HC/FT. Individual investors included Carl Byers, the former chief financial officer of Athenahealth ATHN .

Get Term Sheet, our daily newsletter on deals & deal-makers.

That financing came at around the same time that Congress finally got around to proposing final rules for the Mental Health Parity and Addiction Equity Act, which had originally been passed in 2008 to make insurers (including Medicaid) provide the same benefits to mental health that they do to physical health. The bill was originally championed by then-Congressman Patrick Kennedy, who later joined the Quartet board of directors. Moreover, increased incentives based on outcome have led both insurers and providers to seek out more holistic treatment approaches.

“It’s crazy to think that we effectively had a separate structure for mental health in this country, where you could see a cardiologist 365 days per year, but not 1% of that on the mental health side because of benefits caps,” Gupta says. “Not only was that bad medicine, but it was bad business.” For instance, Gupta says that the data shows that if a cardiologist is able to identify a behavioral health risk in one of his patients and get that patient assessed and treated, then that patient will end up with far fewer visits to the cardiologist, thus saving the overall system money.

Quartet says that it provides service to over a million patients, in terms of those covered by health systems and insurers that contract with the company, and that it expects to raise a new round of financing later this year.

It does not disclose data on how many of that million-plus have directly utilized the Quartet platform, but Gupta points out the indirect participation in the form of blind data aggregation (i.e., the more patients, the more accurate the comorbidity identification). The company also has over 100 employees, most of whom are engineers and data scientists who come from the consumer technology space.

One weakness, Gupta acknowledges, is a supply issue when it comes to psychiatrists―a group he also says have been more resistant to Quartet than have primary care physicians and psychologists. “This is really a broader society issue, in that there is an overall shortage of certain types of behavioral health professionals, which means the people out there already have jammed schedules,” he says. “But what we’ve shown is that we can wrap a lot of services around the primary care, including curbside consults through telemedicine, self-care, online cognitive therapy, peer support, and other things beyond just facilitating a referral. In this way, technology can help use the scarcer resources more judiciously without sacrificing care.”