<?php

namespace common\models;

use Yii;

/**
 * This is the model class for view "lis_api_d".
 *
 * @property int $RiaHDocID
 * @property string $RiaHDocDate
 * @property string $LabID
 * @property string $LabName
 * @property string $RiaLDRsltAnal
 * @property string|null $LabNormal1
 * @property string|null $LabUnit
 * @property string|null $PatName
 * @property string|null $PatAge
 * @property string|null $PatHN
 * @property string|null $CustID
 * @property string|null $CustTitle
 * @property string|null $CustName
 * @property string|null $RiaLDUserNameReEntry
 * @property string|null $RiaLDUserDateReEntry
 * @property string|null $RiaLDUserNameAppr
 * @property string|null $RiaLDUserDateAppr
 * @property string|null $RiaLDApprvFlag
 * @property string|null $RiaLDUserNameEntry
 * @property string|null $RiaLDUserDateEntry
 */
class LisApiD extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'lis_api_d'; // ชื่อ view
    }

    public static function getDb()
    {
        return Yii::$app->get('prolab');
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['RiaHDocID', 'LabID', 'LabName', 'RiaLDRsltAnal'], 'required'],
            [['RiaHDocID'], 'integer'],
            [['RiaHDocDate', 'RiaLDUserDateReEntry', 'RiaLDUserDateAppr', 'RiaLDUserDateEntry'], 'safe'],
            [['LabID'], 'string', 'max' => 50],
            [['LabName', 'RiaLDRsltAnal', 'LabNormal1', 'LabUnit', 'PatName', 'PatAge', 'PatHN', 'CustID', 'CustTitle', 'CustName', 'RiaLDUserNameReEntry', 'RiaLDUserNameAppr', 'RiaLDApprvFlag', 'RiaLDUserNameEntry'], 'string', 'max' => 255],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'RiaHDocID' => 'Doc ID',
            'RiaHDocDate' => 'Doc Date',
            'LabID' => 'Lab ID',
            'LabName' => 'Lab Name',
            'RiaLDRsltAnal' => 'Result',
            'LabNormal1' => 'Normal Range',
            'LabUnit' => 'Unit',
            'PatName' => 'Patient Name',
            'PatAge' => 'Patient Age',
            'PatHN' => 'HN',
            'CustID' => 'Customer ID',
            'CustTitle' => 'Customer Title',
            'CustName' => 'Customer Name',
            'RiaLDUserNameReEntry' => 'Re-Entry User',
            'RiaLDUserDateReEntry' => 'Re-Entry Date',
            'RiaLDUserNameAppr' => 'Approved User',
            'RiaLDUserDateAppr' => 'Approved Date',
            'RiaLDApprvFlag' => 'Approval Flag',
            'RiaLDUserNameEntry' => 'Entry User',
            'RiaLDUserDateEntry' => 'Entry Date',
        ];
    }
}
