michael_barnett wrote on Wednesday, June 21, 2006:
ok i miss read your post. your talking about when you are using the popup when scheduling a patient right?
i added the first name search to mine but for some reason it still gives me everyone when i type in a first name. did not have much time to tinker though
i added a function in the patients.inc
function getPatientFnames($fname = “%”, $given1 = “pid, id, lname, fname, mname, providerID, DATE_FORMAT(DOB,’%m/%d/%Y’) as DOB_TS”, $orderby = “lname ASC, fname ASC”)
{
$sql=“select $given1 from patient_data where fname like ‘$fname%’ order by $orderby”;
$rez = sqlStatement($sql);
for($iter=0; $row=sqlFetchArray($rez); $iter++)
$returnval[$iter]=$row;
return $returnval;
}
i just diced the last name function on a guess hehe
i also added a function to get insurance phone numbers
function getInsurancePhone($id){
$sql =“select foreign_id, country_code, area_code, prefix, number from phone_numbers where foreign_id = ‘$id’”;
return sqlQuery($sql);
}
I use this for one of the custome fee sheets. I found no other way to get an insurance phone number. if there is one please point it out.
And I’m here to learn any advice or critisism on the code i present is appreciated.
i also added to the find_patient_popup.php
if ($searchby == "Last") {
$result = getPatientLnames("$searchparm","*");
} elseif ($searchby == "ID") {
$result = getPatientId("$searchparm","*");
} elseif ($searchby == "DOB") {
$result = getPatientDOB("$searchparm","*");
} elseif ($searchby == "SSN") {
$result = getPatientSSN("$searchparm","*");
} elseif ($searchby == "First"){
$result = getPatientFnames("$searchparam","*");
}
}
<select name=‘searchby’>
<option value=“Last”>Last Name</option>
<option value=“First”<? if ($searchby == ‘First’) echo ’ selected’ ?>>First Name</option>
<option value=“ID”<? if ($searchby == ‘ID’) echo ’ selected’ ?>>ID</option>
<option value=“SSN”<? if ($searchby == ‘SSN’) echo ’ selected’ ?>>SSN</option>
<option value=“DOB”<? if ($searchby == ‘DOB’) echo ’ selected’ ?>>DOB</option>
</select>
<table border=‘0’>
<tr>
<td><b>First Name</b></td>
<td><b>Last Name</b></td>
<td><b>SS</b></td>
<td><b>DOB</b></td>
<td><b>ID</b></td>
</tr>