clqms-be/app/Models/RefRange/RefNumModel.php

50 lines
959 B
PHP
Raw Normal View History

2025-10-24 16:41:31 +07:00
<?php
namespace App\Models\RefRange;
use App\Models\BaseModel;
class RefNumModel extends BaseModel
{
2025-10-24 16:41:31 +07:00
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'
];
2025-10-24 16:41:31 +07:00
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();
}
}