32 lines
983 B
PHP
32 lines
983 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use CodeIgniter\Model;
|
|
|
|
class PatVisitModel extends Model {
|
|
protected $table = 'patvisit';
|
|
protected $primaryKey = 'InternalPVID';
|
|
protected $allowedFields = ['PVID', 'InternalPID', 'EpisodeID', 'EndDate'];
|
|
|
|
protected $useTimestamps = true;
|
|
protected $dateFormat = 'datetime';
|
|
protected $createdField = 'CreateDate';
|
|
protected $deletedField = 'EndDate';
|
|
|
|
public function show($PVID) {
|
|
$rows = $this->join('patdiag pd', 'pd.InternalPVID=patvisit.InternalPVID', 'left')
|
|
->join('patvisitadt pva', 'pva.InternalPVID=patvisit.InternalPVID', 'left')
|
|
->where('patvisit.PVID',$PVID)->get()->getResultArray();
|
|
return $rows;
|
|
}
|
|
|
|
public function showByPatient($InternalPID) {
|
|
$rows = $this->join('patdiag pd', 'pd.InternalPVID=patvisit.InternalPVID', 'left')
|
|
->join('patvisitadt pva', 'pd.InternalPVID=pva.InternalPVID', 'left')
|
|
->where('patvisit.InternalPID',$InternalPID)->get()->getResultArray();
|
|
return $rows;
|
|
}
|
|
|
|
}
|