The doctors prescribe different medications.
The patient goes to two different pharmacists to pick them up.
In a victory for privacy, the patient dies from a fatal interaction of the prescribed medications.
In the US there is a strong medical privacy law. And it includes an exception for providers of medical care to share treatment information with each other, for precisely this reason. Even so, every single time you see a doctor in the US, you are handed a notice saying they'll share information for permitted purposes (the triad of "TPO" -- Treatment, Payment, and Operations), and given a form to sign saying you have been made aware of this.
[1] https://ds.ccc.de/download.html (german)
I think it's non-ideal, but the health insurance should never need to know whether you're using your CPAP. They should only know if the doctor prescribed it.
Information should be shared with the pharmacy and other doctors. That would be helpful and would save lives.
In one country, I visit any doctor and they have my full medical history, despite not living there.
In another country, every time I visit the same doctor, they somehow don't have any files for me and I have to sign up as a new patient, despite being born and resident there.
It's all shambles, but in both cases, I get healthcare for free so it could be a lot worse.
You could extend your argument that insurance companies should get access to what food and drinks you buy so they prevent side effects(and not at all tax you more because you drink beer or eat cheap food a lot)
The point was to be an illustrative example of why it can be useful for health-care providers to share information. HN, predictably, took it as a challenge to try to work around and find as many possible ways to hide the information as they could.
Also if you're seeing multiple doctors (like, for example, a general practitioner and a specialist) you should be transparent on what prescriptions you're already taking.
Being an idiot and getting yourself killed is not the doctors fault.