5) $mzip = substr($myrow['A25'],0,5)."-".substr($myrow['A25'],5); else $mzip = $myrow['A25']; $mphone = "(".substr($myrow['A27'],0,3).") ".substr($myrow['A27'],3,3)."-".substr($myrow['A27'],6); $mfax = "(".substr($myrow['A28'],0,3).") ".substr($myrow['A28'],3,3)."-".substr($myrow['A28'],6); /*Practice Address*/ $address1 = ucwords(strtolower($myrow['A29'])); $address2 = ucwords(strtolower($myrow['A30'])); $cityname = ucwords(strtolower($myrow['A31'])); $statename = $myrow['A32']; if(strlen($myrow['A33'])>5) $zip = substr($myrow['A33'],0,5)."-".substr($myrow['A33'],5); else $zip = $myrow['A33']; $phone = "(".substr($myrow['A35'],0,3).") ".substr($myrow['A35'],3,3)."-".substr($myrow['A35'],6); $cphone = $myrow['A35']; if(!empty($myrow['A36'])) { $fax = "(".substr($myrow['A36'],0,3).") ".substr($myrow['A36'],3,3)."-".substr($myrow['A36'],6); } else { $fax = "Not Available"; } $enumdate = $myrow['A37']; $updatedate = $myrow['A38']; $gender = $myrow['A42']; $states = array( 'AA'=>"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", NULL => '* (Not Available)', ); /*active and other taxonomy (non active)*/ $othertax = array(); $taxarr = array(); $switch = 50; for($i=0;$i<15;$i++) { $park = $switch + $i*4; if(!empty($myrow[$park])) { $othertax[$i][0] = $myrow[$park-3]; $othertax[$i][1] = $myrow[$park-2]; $othertax[$i][2] = $myrow[$park-1]; $othertax[$i][3] = $myrow[$park]; $taxarr[$i] = "".$myrow[$park-3].""; } if($myrow[$park]=="Y" || $myrow[$park]=="X" || $i==0) { $taxonomy = $myrow[$park-3]; $license = $myrow[$park-2]; $fullstate1 = $states[$myrow[$park-1]] ?? $myrow[$park-1]; } } $sql3 = "select * from taxonomy where code IN ('".implode("','",$taxarr)."')"; $query3 = MySQLi_query($link,$sql3); $type1 = $class1 = $special1 = $definition1 = array(); $i=0; while($myrow1 = MySQLi_fetch_array($query3, MYSQLI_BOTH)) { $code1 = $myrow1[0]; $type1[$code1] = $myrow1[1]; $class2[$code1] = $myrow1[2]; $special1[$code1] = $myrow1[3]; $definition1[$code1] = $myrow1[4]; if($special1[$code1]!="") { $class1[$code1] = $class2[$code1]." - ".$special1[$code1]; } else $class1[$code1] = $class2[$code1]; $class1[$code1] = ucwords(strtolower($class1[$code1])); $i++; } $activeclass = $class1[$taxonomy]; $activetype = $class2[$taxonomy]; /*other identifiers*/ $other = array(); $switch = 107; for($i=0;$i<50;$i++) { $park = $switch + $i*4; if($myrow[$park]!=NULL) { $other[$i][0]=$myrow[$park]; $other[$i][1]=$myrow[$park+1]; $other[$i][2]=$myrow[$park+2]; $other[$i][3]=$myrow[$park+3]; } else break; } $soleprop = $myrow['A308']; $mflag = $myrow['mflag']; $fullname = trim(ucwords(strtolower($prefix." ".$fname." ".$mname." ".$lname." ".$suffix)).", ".$credential); $fullname = str_replace(' ,',',',$fullname); //remove space before comma, if any. $fullname = str_replace('.','',$fullname); //remove all periods $fullname = str_replace(' ',' ',$fullname); //3 to 1 $fullname = str_replace(' ',' ',$fullname); //2 to 1 $fullnamewnc = trim(ucwords(strtolower($prefix." ".$fname." ".$mname." ".$lname." ".$suffix))); $fullnamewnc = str_replace(' ,',',',$fullnamewnc); //remove space before comma, if any. $fullnamewnc = str_replace('.','',$fullnamewnc); //remove all periods $fullnamewnc = str_replace(' ',' ',$fullnamewnc); //3 to 1 $fullnamewnc = str_replace(' ',' ',$fullnamewnc); //2 to 1 $ofullname= trim(ucwords(strtolower($oprefix." ".$ofname." ".$omname." ".$olname." ".$osuffix)).", ".$ocredential); $ofullname = str_replace(' ,',',',$ofullname); //remove space before comma, if any. $ofullname = str_replace('.','',$ofullname); //remove all periods $ofullname = str_replace(' ',' ',$ofullname); //3 to 1 $ofullname = str_replace(' ',' ',$ofullname); //2 to 1 $fulladdress = "
"; if($address1!="") $fulladdress = $fulladdress.$address1; if($address2!="") $fulladdress = $fulladdress.", ".$address2; $fulladdress = $fulladdress.",
".$cityname.", ".$statename." ".$zip."
"; $mfulladdress = "
"; if($maddress1!="") $mfulladdress = $mfulladdress.$maddress1; if($maddress2!="") $mfulladdress = $mfulladdress.", ".$maddress2; $mfulladdress = $mfulladdress.",
".$mcityname.", ".$mstatename." ".$mzip."
"; $fullstate = $states[$statename] ?? $statename; $mfullstate = $states[$mstatename] ?? $mstatename; $fullpracticeaddress = $address1; if($address2!="") $fullpracticeaddress = $fullpracticeaddress.", ".$address2; $fullpracticeaddress = $fullpracticeaddress.", ".$cityname.", ".$fullstate; //$mapaddress = implode("+",explode(" ",$fullpracticeaddress)); $mapaddress = urlencode($fullpracticeaddress); $fullmailingaddress = $maddress1; if($maddress2!="") $fullmailingaddress = $fullmailingaddress.", ".$maddress2; $fullmailingaddress = $fullmailingaddress.", ".$mcityname.", ".$mfullstate; $providerlink = "https://www.medicareusa.org/?doctor/".$doctorlink."/"; /* mflag Description "Y" - Accepts Medicare. (All things Yes) "M" - May Accept Medicare. (All things Yes but may not accept medicare) "P" - Medicare Enrolled (order and refer) and two cases based on presence in reassign table: 1. Either don't accept medicare assignment but can order and refer or 2. Have reassigned the medicare benefits to hospitals, clinics or other practitioners. "I" - Medicare enrolled but only for precribing medicare part D drugs. May not claim. "N" - Not enrolled with medicare, thus, no to all medicare related questions. */ if($mflag=="Y"||$mflag=="M") { /*Medicare Related Data*/ $first=0; $group = ""; $sql2 = "Select SQL_NO_CACHE * from newmedicare1 where NPI = '$npi'"; $query2 = MySQLi_query($link,$sql2); while($myrow = MySQLi_fetch_array($query2, MYSQLI_BOTH)) { if($first==0) { //Do this only once to copy things from 1st row in result $PACID = $myrow['PACID']; $PEID = $myrow['PEID']; $School = ucwords(strtolower($myrow['School'])); $Spec = ucwords(strtolower($myrow['Spec'])); //$AllSpecs = ucwords(strtolower($myrow['AllSpecs'])); $Gyear = $myrow['Gyear']; $thisyear = date("Y"); $experience = $thisyear - $Gyear; $assignments = $myrow['Medicare']; $sql6 = "Select Facility_Type,Parent_CCN,LCCN,OCCN,link from facility_aff where PACID = '$PACID'"; $query6 = MySQLi_query($link,$sql6); $mcount = 0; $ftype = $pccn = $lccn = $occn = $ccnlink = array(); while($myrow6 = MySQLi_fetch_array($query6, MYSQLI_BOTH)) { $ccnlink[$mcount] = $myrow6['link']; if(!empty($ccnlink[$mcount])) { $ftype[$mcount] = $myrow6['Facility_Type']; $pccn[$mcount] = $myrow6['Parent_CCN']; $lccn[$mcount] = $myrow6['LCCN']; $occn[$mcount] = ucwords(strtolower($myrow6['OCCN'])); $mcount++; } } $OrgName[$first] = ucwords(strtolower($myrow['OrgName'])); $GPPACID[$first] = $myrow['GPPACID']; $Members[$first] = $myrow['Members']; if(!empty($OrgName[$first])) $group = $OrgName[$first]; } else { $OrgName[$first] = ucwords(strtolower($myrow['OrgName'])); $GPPACID[$first] = $myrow['GPPACID']; $Members[$first] = $myrow['Members']; if(!empty($OrgName[$first]) AND empty($group)) { $group = $OrgName[$first]; } else if(!empty($OrgName[$first]) AND !empty($group)) { $group = $group.", ".$OrgName[$first]; } } $first++; } } else if($mflag=="P") { $sql2 = "Select SQL_NO_CACHE * from ppee where NPI = '$npi'"; $query2 = MySQLi_query($link,$sql2); $myrow = MySQLi_fetch_array($query2, MYSQLI_BOTH); $PACID = $myrow['PACID']; $PEID = $myrow['EID']; $Spec = $activetype; } else if($mflag=="I") { $Spec = $activetype; } $taxlist = array( 'cardiovascular-disease'=>array('207RC0000X','Cardiovascular Disease','cardiovascular-disease'), 'gastroenterology'=>array('207RG0100X','Gastroenterology','gastroenterology'), 'hematology-oncology'=>array('207RH0003X','Hematology & Oncology','hematology-oncology'), 'nephrology'=>array('207RN0300X','Nephrology','nephrology'), 'pulmonary-disease'=>array('207RP1001X','Pulmonary Disease','pulmonary-disease'), 'infectious-disease'=>array('207RI0200X','Infectious Disease','infectious-disease'), 'endocrinology-diabetes'=>array('207RE0101X','Endocrinology, Diabetes & Metabolism','endocrinology-diabetes'), 'rheumatology'=>array('207RR0500X','Rheumatology','rheumatology'), 'critical-care'=>array('207RC0200X','Critical Care Medicine','critical-care'), 'geriatric-medicine'=>array('207RG0300X','Geriatric Medicine','geriatric-medicine'), 'internal-medicine'=>array('207R','Internal Medicine','internal-medicine'), 'family-medicine'=>array('207Q','Family Medicine','family-medicine'), 'anesthesiology'=>array('207L','Anesthesiology','anesthesiology'), 'psychiatry'=>array('2084','Psychiatry & Neurology','psychiatry'), 'radiology'=>array('2085','Radiology','radiology'), 'obstetrics-gynecology'=>array('207V','Obstetrics & Gynecology','obstetrics-gynecology'), 'surgery'=>array('2086','Surgery','surgery'), 'orthopedic-surgery'=>array('207X','Orthopedic Surgery','orthopedic-surgery'), 'emergency-medicine'=>array('207P','Emergency Medicine','emergency-medicine'), 'ophthalmology'=>array('207W','Ophthalmology','ophthalmology'), 'pediatrics'=>array('2080','Pediatrics','pediatrics'), 'pathology'=>array('207Z','Pathology','pathology'), 'dermatology'=>array('207N','Dermatology','dermatology'), 'urology'=>array('2088','Urology','urology'), 'ent'=>array('207Y','Otolaryngology','ent'), 'physiatry'=>array('2081','Physical Medicine & Rehabilitation','physiatry'), 'hospitalist'=>array('208M','Hospitalist','hospitalist'), 'general-practice'=>array('208D','General Practice','general-practice'), 'neurological-surgery'=>array('207T','Neurological Surgery','neurological-surgery'), 'thoracic-surgery'=>array('208G','Thoracic Surgery (Cardiothoracic Vascular Surgery)','thoracic-surgery'), 'plastic-surgery'=>array('2082','Plastic Surgery','plastic-surgery'), 'allergy-immunology'=>array('207K','Allergy & Immunology','allergy-immunology'), 'pain-medicine'=>array('208V','Pain Medicine','pain-medicine'), 'preventive-medicine'=>array('2083','Preventive Medicine','preventive-medicine'), ); $first4 = substr($taxonomy,0,4); $catlink = ""; $catname = ""; foreach($taxlist as $mytax) { if($taxonomy==$mytax[0]||$first4==$mytax[0]) { $catlink = "https://www.medicareusa.org/?".$mytax[2]."/"; $catname = $mytax[1]; break; } } $temp = explode(" ",strtolower($cityname)); $tempcity = urlencode(implode("-",$temp)); $tempstate = strtolower($statename); $statelink = $catlink.$tempstate."/"; $citylink = $statelink.$tempcity."/"; // Setting Provider verbs if($gender == 'M'){ $gender1 = "Male"; $gpronoun = "he"; $ugpronoun = "He"; $ugverb = "His"; $gverb = "his"; } else if($gender == 'F'){ $gender1 = "Female"; $gpronoun = "she"; $ugpronoun = "She"; $ugverb = "Her"; $gverb = "her"; } if($mflag!="N") { $desc = $fullname." in ".$cityname.", ".$statename." - Medicare ".$Spec." Details including NPI, Practice Location and Contact Numbers. Find if $fullnamewnc participate in medicare and accept medicare assignments."; $title = $fullname." in ".$cityname.", ".$statename." - Medicare ".$Spec; $header = $fullname." - Medicare ".$Spec." in ".$cityname.", ".$statename; } else { $desc = $fullname." in ".$cityname.", ".$statename." - ".$activetype." Details including NPI, Practice Location and Contact Numbers. Find if $fullnamewnc participate in medicare and accept medicare assignments."; $title = $fullname." in ".$cityname.", ".$statename." - ".$activetype; $header = $fullname." - ".$activetype." in ".$cityname.", ".$statename; } $advert = '
'; $advertdesktop = '
'; $adlink = ' '; ?> <?php echo $title;?> | MedicareUSA

$fullname is a medicare enrolled \"$activeclass\" physician in $cityname, $fullstate. "; if(!empty($Gyear)) { if($School!="Other") echo "$ugpronoun went to $School and graduated in $Gyear "; else echo "$ugpronoun graduated from medical school in $Gyear "; echo "and has $experience years of diverse experience with area of expertise as $Spec. "; } if(!empty($group)) echo "$ugpronoun is a member of the group practice $group and $gverb "; else echo "$ugverb"; echo " current practice location is $fullpracticeaddress. You can reach out to $gverb office (for appointments etc.) via phone at $phone."; echo "

$fullnamewnc is licensed to practice in $fullstate1 (license number $license) and $gpronoun also participates in the medicare program. "; } else { echo "$fullname is a $activeclass physician based in $cityname, $fullstate. "; echo "$fullnamewnc is licensed to practice in $fullstate1 (license number $license) and $gverb current practice location is $fullpracticeaddress. "; echo "$ugpronoun can be reached at $gverb office (for appointments etc.) via phone at $phone.

"; echo "NPI number for $fullnamewnc is $npi and $gverb current mailing address is $fullmailingaddress. "; } if($mflag=="Y") echo "$ugpronoun accepts medicare assignments (which means $gpronoun accepts the Medicare-approved amount; you will not be billed for any more than the Medicare deductible and coinsurance) and $gverb NPI Number is $npi."; else if($mflag=="M") echo "$ugpronoun may accept medicare assignments (which means $gpronoun may accept the Medicare-approved amount; you may be billed for more than the Medicare deductible and coinsurance) and $gverb NPI Number is $npi."; else if($mflag=="P") echo "$ugpronoun does not accept medicare assignments directly but $gpronoun may accept medicare through third-party (refer to Reassignment section below) and may also prescribe medicare part D drugs. $ugverb NPI Number is $npi."; else if($mflag=="I") echo "$ugpronoun is enrolled with medicare but does not accept medicare assignments but since $gpronoun is enrolled in medicare, $gpronoun may order Medicare Part D Prescription drugs, if eligible. $ugverb NPI Number is $npi."; else if($mflag=="N") echo "$ugpronoun does not participate in medicare program and thus does not accept medicare assignments. $ugverb NPI Number is $npi."; echo "
"; //Ad only on desktop echo "$advertdesktop"; ?>

Contact Information

$fullname";?>
$phone";?>

$advert
"; ?>

Physician's Profile

"; echo ""; if($mflag=="Y"||$mflag=="M") { echo ""; echo ""; } else echo ""; echo ""; echo ""; ?>
Full Name$fullnamewnc
Gender$gender1
Speciality$Spec
Experience$experience Years
Speciality$activeclass
Location$address1, $cityname, $fullstate
Accepts Medicare Assignments"; if($mflag=="Y") echo "Yes. $ugpronoun accepts the Medicare-approved amount; you will not be billed for any more than the Medicare deductible and coinsurance."; else if($mflag=="M") echo "May be. $ugpronoun may accept the Medicare-approved amount; you may be billed for more than the Medicare deductible and coinsurance."; else if($mflag=="P") echo "Medicare enrolled and may accept medicare through third-party reassignment. May prescribe medicare part D drugs."; else if($mflag=="I") echo "Medicare enrolled but does not accept medicare assignments. May prescribe medicare part D drugs."; else if($mflag=="N") echo "Does not participate in Medicare Program. $ugpronoun may not accept medicare assignment."; echo "
  Medical Education and Training:
'; if($School!=="Other") echo "
  • $fullnamewnc attended and graduated from $School in $Gyear
"; else echo "
  • $fullnamewnc graduated from medical school in $Gyear
"; } ?>
  NPI Data:
    NPI Number: $npi"; echo "
  • Provider Enumeration Date: $enumdate
  • "; echo "
  • Last Update Date: $updatedate
  • "; ?>
  Medicare PECOS Information:
    '; echo "
  • PECOS PAC ID: $PACID
  • "; echo "
  • Enrollment ID: $PEID
"; } ?>

Medical Identifiers

Medical identifiers for such as npi, medicare ID, medicare PIN, medicaid, etc. "; // if other identifier exist, show below table $i=0; if(isset($other[$i][0])) { $otherid = array( '01'=>"Other", '02'=>"Medicare UPIN", '04'=>"Medicare ID-Type Unspecified", '05'=>"Medicaid", '06'=>"Medicare OSCAR/CERTIFICATION", '07'=>"Medicare NSC", '08'=>"Medicare PIN" ); for($i=0;$i<50;$i++) { if(isset($other[$i][0])) { $A = $other[$i][0]; $B = $other[$i][1]; $C = $other[$i][2]; $D = $other[$i][3]; $idtype = $otherid[$B]; echo ""; } else break; } } ?>
IdentifierTypeStateIssuer
$npiNPI-NPPES
$A$idtype$C$D

Medical Taxonomies and Licenses

"; } } ?>
TaxonomyTypeLicense (State)Status
$thistax$thisclass $thislicense ($thisstate)$activestatus
0) { echo '

Medical Facilities Affiliation

'; for($k=0;$k<$mcount;$k++) { $ccnlink[$k] = $home."/".$ccnlink[$k]; echo "\n"; } echo "
Facility NameLocationFacility Type
{$occn[$k]}{$lccn[$k]}{$ftype[$k]}
"; } ?>

Group Practice Association

'; for($i=0;$i<$first;$i++) { echo ""; } echo "
Group Practice NameGroup PECOS PAC IDNo. of Members
$OrgName[$i]$GPPACID[$i]$Members[$i]
"; } } ?>

Medicare Reassignments

'; echo "Some practitioners may not bill the customers directly but medicare billing happens through clinics / group practice / hospitals where the provider works. Medicare reassignment of benefits is a mechanism by which practitioners allow third parties to bill and receive payment for medicare services performed by them. $fullnamewnc allows following entities to bill medicare on $gverb behalf.
"; } $tfirst++; $tNPI = $myrow2['NPI']; $tPACID = $myrow2['PACID']; $tPEID = $myrow2['EID']; $tType = ucwords(strtolower($myrow2['TypeDesc'])); $tState = $myrow2['State']; if(!empty($myrow2['Org'])) { $tName = ucwords(strtolower($myrow2['Org'])); } else { if(!empty($myrow2['MName'])) $tName = ucwords(strtolower($myrow2['FName']." ".$myrow2['MName']." ".$myrow2['LName'])); else $tName = ucwords(strtolower($myrow2['FName']." ".$myrow2['LName'])); } echo ''; echo ""; echo ""; echo ""; echo "
Entity Name$tName
Entity Type$tType
Entity IdentifiersNPI Number: $tNPI
PECOS PAC ID: $tPACID
Enrollment ID: $tPEID
"; } } ?>

Medicare Part D Prescriber Enrollment

'; if($mflag!="N") echo "Any physician or other eligible professional who prescribes Part D drugs must either enroll in the Medicare program or opt out in order to prescribe drugs to their patients with Part D prescription drug benefit plans. $fullnamewnc is enrolled with medicare and thus, if eligible, can prescribe medicare part D drugs to patients with medicare part D benefits.
"; else echo "Any physician or other eligible professional who prescribes Part D drugs must either enroll in the Medicare program or opt out in order to prescribe drugs to their patients with Part D prescription drug benefit plans. $fullnamewnc is NOT enrolled with medicare and thus cannot prescribe medicare part D drugs to patients with medicare part D benefits.
"; echo "
"; ?>

Medicare Quality Measures

'; echo ""; echo ""; echo ""; echo "
Quality ProgramParticipation
Reported to Medicare Physician Quality Reporting System (PQRS) $PQRS
Used Electronic Health Record (EHR) $EHR
Committed to heart health through the Million Hearts Initiative $MHI
"; } */ ?>

Mailing Address and Practice Location

"; ?>
Mailing AddressPractice Location Address
$fullname
$mfulladdress
Ph: $mphone
$fullname
$fulladdress
Ph: $phone

News Archive

Scientists reveal how a genetic code variation results in devastating brain diseases

New findings reveal how a mutation, a change in the genetic code that causes neurodegeneration, alters the shape of DNA, making cells more vulnerable to stress and more likely to die.

Ugandan text messaging program aims to increase awareness, knowledge of HIV/AIDS

A text messaging program using mobile phone technology is being used in western Uganda to increase awareness of and knowledge about HIV/AIDS, IRIN/Plus News reports.

Research shows link between long working hours and low life expectancy

Countries which have an average working week that exceeds 48 hours die an average of two years earlier than those that work for 45 hours or less, new research shows.

Fruit fly discovery could lead to a completely new approach to tackling some cancers

Scientists studying the humble fruit fly have found a family of proteins that enhances the sensitivity of a cell to a hormone that can trigger abnormal growth and cancer. Their discovery could lead to a completely new approach to tackling some cancers and the development of new drugs to stop uncontrolled growth in a wide variety of tumour cells.

Read more News

› Verified 3 days ago


$activetype Doctors in $cityname, $statename"; $sql4 = "Select A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A29,A30,A31,A32,A33,A35,A36,A42,A48,mflag,link from doctors where Code='$code' AND A32='$statename' AND A31='$cityname' LIMIT 7"; $query4 = MySQLi_query($link,$sql4); echo ""; while($myrow = MySQLi_fetch_array($query4, MYSQLI_BOTH)) { $npi = $myrow['A1']; $entity = $myrow['A2']; $lname = $myrow['A6']; $fname = $myrow['A7']; $mname = $myrow['A8']; $prefix = $myrow['A9']; $suffix = $myrow['A10']; $credential = $myrow['A11']; $cityname = ucwords(strtolower($myrow['A31'])); $statename = $myrow['A32']; $zip = substr($myrow['A33'],0,5); $address1 = ucwords(strtolower($myrow['A29'])); $address2 = ucwords(strtolower($myrow['A30'])); $phone = substr($myrow['A35'],0,3)."-".substr($myrow['A35'],3,3)."-".substr($myrow['A35'],6); if(!empty($myrow['A36'])) $fax = substr($myrow['A36'],0,3)."-".substr($myrow['A36'],3,3)."-".substr($myrow['A36'],6); else $fax =""; $orgname = $myrow['A5']; $gender = $myrow['A42']; $doclink = $myrow['link']; if($myrow['mflag']=="Y") $mflag = "Accepting Medicare Assignments"; else if($myrow['mflag']=="M") $mflag = "May Accept Medicare Assignments"; else if($myrow['mflag']=="P"||$myrow['mflag']=="I") $mflag = "Medicare Enrolled"; else $mflag = "Not Enrolled in Medicare"; $fullname = ucwords(strtolower(trim($prefix." ".$fname." ".$mname." ".$lname." ".$suffix))); $fullname = str_replace(' ',' ',$fullname); $printname = $fullname.", ".$credential; $fulladdress=""; if($address1!="") $fulladdress = $address1.", "; if($address2!="") $fulladdress = $fulladdress.$address2.", "; $fulladdress = $fulladdress.$cityname.", ".$statename." ".$zip; $branchlink = "https://www.medicareusa.org/?doctor/".$doclink."/"; if($doclink!=$doctorlink) { echo ""; } } echo "
"; echo "
$printname
"; echo "$catname
Medicare: $mflag
Practice Location: $fulladdress
"; echo "Phone: $phone    "; if(!empty($fax)) echo "Fax: $fax"; echo "
"; } ?>