"Armed Forces Americas", 'AE'=>"Armed Forces Europe", 'AL'=>"Alabama", 'AK'=>"Alaska", 'AP'=>"Armed Forces Pacific", 'AS'=>"American Samoa", 'AZ'=>"Arizona", 'AR'=>"Arkansas", 'CA'=>"California", 'CO'=>"Colorado", 'CT'=>"Connecticut", 'DE'=>"Delaware", 'DC'=>"District Of Columbia", 'FL'=>"Florida", 'FM'=>"Micronesia", 'FPO'=>"FPO", 'GA'=>"Georgia", 'GU'=>"Guam", 'HI'=>"Hawaii", 'ID'=>"Idaho", 'IL'=>"Illinois", 'IN'=>"Indiana", 'IA'=>"Iowa", 'KS'=>"Kansas", 'KY'=>"Kentucky", 'LA'=>"Louisiana", 'ME'=>"Maine", 'MD'=>"Maryland", 'MA'=>"Massachusetts", 'MH'=>"Marshall Islands", 'MI'=>"Michigan", 'MN'=>"Minnesota", 'MS'=>"Mississippi", 'MO'=>"Missouri", 'MT'=>"Montana", 'NE'=>"Nebraska", 'NV'=>"Nevada", 'NH'=>"New Hampshire", 'NJ'=>"New Jersey", 'NM'=>"New Mexico", 'NY'=>"New York", 'NC'=>"North Carolina", 'ND'=>"North Dakota", 'OH'=>"Ohio", 'OK'=>"Oklahoma", 'OR'=>"Oregon", 'PA'=>"Pennsylvania", 'PW'=>"Palau", 'RI'=>"Rhode Island", 'SC'=>"South Carolina", 'SD'=>"South Dakota", 'TN'=>"Tennessee", 'TX'=>"Texas", 'UT'=>"Utah", 'VT'=>"Vermont", 'VA'=>"Virginia", 'VI'=>"Virgin Island", 'WA'=>"Washington", 'WV'=>"West Virginia", 'WI'=>"Wisconsin", 'WY'=>"Wyoming", 'PR'=>"Puerto Rico", 'MP'=>"Northern Mariana Islands", ); $case = 1; if(isset($var[2])&&($var[2]!="")) { $state = strtolower($var[2]); $ustate = strtoupper($state); $shortstate = strtoupper($state); $statelink = $classlink.$state."/"; $fullstate = $states[strtoupper($state)]; $case = 2; } if(isset($var[2])&&isset($var[3])&&($var[2]!="")&&($var[3]!="")) { $city1 = strtolower($var[3]); $citylink = $statelink.$city1."/"; $temp = explode("-",$city1); $city = implode(" ",$temp); $fullcity = ucwords($city); $case = 3; if($city1=="all") { include 'allcities-snf.php'; exit; } } $docsinpage = 20; $count = 0; $link = mysqli_connect("localhost", "root", "pencil123", "medicare"); if (!$link) { echo "Error: Unable to connect to MySQL." . PHP_EOL; echo "Debugging errno: " . mysqli_connect_errno() . PHP_EOL; exit; } if($case==3) { $sql2 = "Select doccount from snfcount where state='$state' and city='$city'"; } else if($case==2) { $sql2 = "Select sum(doccount) from snfcount where state='$state' group by state"; } else if($case==1) { $sql2 = "Select sum(doccount) from snfcount"; } $query2 = MySQLi_query($link,$sql2); $myrow = MySQLi_fetch_array($query2, MYSQLI_BOTH); $nofdocs = $myrow[0]; $npages = ceil($nofdocs/$docsinpage); if($case == 1) { $desc = "Medicare Nursing Homes Ratings. Find Medicare ID, medicare ratings, NPI number, address and contact details for all medicare nursing homes in USA"; $title = "Medicare Nursing Homes Ratings, Address, Contact"; $title1 = "Medicare Nursing Homes Ratings, Location and Contact"; $header = "Medicare Nursing Homes in USA"; } else if ( $case == 2) { $desc = "Medicare Nursing Homes in ".$fullstate.". Find Medicare ID, medicare ratings, NPI number, address and contact details for all medicare nursing homes in ".$fullstate; $title = "Medicare Nursing Homes in ".$fullstate." - Ratings, Location, NPI Details"; $title1 = "Medicare Nursing Homes in ".$fullstate." - Ratings, Address, Contact"; $header = "Medicare Nursing Homes in ".$fullstate; } else if ($case == 3) { $desc = "Medicare Nursing Homes in ".$fullcity.", ".$fullstate.". Find Medicare ID, medicare ratings, NPI number, address and contact details for all medicare nursing homes in ".$fullcity.", ".$fullstate; $title1 = "Medicare Nursing Homes in ".$fullcity.", ".$shortstate; $title = "Medicare Nursing Homes in ".$fullcity.", ".$shortstate." - Medicare Status, Ratings, Address, Contact"; $header = "Medicare Nursing Homes in ".$fullcity.", ".$fullstate; } $advert = ' '; $adlinkresp = ' '; $adlink = ' '; $replace_linkad = ' '; ?> <?php echo $title;?> | MedicareUSA "; } if ($page == 2) { echo ""; } else if($page != 1) { $ppage=$page - 1; $prev=$canonicalurl."?page=".$ppage; echo ""; } if($page!=$npages) { $npage=$page + 1; $next=$canonicalurl."?page=".$npage; echo ""; } ?>

$nofdocs Nursing Homes found. Showing $showstart - $showend"; if($case!=3) echo ""; /*Select relevant branches*/ $qonpage = 0; if($case==3) { $sql3 = "Select * from medsnf where State='$state' AND City='$city' LIMIT $offset, $docsinpage"; } else if($case==2) { $sql3 = "Select * from medsnf where State='$state' LIMIT $offset, $docsinpage"; } else if($case==1) { $sql3 = "Select * from medsnf LIMIT $offset, $docsinpage"; } $query3 = MySQLi_query($link,$sql3); echo ""; while($myrow = MySQLi_fetch_array($query3, MYSQLI_BOTH)) { $PID = $myrow['provnum']; $name = ucwords(strtolower($myrow['PROVNAME'])); $address = ucwords(strtolower($myrow['ADDRESS'])); $city = ucwords(strtolower($myrow['CITY'])); $state = $myrow['STATE']; $zip = $myrow['ZIP']; $county = $myrow['COUNTY_NAME']; $phone = $myrow['PHONE']; $formattedphone = "(".substr($phone,0,3).") ".substr($phone,3,3)."-".substr($phone,6); $owner = $myrow['OWNERSHIP']; $bedcert = $myrow['BEDCERT']; $type = $myrow['CERTIFICATION']; $rating = $myrow['overall_rating']; $snflink = $myrow['link']; $branchlink = $snfbase.$snflink."/"; $fullstate = $states[$state]; $fulladdress = $address.", ".$city.", ".$fullstate." ".$zip; $qonpage++; if($qonpage==4) { echo ""; } echo ""; } if($qonpage<4) { echo ""; } echo "
"; echo "$advert"; echo "
"; echo "
\"nursing
"; echo "
$name
"; echo "$type
Location: $fulladdress
"; echo "Ratings:
"; if($rating=="1") echo ""; else if($rating=="2") echo ""; else if($rating=="3") echo ""; else if($rating=="4") echo ""; else if($rating=="5") echo ""; else echo "NA"; echo "   Phone: $formattedphone"; echo "
"; echo "$advert"; echo "
"; if($npages>1) { echo "
    "; $diff = max(0, $page+5-$npages); $minpage = max(1, $page-5-$diff); $diff = max(0,1+5-$page); $maxpage = min($npages, $page+5+$diff); $minlink = $urlwithoutparam."?page=".$minpage; $maxlink = $urlwithoutparam."?page=".$maxpage; if($minpage != 1) echo "
  • «
  • "; for ($i=$minpage;$i<=$maxpage;$i++) { $link2 = $urlwithoutparam."?page=".$i; if($i==$page) echo "
  • $i(current)
  • \n"; else echo "
  • $i
  • \n"; } if($maxpage != $npages) echo "
  • »
  • "; echo "
"; } ?>
$adlinkresp"; } else if($case == 2) { $sql4 = "SELECT * from (Select city, doccount from snfcount where state='$state' order by doccount desc limit 30) as t1 order by city"; //$sql4 = "Select city, doccount from snfcount where state='$state' order by city"; echo "Top Cities in $state:
"; $query4 = MySQLi_query($link,$sql4); while($myrow = MySQLi_fetch_array($query4, MYSQLI_BOTH)) { $option = ucwords(strtolower($myrow[0])); $countoption = $myrow[1]; $temp = explode(" ",strtolower($option)); $tempcity = urlencode(implode("-",$temp)); $link1 = $statelink.$tempcity."/"; echo "$option ($countoption)
"; } $allcities = $statelink."all/"; echo "
All Cities in $ustate"; } else if($case == 1) { $sql4 = "Select state, sum(doccount) from snfcount group by state order by state"; echo "Filter By State:
"; $query4 = MySQLi_query($link,$sql4); while($myrow = MySQLi_fetch_array($query4, MYSQLI_BOTH)) { $option = strtolower($myrow[0]); $countoption = $myrow[1]; $state1 = $states[$myrow[0]]; $link1 = $classlink.$option."/"; echo "$state1 ($countoption)
"; } } ?>

Nursing Home

A nursing home (also called skilled nursing facility) is a facility or distinct part of an institution whose primary function is to provide medical, continuous nursing, and other health and social services to patients who are not in an acute phase of illness requiring services in a hospital, but who require primary restorative or skilled nursing services on an inpatient basis above the level of intermediate or custodial care in order to reach a degree of body functioning to permit self care in essential daily living.

A skilled nursing facility (SNF) may be a freestanding facility or part of a hospital that has been certified by Medicare to admit patients requiring subacute care and rehabilitation.

Nursing Home Compare

Nursing Home Compare allows consumers to compare information about nursing homes. It contains quality of care and staffing information for all 15,000 plus Medicare- and Medicaid-participating nursing homes.

Note: Nursing homes aren't included on Nursing Home Compare if they aren't Medicare or Medicaid certified. These Nursing Homes can be licensed by the state.

Information on Nursing Home Compare isn't an endorsement or advertisement for any nursing home and should be considered carefully. Use it with other information you gather about nursing homes facilities. Talk to your doctor or other health care provider about the information on Nursing Home Compare.
$advert"; ?>