患者信息、挂号记录、处方记录、退款功能鉴权

This commit is contained in:
2024-09-26 11:09:42 +08:00
parent 60dfeb3c05
commit 90a71b6511
5 changed files with 163 additions and 2 deletions

View File

@@ -60,6 +60,46 @@ class StoreAcceptController extends BaseAppController
$register['prescription'] = $prescription;
return $register;
}
/**
* @doc-name 患者信息(线下患者挂号信息)
* @doc-param int register_id 挂号id
* @doc-param int patient_id 患者id
* @doc-return mixed @Register{*} 挂号信息
* @doc-return mixed @UserPatient{*} 患者信息
* @doc-return mixed @UserPatientHealthInquiry{*} 健康信息
* @doc-return mixed @Store{name-string-门店} 门店信息
* @doc-return mixed @Doctor{name-string-医生} 医生信息
* @doc-return mixed @Depart{name-string-科室} 科室信息
*/
public function actionPatientDetailAll()
{
$post=\Yii::$app->request->post();
$this->requestValidate($post,[
[['patient_id','register_id'],'required']
]);
$register=Register::find()->where([
'id'=>$post['register_id'],
'service_user_id'=>\Yii::$app->user->id,
'user_patient_id'=>$post['patient_id'],
'is_cancel'=>0,
'is_delete'=>0
])->with(['patient','healthInquery'])
->with(['depart'=>function($d){
$d->select('name');
}])
->with(['doctor'=>function($d){
$d->select('name');
}])
->with(['store'=>function($s){
$s->select('name');
}])
->asArray()->one();
if (!$register) throw new Exception('挂号不存在');
$prescription = Prescription::find()->select('id,prescription_no')->where(['register_id' => $register['id']])->all();
$register['prescription'] = $prescription;
return $register;
}
/**
* @doc-name 患者详情