Back in 2010, a study by Dr. Rainu Kaushal, a professor of medical informatics at Weill Cornell Medical College, revealed that 37 errors occurred out of every 100 paper prescriptions. That whopping figure, which didn't even include legibility issues, was far worse than the seven errors that occurred out of 100 when doctors used e-prescribing software. Since Kaushal's study was published, the market for EHR (electronic health records) has grown substantially, and e-prescriptions are now a crucial part of that package.

The two leading pharmacies in America -- Walgreen (NASDAQ:WBA) and CVS Caremark (NYSE:CVS) -- have partnered respectively with EHR companies Greenway Medical Technologies (NYSE:GWAY) and Allscripts (NASDAQ:MDRX) to offer their customers full EHR solutions. The deployment of these services not only makes their pharmacies more efficient, but can also have a halo effect in improving same-store sales significantly throughout the stores.

Walgreen and Greenway
Walgreen and Greenway have worked together since 2010, when Walgreen installed Greenway's PrimeSUITE EHR at its worksite health centers. Last August, Walgreen began deploying Greenway's WellHealth EHR in its retail pharmacy locations as the backbone to its HealthCloud initiative. WellHealth EHR gives Walgreen full access to a patient's latest health testing and immunization records, regardless of where the service was administered.

For Walgreen, HealthCloud is part of a broad reinvention of its stores, centered around its 370 Healthcare Clinics (formerly known as Take Care Clinics), which are fully staffed by nurses and physician assistants connected to doctors via EHRs and the Internet. These clinics can even provide treatment for chronic diseases such as diabetes, asthma, and hypertension.

However, Walgreen's strategy goes a step beyond clinical care. At several locations, Walgreen has introduced massage services, coffee shops, and wine bars to make visiting a clinic a more relaxing experience. One flagship location even serves sushi and smoothies. These experimental stores are aimed at solving one of Walgreen's oldest problems -- lagging front-end same-store sales growth.

Walgreen reported a 6.3% gain in same-store sales in July, topping the Thomson Reuters' consensus estimate of 5.3%. Pharmacy revenue rose 8.8%, beating the consensus estimate of 6.6%, but front-end same-store sales only increased 2.3%, falling short of the 2.7% gain that analysts had expected. Yet both figures were a significant improvement from its lackluster third-quarter earnings, when it reported a same-store sales decline of 3.9%.

Although pharmacy sales are strong, shoppers aren't making as many purchases from the rest of the store. Therefore, slowly turning its pharmacies into "lifestyle hubs" could be the key to boosting Walgreen's long-term top line growth.

CVS Caremark and Allscripts
CVS Caremark, on the other hand, partnered with Allscripts to replace its proprietary EHR system at its retail clinic, MinuteClinic, last February. The system, AllScripts MyWay, gives CVS the ability to provide more seamless treatments for patients. Last October, Allscripts announced that it would unite all of its small physician EHR software, including MyWay, into a single product, Allscripts Professional EHR.

MinuteClinic offers most of the same services as Walgreen's Healthcare Clinics, although CVS doesn't offer massage services, wine, coffee, or sushi at any locations. However, CVS' goal is the same -- to streamline patient operations via a larger EHR service, to keep them coming back to the stores, and to hopefully boost front-end same-store sales in the process.

Last quarter, CVS' same-store sales inched up 0.4% year-on-year. Same-store sales at its pharmacy rose 1.9%, but front-end same-store sales declined 0.4%.

The Foolish bottom line
Although Walgreen and CVS are both reporting steady growth in their retail pharmacy businesses, thanks to rising demand for generic drugs, both companies must find new ways to boost their front-end same-store sales going forward. For now, both companies are looking toward EHR companies like Greenway and Allscripts to help them improve services at their clinics -- which could boost same-store sales in the future by increasing store traffic.

Leo Sun has no position in any stocks mentioned. The Motley Fool has no position in any of the stocks mentioned. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.