change all migration to use manual datetime for creation
This commit is contained in:
parent
e34b96bc19
commit
bd3284b86f
@ -12,7 +12,7 @@ class CreatePatientRegTables extends Migration {
|
||||
'InternalPID'=> ['type' => 'INT', 'constraint' => 11, 'null' => true],
|
||||
'Address' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||
'UserID' => ['type' => 'INT', 'constraint' => 11, 'null' => true],
|
||||
'CreateDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP',
|
||||
'CreateDate' => ['type' => 'DATETIME', 'null' => true],
|
||||
'DelDate' => ['type' => 'DATETIME', 'null' => true],
|
||||
]);
|
||||
$this->forge->addKey('PatAttID', true);
|
||||
@ -24,7 +24,7 @@ class CreatePatientRegTables extends Migration {
|
||||
'PatComID' => ['type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'auto_increment' => true],
|
||||
'InternalPID'=> ['type' => 'INT', 'constraint' => 11, 'null' => true],
|
||||
'Comment' => ['type' => 'TEXT', 'null' => true],
|
||||
'CreateDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP',
|
||||
'CreateDate' => ['type' => 'DATETIME', 'null' => true],
|
||||
'EndDate' => ['type' => 'DATETIME', 'null' => true],
|
||||
]);
|
||||
$this->forge->addKey('PatComID', true);
|
||||
@ -39,7 +39,7 @@ class CreatePatientRegTables extends Migration {
|
||||
'Identifier' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||
'EffectiveDate' => ['type' => 'DATETIME', 'null' => true],
|
||||
'ExpirationDate'=> ['type' => 'DATETIME', 'null' => true],
|
||||
'CreateDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP',
|
||||
'CreateDate' => ['type' => 'DATETIME', 'null' => true],
|
||||
'DelDate' => ['type' => 'DATETIME', 'null' => true],
|
||||
]);
|
||||
$this->forge->addKey('PatIdtID', true);
|
||||
@ -81,8 +81,8 @@ class CreatePatientRegTables extends Migration {
|
||||
'DeathIndicator'=> ['type' => 'INT', 'constraint' => 11, 'null' => true],
|
||||
'DeathDateTime' => ['type' => 'DATETIME', 'null' => true],
|
||||
'LinkTo' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||
'CreateDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP',
|
||||
'DelDate' => ['type' => 'DATETIME', 'null' => true],
|
||||
'CreateDate' => ['type' => 'DATETIME', 'null' => true],
|
||||
'DelDate' => ['type' => 'DATETIME', 'null' => true]
|
||||
]);
|
||||
$this->forge->addKey('InternalPID', true);
|
||||
$this->forge->addUniqueKey('PatientID');
|
||||
@ -109,8 +109,8 @@ class CreatePatientRegTables extends Migration {
|
||||
'EventID' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||
'ActivityID' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||
'Reason' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||
'LogDate' => ['type' => 'DATETIME', 'null' => true],
|
||||
]);
|
||||
$this->forge->addField('LogDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP');
|
||||
$this->forge->addKey('PatRegLogID', true);
|
||||
$this->forge->createTable('patreglog');
|
||||
|
||||
@ -118,7 +118,7 @@ class CreatePatientRegTables extends Migration {
|
||||
$this->forge->addField([
|
||||
'PatRelID' => ['type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'auto_increment' => true],
|
||||
'InternalPID'=> ['type' => 'INT', 'constraint' => 11, 'null' => true],
|
||||
'CreateDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP',
|
||||
'CreateDate' => ['type' => 'DATETIME', 'null' => true],
|
||||
'EndDate' => ['type' => 'DATETIME', 'null' => true],
|
||||
]);
|
||||
$this->forge->addKey('PatRelID', true);
|
||||
|
||||
@ -29,7 +29,7 @@ class CreatePVTables extends Migration {
|
||||
'InternalPID' => ['type' => 'INT', 'constraint' => 11, 'null' => true],
|
||||
'DiagCode' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||
'Diagnosis' => ['type' => 'TEXT', 'null' => true],
|
||||
'CreateDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP',
|
||||
'CreateDate' => ['type' => 'DATETIME', 'null' => true],
|
||||
'EndDate' => ['type' => 'DATETIME', 'null' => true],
|
||||
'ArchivedDate' => ['type' => 'DATETIME', 'null' => true],
|
||||
'DelDate' => ['type' => 'DATETIME', 'null' => true],
|
||||
@ -47,7 +47,7 @@ class CreatePVTables extends Migration {
|
||||
'RefDoc' => ['type' => 'INT', 'constraint' => 11, 'null' => true],
|
||||
'AdmDoc' => ['type' => 'INT', 'constraint' => 11, 'null' => true],
|
||||
'CnsDoc' => ['type' => 'INT', 'constraint' => 11, 'null' => true],
|
||||
'CreateDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP',
|
||||
'CreateDate' => ['type' => 'DATETIME', 'null' => true],
|
||||
'EndDate' => ['type' => 'DATETIME', 'null' => true],
|
||||
'ArchivedDate'=> ['type' => 'DATETIME', 'null' => true],
|
||||
'DelDate' => ['type' => 'DATETIME', 'null' => true],
|
||||
@ -75,7 +75,7 @@ class CreatePVTables extends Migration {
|
||||
'EventID' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||
'ActivityID' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||
'Reason' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||
'LogDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP'
|
||||
'LogDate' => ['type' => 'DATETIME', 'null' => true],
|
||||
]);
|
||||
$this->forge->addKey('PatVisLogID', true);
|
||||
$this->forge->createTable('patvisitlog');
|
||||
|
||||
@ -15,7 +15,7 @@ class CreateLocationTable extends Migration {
|
||||
'LocFull' => ['type' => 'varchar', 'constraint' => 255, 'null' => true],
|
||||
'Description' => ['type' => 'varchar', 'constraint' => 255, 'null' => true],
|
||||
'LocType' => ['type' => 'varchar', 'constraint' => 11, 'null' => true],
|
||||
'CreateDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP',
|
||||
'CreateDate' => ['type' => 'DATETIME', 'null' => true],
|
||||
'EndDate' => ['type' => 'DATETIME', 'null' => true]
|
||||
]);
|
||||
$this->forge->addKey('LocationID', true);
|
||||
@ -30,7 +30,7 @@ class CreateLocationTable extends Migration {
|
||||
'PostCode' => ['type' => 'varchar', 'constraint' => 255, 'null' => true],
|
||||
'GeoLocationSystem' => ['type' => 'varchar', 'constraint' => 255, 'null' => true],
|
||||
'GeoLocationData' => ['type' => 'varchar', 'constraint' => 255, 'null' => true],
|
||||
'CreateDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP',
|
||||
'CreateDate' => ['type' => 'DATETIME', 'null' => true],
|
||||
'EndDate' => ['type' => 'DATETIME', 'null' => true]
|
||||
]);
|
||||
$this->forge->addKey('LocationID', true);
|
||||
|
||||
@ -22,7 +22,7 @@ class CreateContactTable extends Migration {
|
||||
'Specialty' => [ 'type' => 'VARCHAR', 'constraint' => 100, 'null' => true ],
|
||||
'SubSpecialty' => [ 'type' => 'VARCHAR', 'constraint' => 100, 'null' => true ],
|
||||
'Password' => [ 'type' => 'VARCHAR', 'constraint' => 255, 'null' => true ],
|
||||
'CreateDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP',
|
||||
'CreateDate' => ['type' => 'DATETIME', 'null' => true],
|
||||
'EndDate' => [ 'type' => 'DATETIME', 'null' => true ],
|
||||
]);
|
||||
$this->forge->addKey('ContactID', true);
|
||||
@ -51,7 +51,7 @@ class CreateContactTable extends Migration {
|
||||
'OccCode' => [ 'type' => 'VARCHAR', 'constraint' => 5, 'null' => true ],
|
||||
'OccText' => [ 'type' => 'VARCHAR', 'constraint' => 255, 'null' => true ],
|
||||
'Description' => [ 'type' => 'TEXT', 'null' => true ],
|
||||
'CreateDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP',
|
||||
'CreateDate' => ['type' => 'DATETIME', 'null' => true],
|
||||
]);
|
||||
$this->forge->addKey('OccupationID', true);
|
||||
$this->forge->createTable('occupation');
|
||||
|
||||
@ -18,11 +18,11 @@ class CreateOrdersTable extends Migration {
|
||||
'Priority' => ['type' => 'VARCHAR', 'constraint' => 50, 'null' => true],
|
||||
'TrnDate' => ['type' => 'Datetime', 'null' => true],
|
||||
'EffDate' => ['type' => 'Datetime', 'null' => true],
|
||||
'CreateDate' => ['type' => 'Datetime', 'null' => true],
|
||||
'EndDate' => ['type' => 'Datetime', 'null' => true],
|
||||
'ArchiveDate' => ['type' => 'Datetime', 'null' => true],
|
||||
'DelDate' => ['type' => 'Datetime', 'null' => true]
|
||||
]);
|
||||
$this->forge->addField('CreateDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP');
|
||||
$this->forge->addKey('InternalOID', true);
|
||||
$this->forge->addUniqueKey('OrderID');
|
||||
$this->forge->createTable('ordertest');
|
||||
@ -32,11 +32,11 @@ class CreateOrdersTable extends Migration {
|
||||
'OrderComID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true],
|
||||
'Comment' => ['type' => 'text', 'null' => true],
|
||||
'UserID' => ['type' => 'INT', 'null' => false],
|
||||
'CreateDate' => ['type' => 'Datetime', 'null' => true],
|
||||
'EndDate' => ['type' => 'Datetime', 'null' => true],
|
||||
'ArchiveDate' => ['type' => 'Datetime', 'null' => true],
|
||||
'DelDate' => ['type' => 'Datetime', 'null' => true]
|
||||
]);
|
||||
$this->forge->addField('CreateDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP');
|
||||
$this->forge->addKey('OrderComID', true);
|
||||
$this->forge->createTable('ordercom');
|
||||
|
||||
@ -45,11 +45,11 @@ class CreateOrdersTable extends Migration {
|
||||
'OrderAttID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true],
|
||||
'Address' => ['type' => 'varchar', 'constraint'=>255, 'null' => true],
|
||||
'UserID' => ['type' => 'INT', 'null' => false],
|
||||
'CreateDate' => ['type' => 'Datetime', 'null' => true],
|
||||
'EndDate' => ['type' => 'Datetime', 'null' => true],
|
||||
'ArchiveDate' => ['type' => 'Datetime', 'null' => true],
|
||||
'DelDate' => ['type' => 'Datetime', 'null' => true]
|
||||
]);
|
||||
$this->forge->addField('CreateDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP');
|
||||
$this->forge->addKey('OrderAttID', true);
|
||||
$this->forge->createTable('orderatt');
|
||||
|
||||
@ -57,11 +57,11 @@ class CreateOrdersTable extends Migration {
|
||||
'InternalOID' => ['type' => 'INT', 'null' => false],
|
||||
'OrderStatID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true],
|
||||
'OrderStatus' => ['type' => 'varchar', 'constraint'=>2, 'null' => false],
|
||||
'CreateDate' => ['type' => 'Datetime', 'null' => true],
|
||||
'EndDate' => ['type' => 'Datetime', 'null' => true],
|
||||
'ArchiveDate' => ['type' => 'Datetime', 'null' => true],
|
||||
'DelDate' => ['type' => 'Datetime', 'null' => true]
|
||||
]);
|
||||
$this->forge->addField('CreateDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP');
|
||||
$this->forge->addKey('OrderStatID', true);
|
||||
$this->forge->createTable('orderstatus');
|
||||
|
||||
|
||||
@ -15,9 +15,9 @@ class CreateValueSetTable extends Migration {
|
||||
'VValue' => ['type' => 'varchar', 'constraint' => 10],
|
||||
'VDesc' => ['type' => 'varchar', 'constraint' => 255, 'null' => true],
|
||||
'VCategory' => ['type' => 'int', 'null' => true],
|
||||
'CreateDate' => ['type' => 'Datetime', 'null' => true],
|
||||
'EndDate' => ['type' => 'DATETIME', 'null' => true]
|
||||
]);
|
||||
$this->forge->addField('CreateDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP');
|
||||
$this->forge->addKey('VID', true);
|
||||
$this->forge->createTable('valueset');
|
||||
|
||||
@ -26,9 +26,9 @@ class CreateValueSetTable extends Migration {
|
||||
'SiteID' => ['type' => 'INT', 'null' => true],
|
||||
'VSName' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => false],
|
||||
'VSDesc' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => false],
|
||||
'CreateDate' => ['type' => 'Datetime', 'null' => true],
|
||||
'EndDate' => ['type' => 'DATETIME', 'null' => true]
|
||||
]);
|
||||
$this->forge->addField('CreateDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP');
|
||||
$this->forge->addKey('VSetID', true);
|
||||
$this->forge->createTable('valuesetdef');
|
||||
}
|
||||
|
||||
@ -14,9 +14,9 @@ class CreateCounterTable extends Migration {
|
||||
'CounterEnd' => ['type' => 'INT', 'null' => false],
|
||||
'CounterDesc' => ['type' => 'varchar', 'constraint' => 255, 'null' => true],
|
||||
'CounterReset' => ['type' => 'varchar', 'constraint' => 1, 'null' => true],
|
||||
'CreateDate' => ['type' => 'Datetime', 'null' => true],
|
||||
'EndDate' => ['type' => 'DATETIME', 'null' => true]
|
||||
]);
|
||||
$this->forge->addField('CreateDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP');
|
||||
$this->forge->addKey('CounterID', true);
|
||||
$this->forge->createTable('counter');
|
||||
}
|
||||
|
||||
@ -16,7 +16,7 @@ class CreateSpecimenTable extends Migration {
|
||||
'Additive' => ['type' => 'varchar', 'constraint' => 50, 'null' => true],
|
||||
'ConClass' => ['type' => 'int', 'null' => false],
|
||||
'Color' => ['type' => 'int', 'null' => false],
|
||||
'CreateDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP',
|
||||
'CreateDate' => ['type' => 'Datetime', 'null' => true],
|
||||
'EndDate' => ['type' => 'DATETIME', 'null' => true]
|
||||
]);
|
||||
$this->forge->addKey('ConDefID', true);
|
||||
@ -34,7 +34,7 @@ class CreateSpecimenTable extends Migration {
|
||||
'Unit' => ['type' => 'varchar', 'constraint'=> 30, 'null' => true],
|
||||
'GenerateBy' => ['type' => 'int', 'null' => true],
|
||||
'SchDateTime' => ['type' => 'datetime', 'null' => true],
|
||||
'CreateDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP',
|
||||
'CreateDate' => ['type' => 'Datetime', 'null' => true],
|
||||
'EndDate' => ['type' => 'DATETIME', 'null' => true],
|
||||
'ArchiveDate' => ['type' => 'DATETIME', 'null' => true]
|
||||
]);
|
||||
@ -59,7 +59,7 @@ class CreateSpecimenTable extends Migration {
|
||||
'GeoLocationData' => ['type' => 'varchar', 'constraint'=>10, 'null' => true ],
|
||||
'DIDType' => ['type' => 'varchar', 'constraint'=>10, 'null' => true ],
|
||||
'DID' => ['type' => 'varchar', 'constraint'=>10, 'null' => true ],
|
||||
'CreateDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP',
|
||||
'CreateDate' => ['type' => 'Datetime', 'null' => true],
|
||||
'EndDate' => ['type' => 'DATETIME', 'null' => true],
|
||||
'ArchiveDate' => ['type' => 'DATETIME', 'null' => true]
|
||||
]);
|
||||
@ -76,7 +76,7 @@ class CreateSpecimenTable extends Migration {
|
||||
'FastingVolume' => ['type' => 'varchar', 'constraint'=> 2, 'null' => true],
|
||||
'ColStart' => ['type' => 'datetime', 'null' => true],
|
||||
'ColEnd' => ['type' => 'datetime', 'null' => true],
|
||||
'CreateDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP',
|
||||
'CreateDate' => ['type' => 'Datetime', 'null' => true],
|
||||
'EndDate' => ['type' => 'DATETIME', 'null' => true],
|
||||
'ArchiveDate' => ['type' => 'DATETIME', 'null' => true]
|
||||
]);
|
||||
@ -93,7 +93,7 @@ class CreateSpecimenTable extends Migration {
|
||||
'AddUnit' => ['type' => 'varchar', 'constraint'=> 15, 'null' => true],
|
||||
'PrepStart' => ['type' => 'datetime', 'null' => true],
|
||||
'PrepEnd' => ['type' => 'datetime', 'null' => true],
|
||||
'CreateDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP',
|
||||
'CreateDate' => ['type' => 'Datetime', 'null' => true],
|
||||
'EndDate' => ['type' => 'DATETIME', 'null' => true],
|
||||
'ArchiveDate' => ['type' => 'DATETIME', 'null' => true]
|
||||
]);
|
||||
@ -118,7 +118,7 @@ class CreateSpecimenTable extends Migration {
|
||||
'EventID' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||
'ActivityID' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||
'Reason' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||
'LogDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP'
|
||||
'LogDate' => ['type' => 'Datetime', 'null' => true],
|
||||
]);
|
||||
$this->forge->addKey('SpcLogID', true);
|
||||
$this->forge->createTable('specimenlog');
|
||||
|
||||
@ -11,6 +11,9 @@ class PatientModel extends Model {
|
||||
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',
|
||||
'DeathIndicator', 'DeathDateTime', 'LinkTo' ];
|
||||
protected $useTimestamps = true; // Enable automatic timestamps
|
||||
protected $createdField = 'CreateDate'; // Specify the 'created_at' field name
|
||||
protected $dateFormat = 'datetime';
|
||||
|
||||
public function getPatients($filters = []) {
|
||||
$qname = "LOWER(CONCAT_WS(' ', IFNULL(Prefix,''), IFNULL(NameFirst,''), IFNULL(NameMiddle,''), IFNULL(NameLast,''), IFNULL(NameMaiden,''), IFNULL(Suffix,'')))";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user