prolab-api/common/models/HisObr.php

70 lines
2.7 KiB
PHP

<?php
namespace common\models;
use Yii;
use yii\db\ActiveRecord;
/**
* This is the model class for table "his_obr".
*
* @property int $id
* @property int $his_request_id
* @property string|null $obr_set_id
* @property string|null $obr_placer_order_number
* @property string|null $obr_filler_order_number
* @property string|null $universal_service
* @property string|null $universal_service_id
* @property string|null $universal_service_text
* @property string|null $universal_service_name_of_coding_system
* @property string|null $universal_service_alternate_id
* @property string|null $universal_service_alternate_text
* @property string|null $name_of_alternate_coding_system
* @property string|null $priority
* @property string|null $requested_date_time
* @property string|null $relevant_clinical_info
* @property string|null $specimen_source
* @property string|null $specimen_source_code
* @property string|null $specimen_source_name
* @property string|null $obr_ordering_provider_id
* @property string|null $obr_ordering_provider_last_name
* @property string|null $obr_ordering_provider_first_name
* @property string|null $obr_ordering_provider_middle_name
* @property string|null $obr_ordering_provider_prefix_name
* @property string|null $placer_field_1
* @property string|null $ward_code_name
* @property string|null $charge_to_practice
*
* @property HisRequest $request
* @property HisObx[] $obxs
*/
class HisObr extends ActiveRecord
{
public static function tableName()
{
return 'his_obr';
}
public function rules()
{
return [
[['his_request_id'], 'required'],
[['his_request_id'], 'integer'],
[['requested_date_time'], 'safe'],
[['obr_set_id', 'obr_placer_order_number', 'obr_filler_order_number', 'universal_service_id', 'priority', 'obr_ordering_provider_id'], 'string', 'max' => 64],
[['universal_service', 'universal_service_text', 'universal_service_name_of_coding_system', 'universal_service_alternate_id', 'universal_service_alternate_text', 'name_of_alternate_coding_system', 'relevant_clinical_info', 'specimen_source', 'specimen_source_code', 'specimen_source_name', 'obr_ordering_provider_last_name', 'obr_ordering_provider_first_name', 'obr_ordering_provider_middle_name', 'obr_ordering_provider_prefix_name', 'placer_field_1', 'ward_code_name', 'charge_to_practice'], 'string', 'max' => 255],
[['his_request_id'], 'exist', 'skipOnError' => true, 'targetClass' => HisRequest::class, 'targetAttribute' => ['his_request_id' => 'id']],
];
}
public function getRequest()
{
return $this->hasOne(HisRequest::class, ['id' => 'his_request_id']);
}
public function getObxs()
{
return $this->hasMany(HisObx::class, ['his_obr_id' => 'id']);
}
}