First, this is not about doctors exchanging patients' medical histories, it's about two central government offices exchanging everybody's medical histories.
Second, the fact that security is (really!) hard is not a valid argument against doing it.
Third, there's a huge difference between the appropriate levels of security around individual patients' medical histories, a single doctors office worth of patients' data, and then the collective medical histories for every single patient in the nation.