<?php

namespace console\models;

use Yii;

/**
 * This is the model class for table "RIALABH".
 *
 * @property string $RiaHDocDate
 * @property string $RiaHDocID
 * @property string|null $PatName
 * @property float|null $PatAge
 * @property string|null $PatHN
 * @property string|null $PatWard
 * @property string|null $CustID
 * @property string|null $CustTitle
 * @property string|null $CustName
 * @property string|null $CustFax
 * @property int|null $RiaHPaySts
 * @property float|null $RiaHCrDay
 * @property string|null $RiaHReqBy
 * @property string|null $RiaHRemark
 * @property string|null $CsHDocID
 * @property float|null $RiaHSUPrice
 * @property int $RiaLHGRFlag
 * @property int $RiaLHPrintFlag
 * @property int $RiaLHSelectFlag
 * @property int $RiaLHReEntryFlag
 * @property int $RiaLHReEntryAllFlag
 * @property int $RiaLHApprvAllFlag
 * @property string|null $RiaLHFinDate
 * @property string|null $RiaLHFinType
 * @property string|null $RiaLHFinSts
 * @property string|null $RiaLDUserIDReEntry
 * @property string|null $RiaLDUserNameReEntry
 * @property string|null $RiaLDUserDateReEntry
 * @property string|null $RiaLDUserIDAppr
 * @property string|null $RiaLDUserNameAppr
 * @property string|null $RiaLDUserDateAppr
 * @property int $RiaLHApprvFlag
 * @property int $RiaLHNoResultFlag
 * @property int $RiaLHPrintHeadFlag
 * @property int $RiaLHPrintSecretFlag
 * @property int|null $CustLabQty
 * @property int $RiaLHPrintH15Flag
 * @property int $RiaLHPrintH16Flag
 * @property int $RiaLHPrintH18Flag
 * @property int $RiaLHReNoApprvFlag
 * @property int $RiaLHPreExpFlag
 * @property int $RiaLHExpFlag
 * @property string|null $PatAgeType
 * @property string|null $PatAgeDesc
 * @property string|null $RiaLHLabRsltSm
 * @property int $RiaLHResultFlag
 * @property int|null $RiaHRepType
 * @property int|null $RiaLHSelectPrnFlag
 * @property string|null $Sex
 * @property int|null $RiaHOnlineFlag
 * @property int|null $RiaHMsightFlag
 * @property string|null $MLABLabNo
 * @property string|null $AttachResult
 * @property string|null $RiaHReadFlag
 */
class RIALABH extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'RIALABH';
    }

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

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['RiaHDocDate', 'RiaHDocID'], 'required'],
            [['RiaHDocDate', 'RiaLHFinDate', 'RiaLDUserDateReEntry', 'RiaLDUserDateAppr'], 'safe'],
            [['PatAge', 'RiaHCrDay', 'RiaHSUPrice'], 'number'],
            [['RiaHPaySts', 'RiaLHGRFlag', 'RiaLHPrintFlag', 'RiaLHSelectFlag', 'RiaLHReEntryFlag', 'RiaLHReEntryAllFlag', 'RiaLHApprvAllFlag', 'RiaLHApprvFlag', 'RiaLHNoResultFlag', 'RiaLHPrintHeadFlag', 'RiaLHPrintSecretFlag', 'CustLabQty', 'RiaLHPrintH15Flag', 'RiaLHPrintH16Flag', 'RiaLHPrintH18Flag', 'RiaLHReNoApprvFlag', 'RiaLHPreExpFlag', 'RiaLHExpFlag', 'RiaLHResultFlag', 'RiaHRepType', 'RiaLHSelectPrnFlag', 'RiaHOnlineFlag', 'RiaHMsightFlag'], 'integer'],
            [['RiaHDocID', 'PatHN', 'CsHDocID', 'RiaLDUserIDReEntry', 'RiaLDUserIDAppr', 'PatAgeDesc', 'MLABLabNo'], 'string', 'max' => 20],
            [['PatName', 'CustName', 'CustFax', 'RiaHReqBy'], 'string', 'max' => 100],
            [['PatWard', 'CustTitle', 'RiaLDUserNameReEntry', 'RiaLDUserNameAppr'], 'string', 'max' => 50],
            [['CustID'], 'string', 'max' => 4],
            [['RiaHRemark'], 'string', 'max' => 150],
            [['RiaLHFinType', 'RiaLHFinSts', 'PatAgeType', 'Sex', 'RiaHReadFlag'], 'string', 'max' => 1],
            [['RiaLHLabRsltSm'], 'string', 'max' => 255],
            [['AttachResult'], 'string', 'max' => 200],
            [['RiaHDocDate', 'RiaHDocID'], 'unique', 'targetAttribute' => ['RiaHDocDate', 'RiaHDocID']],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'RiaHDocDate' => 'Ria H Doc Date',
            'RiaHDocID' => 'Ria H Doc ID',
            'PatName' => 'Pat Name',
            'PatAge' => 'Pat Age',
            'PatHN' => 'Pat Hn',
            'PatWard' => 'Pat Ward',
            'CustID' => 'Cust ID',
            'CustTitle' => 'Cust Title',
            'CustName' => 'Cust Name',
            'CustFax' => 'Cust Fax',
            'RiaHPaySts' => 'Ria H Pay Sts',
            'RiaHCrDay' => 'Ria H Cr Day',
            'RiaHReqBy' => 'Ria H Req By',
            'RiaHRemark' => 'Ria H Remark',
            'CsHDocID' => 'Cs H Doc ID',
            'RiaHSUPrice' => 'Ria Hsu Price',
            'RiaLHGRFlag' => 'Ria Lhgr Flag',
            'RiaLHPrintFlag' => 'Ria Lh Print Flag',
            'RiaLHSelectFlag' => 'Ria Lh Select Flag',
            'RiaLHReEntryFlag' => 'Ria Lh Re Entry Flag',
            'RiaLHReEntryAllFlag' => 'Ria Lh Re Entry All Flag',
            'RiaLHApprvAllFlag' => 'Ria Lh Apprv All Flag',
            'RiaLHFinDate' => 'Ria Lh Fin Date',
            'RiaLHFinType' => 'Ria Lh Fin Type',
            'RiaLHFinSts' => 'Ria Lh Fin Sts',
            'RiaLDUserIDReEntry' => 'Ria Ld User Id Re Entry',
            'RiaLDUserNameReEntry' => 'Ria Ld User Name Re Entry',
            'RiaLDUserDateReEntry' => 'Ria Ld User Date Re Entry',
            'RiaLDUserIDAppr' => 'Ria Ld User Id Appr',
            'RiaLDUserNameAppr' => 'Ria Ld User Name Appr',
            'RiaLDUserDateAppr' => 'Ria Ld User Date Appr',
            'RiaLHApprvFlag' => 'Ria Lh Apprv Flag',
            'RiaLHNoResultFlag' => 'Ria Lh No Result Flag',
            'RiaLHPrintHeadFlag' => 'Ria Lh Print Head Flag',
            'RiaLHPrintSecretFlag' => 'Ria Lh Print Secret Flag',
            'CustLabQty' => 'Cust Lab Qty',
            'RiaLHPrintH15Flag' => 'Ria Lh Print H15flag',
            'RiaLHPrintH16Flag' => 'Ria Lh Print H16flag',
            'RiaLHPrintH18Flag' => 'Ria Lh Print H18flag',
            'RiaLHReNoApprvFlag' => 'Ria Lh Re No Apprv Flag',
            'RiaLHPreExpFlag' => 'Ria Lh Pre Exp Flag',
            'RiaLHExpFlag' => 'Ria Lh Exp Flag',
            'PatAgeType' => 'Pat Age Type',
            'PatAgeDesc' => 'Pat Age Desc',
            'RiaLHLabRsltSm' => 'Ria Lh Lab Rslt Sm',
            'RiaLHResultFlag' => 'Ria Lh Result Flag',
            'RiaHRepType' => 'Ria H Rep Type',
            'RiaLHSelectPrnFlag' => 'Ria Lh Select Prn Flag',
            'Sex' => 'Sex',
            'RiaHOnlineFlag' => 'Ria H Online Flag',
            'RiaHMsightFlag' => 'Ria H Msight Flag',
            'MLABLabNo' => 'Mlab Lab No',
            'AttachResult' => 'Attach Result',
            'RiaHReadFlag' => 'Ria H Read Flag',
        ];
    }
}
