138 lines
6.4 KiB
PHP
138 lines
6.4 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace common\models;
|
||
|
|
|
||
|
|
use Yii;
|
||
|
|
use yii\db\ActiveRecord;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* This is the model class for table "his_request".
|
||
|
|
*
|
||
|
|
* @property int $id
|
||
|
|
* @property string|null $request_datetime
|
||
|
|
* @property string|null $encoding_characters
|
||
|
|
* @property string|null $sending_application
|
||
|
|
* @property string|null $sending_facility
|
||
|
|
* @property string|null $receiving_application
|
||
|
|
* @property string|null $receiving_facility
|
||
|
|
* @property string|null $date_time_of_message
|
||
|
|
* @property string|null $message_type
|
||
|
|
* @property string|null $message_type_code
|
||
|
|
* @property string|null $message_type_name
|
||
|
|
* @property string|null $message_control_id
|
||
|
|
* @property string|null $processing_id
|
||
|
|
* @property string|null $version_id
|
||
|
|
* @property string|null $pid_set_id
|
||
|
|
* @property string|null $patient_id_external_hn
|
||
|
|
* @property string|null $patient_id_internal_hn
|
||
|
|
* @property string|null $alternate_patient_id
|
||
|
|
* @property string|null $patient_name
|
||
|
|
* @property string|null $patient_last_name
|
||
|
|
* @property string|null $patient_first_name
|
||
|
|
* @property string|null $patient_middle
|
||
|
|
* @property string|null $patient_name_suffix
|
||
|
|
* @property string|null $patient_name_prefix
|
||
|
|
* @property string|null $date_time_of_birth
|
||
|
|
* @property string|null $sex
|
||
|
|
* @property string|null $patient_alias
|
||
|
|
* @property string|null $patient_last_name_o
|
||
|
|
* @property string|null $patient_first_name_o
|
||
|
|
* @property string|null $patient_middle_o
|
||
|
|
* @property string|null $patient_name_suffix_o
|
||
|
|
* @property string|null $patient_name_prefix_o
|
||
|
|
* @property string|null $race
|
||
|
|
* @property string|null $patient_address
|
||
|
|
* @property string|null $patient_street_address
|
||
|
|
* @property string|null $sub_district
|
||
|
|
* @property string|null $city
|
||
|
|
* @property string|null $state
|
||
|
|
* @property string|null $zip
|
||
|
|
* @property string|null $phone_number_home
|
||
|
|
* @property string|null $pv1_set_id
|
||
|
|
* @property string|null $patient_class
|
||
|
|
* @property string|null $assigned_patient_location
|
||
|
|
* @property string|null $assigned_patient_location_point_of_care
|
||
|
|
* @property string|null $assigned_patient_location_room
|
||
|
|
* @property string|null $assigned_patient_location_bed
|
||
|
|
* @property string|null $preadmit_number
|
||
|
|
* @property string|null $attending_doctor
|
||
|
|
* @property string|null $attending_id
|
||
|
|
* @property string|null $attending_last_name
|
||
|
|
* @property string|null $attending_first_name
|
||
|
|
* @property string|null $attending_middle_name
|
||
|
|
* @property string|null $attending_prefix_name
|
||
|
|
* @property string|null $hospital_service
|
||
|
|
* @property string|null $temporary_location
|
||
|
|
* @property string|null $temporary_location_code
|
||
|
|
* @property string|null $temporary_location_name
|
||
|
|
* @property string|null $admitting_doctor
|
||
|
|
* @property string|null $admitting_id
|
||
|
|
* @property string|null $admitting_last_name
|
||
|
|
* @property string|null $admitting_first_name
|
||
|
|
* @property string|null $admitting_middle_name
|
||
|
|
* @property string|null $admitting_prefix_name
|
||
|
|
* @property string|null $patient_type
|
||
|
|
* @property string|null $patient_type_code
|
||
|
|
* @property string|null $patient_type_name
|
||
|
|
* @property string|null $visit_number
|
||
|
|
* @property string|null $admit_date_time
|
||
|
|
* @property string|null $discharge_date_time
|
||
|
|
* @property string|null $order_control
|
||
|
|
* @property string|null $orc_placer_order_number
|
||
|
|
* @property string|null $orc_filler_order_number
|
||
|
|
* @property string|null $order_status
|
||
|
|
* @property string|null $date_time_of_transaction
|
||
|
|
* @property string|null $orc_ordering_provider
|
||
|
|
* @property string|null $orc_ordering_provider_id
|
||
|
|
* @property string|null $orc_ordering_provider_last_name
|
||
|
|
* @property string|null $orc_ordering_provider_first_name
|
||
|
|
* @property string|null $orc_ordering_provider_middle_name
|
||
|
|
* @property string|null $orc_ordering_provider_prefix_name
|
||
|
|
* @property string|null $order_control_code_reason
|
||
|
|
* @property string|null $entering_organization
|
||
|
|
* @property string|null $entering_device
|
||
|
|
* @property string|null $action_by
|
||
|
|
*
|
||
|
|
* @property HisObr[] $obrs
|
||
|
|
*/
|
||
|
|
class HisRequest extends ActiveRecord
|
||
|
|
{
|
||
|
|
public $type_of_specimen;
|
||
|
|
|
||
|
|
public static function tableName()
|
||
|
|
{
|
||
|
|
return 'his_request';
|
||
|
|
}
|
||
|
|
|
||
|
|
public function rules()
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
[['id_case', 'request_datetime', 'date_time_of_message', 'date_time_of_birth', 'admit_date_time', 'discharge_date_time', 'date_time_of_transaction', 'type_of_specimen', 'pid_set_id', 'pv1_set_id'], 'safe'],
|
||
|
|
//[['id_case'], 'string', 'max' => 13],
|
||
|
|
[['import_by'], 'integer'],
|
||
|
|
[['message_control_id'], 'string', 'max' => 64],
|
||
|
|
[['patient_id_internal_hn', 'visit_number', 'orc_placer_order_number', 'orc_filler_order_number'], 'string', 'max' => 64],
|
||
|
|
[['encoding_characters', 'sending_application', 'sending_facility', 'receiving_application', 'receiving_facility', 'message_type', 'message_type_code', 'message_type_name', 'processing_id', 'version_id', 'sex', 'race', 'patient_class', 'preadmit_number', 'attending_doctor', 'attending_id', 'hospital_service', 'temporary_location', 'temporary_location_code', 'temporary_location_name', 'admitting_doctor', 'admitting_id', 'patient_type', 'patient_type_code', 'patient_type_name', 'order_control', 'order_status', 'orc_ordering_provider', 'orc_ordering_provider_id', 'order_control_code_reason', 'entering_organization', 'entering_device', 'action_by'], 'string', 'max' => 255],
|
||
|
|
[['patient_name', 'patient_last_name', 'patient_first_name', 'patient_middle', 'patient_name_suffix', 'patient_name_prefix', 'patient_alias', 'patient_last_name_o', 'patient_first_name_o', 'patient_middle_o', 'patient_name_suffix_o', 'patient_name_prefix_o', 'patient_address', 'patient_street_address', 'sub_district', 'city', 'state', 'zip', 'phone_number_home', 'attending_last_name', 'attending_first_name', 'attending_middle_name', 'attending_prefix_name', 'admitting_last_name', 'admitting_first_name', 'admitting_middle_name', 'admitting_prefix_name', 'orc_ordering_provider_last_name', 'orc_ordering_provider_first_name', 'orc_ordering_provider_middle_name', 'orc_ordering_provider_prefix_name'], 'string', 'max' => 255],
|
||
|
|
[['alternate_patient_id'], 'string', 'max' => 50],
|
||
|
|
[['message_control_id'], 'unique'],
|
||
|
|
];
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* {@inheritdoc}
|
||
|
|
*/
|
||
|
|
public function attributeLabels()
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
'request_datetime' => 'Request At',
|
||
|
|
'patient_id_internal_hn' => 'HN',
|
||
|
|
];
|
||
|
|
}
|
||
|
|
|
||
|
|
public function getObrs()
|
||
|
|
{
|
||
|
|
return $this->hasMany(HisObr::class, ['his_request_id' => 'id']);
|
||
|
|
}
|
||
|
|
}
|