Hospitals have intramural functions that provide care within the facility and extramural functions that provide care outside the facility. The types of hospitals are determined by factors such as the health needs of the community including diseases prevalent in the area, demographics of the population, and resources available.