产品服务包
This commit is contained in:
81
common/models/oldDb/PrescriptionServer.php
Normal file
81
common/models/oldDb/PrescriptionServer.php
Normal file
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
|
||||
namespace common\models\oldDb;
|
||||
|
||||
use yii\behaviors\TimestampBehavior;
|
||||
use yii\db\ActiveRecord;
|
||||
|
||||
class PrescriptionServer extends \common\modelsgii\oldDb\PrescriptionServer
|
||||
{
|
||||
|
||||
public function behaviors()
|
||||
{
|
||||
return [
|
||||
[
|
||||
'class' => TimestampBehavior::class,
|
||||
'attributes' => [
|
||||
ActiveRecord::EVENT_BEFORE_INSERT => ['created_at', 'updated_at'],
|
||||
ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at'],
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
public function getPrescription(){
|
||||
return $this->hasOne(Prescription::class,['prescription_no'=>'prescription_no']);
|
||||
}
|
||||
public function getWestes(){
|
||||
return $this->hasOne(Drug::class,['id'=>'usage_dosage']);
|
||||
}
|
||||
public function getPrices(){
|
||||
|
||||
return $this->hasMany(Drug::class,['id'=>'drug_id']);
|
||||
}
|
||||
|
||||
public function getUsetime(){
|
||||
return $this->hasMany(DrugUseTime::class,['id'=>'time_id']);
|
||||
}
|
||||
public function getTypes(){
|
||||
|
||||
return $this->hasMany(DrugUseType::class,['id'=>'type_id']);
|
||||
}
|
||||
|
||||
public function getFrequency(){
|
||||
|
||||
return $this->hasMany(DrugUseFrequency::class,['id'=>'f_id']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户
|
||||
*/
|
||||
public function getPatient(){
|
||||
return $this->hasMany(UserPatient::class,['id'=>'up_id']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 科室
|
||||
*/
|
||||
public function getDepart(){
|
||||
return $this->hasMany(DoctorInfo::class,['id'=>'su_id']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 医生
|
||||
*/
|
||||
public function getDoctor(){
|
||||
return $this->hasOne(DoctorInfo::class,['su_id'=>'su_id']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 就诊人
|
||||
*/
|
||||
public function getPatients(){
|
||||
return $this->hasOne(UserPatient::class,['id'=>'up_id']);
|
||||
}
|
||||
|
||||
|
||||
public function getPharmacistInfo(){
|
||||
return $this->hasOne(PharmacistrInfo::class,['su_id'=>'pharmacist_id']);
|
||||
}
|
||||
|
||||
}
|
||||
43
common/models/oldDb/ServicePackageRepice.php
Normal file
43
common/models/oldDb/ServicePackageRepice.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace common\models\oldDb;
|
||||
|
||||
use common\modelsgii\oldDb\ServicePackageRecipe;
|
||||
use yii\behaviors\TimestampBehavior;
|
||||
use yii\db\ActiveRecord;
|
||||
|
||||
class ServicePackageRepice extends ServicePackageRecipe
|
||||
{
|
||||
|
||||
public function behaviors()
|
||||
{
|
||||
return [
|
||||
[
|
||||
'class' => TimestampBehavior::class,
|
||||
'attributes' => [
|
||||
ActiveRecord::EVENT_BEFORE_INSERT => ['created_at','updated_at'],
|
||||
ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at'],
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
public function getUsetime(){
|
||||
return $this->hasOne(DrugUseTime::class,['id'=>'time_id']);
|
||||
}
|
||||
|
||||
|
||||
public function getWestUnit(){
|
||||
return $this->hasOne(WestUnit::class,['id'=>'wu_id']);
|
||||
}
|
||||
|
||||
public function getUsetype(){
|
||||
|
||||
return $this->hasOne(DrugUseType::class,['id'=>'type_id']);
|
||||
}
|
||||
|
||||
public function getFrequency(){
|
||||
|
||||
return $this->hasOne(DrugUseFrequency::class,['id'=>'f_id']);
|
||||
}
|
||||
}
|
||||
91
common/modelsgii/oldDb/PrescriptionServer.php
Normal file
91
common/modelsgii/oldDb/PrescriptionServer.php
Normal file
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
|
||||
namespace common\modelsgii\oldDb;
|
||||
|
||||
/**
|
||||
* This is the model class for table "yii_prescription_granular".
|
||||
*
|
||||
* @property int $id
|
||||
* @property string|null $name 保存为常用处方时的名字
|
||||
* @property int $su_id
|
||||
* @property string $prescription_no 处方编号
|
||||
* @property string $content
|
||||
* @property string $clinical_diagnose 临床诊断
|
||||
* @property int $user_id 用户id
|
||||
* @property int $up_id 就诊人id
|
||||
* @property int $store_id 门店id
|
||||
* @property int $status 状态 7已初审,0待审核,1已通过,2未通过,3待使用,4已使用,5未使用,6已失效
|
||||
* @property int $category 类别 1自费2医保
|
||||
* @property string $doctor_order 医嘱
|
||||
* @property string|null $doctor_sign
|
||||
* @property int|null $pharmacist_id
|
||||
* @property string|null $pharmacist_sign
|
||||
* @property int|null $pharmacist_view_time
|
||||
* @property int|null $first_view 初审药师id
|
||||
* @property int|null $first_time 初审时间
|
||||
* @property int|null $again_view 复审药师id
|
||||
* @property int|null $again_time 复审时间
|
||||
* @property int $type 类型 1普通方 2常用方
|
||||
* @property string $gr_ids 药方ids
|
||||
* @property int $created_at 开具时间
|
||||
* @property int $updated_at
|
||||
*/
|
||||
class PrescriptionServer extends \common\core\BaseActiveRecord
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function tableName()
|
||||
{
|
||||
return 'yii_prescription_server';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['store_id', 'su_id', 'up_id', 'prescription_no'], 'required'],
|
||||
[['store_id', 'su_id', 'user_id', 'up_id', 'status', 'category', 'pharmacist_id', 'pharmacist_view_time', 'first_view', 'first_time', 'again_view', 'again_time', 'type', 'created_at', 'updated_at'], 'integer'],
|
||||
[['content', 'doctor_sign', 'pharmacist_sign'], 'string'],
|
||||
[['name', 'prescription_no', 'wr_ids'], 'string', 'max' => 50],
|
||||
[['doctor_order'], 'string', 'max' => 200],
|
||||
[['clinical_diagnose'], 'string', 'max' => 100],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function attributeLabels()
|
||||
{
|
||||
return [
|
||||
'id' => 'ID',
|
||||
'name' => 'Name',
|
||||
'store_id' => 'Store ID',
|
||||
'su_id' => 'Su ID',
|
||||
'user_id' => 'User ID',
|
||||
'up_id' => 'Up ID',
|
||||
'doctor_order' => 'Doctor Order',
|
||||
'prescription_no' => 'Prescription No',
|
||||
'content' => 'Content',
|
||||
'clinical_diagnose' => 'Clinical Diagnose',
|
||||
'status' => 'Status',
|
||||
'category' => 'Category',
|
||||
'doctor_sign' => 'Doctor Sign',
|
||||
'pharmacist_sign' => 'Pharmacist Sign',
|
||||
'pharmacist_id' => 'Pharmacist ID',
|
||||
'pharmacist_view_time' => 'Pharmacist View Time',
|
||||
'first_view' => 'First View',
|
||||
'first_time' => 'First Time',
|
||||
'again_view' => 'Again View',
|
||||
'again_time' => 'Again Time',
|
||||
'wr_ids' => 'Wr Ids',
|
||||
'type' => 'Type',
|
||||
'created_at' => 'Created At',
|
||||
'updated_at' => 'Updated At',
|
||||
];
|
||||
}
|
||||
}
|
||||
50
common/modelsgii/oldDb/ServicePackageRecipe.php
Normal file
50
common/modelsgii/oldDb/ServicePackageRecipe.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace common\modelsgii\oldDb;
|
||||
|
||||
/**
|
||||
* This is the model class for table "yii_west_recipe".
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $content
|
||||
* @property int $number 药品数量
|
||||
* @property string|null $instruction 说明书
|
||||
* @property int $created_at
|
||||
* @property int $updated_at
|
||||
*/
|
||||
class ServicePackageRecipe extends \common\core\BaseActiveRecord
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function tableName()
|
||||
{
|
||||
return 'yii_server_recipe';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['content', 'number','grain_number', 'available_days'], 'required'],
|
||||
[['number', 'grain_number', 'available_days', 'created_at', 'updated_at'], 'integer'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function attributeLabels()
|
||||
{
|
||||
return [
|
||||
'id' => 'ID',
|
||||
'content' => 'Content',
|
||||
'number' => '药品数量',
|
||||
'wu_id' => '单位 ID',
|
||||
'created_at' => 'Created At',
|
||||
'updated_at' => 'Updated At',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user