Pharmacies are located to near hospitals because people usually go to the hopitals first to get prescriptions from the doctors, which makes it inconvenient for someone who is used to just walk in to the pharmacies to get medicine they want.
A lot of Japanese people, especially elderly, don't mind going to a big hospital where they have to wait for hours to see a doctor for less than half an hour.

In old days, your family doctor would come to your house when they were called, I don't believe that's happening in the U.S. anymore either.