50 lines
959 B
PHP
50 lines
959 B
PHP
<?php
|
|
|
|
namespace App\Models\RefRange;
|
|
|
|
use App\Models\BaseModel;
|
|
|
|
class RefNumModel extends BaseModel
|
|
{
|
|
protected $table = 'refnum';
|
|
protected $primaryKey = 'RefNumID';
|
|
protected $allowedFields = [
|
|
'SiteID',
|
|
'TestSiteID',
|
|
'SpcType',
|
|
'Sex',
|
|
'Criteria',
|
|
'AgeStart',
|
|
'AgeEnd',
|
|
'NumRefType',
|
|
'RangeType',
|
|
'LowSign',
|
|
'Low',
|
|
'HighSign',
|
|
'High',
|
|
'Display',
|
|
'Flag',
|
|
'Interpretation',
|
|
'Notes',
|
|
'CreateDate',
|
|
'StartDate',
|
|
'EndDate'
|
|
];
|
|
|
|
protected $useTimestamps = true;
|
|
protected $createdField = 'CreateDate';
|
|
protected $updatedField = '';
|
|
protected $useSoftDeletes = true;
|
|
protected $deletedField = "EndDate";
|
|
|
|
/**
|
|
* Get active numeric reference ranges for a test
|
|
*/
|
|
public function getActiveByTestSiteID($testSiteID) {
|
|
return $this->where('TestSiteID', $testSiteID)
|
|
->where('EndDate', null)
|
|
->orderBy('Display', 'ASC')
|
|
->findAll();
|
|
}
|
|
}
|