Analytics to benefit electronic health records?

There has been a lot of discussion recently about creating a national system of electronic healthcare records. Generally the discussion centers around reducing healthcare costs by creating efficiencies of exchanging patient information. This article from suggests that analytics might be another way this database could benefit everyone. With all the information collected in a national database, data mining techniques could be employed to determine ineffective or costly treatments.