change DeathDate to TimeOfDeath
This commit is contained in:
parent
e6b08a6ee6
commit
a3b025ef6c
@ -79,7 +79,7 @@ class CreatePatientRegTables extends Migration {
|
|||||||
'Ethnic' => ['type' => 'INT', 'constraint' => 11, 'null' => true],
|
'Ethnic' => ['type' => 'INT', 'constraint' => 11, 'null' => true],
|
||||||
'Citizenship' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
'Citizenship' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||||
'DeathIndicator'=> ['type' => 'INT', 'constraint' => 11, 'null' => true],
|
'DeathIndicator'=> ['type' => 'INT', 'constraint' => 11, 'null' => true],
|
||||||
'DeathDateTime' => ['type' => 'DATETIME', 'null' => true],
|
'TimeOfDeath' => ['type' => 'DATETIME', 'null' => true],
|
||||||
'LinkTo' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
'LinkTo' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||||
'CreateDate' => ['type' => 'DATETIME', 'null' => true],
|
'CreateDate' => ['type' => 'DATETIME', 'null' => true],
|
||||||
'DelDate' => ['type' => 'DATETIME', 'null' => true]
|
'DelDate' => ['type' => 'DATETIME', 'null' => true]
|
||||||
|
|||||||
@ -26,10 +26,10 @@ class PatVisitModel extends BaseModel {
|
|||||||
|
|
||||||
public function showByPatient($InternalPID) {
|
public function showByPatient($InternalPID) {
|
||||||
$rows = $this
|
$rows = $this
|
||||||
//->join('patdiag pd', 'pd.InternalPVID=patvisit.InternalPVID', 'left')
|
->join('patdiag pd', 'pd.InternalPVID=patvisit.InternalPVID', 'left')
|
||||||
//->join('patvisitadt pva', 'pd.InternalPVID=pva.InternalPVID', 'left')
|
->join('patvisitadt pva', 'pd.InternalPVID=pva.InternalPVID', 'left')
|
||||||
//->join('location l', 'l.LocationID=pva.LocationID', 'left')
|
->join('location l', 'l.LocationID=pva.LocationID', 'left')
|
||||||
->where('InternalPID',$InternalPID)->findAll();
|
->where('patvisit.InternalPID',$InternalPID)->findAll();
|
||||||
return $rows;
|
return $rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,7 @@ class PatientModel extends BaseModel {
|
|||||||
protected $primaryKey = 'InternalPID';
|
protected $primaryKey = 'InternalPID';
|
||||||
protected $allowedFields = ['PatientID', 'AlternatePID', 'Prefix', 'NameFirst', 'NameMiddle', 'NameMaiden', 'NameLast', 'Suffix', 'NameAlias', 'Gender', 'Birthdate', 'PlaceOfBirth', 'Street_1', 'Street_2', 'Street_3',
|
protected $allowedFields = ['PatientID', 'AlternatePID', 'Prefix', 'NameFirst', 'NameMiddle', 'NameMaiden', 'NameLast', 'Suffix', 'NameAlias', 'Gender', 'Birthdate', 'PlaceOfBirth', 'Street_1', 'Street_2', 'Street_3',
|
||||||
'City', 'Province', 'ZIP', 'EmailAddress1', 'EmailAddress2', 'Phone', 'MobilePhone', 'Custodian', 'AccountNumber', 'Country', 'Race', 'MaritalStatus', 'Religion', 'Ethnic', 'Citizenship',
|
'City', 'Province', 'ZIP', 'EmailAddress1', 'EmailAddress2', 'Phone', 'MobilePhone', 'Custodian', 'AccountNumber', 'Country', 'Race', 'MaritalStatus', 'Religion', 'Ethnic', 'Citizenship',
|
||||||
'DeathIndicator', 'DeathDateTime', 'LinkTo', 'CreateDate', 'DelDate' ];
|
'DeathIndicator', 'TimeOfDeath', 'LinkTo', 'CreateDate', 'DelDate' ];
|
||||||
|
|
||||||
protected $useTimestamps = true;
|
protected $useTimestamps = true;
|
||||||
protected $createdField = 'CreateDate';
|
protected $createdField = 'CreateDate';
|
||||||
@ -215,8 +215,8 @@ class PatientModel extends BaseModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function transformPatientData(array $patient): array {
|
private function transformPatientData(array $patient): array {
|
||||||
$patient["Age"] = $this->calculateAgeFromBirthdate($patient["Birthdate"], $patient["DeathDateTime"]);
|
$patient["Age"] = $this->calculateAgeFromBirthdate($patient["Birthdate"], $patient["TimeOfDeath"]);
|
||||||
$patient["DeathDateTime"] = $this->formattedDate($patient["DeathDateTime"]);
|
$patient["TimeOfDeath"] = $this->formattedDate($patient["TimeOfDeath"]);
|
||||||
$patient["CreateDate"] = $this->formattedDate($patient["CreateDate"]);
|
$patient["CreateDate"] = $this->formattedDate($patient["CreateDate"]);
|
||||||
$patient["BirthdateConversion"] = $this->formatedDateForDisplay($patient["Birthdate"]);
|
$patient["BirthdateConversion"] = $this->formatedDateForDisplay($patient["Birthdate"]);
|
||||||
$patient["LinkTo"] = $this->getLinkedPatients($patient['LinkTo']);
|
$patient["LinkTo"] = $this->getLinkedPatients($patient['LinkTo']);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user