From 714023765907fe1e7c7c1841023e10063631d8a7 Mon Sep 17 00:00:00 2001 From: liqi Date: Sat, 21 Dec 2024 16:35:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A7=E5=93=81=E6=9C=8D=E5=8A=A1=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/models/oldDb/PrescriptionServer.php | 81 +++++++++++++++++ common/models/oldDb/ServicePackageRepice.php | 43 +++++++++ common/modelsgii/oldDb/PrescriptionServer.php | 91 +++++++++++++++++++ .../modelsgii/oldDb/ServicePackageRecipe.php | 50 ++++++++++ 4 files changed, 265 insertions(+) create mode 100644 common/models/oldDb/PrescriptionServer.php create mode 100644 common/models/oldDb/ServicePackageRepice.php create mode 100644 common/modelsgii/oldDb/PrescriptionServer.php create mode 100644 common/modelsgii/oldDb/ServicePackageRecipe.php diff --git a/common/models/oldDb/PrescriptionServer.php b/common/models/oldDb/PrescriptionServer.php new file mode 100644 index 0000000..3b074ef --- /dev/null +++ b/common/models/oldDb/PrescriptionServer.php @@ -0,0 +1,81 @@ + 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']); + } + +} diff --git a/common/models/oldDb/ServicePackageRepice.php b/common/models/oldDb/ServicePackageRepice.php new file mode 100644 index 0000000..c77f9ab --- /dev/null +++ b/common/models/oldDb/ServicePackageRepice.php @@ -0,0 +1,43 @@ + 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']); + } +} \ No newline at end of file diff --git a/common/modelsgii/oldDb/PrescriptionServer.php b/common/modelsgii/oldDb/PrescriptionServer.php new file mode 100644 index 0000000..0c77b25 --- /dev/null +++ b/common/modelsgii/oldDb/PrescriptionServer.php @@ -0,0 +1,91 @@ + 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', + ]; + } +} diff --git a/common/modelsgii/oldDb/ServicePackageRecipe.php b/common/modelsgii/oldDb/ServicePackageRecipe.php new file mode 100644 index 0000000..f52ce75 --- /dev/null +++ b/common/modelsgii/oldDb/ServicePackageRecipe.php @@ -0,0 +1,50 @@ + 'ID', + 'content' => 'Content', + 'number' => '药品数量', + 'wu_id' => '单位 ID', + 'created_at' => 'Created At', + 'updated_at' => 'Updated At', + ]; + } +}