Some EHRs are pretty good about this nowadays. Epic, for example, allows you to share info across health systems. The user has to enable it though, which is a problem due to low adoption among older patients.
Also, this will be less of a problem in coming years due to increasing consolidation of health systems.