Update Patient kolom BirthDate menjadi Birthdate
This commit is contained in:
parent
abab1f4479
commit
9124b49813
@ -18,10 +18,10 @@ class Patient extends Controller {
|
|||||||
$InternalPID = $this->request->getVar('InternalPID');
|
$InternalPID = $this->request->getVar('InternalPID');
|
||||||
$PatientID = $this->request->getVar('PatientID');
|
$PatientID = $this->request->getVar('PatientID');
|
||||||
$Name = $this->request->getVar('Name');
|
$Name = $this->request->getVar('Name');
|
||||||
$BirthDate = $this->request->getVar('BirthDate');
|
$Birthdate = $this->request->getVar('Birthdate');
|
||||||
$qname = "LOWER(CONCAT_WS(' ', IFNULL(Prefix,''), IFNULL(NameFirst,''), IFNULL(NameMiddle,''), IFNULL(NameLast,''), IFNULL(NameMaiden,''), IFNULL(Suffix,'')))";
|
$qname = "LOWER(CONCAT_WS(' ', IFNULL(Prefix,''), IFNULL(NameFirst,''), IFNULL(NameMiddle,''), IFNULL(NameLast,''), IFNULL(NameMaiden,''), IFNULL(Suffix,'')))";
|
||||||
$builder = $this->db->table('patient');
|
$builder = $this->db->table('patient');
|
||||||
$builder->select("InternalPID, PatientID, $qname as FullName, Gender, BirthDate, EmailAddress1 as Email, MobilePhone");
|
$builder->select("InternalPID, PatientID, $qname as FullName, Gender, Birthdate, EmailAddress1 as Email, MobilePhone");
|
||||||
if ($Name !== null) {
|
if ($Name !== null) {
|
||||||
$sql = $qname;
|
$sql = $qname;
|
||||||
$rawSql = new RawSql($sql);
|
$rawSql = new RawSql($sql);
|
||||||
@ -29,7 +29,7 @@ class Patient extends Controller {
|
|||||||
}
|
}
|
||||||
if ($InternalPID !== null) { $builder->where('InternalPID', $InternalPID); }
|
if ($InternalPID !== null) { $builder->where('InternalPID', $InternalPID); }
|
||||||
if ($PatientID !== null) { $builder->like('PatientID', $PatientID, 'both'); }
|
if ($PatientID !== null) { $builder->like('PatientID', $PatientID, 'both'); }
|
||||||
if ($BirthDate !== null) { $builder->where('BirthDate', $BirthDate); }
|
if ($Birthdate !== null) { $builder->where('Birthdate', $Birthdate); }
|
||||||
|
|
||||||
$filteredPatients = $builder->get()->getResultArray();
|
$filteredPatients = $builder->get()->getResultArray();
|
||||||
|
|
||||||
@ -107,7 +107,7 @@ class Patient extends Controller {
|
|||||||
"NameAlias" => null,
|
"NameAlias" => null,
|
||||||
"Gender" => isset($input['Gender']) ? (int) $input['Gender'] : null,
|
"Gender" => isset($input['Gender']) ? (int) $input['Gender'] : null,
|
||||||
"PlaceOfBirth" => $input['PlaceOfBirth'] ?? null,
|
"PlaceOfBirth" => $input['PlaceOfBirth'] ?? null,
|
||||||
"BirthDate" => $input['BirthDate'] ?? null,
|
"Birthdate" => $input['Birthdate'] ?? null,
|
||||||
"Street_1" => $input['Street_1'] ?? null,
|
"Street_1" => $input['Street_1'] ?? null,
|
||||||
"Street_2" => $input['Street_2'] ?? null,
|
"Street_2" => $input['Street_2'] ?? null,
|
||||||
"Street_3" => null,
|
"Street_3" => null,
|
||||||
@ -199,7 +199,7 @@ class Patient extends Controller {
|
|||||||
"NameAlias" => null,
|
"NameAlias" => null,
|
||||||
"Gender" => isset($input['Gender']) ? (int) $input['Gender'] : null,
|
"Gender" => isset($input['Gender']) ? (int) $input['Gender'] : null,
|
||||||
"PlaceOfBirth" => $input['PlaceOfBirth'] ?? null,
|
"PlaceOfBirth" => $input['PlaceOfBirth'] ?? null,
|
||||||
"BirthDate" => $input['BirthDate'] ?? null,
|
"Birthdate" => $input['Birthdate'] ?? null,
|
||||||
"Street_1" => $input['Street_1'] ?? null,
|
"Street_1" => $input['Street_1'] ?? null,
|
||||||
"Street_2" => $input['Street_2'] ?? null,
|
"Street_2" => $input['Street_2'] ?? null,
|
||||||
"Street_3" => null,
|
"Street_3" => null,
|
||||||
@ -241,7 +241,7 @@ class Patient extends Controller {
|
|||||||
// "NameAlias" => null,
|
// "NameAlias" => null,
|
||||||
// "Gender" => ((int) $input['Gender']) ?? null, //int
|
// "Gender" => ((int) $input['Gender']) ?? null, //int
|
||||||
// "PlaceOfBirth" => $input['PlaceOfBirthdate'] ?? null,
|
// "PlaceOfBirth" => $input['PlaceOfBirthdate'] ?? null,
|
||||||
// "BirthDate" => $input['BirthDate'] ?? null,
|
// "Birthdate" => $input['Birthdate'] ?? null,
|
||||||
// "Street1" => $input['Street1'] ?? null,
|
// "Street1" => $input['Street1'] ?? null,
|
||||||
// "Street2" => $input['Street2'] ?? null,
|
// "Street2" => $input['Street2'] ?? null,
|
||||||
// "Street3" => null,
|
// "Street3" => null,
|
||||||
@ -297,7 +297,7 @@ class Patient extends Controller {
|
|||||||
|
|
||||||
$allowedUpdateFields = [
|
$allowedUpdateFields = [
|
||||||
'NameFirst', 'NameLast', 'NameMiddle',
|
'NameFirst', 'NameLast', 'NameMiddle',
|
||||||
'PatientID', 'AlternatePID', 'BirthDate', 'PlaceOfBirth',
|
'PatientID', 'AlternatePID', 'Birthdate', 'PlaceOfBirth',
|
||||||
'Street_1', 'Street_2', 'Street_3', 'City', 'Province', 'ZIP',
|
'Street_1', 'Street_2', 'Street_3', 'City', 'Province', 'ZIP',
|
||||||
'EmailAddress1', 'EmailAddress2', 'Phone', 'MobilePhone', 'Mother', 'AccountNumber'
|
'EmailAddress1', 'EmailAddress2', 'Phone', 'MobilePhone', 'Mother', 'AccountNumber'
|
||||||
];
|
];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user