Commit 0db1ca14 by lujunyi

处方添加

parent b066c9e4
...@@ -3,6 +3,13 @@ ...@@ -3,6 +3,13 @@
namespace App\Admin\Controllers; namespace App\Admin\Controllers;
use App\Admin\Repositories\PrescriptionRepository; use App\Admin\Repositories\PrescriptionRepository;
use App\Models\DiagnosiModel;
use App\Models\DoctorModel;
use App\Models\InquiryModel;
use App\Models\PatientModel;
use App\Models\PharmacyDrugModel;
use App\Models\PharmacyModel;
use App\Models\PrescriptionModel;
use Dcat\Admin\Form; use Dcat\Admin\Form;
use Dcat\Admin\Grid; use Dcat\Admin\Grid;
use Dcat\Admin\Http\Controllers\AdminController; use Dcat\Admin\Http\Controllers\AdminController;
...@@ -109,25 +116,19 @@ protected function form() ...@@ -109,25 +116,19 @@ protected function form()
{ {
return Form::make(new PrescriptionRepository(), function (Form $form) { return Form::make(new PrescriptionRepository(), function (Form $form) {
$form->display('id')->width(4); $form->display('id')->width(4);
$form->text('status'); $form->radio('status')->options(PrescriptionModel::PRESCRIPTION_STATUS_MAP);
$form->text('patient_name')->width(4); $form->select('patient_id')->options(PatientModel::all()->pluck('name', 'id'))->width(4);
$form->text('patient_age')->width(4); $form->select('diagnosis_id')->options(DiagnosiModel::all()->pluck('name', 'id'))->width(4);
$form->text('patient_gender')->width(4); $form->select('doctor_id')->options(DoctorModel::all()->pluck('name', 'id'))->width(4);
$form->text('diagnosis_id')->width(4); $form->select('pharmacy_id')->options(PharmacyModel::all()->pluck('name', 'id'))->width(4);
$form->text('diagnosis_name')->width(4); $form->select('pharmacist_id')->options(DoctorModel::all()->pluck('name', 'id'))->width(4);
$form->text('inquiry_info')->width(4); $form->multipleSelect('inquiry_info')->options(InquiryModel::all()->pluck('question', 'id'))->width(4)->saving(function ($v) {
$form->text('drug_info')->width(4); return json_encode($v);
$form->text('doctor_id')->width(4); });
$form->text('doctor_name')->width(4); $form->multipleSelect('drug_info')->options(PharmacyDrugModel::with('drug')->get()->pluck('drug')->pluck('name', 'id'))->width(4)->saving(function ($v) {
$form->text('doctor_online_hospital_name')->width(4); return json_encode($v);
$form->text('doctor_department')->width(4); });
$form->text('doctor_title')->width(4); $form->switch('is_voided')->width(4);
$form->text('doctor_license_no')->width(4);
$form->text('pharmacy_id')->width(4);
$form->text('pharmacy_name')->width(4);
$form->text('pharmacist_id')->width(4);
$form->text('pharmacist_name')->width(4);
$form->text('pharmacist_license_number')->width(4);
$form->display('created_at')->width(4); $form->display('created_at')->width(4);
$form->display('updated_at')->width(4); $form->display('updated_at')->width(4);
......
...@@ -12,4 +12,18 @@ class PrescriptionModel extends Model ...@@ -12,4 +12,18 @@ class PrescriptionModel extends Model
use SoftDeletes; use SoftDeletes;
protected $table = 'prescription'; protected $table = 'prescription';
// 审方状态[0=待开方,1=待审方,2=审方成功]
const PRESCRIPTION_STATUS_PENDING = 0;
const PRESCRIPTION_STATUS_REVIEWING = 1;
const PRESCRIPTION_STATUS_SUCCESS = 2;
// 审方状态-文字映射
const PRESCRIPTION_STATUS_MAP = [
self::PRESCRIPTION_STATUS_PENDING => '待开方',
self::PRESCRIPTION_STATUS_REVIEWING => '待审方',
self::PRESCRIPTION_STATUS_SUCCESS => '审方成功',
];
} }
...@@ -9,22 +9,24 @@ ...@@ -9,22 +9,24 @@
'patient_name' => '姓名', 'patient_name' => '姓名',
'patient_age' => '年龄', 'patient_age' => '年龄',
'patient_gender' => '性别', 'patient_gender' => '性别',
'diagnosis_id' => '诊断表ID', 'diagnosis_id' => '诊断',
'diagnosis_name' => '诊断', 'diagnosis_name' => '诊断',
'inquiry_info' => '问诊问题', 'inquiry_info' => '问诊问题',
'drug_info' => '处方药', 'drug_info' => '处方药',
'doctor_id' => '医师表ID', 'doctor_id' => '医师',
'doctor_name' => '开方医师', 'doctor_name' => '开方医师',
'doctor_online_hospital_name' => '医师互联网医院名称', 'doctor_online_hospital_name' => '医师互联网医院名称',
'doctor_department' => '医师科室', 'doctor_department' => '医师科室',
'doctor_title' => '医师职称', 'doctor_title' => '医师职称',
'doctor_license_no' => '医师执照编号', 'doctor_license_no' => '医师执照编号',
'pharmacy_id' => '药店表ID', 'pharmacy_id' => '药店',
'pharmacy_name' => '药店', 'pharmacy_name' => '药店',
'pharmacist_id' => '药师表ID', 'pharmacist_id' => '药师',
'pharmacist_name' => '审方药师', 'pharmacist_name' => '审方药师',
'pharmacist_license_number' => '药师执照编号', 'pharmacist_license_number' => '药师执照编号',
'prescriptio_number' => '处方单编号', 'prescriptio_number' => '处方单编号',
'patient_id' => '问诊人',
'is_voided' => '作废',
], ],
'options' => [ 'options' => [
], ],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment