1
This commit is contained in:
parent
056de43bc7
commit
cc2470a781
31
app/Controller/PatientCaseController.php
Normal file
31
app/Controller/PatientCaseController.php
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Controller;
|
||||||
|
|
||||||
|
use App\Request\PatientCaseRequest;
|
||||||
|
use App\Services\InquiryService;
|
||||||
|
use Psr\Container\ContainerExceptionInterface;
|
||||||
|
use Psr\Container\NotFoundExceptionInterface;
|
||||||
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 患者家庭成员病例
|
||||||
|
*/
|
||||||
|
class PatientCaseController extends AbstractController
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 获取患者家庭成员问诊病例详情
|
||||||
|
* @return ResponseInterface
|
||||||
|
* @throws ContainerExceptionInterface
|
||||||
|
* @throws NotFoundExceptionInterface
|
||||||
|
*/
|
||||||
|
public function getPatientFamilyInquiryCase(): ResponseInterface
|
||||||
|
{
|
||||||
|
$request = $this->container->get(PatientCaseRequest::class);
|
||||||
|
$request->scene('getPatientFamilyInquiryCase')->validateResolved();
|
||||||
|
|
||||||
|
$InquiryService = new InquiryService();
|
||||||
|
$data = $InquiryService->getPatientInquiryCase();
|
||||||
|
return $this->response->json($data);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -463,6 +463,62 @@ class TestController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function test_17(){
|
public function test_17(){
|
||||||
|
$expertise_id = $this->request->input('expertise_id');
|
||||||
|
$province_id = $this->request->input('province_id');
|
||||||
|
$city_id = $this->request->input('city_id');
|
||||||
|
$sort_order = $this->request->input('sort_order',1);
|
||||||
|
$keyword = $this->request->input('keyword',"");
|
||||||
|
$is_search_welfare_reception = $this->request->input('is_search_welfare_reception',0); // 是否参加公益图文问诊(0:否 1:是)
|
||||||
|
$is_first_online = $this->request->input('is_first_online',0); // 是否优先在线(1:是)
|
||||||
|
$page = $this->request->input('page',1);
|
||||||
|
$per_page = $this->request->input('per_page',10);
|
||||||
|
|
||||||
|
// 组合条件
|
||||||
|
$hospital_params = array();// 医院搜索
|
||||||
|
$doctor_params = array();// 医生搜索
|
||||||
|
$doctor_expertise_params = array();// 医生专长搜索
|
||||||
|
|
||||||
|
// 省市区
|
||||||
|
if (!empty($province_id)) {
|
||||||
|
if (empty($city_id)) {
|
||||||
|
// 省份存在时需和城市在一块
|
||||||
|
return fail(HttpEnumCode::CLIENT_HTTP_ERROR);
|
||||||
|
}
|
||||||
|
$hospital_params[] = ['province_id', '=', $province_id];
|
||||||
|
$hospital_params[] = ['city_id', '=', $city_id];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 医生专长
|
||||||
|
if (!empty($expertise_id)) {
|
||||||
|
$doctor_expertise_params['expertise_id'] = $expertise_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 固定医生查询条件
|
||||||
|
$doctor_params['status'] = 1; // 状态(0:禁用 1:正常 2:删除)
|
||||||
|
|
||||||
|
$doctor_params["iden_auth_status"] = 1;// 身份认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败)
|
||||||
|
$doctor_params["is_bind_bank"] = 1;// 是否已绑定结算银行卡(0:否 1:是)
|
||||||
|
|
||||||
|
$fields = [
|
||||||
|
"doctor_id",
|
||||||
|
"user_id",
|
||||||
|
"user_name",
|
||||||
|
"multi_point_status",
|
||||||
|
"is_bind_bank",
|
||||||
|
"is_recommend",
|
||||||
|
"avatar",
|
||||||
|
"doctor_title",
|
||||||
|
"department_custom_id",
|
||||||
|
"department_custom_name",
|
||||||
|
"hospital_id",
|
||||||
|
"served_patients_num",
|
||||||
|
"praise_rate",
|
||||||
|
"avg_response_time",
|
||||||
|
"number_of_fans",
|
||||||
|
"be_good_at",
|
||||||
|
];
|
||||||
|
|
||||||
|
$user_doctors = UserDoctor::getInquiryDoctorPageTest($keyword,$hospital_params, $doctor_params,$doctor_expertise_params,$is_search_welfare_reception,$is_first_online, $sort_order, ['*'],$page,$per_page);
|
||||||
|
return success($user_doctors);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -14,14 +14,14 @@ use Hyperf\Snowflake\Concern\Snowflake;
|
|||||||
* @property int $patient_id 患者id
|
* @property int $patient_id 患者id
|
||||||
* @property int $order_inquiry_id 订单-问诊id
|
* @property int $order_inquiry_id 订单-问诊id
|
||||||
* @property int $family_id 家庭成员id
|
* @property int $family_id 家庭成员id
|
||||||
* @property int $relation 与患者关系(1:本人 2:父母 3:爱人 4:子女 5:亲戚 6:其他 )
|
* @property int $disease_class_id 疾病分类id-系统
|
||||||
|
* @property int $nation_id 民族
|
||||||
* @property int $status 状态(1:正常 2:删除)
|
* @property int $status 状态(1:正常 2:删除)
|
||||||
* @property string $name 患者名称
|
* @property string $name 患者名称
|
||||||
* @property int $sex 患者性别(0:未知 1:男 2:女)
|
* @property int $sex 患者性别(0:未知 1:男 2:女)
|
||||||
* @property int $age 患者年龄
|
* @property int $age 患者年龄
|
||||||
* @property string $height 身高(cm)
|
* @property string $height 身高(cm)
|
||||||
* @property string $weight 体重(kg)
|
* @property string $weight 体重(kg)
|
||||||
* @property int $disease_class_id 疾病分类id-系统
|
|
||||||
* @property string $disease_class_name 疾病名称-系统
|
* @property string $disease_class_name 疾病名称-系统
|
||||||
* @property string $diagnosis_date 确诊日期
|
* @property string $diagnosis_date 确诊日期
|
||||||
* @property string $disease_desc 病情描述(主诉)
|
* @property string $disease_desc 病情描述(主诉)
|
||||||
@ -33,8 +33,17 @@ use Hyperf\Snowflake\Concern\Snowflake;
|
|||||||
* @property int $is_pregnant 是否备孕、妊娠、哺乳期(0:否 1:是)
|
* @property int $is_pregnant 是否备孕、妊娠、哺乳期(0:否 1:是)
|
||||||
* @property string $pregnant 备孕、妊娠、哺乳期描述
|
* @property string $pregnant 备孕、妊娠、哺乳期描述
|
||||||
* @property int $is_taboo 是否服用过禁忌药物,且无相关禁忌(0:否 1:是)问诊购药时存在
|
* @property int $is_taboo 是否服用过禁忌药物,且无相关禁忌(0:否 1:是)问诊购药时存在
|
||||||
* @property int $nation_id 民族
|
* @property int $job_id 职业id
|
||||||
|
* @property int $relation 与患者关系(1:本人 2:父母 3:爱人 4:子女 5:亲戚 6:其他 )
|
||||||
* @property string $nation_name 民族名称
|
* @property string $nation_name 民族名称
|
||||||
|
* @property string $job_name 职业名称
|
||||||
|
* @property string $diagnosis_hospital 确诊医院
|
||||||
|
* @property int $is_operation 是否存在手术(0:否 1:是)
|
||||||
|
* @property string $operation 手术描述
|
||||||
|
* @property int $drink_wine_status 饮酒状态(1:从不 2:偶尔 3:经常 4:每天 5:已戒酒)
|
||||||
|
* @property int $smoke_status 吸烟状态(1:从不 2:偶尔 3:经常 4:每天 5:已戒烟)
|
||||||
|
* @property int $chemical_compound_status 化合物状态(1:从不 2:偶尔 3:经常 4:每天)
|
||||||
|
* @property string $chemical_compound_describe 化合物描述
|
||||||
* @property \Carbon\Carbon $created_at 创建时间
|
* @property \Carbon\Carbon $created_at 创建时间
|
||||||
* @property \Carbon\Carbon $updated_at 修改时间
|
* @property \Carbon\Carbon $updated_at 修改时间
|
||||||
* @property-read BasicJob|null $BasicJob
|
* @property-read BasicJob|null $BasicJob
|
||||||
@ -53,7 +62,7 @@ class OrderInquiryCase extends Model
|
|||||||
/**
|
/**
|
||||||
* The attributes that are mass assignable.
|
* The attributes that are mass assignable.
|
||||||
*/
|
*/
|
||||||
protected array $fillable = ['inquiry_case_id', 'user_id', 'patient_id', 'order_inquiry_id', 'family_id', 'relation', 'status', 'name', 'sex', 'age', 'height', 'weight', 'disease_class_id', 'disease_class_name', 'diagnosis_date', 'disease_desc', 'diagnose_images', 'is_allergy_history', 'allergy_history', 'is_family_history', 'family_history', 'is_pregnant', 'pregnant', 'is_taboo', 'nation_id', 'nation_name', 'created_at', 'updated_at'];
|
protected array $fillable = ['inquiry_case_id', 'user_id', 'patient_id', 'order_inquiry_id', 'family_id', 'disease_class_id', 'nation_id', 'status', 'name', 'sex', 'age', 'height', 'weight', 'disease_class_name', 'diagnosis_date', 'disease_desc', 'diagnose_images', 'is_allergy_history', 'allergy_history', 'is_family_history', 'family_history', 'is_pregnant', 'pregnant', 'is_taboo', 'job_id', 'relation', 'nation_name', 'job_name', 'diagnosis_hospital', 'is_operation', 'operation', 'drink_wine_status', 'smoke_status', 'chemical_compound_status', 'chemical_compound_describe', 'created_at', 'updated_at'];
|
||||||
|
|
||||||
protected string $primaryKey = "inquiry_case_id";
|
protected string $primaryKey = "inquiry_case_id";
|
||||||
|
|
||||||
|
|||||||
@ -7,6 +7,7 @@ namespace App\Model;
|
|||||||
|
|
||||||
|
|
||||||
use Hyperf\Database\Model\Collection;
|
use Hyperf\Database\Model\Collection;
|
||||||
|
use Hyperf\Database\Model\Relations\HasOne;
|
||||||
use Hyperf\DbConnection\Db;
|
use Hyperf\DbConnection\Db;
|
||||||
use Hyperf\Snowflake\Concern\Snowflake;
|
use Hyperf\Snowflake\Concern\Snowflake;
|
||||||
|
|
||||||
@ -68,6 +69,14 @@ class PatientPathography extends Model
|
|||||||
|
|
||||||
protected string $primaryKey = "pathography_id";
|
protected string $primaryKey = "pathography_id";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联问诊订单表
|
||||||
|
*/
|
||||||
|
public function OrderInquiry(): HasOne
|
||||||
|
{
|
||||||
|
return $this->hasOne(OrderInquiry::class, 'order_inquiry_id', 'order_inquiry_id');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取信息-单条
|
* 获取信息-单条
|
||||||
* @param array $params
|
* @param array $params
|
||||||
@ -132,7 +141,8 @@ class PatientPathography extends Model
|
|||||||
*/
|
*/
|
||||||
public static function getPatientPathographyPage(array $params,array $fields = ["*"], int $page = null, ?int $per_page = 10): array
|
public static function getPatientPathographyPage(array $params,array $fields = ["*"], int $page = null, ?int $per_page = 10): array
|
||||||
{
|
{
|
||||||
$result = self::where($params)
|
$result = self::with(['OrderInquiry'])
|
||||||
|
->where($params)
|
||||||
->orderBy("created_at",'desc')
|
->orderBy("created_at",'desc')
|
||||||
->paginate($per_page, $fields, "page", $page);
|
->paginate($per_page, $fields, "page", $page);
|
||||||
|
|
||||||
|
|||||||
46
app/Request/PatientCaseRequest.php
Normal file
46
app/Request/PatientCaseRequest.php
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Request;
|
||||||
|
|
||||||
|
use App\Constants\HttpEnumCode;
|
||||||
|
use Hyperf\Validation\Request\FormRequest;
|
||||||
|
use Hyperf\Validation\Rule;
|
||||||
|
|
||||||
|
class PatientCaseRequest extends FormRequest
|
||||||
|
{
|
||||||
|
protected array $scenes = [
|
||||||
|
'getPatientFamilyInquiryCase' => [ // 获取患者问诊病例
|
||||||
|
'order_inquiry_id',
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine if the user is authorized to make this request.
|
||||||
|
*/
|
||||||
|
public function authorize(): bool
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation rules that apply to the request.
|
||||||
|
*/
|
||||||
|
public function rules(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'order_inquiry_id' => 'required',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取已定义验证规则的错误消息.
|
||||||
|
*/
|
||||||
|
public function messages(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'order_inquiry_id.required' => HttpEnumCode::getMessage(HttpEnumCode::CLIENT_HTTP_ERROR),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
11
app/Services/PatientCaseService.php
Normal file
11
app/Services/PatientCaseService.php
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Services;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 患者家庭成员病例
|
||||||
|
*/
|
||||||
|
class PatientCaseService extends BaseService
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
@ -58,6 +58,9 @@ class PatientPathographyService extends BaseService
|
|||||||
// 获取病情记录列表
|
// 获取病情记录列表
|
||||||
$fields = [
|
$fields = [
|
||||||
"pathography_id",
|
"pathography_id",
|
||||||
|
"name",
|
||||||
|
"sex",
|
||||||
|
"age",
|
||||||
"created_at",
|
"created_at",
|
||||||
"disease_class_name",
|
"disease_class_name",
|
||||||
"disease_desc"
|
"disease_desc"
|
||||||
@ -70,6 +73,16 @@ class PatientPathographyService extends BaseService
|
|||||||
$params['status'] = 1;
|
$params['status'] = 1;
|
||||||
$patient_pathographys = PatientPathography::getPatientPathographyPage($params, $fields, $page, $per_page);
|
$patient_pathographys = PatientPathography::getPatientPathographyPage($params, $fields, $page, $per_page);
|
||||||
|
|
||||||
|
foreach ($patient_pathographys['data'] as &$patient_pathography){
|
||||||
|
$patient_pathography['reception_time'] = null;
|
||||||
|
if (!empty($patient_pathography['order_inquiry'])){
|
||||||
|
// 接诊时间
|
||||||
|
$patient_pathography['reception_time'] = $patient_pathography['order_inquiry']['reception_time'];
|
||||||
|
}
|
||||||
|
|
||||||
|
unset($patient_pathography['OrderInquiry']);
|
||||||
|
}
|
||||||
|
|
||||||
return success($patient_pathographys);
|
return success($patient_pathographys);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -21,6 +21,7 @@ use App\Controller\InquiryController;
|
|||||||
use App\Controller\LoginController;
|
use App\Controller\LoginController;
|
||||||
use App\Controller\CodeController;
|
use App\Controller\CodeController;
|
||||||
use App\Controller\MessageNoticeController;
|
use App\Controller\MessageNoticeController;
|
||||||
|
use App\Controller\PatientCaseController;
|
||||||
use App\Controller\PatientCenterController;
|
use App\Controller\PatientCenterController;
|
||||||
use App\Controller\PatientDoctorController;
|
use App\Controller\PatientDoctorController;
|
||||||
use App\Controller\PatientFamilyController;
|
use App\Controller\PatientFamilyController;
|
||||||
@ -82,8 +83,8 @@ Router::addGroup('/doctor', function () {
|
|||||||
// 修改医生问诊配置
|
// 修改医生问诊配置
|
||||||
Router::put('/config', [UserDoctorController::class, 'putInquiryConfig']);
|
Router::put('/config', [UserDoctorController::class, 'putInquiryConfig']);
|
||||||
|
|
||||||
// 获取患者问诊病例
|
// // 获取患者问诊病例
|
||||||
Router::get('/case', [InquiryController::class, 'getPatientInquiryCase']);
|
// Router::get('/case', [InquiryController::class, 'getPatientInquiryCase']);
|
||||||
|
|
||||||
// 获取医生问诊消息列表
|
// 获取医生问诊消息列表
|
||||||
Router::get('/message', [UserDoctorController::class, 'getDoctorMessageList']);
|
Router::get('/message', [UserDoctorController::class, 'getDoctorMessageList']);
|
||||||
@ -725,8 +726,12 @@ Router::addGroup('/user', function () {
|
|||||||
Router::put('/system', [UserController::class, 'putUserSystem']);
|
Router::put('/system', [UserController::class, 'putUserSystem']);
|
||||||
});
|
});
|
||||||
|
|
||||||
// 获取患者问诊病例
|
// 获取患者家庭成员问诊订单病例
|
||||||
Router::get('/case', [InquiryController::class, 'getPatientInquiryCase']);
|
Router::addGroup('/case', function () {
|
||||||
|
// 获取患者家庭成员问诊病例详情
|
||||||
|
Router::get('/inquiry', [PatientCaseController::class, 'getPatientFamilyInquiryCase']);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
// 测试使用
|
// 测试使用
|
||||||
Router::addGroup('/test', function () {
|
Router::addGroup('/test', function () {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user