<?php

namespace console\models;

use Yii;

/**
 * This is the model class for table "his_request".
 *
 * @property int $ID
 * @property string $LabNo
 * @property string $HN
 * @property string|null $AN
 * @property string|null $VN
 * @property string $PrefixName
 * @property string $FirstName
 * @property string $LastName
 * @property string $DateOfBirth
 * @property string|null $PersonalID
 * @property string|null $PassportNo
 * @property string|null $Phone
 * @property string|null $Address
 * @property string|null $SubDistrict
 * @property string|null $District
 * @property string|null $ProvinceCode
 * @property string|null $ProvinceName
 * @property string|null $PostalCode
 * @property string $Sex
 * @property int|null $Weight
 * @property int|null $Height
 * @property string|null $VisitType
 * @property string $RequestUnit
 * @property string $RequestUnitName
 * @property string|null $ReceiveLocation
 * @property string|null $Room
 * @property string $Priority
 * @property string|null $RightsCode
 * @property string|null $RightsName
 * @property string|null $DepartmentCode
 * @property string|null $DepartmentName
 * @property string|null $WardCode
 * @property string|null $WardName
 * @property string|null $AdmissionDate
 * @property string|null $DoctorCode
 * @property string|null $DoctorName
 * @property string|null $RequestRemark
 * @property string $RequestDate
 * @property string $RequestByCode
 * @property string $RequestBy
 * @property string $RequestStatus
 * @property int $Status
 * @property string $Message
 */
class HisRequest extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'his_request';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['LabNo', 'HN', 'PrefixName', 'FirstName', 'LastName', 'DateOfBirth'], 'required'],
            //[['DateOfBirth'], 'safe'],
            [['Weight', 'Height'], 'number'],
            [['Status', 'UserID'], 'integer'],
            [['LabNo', 'HN', 'PersonalID', 'PassportNo', 'AdmissionDate', 'RequestDate', 'CustomerCode'], 'string', 'max' => 20],
            [['AN', 'VN', 'Phone', 'ProvinceName', 'Room', 'RightsCode', 'DepartmentCode', 'WardCode', 'RequestByCode', 'DateOfBirth'], 'string', 'max' => 50],
            [['PrefixName', 'FirstName', 'LastName', 'Address', 'SubDistrict', 'District', 'VisitType', 'RequestUnitName', 'Priority', 'RightsName', 'DepartmentName', 'WardName', 'DoctorCode', 'DoctorName', 'RequestBy'], 'string', 'max' => 120],
            [['ProvinceCode'], 'string', 'max' => 2],
            [['PostalCode'], 'string', 'max' => 5],
            [['Sex', 'RequestStatus'], 'string', 'max' => 1],
            [['RequestUnit', 'ReceiveLocation'], 'string', 'max' => 10],
            [['RequestRemark'], 'string', 'max' => 4000],
            [['Message'], 'string', 'max' => 250],
            [['ProlabMessage'], 'string', 'max' => 500],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'ID' => 'ID',
            'LabNo' => 'Lab No',
            'HN' => 'Hn',
            'AN' => 'An',
            'VN' => 'Vn',
            'PrefixName' => 'Prefix Name',
            'FirstName' => 'First Name',
            'LastName' => 'Last Name',
            'DateOfBirth' => 'Date Of Birth',
            'PersonalID' => 'Personal ID',
            'PassportNo' => 'Passport No',
            'Phone' => 'Phone',
            'Address' => 'Address',
            'SubDistrict' => 'Sub District',
            'District' => 'District',
            'ProvinceCode' => 'Province Code',
            'ProvinceName' => 'Province Name',
            'PostalCode' => 'Postal Code',
            'Sex' => 'Sex',
            'Weight' => 'Weight',
            'Height' => 'Height',
            'VisitType' => 'Visit Type',
            'RequestUnit' => 'Request Unit',
            'RequestUnitName' => 'Request Unit Name',
            'ReceiveLocation' => 'Receive Location',
            'Room' => 'Room',
            'Priority' => 'Priority',
            'RightsCode' => 'Rights Code',
            'RightsName' => 'Rights Name',
            'DepartmentCode' => 'Department Code',
            'DepartmentName' => 'Department Name',
            'WardCode' => 'Ward Code',
            'WardName' => 'Ward Name',
            'AdmissionDate' => 'Admission Date',
            'DoctorCode' => 'Doctor Code',
            'DoctorName' => 'Doctor Name',
            'RequestRemark' => 'Request Remark',
            'RequestDate' => 'Request Date',
            'RequestByCode' => 'Request By Code',
            'RequestBy' => 'Request By',
            'RequestStatus' => 'Request Status',
            'Status' => 'Status',
            'Message' => 'Message',
            'ProlabMessage' => 'Prolab Message',
        ];
    }
}
