Compare commits
61 Commits
digital_do
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 0ea51f426c | |||
| 2e50374c64 | |||
| bb66733294 | |||
| e030e55bd8 | |||
| 9e57d8fbf0 | |||
| 50a678714e | |||
| cdf5c7a944 | |||
| b1ac5e95e0 | |||
| 9ab5393c45 | |||
| 992ff09f49 | |||
| 4dba55b19a | |||
| cd97268098 | |||
| 0c1325949d | |||
| 9a224fad7c | |||
| 05ad1ce9ce | |||
| c6008a74dd | |||
| 01ef38027a | |||
| 96aaac501a | |||
| 2090a8569a | |||
| f47ff33226 | |||
| fe769c3367 | |||
| f961d14af7 | |||
| eb647b8cc8 | |||
| 02cc6e039c | |||
| c4e8fb85cd | |||
| 94c598e3de | |||
| 7bf9d51b8f | |||
| b286bf195f | |||
| f7a88b9f36 | |||
| a833aa3dca | |||
| 18a7b5ac74 | |||
| 5fe4aa6f6d | |||
| d82923618c | |||
| bb578274cf | |||
| 35c5690c78 | |||
| 0ad13dc162 | |||
| 146d828c0e | |||
| eb8390593d | |||
| fddbfa670b | |||
| 857e5261b4 | |||
| 8fffd26473 | |||
| f2029fe92f | |||
| fad602b71f | |||
| 57afa3062c | |||
| e74a10ec59 | |||
| 4b850b57aa | |||
| 7a14dffc94 | |||
| 89464f8e07 | |||
| ca5068bab6 | |||
| 896cf4109d | |||
| aac80f715a | |||
| 2fb35934ee | |||
| fdd9099996 | |||
| 7a0a6a1719 | |||
| ddc4c42571 | |||
| 5a334e9670 | |||
| 86e802af4f | |||
| 8572c5d25e | |||
| 2b938a0dbd | |||
| 34bad8850a | |||
| 8acbd1fa6c |
15
digital_doctor/.gitignore
vendored
15
digital_doctor/.gitignore
vendored
@@ -1,21 +1,28 @@
|
||||
/nbproject/
|
||||
#/thinkphp/
|
||||
#/vendor/
|
||||
#/application/extra
|
||||
/runtime/*
|
||||
#/addons/*
|
||||
#/public/assets/libs/
|
||||
/application/admin/command/Install/*.lock
|
||||
#/public/assets/addons/*
|
||||
/public/uploads/*
|
||||
.idea
|
||||
composer.lock
|
||||
.env.sample
|
||||
*.log
|
||||
*.css.map
|
||||
!.gitkeep
|
||||
.env
|
||||
.svn
|
||||
.vscode
|
||||
node_modules
|
||||
#application/extra/*
|
||||
.user.ini
|
||||
|
||||
#/application/database.php
|
||||
js_api_ticket.txt
|
||||
.well-known
|
||||
webautocode
|
||||
webautocodestatic
|
||||
.git
|
||||
.git*
|
||||
.git*
|
||||
*.pid
|
||||
66
digital_doctor/application/api/controller/Hdradmin.php
Normal file
66
digital_doctor/application/api/controller/Hdradmin.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
/*
|
||||
* description:
|
||||
* author:wh
|
||||
* email:
|
||||
* createTime:{2024/8/7} {13:50}
|
||||
*/
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
|
||||
use app\common\model\TabConf;
|
||||
use think\Db;
|
||||
use wanghua\general_utility_tools_php\Mmodel;
|
||||
use wanghua\general_utility_tools_php\tool\Tools;
|
||||
|
||||
class Hdradmin extends BaseHttpApi
|
||||
{
|
||||
|
||||
/**
|
||||
* desc:管理员登录
|
||||
* api/Hdradmin/adminLogin
|
||||
* author:wh
|
||||
*/
|
||||
function adminLogin(){
|
||||
return Mmodel::catchJson(function (){
|
||||
$username = input('username');
|
||||
if(empty($username)){
|
||||
return Tools::set_fail('参数错误:1');
|
||||
}
|
||||
$password = input('password');
|
||||
if(empty($password)){
|
||||
return Tools::set_fail('参数错误:2');
|
||||
}
|
||||
$user = Db::table(TabConf::$fa_hdradmin)
|
||||
->where('username',$username)
|
||||
->find();
|
||||
if(empty($user)){
|
||||
return Tools::set_fail('用户不存在');
|
||||
}
|
||||
if($password != $user['password']){
|
||||
return Tools::set_fail('密码错误');
|
||||
}
|
||||
|
||||
//session('api_user_info',$user);
|
||||
|
||||
unset($user['password']);
|
||||
|
||||
$expires = 7*86400+time();//报告完成之后重新获取票据
|
||||
|
||||
|
||||
//返回票据
|
||||
$ticketstr = md5($user['username'].$expires);
|
||||
|
||||
//修改有效期
|
||||
Db::table('fa_hdrdoctorusers')
|
||||
->data([
|
||||
'ticket'=>$ticketstr,
|
||||
'expires'=>$expires,//7天
|
||||
])
|
||||
->where('username',$username)
|
||||
->update();
|
||||
return Tools::set_ok('登录成功',['ticket'=>$ticketstr,'user'=>$user]);
|
||||
});
|
||||
}
|
||||
}
|
||||
59
digital_doctor/application/api/controller/Hdrdepartment.php
Normal file
59
digital_doctor/application/api/controller/Hdrdepartment.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use think\Db;
|
||||
use app\common\model\TabConf;
|
||||
use wanghua\general_utility_tools_php\file\upload\FileUpload;
|
||||
use wanghua\general_utility_tools_php\tool\Tools;
|
||||
use wanghua\general_utility_tools_php\Validate;
|
||||
use think\Controller;
|
||||
|
||||
class Hdrdepartment extends BaseHttpApi
|
||||
{
|
||||
protected $controller_comments = '科室';
|
||||
|
||||
/**
|
||||
* desc:获取科室
|
||||
*
|
||||
* api/Hdrdepartment/getHdrdepartmentList
|
||||
*
|
||||
* 参数:
|
||||
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* name 科室名称
|
||||
|
||||
* author:wh
|
||||
*/
|
||||
function getHdrdepartmentList(){
|
||||
Tools::log_to_write_txt(['获取科室 入参:'=>input()]);
|
||||
$api_desc = '获取科室';
|
||||
try {
|
||||
|
||||
|
||||
|
||||
$model_obj = Db::table(TabConf::$fa_hdrdepartment);
|
||||
|
||||
$data = $model_obj->select();
|
||||
if(empty($data)){
|
||||
return json(Tools::set_ok('ok',$data));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return json(Tools::set_ok('ok',$data));
|
||||
}catch(\Exception $e){
|
||||
Tools::log_to_write_txt([
|
||||
'error'=>'获取科室.异常.'.$e->getMessage(),
|
||||
'参数'=>input(),
|
||||
'error_info'=>$e->getTraceAsString()
|
||||
]);
|
||||
return json(Tools::set_res(500,'操作异常',[]));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
290
digital_doctor/application/api/controller/Hdrdoctorusers.php
Normal file
290
digital_doctor/application/api/controller/Hdrdoctorusers.php
Normal file
@@ -0,0 +1,290 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use think\Db;
|
||||
use app\common\model\TabConf;
|
||||
use wanghua\general_utility_tools_php\file\upload\FileUpload;
|
||||
use wanghua\general_utility_tools_php\tool\Tools;
|
||||
use think\Controller;
|
||||
|
||||
class Hdrdoctorusers extends BaseHttpApi
|
||||
{
|
||||
protected $controller_comments = '医生账户信息';
|
||||
|
||||
|
||||
/**
|
||||
* 新增医生账户信息
|
||||
*
|
||||
* 参数:
|
||||
* doctor 医生昵称(杨教授) 医生昵称(杨教授) 必须
|
||||
* username 用户名(手机号) 用户名(手机号) 必须
|
||||
* hdrdepartment_id 科室 科室 必须
|
||||
* name 姓名(杨玉环) 姓名(杨玉环) 必须
|
||||
* password 密码a123456 密码a123456 必须
|
||||
* api/Hdrdoctorusers/addHdrdoctorusers
|
||||
*/
|
||||
function addHdrdoctorusers(){
|
||||
Tools::log_to_write_txt(['新增医生账户信息'=>input()]);
|
||||
$api_desc = '新增医生账户信息';
|
||||
Db::startTrans();
|
||||
try {
|
||||
|
||||
$doctor = input('doctor');
|
||||
if(empty($doctor)){
|
||||
return json(Tools::set_fail('参数错误.0'));
|
||||
}
|
||||
|
||||
$username = input('username');
|
||||
if(empty($username)){
|
||||
return json(Tools::set_fail('参数错误.1'));
|
||||
}
|
||||
|
||||
$hdrdepartment_id = input('hdrdepartment_id');
|
||||
if(empty($hdrdepartment_id)){
|
||||
return json(Tools::set_fail('参数错误.2'));
|
||||
}
|
||||
|
||||
$name = input('name');
|
||||
if(empty($name)){
|
||||
return json(Tools::set_fail('参数错误.3'));
|
||||
}
|
||||
|
||||
$password = input('password');
|
||||
if(empty($password)){
|
||||
return json(Tools::set_fail('参数错误.4'));
|
||||
}
|
||||
|
||||
|
||||
$data = [
|
||||
'doctor'=>$doctor?:'',
|
||||
'username'=>$username?:'',
|
||||
'hdrdepartment_id'=>$hdrdepartment_id?:'',
|
||||
'name'=>$name?:'',
|
||||
'password'=>$password?:'',
|
||||
];
|
||||
|
||||
|
||||
$dataid = Db::table(TabConf::$fa_hdrdoctorusers)->insertGetId($data);
|
||||
|
||||
$this->operateLog('新增医生账户信息',api_user_info('id'));
|
||||
Db::commit();
|
||||
return json(Tools::set_ok('ok',$dataid));
|
||||
}catch (\Exception $e){
|
||||
Db::rollback();
|
||||
Tools::log_to_write_txt([
|
||||
'error'=>'新增医生账户信息.异常.'.$e->getMessage(),
|
||||
'input'=>input(),
|
||||
'error_info'=>$e->getTraceAsString()
|
||||
]);
|
||||
return json(Tools::set_fail());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 修改医生账户信息
|
||||
* 参数:
|
||||
* id ID ID 必须
|
||||
* doctor 医生昵称(杨教授)
|
||||
* username 用户名(手机号)
|
||||
* hdrdepartment_id 科室
|
||||
* name 姓名(杨玉环)
|
||||
* password 密码a123456
|
||||
* sex 性别
|
||||
* age 年龄
|
||||
* address 住址
|
||||
* api/Hdrdoctorusers/updateHdrdoctorusers
|
||||
*/
|
||||
function updateHdrdoctorusers(){
|
||||
Tools::log_to_write_txt(['修改医生账户信息'=>input()]);
|
||||
|
||||
$api_desc = '修改医生账户信息';
|
||||
Db::startTrans();
|
||||
try {
|
||||
|
||||
$doctor = input('doctor');
|
||||
$username = input('username');
|
||||
$hdrdepartment_id = input('hdrdepartment_id');
|
||||
$name = input('name');
|
||||
$password = input('password');
|
||||
$sex = input('sex');
|
||||
$age = input('age');
|
||||
$address = input('address');
|
||||
if(empty(input('id'))){
|
||||
return json(Tools::set_fail('参数错误。0'));
|
||||
}
|
||||
|
||||
|
||||
$data = [
|
||||
'doctor'=>$doctor?:'',
|
||||
'username'=>$username?:'',
|
||||
'hdrdepartment_id'=>$hdrdepartment_id?:'',
|
||||
'name'=>$name?:'',
|
||||
'password'=>$password?:'',
|
||||
'sex'=>$sex?:'',
|
||||
'age'=>$age?:'',
|
||||
'address'=>$address?:'',
|
||||
];
|
||||
|
||||
|
||||
$dataid = Db::table(TabConf::$fa_hdrdoctorusers)
|
||||
->data($data)
|
||||
->where('id',input('id'))
|
||||
->update();
|
||||
|
||||
$this->operateLog('修改医生账户信息',api_user_info('id'));
|
||||
Db::commit();
|
||||
return json(Tools::set_ok('ok',$dataid));
|
||||
}catch (\Exception $e){
|
||||
Db::rollback();
|
||||
Tools::log_to_write_txt([
|
||||
'error'=>'修改医生账户信息.异常.'.$e->getMessage(),
|
||||
'input'=>input(),
|
||||
'error_info'=>$e->getTraceAsString()
|
||||
]);
|
||||
return json(Tools::set_fail());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* desc:获取医生账户信息
|
||||
*
|
||||
* api/Hdrdoctorusers/getHdrdoctorusersList
|
||||
*
|
||||
* 参数:
|
||||
* 带分页
|
||||
* current_page 当前页码
|
||||
* list_rows 每页显示条数 默认15
|
||||
* doctor 医生昵称(杨教授)
|
||||
* name 姓名(杨玉环)
|
||||
* doctor 医生昵称(杨教授)
|
||||
* username 用户名(手机号)
|
||||
* hdrdepartment_id 科室
|
||||
* name 姓名(杨玉环)
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* doctor 医生昵称(杨教授)
|
||||
* username 用户名(手机号)
|
||||
* hdrdepartment_id 科室
|
||||
* name 姓名(杨玉环)
|
||||
* password 密码a123456
|
||||
* sex 性别
|
||||
* age 年龄
|
||||
* type 用户类型:user=用户,doc=医生
|
||||
* address 住址
|
||||
* clientid 客户端ID
|
||||
* expires 有效期
|
||||
* ticket 票据
|
||||
* create_time 创建时间
|
||||
|
||||
* author:wh
|
||||
*/
|
||||
function getHdrdoctorusersList(){
|
||||
Tools::log_to_write_txt(['获取医生账户信息 入参:'=>input()]);
|
||||
$api_desc = '获取医生账户信息';
|
||||
try {
|
||||
|
||||
$doctor = input('doctor');
|
||||
$username = input('username');
|
||||
$hdrdepartment_id = input('hdrdepartment_id');
|
||||
$name = input('name');
|
||||
|
||||
|
||||
$model_obj = Db::table(TabConf::$fa_hdrdoctorusers);
|
||||
|
||||
if(input('doctor')){
|
||||
$model_obj->whereLike('doctor','%'.input('doctor').'%');
|
||||
}
|
||||
|
||||
if(input('name')){
|
||||
$model_obj->whereLike('name','%'.input('name').'%');
|
||||
}
|
||||
|
||||
if(input('doctor')){
|
||||
$model_obj->where('doctor',input('doctor'));
|
||||
}
|
||||
if(input('username')){
|
||||
$model_obj->where('username',input('username'));
|
||||
}
|
||||
if(input('hdrdepartment_id')){
|
||||
$model_obj->where('hdrdepartment_id',input('hdrdepartment_id'));
|
||||
}
|
||||
|
||||
$data = $model_obj->paginate(['page'=>input('current_page',1),'list_rows'=>input('list_rows',15)])
|
||||
->each(function($item, $key){
|
||||
$ret_field_name_arr = Tools::delete_str_empty_ele(',,,hdrdepartment_id--name,,,,,,,,,,');
|
||||
|
||||
//处理为外键字段+外键对应数据的字段名 eg:users_id=>nickname
|
||||
$ret_field_name2 = [];
|
||||
foreach ($ret_field_name_arr as $ret_typ_field) {
|
||||
$exp_arr = explode('--',$ret_typ_field);
|
||||
//$exp_arr[0] 主表字段,$exp_arr[1] 副表字段
|
||||
$ret_field_name2[$exp_arr[0]] = [$exp_arr[0],$exp_arr[1]];
|
||||
}
|
||||
|
||||
//返回数据类型处理
|
||||
$return_type_exp_arr = Tools::delete_str_empty_ele(',,,hdrdepartment_id==field_val,,,,,,,,,,');
|
||||
//处理为类型+字段
|
||||
$return_type_exp_arr2 = [];
|
||||
foreach ($return_type_exp_arr as $ret_type_field) {
|
||||
$exp_arr = explode('==',$ret_type_field);
|
||||
$return_type_exp_arr2[$exp_arr[0]] = $exp_arr[1];
|
||||
}
|
||||
|
||||
//返回数组 eg: [id-fa_goods_deal==goods_id,id-fa_goods_deal==goods_id]
|
||||
$rel_table_arr = Tools::delete_str_empty_ele(',,,hdrdepartment_id-fa_hdrdepartment==id,,,,,,,,,,');
|
||||
//关联的字段和表
|
||||
$rel_field_table_arr2 = [];
|
||||
//关系
|
||||
foreach ($rel_table_arr as $rel_str) {
|
||||
$exp_arr = explode('-',$rel_str);
|
||||
$rel_field_table_arr2[$exp_arr[0]] = [explode('==',$exp_arr[1])[0],explode('==',$exp_arr[1])[1]];
|
||||
}
|
||||
|
||||
|
||||
foreach($item as $it_key=>$it_val){
|
||||
if(empty($rel_field_table_arr2[$it_key])){
|
||||
continue;
|
||||
}
|
||||
foreach($return_type_exp_arr as $key=>$val){
|
||||
$val_arr = explode('==',$val);
|
||||
if($it_key == $val_arr[0]){
|
||||
switch($val_arr[1]){
|
||||
case 'two_arr':
|
||||
$item[$it_key.'_data'] = Db::table($rel_field_table_arr2[$it_key][0])->where("{$rel_field_table_arr2[$it_key][1]}",$it_val)->select();
|
||||
break;
|
||||
case 'one_arr':
|
||||
$item[$it_key.'_data'] = Db::table($rel_field_table_arr2[$it_key][0])->where("{$rel_field_table_arr2[$it_key][1]}",$it_val)->find();
|
||||
break;
|
||||
case 'field_val':
|
||||
$item[$it_key.'_data'] = Db::table($rel_field_table_arr2[$it_key][0])->where("{$rel_field_table_arr2[$it_key][1]}",$it_val)->value("{$ret_field_name2[$it_key][1]}");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $item;
|
||||
});
|
||||
|
||||
// ['total'] => int(30)
|
||||
// ['per_page'] => int(15)
|
||||
// ['current_page'] => int(1)
|
||||
// ['last_page''] => int(2)
|
||||
$data = $data->toArray();//包含 data列表
|
||||
|
||||
|
||||
|
||||
|
||||
return json(Tools::set_ok('ok',$data));
|
||||
}catch(\Exception $e){
|
||||
Tools::log_to_write_txt([
|
||||
'error'=>'获取医生账户信息.异常.'.$e->getMessage(),
|
||||
'参数'=>input(),
|
||||
'error_info'=>$e->getTraceAsString()
|
||||
]);
|
||||
return json(Tools::set_res(500,'操作异常',[]));
|
||||
}
|
||||
}
|
||||
246
digital_doctor/application/api/controller/Hdrfollowup.php
Normal file
246
digital_doctor/application/api/controller/Hdrfollowup.php
Normal file
@@ -0,0 +1,246 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use think\Db;
|
||||
use app\common\model\TabConf;
|
||||
use wanghua\general_utility_tools_php\file\upload\FileUpload;
|
||||
use wanghua\general_utility_tools_php\tool\Tools;
|
||||
use think\Controller;
|
||||
|
||||
class Hdrfollowup extends BaseHttpApi
|
||||
{
|
||||
protected $controller_comments = '统一随访记录';
|
||||
|
||||
|
||||
/**
|
||||
* 新增统一随访记录
|
||||
*
|
||||
* 参数:
|
||||
* report_dataid 报告ID 报告ID 必须
|
||||
* userbaseid 基本信息ID 基本信息ID 必须
|
||||
* name 姓名 姓名 必须
|
||||
* phone 电话 电话 必须
|
||||
* content 随访内容 随访内容 必须
|
||||
* send_time 发送时间
|
||||
* api/Hdrfollowup/addHdrfollowup
|
||||
*/
|
||||
function addHdrfollowup(){
|
||||
Tools::log_to_write_txt(['新增统一随访记录'=>input()]);
|
||||
$api_desc = '新增统一随访记录';
|
||||
Db::startTrans();
|
||||
try {
|
||||
|
||||
$report_dataid = input('report_dataid');
|
||||
if(empty($report_dataid)){
|
||||
return json(Tools::set_fail('参数错误.0'));
|
||||
}
|
||||
|
||||
$userbaseid = input('userbaseid');
|
||||
if(empty($userbaseid)){
|
||||
return json(Tools::set_fail('参数错误.1'));
|
||||
}
|
||||
|
||||
$name = input('name');
|
||||
if(empty($name)){
|
||||
return json(Tools::set_fail('参数错误.2'));
|
||||
}
|
||||
|
||||
$phone = input('phone');
|
||||
if(empty($phone)){
|
||||
return json(Tools::set_fail('参数错误.3'));
|
||||
}
|
||||
|
||||
$content = input('content');
|
||||
if(empty($content)){
|
||||
return json(Tools::set_fail('参数错误.4'));
|
||||
}
|
||||
|
||||
$send_time = input('send_time');
|
||||
|
||||
$data = [
|
||||
'report_dataid'=>$report_dataid?:'',
|
||||
'userbaseid'=>$userbaseid?:'',
|
||||
'name'=>$name?:'',
|
||||
'phone'=>$phone?:'',
|
||||
'content'=>$content?:'',
|
||||
'send_time'=>$send_time?:'',
|
||||
];
|
||||
|
||||
|
||||
$dataid = Db::table(TabConf::$fa_hdrfollowup)->insertGetId($data);
|
||||
|
||||
$this->operateLog('新增统一随访记录',api_user_info('id'));
|
||||
Db::commit();
|
||||
return json(Tools::set_ok('ok',$dataid));
|
||||
}catch (\Exception $e){
|
||||
Db::rollback();
|
||||
Tools::log_to_write_txt([
|
||||
'error'=>'新增统一随访记录.异常.'.$e->getMessage(),
|
||||
'input'=>input(),
|
||||
'error_info'=>$e->getTraceAsString()
|
||||
]);
|
||||
return json(Tools::set_fail());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* desc:获取统一随访记录
|
||||
*
|
||||
* api/Hdrfollowup/getHdrfollowupList
|
||||
*
|
||||
* 参数:
|
||||
* 带分页
|
||||
* current_page 当前页码
|
||||
* list_rows 每页显示条数 默认15
|
||||
* report_dataid 报告ID
|
||||
* userbaseid 基本信息ID
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* report_dataid 报告ID
|
||||
* userbaseid 基本信息ID
|
||||
* name 姓名
|
||||
* phone 电话
|
||||
* content 随访内容
|
||||
* status 状态:0=待发送,1=已发送
|
||||
* flow 诊断流程:0=初诊,1=复诊
|
||||
* send_time 发送时间
|
||||
* create_time 创建时间
|
||||
|
||||
* author:wh
|
||||
*/
|
||||
function getHdrfollowupList(){
|
||||
Tools::log_to_write_txt(['获取统一随访记录 入参:'=>input()]);
|
||||
$api_desc = '获取统一随访记录';
|
||||
try {
|
||||
|
||||
$report_dataid = input('report_dataid');
|
||||
$userbaseid = input('userbaseid');
|
||||
|
||||
|
||||
$model_obj = Db::table(TabConf::$fa_hdrfollowup);
|
||||
|
||||
if(input('report_dataid')){
|
||||
$model_obj->where('report_dataid',input('report_dataid'));
|
||||
}
|
||||
if(input('userbaseid')){
|
||||
$model_obj->where('userbaseid',input('userbaseid'));
|
||||
}
|
||||
|
||||
$data = $model_obj->paginate(['page'=>input('current_page',1),'list_rows'=>input('list_rows',15)])
|
||||
->each(function($item, $key){
|
||||
|
||||
|
||||
|
||||
return $item;
|
||||
});
|
||||
|
||||
// ['total'] => int(30)
|
||||
// ['per_page'] => int(15)
|
||||
// ['current_page'] => int(1)
|
||||
// ['last_page''] => int(2)
|
||||
$data = $data->toArray();//包含 data列表
|
||||
|
||||
|
||||
|
||||
|
||||
return json(Tools::set_ok('ok',$data));
|
||||
}catch(\Exception $e){
|
||||
Tools::log_to_write_txt([
|
||||
'error'=>'获取统一随访记录.异常.'.$e->getMessage(),
|
||||
'参数'=>input(),
|
||||
'error_info'=>$e->getTraceAsString()
|
||||
]);
|
||||
return json(Tools::set_res(500,'操作异常',[]));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改统一随访记录
|
||||
* 参数:
|
||||
* id ID
|
||||
* content 随访内容
|
||||
* status 状态:0=待发送,1=已发送
|
||||
* flow 诊断流程:0=初诊,1=复诊
|
||||
* send_time 发送时间
|
||||
* api/Hdrfollowup/updateHdrfollowup
|
||||
*/
|
||||
function updateHdrfollowup(){
|
||||
Tools::log_to_write_txt(['修改统一随访记录'=>input()]);
|
||||
|
||||
$api_desc = '修改统一随访记录';
|
||||
Db::startTrans();
|
||||
try {
|
||||
|
||||
$content = input('content');
|
||||
$status = input('status');
|
||||
$flow = input('flow');
|
||||
$send_time = input('send_time');
|
||||
if(empty(input('id'))){
|
||||
return json(Tools::set_fail('参数错误。0'));
|
||||
}
|
||||
|
||||
|
||||
$data = [
|
||||
'content'=>$content?:'',
|
||||
'status'=>$status?:'',
|
||||
'flow'=>$flow?:'',
|
||||
'send_time'=>$send_time?:'',
|
||||
];
|
||||
|
||||
|
||||
$dataid = Db::table(TabConf::$fa_hdrfollowup)
|
||||
->data($data)
|
||||
->where('id',input('id'))
|
||||
->update();
|
||||
|
||||
$this->operateLog('修改统一随访记录',api_user_info('id'));
|
||||
Db::commit();
|
||||
return json(Tools::set_ok('ok',$dataid));
|
||||
}catch (\Exception $e){
|
||||
Db::rollback();
|
||||
Tools::log_to_write_txt([
|
||||
'error'=>'修改统一随访记录.异常.'.$e->getMessage(),
|
||||
'input'=>input(),
|
||||
'error_info'=>$e->getTraceAsString()
|
||||
]);
|
||||
return json(Tools::set_fail());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除随访
|
||||
* 参数:
|
||||
* id ID
|
||||
* api/Hdrfollowup/del
|
||||
*/
|
||||
function del(){
|
||||
Tools::log_to_write_txt(['删除统一随访记录'=>input()]);
|
||||
|
||||
$api_desc = '删除统一随访记录';
|
||||
try {
|
||||
|
||||
$id = input('id');
|
||||
if(empty($id)){
|
||||
return json(Tools::set_fail('参数错误。0'));
|
||||
}
|
||||
|
||||
|
||||
Db::table(TabConf::$fa_hdrfollowup)
|
||||
->where('id',$id)
|
||||
->delete();
|
||||
|
||||
|
||||
return json(Tools::set_ok('ok'));
|
||||
} catch (\Exception $e) {
|
||||
Tools::log_to_write_txt([
|
||||
'error'=>'删除统一随访记录.异常.'.$e->getMessage(),
|
||||
'input'=>input(),
|
||||
'error_info'=>$e->getTraceAsString()
|
||||
]);
|
||||
return json(Tools::set_fail());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,220 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use think\Db;
|
||||
use app\common\model\TabConf;
|
||||
use wanghua\general_utility_tools_php\file\upload\FileUpload;
|
||||
use wanghua\general_utility_tools_php\tool\Tools;
|
||||
use wanghua\general_utility_tools_php\Validate;
|
||||
use think\Controller;
|
||||
|
||||
class Hdrquestionnaireanswer extends BaseHttpApi
|
||||
{
|
||||
protected $controller_comments = '科室问卷答案';
|
||||
|
||||
/**
|
||||
* desc:获取科室问卷答案
|
||||
*
|
||||
* api/Hdrquestionnaireanswer/getHdrquestionnaireanswerList
|
||||
*
|
||||
* 参数:
|
||||
* 带分页
|
||||
* current_page 当前页码
|
||||
* list_rows 每页显示条数 默认15
|
||||
* id ID
|
||||
* hdrquestionnairequestion_id 问卷问题ID
|
||||
* answer 问卷答案
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* hdrquestionnairequestion_id 问卷问题ID
|
||||
* answer 问卷答案
|
||||
* create_time 创建时间
|
||||
* update_time 更新时间
|
||||
|
||||
* author:wh
|
||||
*/
|
||||
function getHdrquestionnaireanswerList(){
|
||||
Tools::log_to_write_txt(['获取科室问卷答案 入参:'=>input()]);
|
||||
$api_desc = '获取科室问卷答案';
|
||||
try {
|
||||
|
||||
$id = input('id');
|
||||
$hdrquestionnairequestion_id = input('hdrquestionnairequestion_id');
|
||||
$answer = input('answer');
|
||||
|
||||
|
||||
$model_obj = Db::table(TabConf::$fa_hdrquestionnaireanswer);
|
||||
|
||||
if(input('id')){
|
||||
$model_obj->where('id',input('id'));
|
||||
}
|
||||
if(input('hdrquestionnairequestion_id')){
|
||||
$model_obj->where('hdrquestionnairequestion_id',input('hdrquestionnairequestion_id'));
|
||||
}
|
||||
if(input('answer')){
|
||||
$model_obj->where('answer',input('answer'));
|
||||
}
|
||||
|
||||
$data = $model_obj->paginate(['page'=>input('current_page',1),'list_rows'=>input('list_rows',15)])
|
||||
->each(function($item, $key){
|
||||
|
||||
|
||||
|
||||
return $item;
|
||||
});
|
||||
|
||||
// ['total'] => int(30)
|
||||
// ['per_page'] => int(15)
|
||||
// ['current_page'] => int(1)
|
||||
// ['last_page''] => int(2)
|
||||
$data = $data->toArray();//包含 data列表
|
||||
|
||||
|
||||
|
||||
|
||||
return json(Tools::set_ok('ok',$data));
|
||||
}catch(\Exception $e){
|
||||
Tools::log_to_write_txt([
|
||||
'error'=>'获取科室问卷答案.异常.'.$e->getMessage(),
|
||||
'参数'=>input(),
|
||||
'error_info'=>$e->getTraceAsString()
|
||||
]);
|
||||
return json(Tools::set_res(500,'操作异常',[]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增一个问卷答案
|
||||
*
|
||||
* 参数:
|
||||
* hdrquestionnairequestion_id 问卷问题ID 问卷问题ID 必须
|
||||
* answer 问卷答案 问卷答案 必须
|
||||
* api/Hdrquestionnaireanswer/addHdrquestionnaireanswer
|
||||
*/
|
||||
function addHdrquestionnaireanswer(){
|
||||
Tools::log_to_write_txt(['新增一个问卷答案'=>input()]);
|
||||
$api_desc = '新增一个问卷答案';
|
||||
Db::startTrans();
|
||||
try {
|
||||
|
||||
$hdrquestionnairequestion_id = input('hdrquestionnairequestion_id');
|
||||
if(empty($hdrquestionnairequestion_id)){
|
||||
return json(Tools::set_fail('参数错误.0'));
|
||||
}
|
||||
|
||||
$answer = input('answer');
|
||||
if(empty($answer)){
|
||||
return json(Tools::set_fail('参数错误.1'));
|
||||
}
|
||||
|
||||
|
||||
$data = [
|
||||
'hdrquestionnairequestion_id'=>$hdrquestionnairequestion_id?:'',
|
||||
'answer'=>$answer?:'',
|
||||
];
|
||||
|
||||
|
||||
$dataid = Db::table(TabConf::$fa_hdrquestionnaireanswer)->insertGetId($data);
|
||||
|
||||
$this->operateLog('新增一个问卷答案',api_user_info('id'));
|
||||
Db::commit();
|
||||
return json(Tools::set_ok('ok',$dataid));
|
||||
}catch (\Exception $e){
|
||||
Db::rollback();
|
||||
Tools::log_to_write_txt([
|
||||
'error'=>'新增一个问卷答案.异常.'.$e->getMessage(),
|
||||
'input'=>input(),
|
||||
'error_info'=>$e->getTraceAsString()
|
||||
]);
|
||||
return json(Tools::set_fail());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改科室问卷答案
|
||||
* 参数:
|
||||
* id ID ID 必须
|
||||
* hdrquestionnairequestion_id 问卷问题ID
|
||||
* answer 问卷答案
|
||||
* api/Hdrquestionnaireanswer/updateHdrquestionnaireanswer
|
||||
*/
|
||||
function updateHdrquestionnaireanswer(){
|
||||
Tools::log_to_write_txt(['修改科室问卷答案'=>input()]);
|
||||
|
||||
$api_desc = '修改科室问卷答案';
|
||||
Db::startTrans();
|
||||
try {
|
||||
|
||||
$hdrquestionnairequestion_id = input('hdrquestionnairequestion_id');
|
||||
$answer = input('answer');
|
||||
if(empty(input('id'))){
|
||||
return json(Tools::set_fail('参数错误。0'));
|
||||
}
|
||||
|
||||
|
||||
$data = [
|
||||
'hdrquestionnairequestion_id'=>$hdrquestionnairequestion_id?:'',
|
||||
'answer'=>$answer?:'',
|
||||
];
|
||||
|
||||
|
||||
$dataid = Db::table(TabConf::$fa_hdrquestionnaireanswer)
|
||||
->data($data)
|
||||
->where('id',input('id'))
|
||||
->update();
|
||||
|
||||
$this->operateLog('修改科室问卷答案',api_user_info('id'));
|
||||
Db::commit();
|
||||
return json(Tools::set_ok('ok',$dataid));
|
||||
}catch (\Exception $e){
|
||||
Db::rollback();
|
||||
Tools::log_to_write_txt([
|
||||
'error'=>'修改科室问卷答案.异常.'.$e->getMessage(),
|
||||
'input'=>input(),
|
||||
'error_info'=>$e->getTraceAsString()
|
||||
]);
|
||||
return json(Tools::set_fail());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* desc: 删除科室问卷答案
|
||||
* author:wh
|
||||
*
|
||||
* 参数:
|
||||
* id 数据id 必须
|
||||
* api/Hdrquestionnaireanswer/del
|
||||
*/
|
||||
function del(){
|
||||
Tools::log_to_write_txt(['删除科室问卷答案'=>input()]);
|
||||
|
||||
$api_desc = '删除科室问卷答案';
|
||||
try {
|
||||
|
||||
$id = input('id');
|
||||
if(empty($id)){
|
||||
return json(Tools::set_fail('参数错误。0'));
|
||||
}
|
||||
|
||||
|
||||
Db::table(TabConf::$fa_hdrquestionnairequestion)
|
||||
->where('id',$id)
|
||||
->delete();
|
||||
|
||||
|
||||
return json(Tools::set_ok('ok'));
|
||||
} catch (\Exception $e) {
|
||||
Tools::log_to_write_txt([
|
||||
'error'=>'删除科室问卷答案.异常.'.$e->getMessage(),
|
||||
'input'=>input(),
|
||||
'error_info'=>$e->getTraceAsString()
|
||||
]);
|
||||
return json(Tools::set_fail());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,302 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use think\Db;
|
||||
use app\common\model\TabConf;
|
||||
use wanghua\general_utility_tools_php\file\upload\FileUpload;
|
||||
use wanghua\general_utility_tools_php\tool\Tools;
|
||||
use wanghua\general_utility_tools_php\Validate;
|
||||
use think\Controller;
|
||||
|
||||
class Hdrquestionnairequestion extends BaseHttpApi
|
||||
{
|
||||
protected $controller_comments = '科室问卷问题(一个问题对应多个答案)';
|
||||
|
||||
|
||||
/**
|
||||
* 新增科室问卷问题(一个问题对应多个答案)
|
||||
*
|
||||
* 参数:
|
||||
* hdrdepartment_id 所属科室 所属科室 必须
|
||||
* question 问卷问题 问卷问题 必须
|
||||
* is_common 是否通用:yes=是,no=否 是否通用:yes=是,no=否 必须
|
||||
* is_only_boy 只适合男:yes=是,no=否 只适合男:yes=是,no=否 必须
|
||||
* is_only_girl 只适合女:yes=是,no=否 只适合女:yes=是,no=否 必须
|
||||
* type 选项类型:one=单选,more=多选 选项类型:one=单选,more=多选 必须
|
||||
* api/Hdrquestionnairequestion/addHdrquestionnairequestion
|
||||
*/
|
||||
function addHdrquestionnairequestion()
|
||||
{
|
||||
Tools::log_to_write_txt(['新增科室问卷问题(一个问题对应多个答案)' => input()]);
|
||||
$api_desc = '新增科室问卷问题(一个问题对应多个答案)';
|
||||
Db::startTrans();
|
||||
try {
|
||||
|
||||
$hdrdepartment_id = input('hdrdepartment_id');
|
||||
if (empty($hdrdepartment_id)) {
|
||||
return json(Tools::set_fail('参数错误.0'));
|
||||
}
|
||||
|
||||
$question = input('question');
|
||||
if (empty($question)) {
|
||||
return json(Tools::set_fail('参数错误.1'));
|
||||
}
|
||||
|
||||
$is_common = input('is_common');
|
||||
if (empty($is_common)) {
|
||||
return json(Tools::set_fail('参数错误.2'));
|
||||
}
|
||||
|
||||
$is_only_boy = input('is_only_boy');
|
||||
if (empty($is_only_boy)) {
|
||||
return json(Tools::set_fail('参数错误.3'));
|
||||
}
|
||||
|
||||
$is_only_girl = input('is_only_girl');
|
||||
if (empty($is_only_girl)) {
|
||||
return json(Tools::set_fail('参数错误.4'));
|
||||
}
|
||||
|
||||
$type = input('type');
|
||||
if (empty($type)) {
|
||||
return json(Tools::set_fail('参数错误.5'));
|
||||
}
|
||||
|
||||
|
||||
$data = [
|
||||
'hdrdepartment_id' => $hdrdepartment_id ?: '',
|
||||
'question' => $question ?: '',
|
||||
'is_common' => $is_common ?: '',
|
||||
'is_only_boy' => $is_only_boy ?: '',
|
||||
'is_only_girl' => $is_only_girl ?: '',
|
||||
'type' => $type ?: '',
|
||||
];
|
||||
|
||||
|
||||
$dataid = Db::table(TabConf::$fa_hdrquestionnairequestion)->insertGetId($data);
|
||||
|
||||
$this->operateLog('新增科室问卷问题(一个问题对应多个答案)', api_user_info('id'));
|
||||
Db::commit();
|
||||
return json(Tools::set_ok('ok', $dataid));
|
||||
} catch (\Exception $e) {
|
||||
Db::rollback();
|
||||
Tools::log_to_write_txt([
|
||||
'error' => '新增科室问卷问题(一个问题对应多个答案).异常.' . $e->getMessage(),
|
||||
'input' => input(),
|
||||
'error_info' => $e->getTraceAsString()
|
||||
]);
|
||||
return json(Tools::set_fail());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改科室问卷问题(一个问题对应多个答案)
|
||||
* 参数:
|
||||
* id ID ID 必须
|
||||
* hdrdepartment_id 所属科室
|
||||
* question 问卷问题
|
||||
* is_common 是否通用:yes=是,no=否
|
||||
* is_only_boy 只适合男:yes=是,no=否
|
||||
* is_only_girl 只适合女:yes=是,no=否
|
||||
* type 选项类型:one=单选,more=多选
|
||||
* api/Hdrquestionnairequestion/updateHdrquestionnairequestion
|
||||
*/
|
||||
function updateHdrquestionnairequestion()
|
||||
{
|
||||
Tools::log_to_write_txt(['修改科室问卷问题(一个问题对应多个答案)' => input()]);
|
||||
|
||||
$api_desc = '修改科室问卷问题(一个问题对应多个答案)';
|
||||
Db::startTrans();
|
||||
try {
|
||||
|
||||
$hdrdepartment_id = input('hdrdepartment_id');
|
||||
$question = input('question');
|
||||
$is_common = input('is_common');
|
||||
$is_only_boy = input('is_only_boy');
|
||||
$is_only_girl = input('is_only_girl');
|
||||
$type = input('type');
|
||||
if (empty(input('id'))) {
|
||||
return json(Tools::set_fail('参数错误。0'));
|
||||
}
|
||||
|
||||
|
||||
$data = [
|
||||
'hdrdepartment_id' => $hdrdepartment_id ?: '',
|
||||
'question' => $question ?: '',
|
||||
'is_common' => $is_common ?: '',
|
||||
'is_only_boy' => $is_only_boy ?: '',
|
||||
'is_only_girl' => $is_only_girl ?: '',
|
||||
'type' => $type ?: '',
|
||||
];
|
||||
|
||||
|
||||
$dataid = Db::table(TabConf::$fa_hdrquestionnairequestion)
|
||||
->data($data)
|
||||
->where('id', input('id'))
|
||||
->update();
|
||||
|
||||
$this->operateLog('修改科室问卷问题(一个问题对应多个答案)', api_user_info('id'));
|
||||
Db::commit();
|
||||
return json(Tools::set_ok('ok', $dataid));
|
||||
} catch (\Exception $e) {
|
||||
Db::rollback();
|
||||
Tools::log_to_write_txt([
|
||||
'error' => '修改科室问卷问题(一个问题对应多个答案).异常.' . $e->getMessage(),
|
||||
'input' => input(),
|
||||
'error_info' => $e->getTraceAsString()
|
||||
]);
|
||||
return json(Tools::set_fail());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* desc: 删除科室问卷问题(一个问题对应多个答案)
|
||||
* author:wh
|
||||
*
|
||||
* 参数:
|
||||
* id 数据id 必须
|
||||
*
|
||||
* api/Hdrquestionnairequestion/del
|
||||
*/
|
||||
function del()
|
||||
{
|
||||
Tools::log_to_write_txt(['删除科室问卷问题(一个问题对应多个答案)' => input()]);
|
||||
|
||||
$api_desc = '删除科室问卷问题(一个问题对应多个答案)';
|
||||
try {
|
||||
|
||||
$id = input('id');
|
||||
if (empty($id)) {
|
||||
return json(Tools::set_fail('参数错误。0'));
|
||||
}
|
||||
|
||||
|
||||
Db::table(TabConf::$fa_hdrquestionnairequestion)
|
||||
->where('id', $id)
|
||||
->delete();
|
||||
|
||||
|
||||
return json(Tools::set_ok('ok'));
|
||||
} catch (\Exception $e) {
|
||||
Tools::log_to_write_txt([
|
||||
'error' => '删除科室问卷问题(一个问题对应多个答案).异常.' . $e->getMessage(),
|
||||
'input' => input(),
|
||||
'error_info' => $e->getTraceAsString()
|
||||
]);
|
||||
return json(Tools::set_fail());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* desc:获取科室问卷问题(一个问题对应多个答案)
|
||||
*
|
||||
* api/Hdrquestionnairequestion/getHdrquestionnairequestionList
|
||||
*
|
||||
* 参数:
|
||||
* 带分页
|
||||
* current_page 当前页码
|
||||
* list_rows 每页显示条数 默认15
|
||||
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* hdrdepartment_id 所属科室
|
||||
* question 问卷问题
|
||||
* is_common 是否通用:yes=是,no=否
|
||||
* is_only_boy 只适合男:yes=是,no=否
|
||||
* is_only_girl 只适合女:yes=是,no=否
|
||||
* type 选项类型:one=单选,more=多选
|
||||
* create_time 创建时间
|
||||
* update_time 更新时间
|
||||
|
||||
* author:wh
|
||||
*/
|
||||
function getHdrquestionnairequestionList(){
|
||||
Tools::log_to_write_txt(['获取科室问卷问题(一个问题对应多个答案) 入参:'=>input()]);
|
||||
$api_desc = '获取科室问卷问题(一个问题对应多个答案)';
|
||||
try {
|
||||
|
||||
|
||||
|
||||
$model_obj = Db::table(TabConf::$fa_hdrquestionnairequestion);
|
||||
|
||||
|
||||
$data = $model_obj->paginate(['page'=>input('current_page',1),'list_rows'=>input('list_rows',15)])
|
||||
->each(function($item, $key){
|
||||
$ret_field_name_arr = Tools::delete_str_empty_ele('id--testname,,,,,,,,');
|
||||
|
||||
//处理为外键字段+外键对应数据的字段名 eg:users_id=>nickname
|
||||
$ret_field_name2 = [];
|
||||
foreach ($ret_field_name_arr as $ret_typ_field) {
|
||||
$exp_arr = explode('--',$ret_typ_field);
|
||||
//$exp_arr[0] 主表字段,$exp_arr[1] 副表字段
|
||||
$ret_field_name2[$exp_arr[0]] = [$exp_arr[0],$exp_arr[1]];
|
||||
}
|
||||
|
||||
//返回数据类型处理
|
||||
$return_type_exp_arr = Tools::delete_str_empty_ele('id==two_arr,,,,,,,,');
|
||||
//处理为类型+字段
|
||||
$return_type_exp_arr2 = [];
|
||||
foreach ($return_type_exp_arr as $ret_type_field) {
|
||||
$exp_arr = explode('==',$ret_type_field);
|
||||
$return_type_exp_arr2[$exp_arr[0]] = $exp_arr[1];
|
||||
}
|
||||
|
||||
//返回数组 eg: [id-fa_goods_deal==goods_id,id-fa_goods_deal==goods_id]
|
||||
$rel_table_arr = Tools::delete_str_empty_ele('id-fa_hdrquestionnaireanswer==id,,,,,,,,');
|
||||
//关联的字段和表
|
||||
$rel_field_table_arr2 = [];
|
||||
//关系
|
||||
foreach ($rel_table_arr as $rel_str) {
|
||||
$exp_arr = explode('-',$rel_str);
|
||||
$rel_field_table_arr2[$exp_arr[0]] = [explode('==',$exp_arr[1])[0],explode('==',$exp_arr[1])[1]];
|
||||
}
|
||||
|
||||
|
||||
foreach($item as $it_key=>$it_val){
|
||||
if(empty($rel_field_table_arr2[$it_key])){
|
||||
continue;
|
||||
}
|
||||
foreach($return_type_exp_arr as $key=>$val){
|
||||
$val_arr = explode('==',$val);
|
||||
if($it_key == $val_arr[0]){
|
||||
switch($val_arr[1]){
|
||||
case 'two_arr':
|
||||
$item[$it_key.'_data'] = Db::table($rel_field_table_arr2[$it_key][0])->where("{$rel_field_table_arr2[$it_key][1]}",$it_val)->select();
|
||||
break;
|
||||
case 'one_arr':
|
||||
$item[$it_key.'_data'] = Db::table($rel_field_table_arr2[$it_key][0])->where("{$rel_field_table_arr2[$it_key][1]}",$it_val)->find();
|
||||
break;
|
||||
case 'field_val':
|
||||
$item[$it_key.'_data'] = Db::table($rel_field_table_arr2[$it_key][0])->where("{$rel_field_table_arr2[$it_key][1]}",$it_val)->value("{$ret_field_name2[$it_key][1]}");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $item;
|
||||
});
|
||||
|
||||
// ['total'] => int(30)
|
||||
// ['per_page'] => int(15)
|
||||
// ['current_page'] => int(1)
|
||||
// ['last_page''] => int(2)
|
||||
$data = $data->toArray();//包含 data列表
|
||||
|
||||
|
||||
|
||||
|
||||
return json(Tools::set_ok('ok',$data));
|
||||
}catch(\Exception $e){
|
||||
Tools::log_to_write_txt([
|
||||
'error'=>'获取科室问卷问题(一个问题对应多个答案).异常.'.$e->getMessage(),
|
||||
'参数'=>input(),
|
||||
'error_info'=>$e->getTraceAsString()
|
||||
]);
|
||||
return json(Tools::set_res(500,'操作异常',[]));
|
||||
}
|
||||
}
|
||||
194
digital_doctor/application/api/controller/Hdrregister.php
Normal file
194
digital_doctor/application/api/controller/Hdrregister.php
Normal file
@@ -0,0 +1,194 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use think\Db;
|
||||
use app\common\model\TabConf;
|
||||
use wanghua\general_utility_tools_php\file\upload\FileUpload;
|
||||
use wanghua\general_utility_tools_php\tool\Tools;
|
||||
use think\Controller;
|
||||
|
||||
class Hdrregister extends BaseHttpApi
|
||||
{
|
||||
protected $controller_comments = '患者挂号列表(可重复挂号)';
|
||||
|
||||
|
||||
/**
|
||||
* 新增患者挂号列表(可重复挂号)
|
||||
*
|
||||
* 参数:
|
||||
* date 挂号日期
|
||||
* name 患者姓名(可重复挂号)
|
||||
* doctor_name 医生名称
|
||||
* age 病人年龄
|
||||
* gender 病人性别
|
||||
* phone 手机号
|
||||
* qa_type 问答类型(患者定):1=自由问答,2=固定问答,3=健康问答
|
||||
* ticket 对话凭据(便于查询)
|
||||
* api/Hdrregister/addHdrregister
|
||||
*/
|
||||
function addHdrregister(){
|
||||
Tools::log_to_write_txt(['新增患者挂号列表(可重复挂号)'=>input()]);
|
||||
$api_desc = '新增患者挂号列表(可重复挂号)';
|
||||
Db::startTrans();
|
||||
try {
|
||||
|
||||
$date = input('date');
|
||||
if(empty($date)){
|
||||
return json(Tools::set_fail('参数错误.0'));
|
||||
}
|
||||
|
||||
$name = input('name');
|
||||
if(empty($name)){
|
||||
return json(Tools::set_fail('参数错误.1'));
|
||||
}
|
||||
|
||||
$doctor_name = input('doctor_name');
|
||||
if(empty($doctor_name)){
|
||||
return json(Tools::set_fail('参数错误.2'));
|
||||
}
|
||||
|
||||
$age = input('age');
|
||||
if(empty($age)){
|
||||
return json(Tools::set_fail('参数错误.3'));
|
||||
}
|
||||
|
||||
$gender = input('gender');
|
||||
if(empty($gender)){
|
||||
return json(Tools::set_fail('参数错误.4'));
|
||||
}
|
||||
|
||||
$phone = input('phone');
|
||||
if(empty($phone)){
|
||||
return json(Tools::set_fail('参数错误.5'));
|
||||
}
|
||||
|
||||
$qa_type = input('qa_type');
|
||||
$ticket = input('ticket');
|
||||
if(empty($ticket)){
|
||||
return json(Tools::set_fail('参数错误.7'));
|
||||
}
|
||||
|
||||
|
||||
$data = [
|
||||
'date'=>$date?:'',
|
||||
'name'=>$name?:'',
|
||||
'doctor_name'=>$doctor_name?:'',
|
||||
'age'=>$age?:'',
|
||||
'gender'=>$gender?:'',
|
||||
'phone'=>$phone?:'',
|
||||
'qa_type'=>$qa_type?:'',
|
||||
'ticket'=>$ticket?:'',
|
||||
];
|
||||
|
||||
|
||||
$dataid = Db::table(TabConf::$fa_hdrregister)->insertGetId($data);
|
||||
|
||||
$this->operateLog('新增患者挂号列表(可重复挂号)',api_user_info('id'));
|
||||
Db::commit();
|
||||
return json(Tools::set_ok('ok',$dataid));
|
||||
}catch (\Exception $e){
|
||||
Db::rollback();
|
||||
Tools::log_to_write_txt([
|
||||
'error'=>'新增患者挂号列表(可重复挂号).异常.'.$e->getMessage(),
|
||||
'input'=>input(),
|
||||
'error_info'=>$e->getTraceAsString()
|
||||
]);
|
||||
return json(Tools::set_fail());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* desc:获取患者挂号列表(可重复挂号)
|
||||
*
|
||||
* api/Hdrregister/getHdrregisterList
|
||||
*
|
||||
* 参数:
|
||||
* name 患者姓名(可重复挂号)
|
||||
* phone 手机号
|
||||
* id ID
|
||||
* date 挂号日期
|
||||
* name 患者姓名(可重复挂号)
|
||||
* gender 病人性别
|
||||
* phone 手机号
|
||||
* status 状态:0=挂号中,1=结束诊断
|
||||
* qa_type 问答类型(患者定):1=自由问答,2=固定问答,3=健康问答
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* date 挂号日期
|
||||
* name 患者姓名(可重复挂号)
|
||||
* doctor_name 医生名称
|
||||
* age 病人年龄
|
||||
* gender 病人性别
|
||||
* phone 手机号
|
||||
* create_time 创建时间
|
||||
* status 状态:0=挂号中,1=结束诊断
|
||||
* qa_type 问答类型(患者定):1=自由问答,2=固定问答,3=健康问答
|
||||
* ticket 对话凭据(便于查询)
|
||||
|
||||
* author:wh
|
||||
*/
|
||||
function getHdrregisterList(){
|
||||
Tools::log_to_write_txt(['获取患者挂号列表(可重复挂号) 入参:'=>input()]);
|
||||
$api_desc = '获取患者挂号列表(可重复挂号)';
|
||||
try {
|
||||
|
||||
$id = input('id');
|
||||
$date = input('date');
|
||||
$name = input('name');
|
||||
$gender = input('gender');
|
||||
$phone = input('phone');
|
||||
$status = input('status');
|
||||
$qa_type = input('qa_type');
|
||||
|
||||
|
||||
$model_obj = Db::table(TabConf::$fa_hdrregister);
|
||||
|
||||
if(input('name')){
|
||||
$model_obj->whereLike('name','%'.input('name').'%');
|
||||
}
|
||||
|
||||
if(input('phone')){
|
||||
$model_obj->whereLike('phone','%'.input('phone').'%');
|
||||
}
|
||||
|
||||
if(input('id')){
|
||||
$model_obj->where('id',input('id'));
|
||||
}
|
||||
if(input('date')){
|
||||
$model_obj->where('date',input('date'));
|
||||
}
|
||||
if(input('name')){
|
||||
$model_obj->where('name',input('name'));
|
||||
}
|
||||
if(input('gender')){
|
||||
$model_obj->where('gender',input('gender'));
|
||||
}
|
||||
if(input('status')){
|
||||
$model_obj->where('status',input('status'));
|
||||
}
|
||||
if(input('qa_type')){
|
||||
$model_obj->where('qa_type',input('qa_type'));
|
||||
}
|
||||
$data = $model_obj->select();
|
||||
if(empty($data)){
|
||||
return json(Tools::set_ok('ok',$data));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return json(Tools::set_ok('ok',$data));
|
||||
}catch(\Exception $e){
|
||||
Tools::log_to_write_txt([
|
||||
'error'=>'获取患者挂号列表(可重复挂号).异常.'.$e->getMessage(),
|
||||
'参数'=>input(),
|
||||
'error_info'=>$e->getTraceAsString()
|
||||
]);
|
||||
return json(Tools::set_res(500,'操作异常',[]));
|
||||
}
|
||||
}
|
||||
}
|
||||
192
digital_doctor/application/api/controller/Hdruserbaseinfo.php
Normal file
192
digital_doctor/application/api/controller/Hdruserbaseinfo.php
Normal file
@@ -0,0 +1,192 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use think\Db;
|
||||
use app\common\model\TabConf;
|
||||
use wanghua\general_utility_tools_php\file\upload\FileUpload;
|
||||
use wanghua\general_utility_tools_php\tool\Tools;
|
||||
use wanghua\general_utility_tools_php\Validate;
|
||||
use think\Controller;
|
||||
|
||||
class Hdruserbaseinfo extends BaseHttpApi
|
||||
{
|
||||
protected $controller_comments = '统一问诊用户基本信息';
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* desc:获取统一问诊用户基本信息列表(后台病历管理列表)
|
||||
*
|
||||
* api/Hdruserbaseinfo/getHdruserbaseinfoList
|
||||
*
|
||||
* 参数:
|
||||
* 带分页
|
||||
* current_page 当前页码
|
||||
* list_rows 每页显示条数 默认15
|
||||
* doctor 所属医生
|
||||
* id ID
|
||||
* date 日期
|
||||
* doctor 所属医生
|
||||
* hdrdepartment_id 科室
|
||||
* from 来源:num_per=数智人,ty=听译助手,h5=h5网页问诊
|
||||
* name 病人姓名
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* date 日期
|
||||
* doctor 所属医生
|
||||
* hdrdepartment_id 科室
|
||||
* from 来源:num_per=数智人,ty=听译助手,h5=h5网页问诊
|
||||
* name 病人姓名
|
||||
* gender 病人性别
|
||||
* age 病人年龄
|
||||
* edu 教育程度
|
||||
* career_year 职业及年限
|
||||
* power 体力要求
|
||||
* satisfaction 经济满意度
|
||||
* old_career_year 过往职业及年限
|
||||
* old_career_power 过往职业体力要求
|
||||
* support 社会支持度
|
||||
* marriage 婚姻状况
|
||||
* live 居住情况
|
||||
* home 家庭关系
|
||||
* address 地址
|
||||
* phone 联系方式
|
||||
* wechat_no 微信号
|
||||
* ticket 对话票据(数据隔离)
|
||||
* create_time 创建时间
|
||||
* is_flow 是否接受随访:yes=是,no=否
|
||||
|
||||
* author:wh
|
||||
*/
|
||||
function getHdruserbaseinfoList(){
|
||||
Tools::log_to_write_txt(['获取统一问诊用户基本信息列表(后台病历管理列表) 入参:'=>input()]);
|
||||
$api_desc = '获取统一问诊用户基本信息列表(后台病历管理列表)';
|
||||
try {
|
||||
|
||||
$id = input('id');
|
||||
$date = input('date');
|
||||
$doctor = input('doctor');
|
||||
$hdrdepartment_id = input('hdrdepartment_id');
|
||||
$from = input('from');
|
||||
$name = input('name');
|
||||
|
||||
|
||||
$model_obj = Db::table(TabConf::$fa_hdruserbaseinfo);
|
||||
|
||||
if(input('doctor')){
|
||||
$model_obj->whereLike('doctor','%'.input('doctor').'%');
|
||||
}
|
||||
|
||||
if(input('id')){
|
||||
$model_obj->where('id',input('id'));
|
||||
}
|
||||
if(input('date')){
|
||||
$model_obj->where('date',input('date'));
|
||||
}
|
||||
if(input('hdrdepartment_id')){
|
||||
$model_obj->where('hdrdepartment_id',input('hdrdepartment_id'));
|
||||
}
|
||||
if(input('from')){
|
||||
$model_obj->where('from',input('from'));
|
||||
}
|
||||
if(input('name')){
|
||||
$model_obj->where('name',input('name'));
|
||||
}
|
||||
|
||||
$data = $model_obj->paginate(['page'=>input('current_page',1),'list_rows'=>input('list_rows',15)])
|
||||
->each(function($item, $key){
|
||||
|
||||
|
||||
|
||||
return $item;
|
||||
});
|
||||
|
||||
// ['total'] => int(30)
|
||||
// ['per_page'] => int(15)
|
||||
// ['current_page'] => int(1)
|
||||
// ['last_page''] => int(2)
|
||||
$data = $data->toArray();//包含 data列表
|
||||
|
||||
|
||||
|
||||
|
||||
return json(Tools::set_ok('ok',$data));
|
||||
}catch(\Exception $e){
|
||||
Tools::log_to_write_txt([
|
||||
'error'=>'获取统一问诊用户基本信息列表(后台病历管理列表).异常.'.$e->getMessage(),
|
||||
'参数'=>input(),
|
||||
'error_info'=>$e->getTraceAsString()
|
||||
]);
|
||||
return json(Tools::set_res(500,'操作异常',[]));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* desc:获取统一问诊用户基本信息详情(后台病历管理详情)
|
||||
*
|
||||
* api/Hdruserbaseinfo/getHdruserbaseinfoDetailById
|
||||
*
|
||||
* 参数:
|
||||
* id ID ID 必须
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* date 日期
|
||||
* doctor 所属医生
|
||||
* hdrdepartment_id 科室
|
||||
* from 来源:num_per=数智人,ty=听译助手,h5=h5网页问诊
|
||||
* name 病人姓名
|
||||
* gender 病人性别
|
||||
* age 病人年龄
|
||||
* edu 教育程度
|
||||
* career_year 职业及年限
|
||||
* power 体力要求
|
||||
* satisfaction 经济满意度
|
||||
* old_career_year 过往职业及年限
|
||||
* old_career_power 过往职业体力要求
|
||||
* support 社会支持度
|
||||
* marriage 婚姻状况
|
||||
* live 居住情况
|
||||
* home 家庭关系
|
||||
* address 地址
|
||||
* phone 联系方式
|
||||
* wechat_no 微信号
|
||||
* ticket 对话票据(数据隔离)
|
||||
* create_time 创建时间
|
||||
* is_flow 是否接受随访:yes=是,no=否
|
||||
|
||||
* author:wh
|
||||
*/
|
||||
function getHdruserbaseinfoDetailById(){
|
||||
Tools::log_to_write_txt(['获取统一问诊用户基本信息详情(后台病历管理详情) 入参:'=>input()]);
|
||||
$api_desc = '获取统一问诊用户基本信息详情(后台病历管理详情)';
|
||||
try {
|
||||
|
||||
$id = input('id');
|
||||
if(empty($id)){
|
||||
return json(Tools::set_fail('id参数错误'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
$model_obj = Db::table(TabConf::$fa_hdruserbaseinfo);
|
||||
|
||||
if(input('id')){
|
||||
$model_obj->where('id',input('id'));
|
||||
}
|
||||
$item = $model_obj->find();
|
||||
$data = $item;
|
||||
|
||||
|
||||
|
||||
return json(Tools::set_ok('ok',$data));
|
||||
}catch(\Exception $e){
|
||||
Tools::log_to_write_txt([
|
||||
'error'=>'获取统一问诊用户基本信息详情(后台病历管理详情).异常.'.$e->getMessage(),
|
||||
'参数'=>input(),
|
||||
'error_info'=>$e->getTraceAsString()
|
||||
]);
|
||||
return json(Tools::set_res(500,'操作异常',[]));
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@
|
||||
namespace app\api\controller;
|
||||
|
||||
|
||||
use app\common\model\TabConf;
|
||||
use think\Db;
|
||||
use wanghua\general_utility_tools_php\gpt\chat\ChatGPT;
|
||||
use wanghua\general_utility_tools_php\Mmodel;
|
||||
@@ -19,14 +20,39 @@ use wanghua\general_utility_tools_php\tool\Tools;
|
||||
* Class Reporttt
|
||||
* @package app\api\controller
|
||||
*/
|
||||
class Reporttt
|
||||
class Reporttt extends BaseHttpApi
|
||||
{
|
||||
|
||||
/**
|
||||
* desc:疼痛科-数字人-生成听诊报告
|
||||
* desc:疼痛科-数字人-生成听诊报告(同时提交固定问答聊天记录)
|
||||
*
|
||||
* api/Reporttt/createReport
|
||||
* username 用户名
|
||||
*
|
||||
* name 病人姓名
|
||||
gender 病人性别
|
||||
age 病人年龄
|
||||
edu 教育程度
|
||||
career_year 职业及年限
|
||||
power 体力要求
|
||||
satisfaction 经济满意度
|
||||
old_career_year 过往职业及年限
|
||||
support 社会支持度
|
||||
marriage 婚姻状况
|
||||
live 居住情况
|
||||
home 家庭关系
|
||||
address 地址
|
||||
phone 联系方式
|
||||
wechat_no 微信号
|
||||
ticket 对话票据
|
||||
hdrdepartment_id 科室
|
||||
* from 来源:num_per=数智人,ty=听译助手,h5=h5网页问诊
|
||||
*
|
||||
* content 对话内容;格式:
|
||||
* $content = [
|
||||
["role" => "user", "content" => '医生说:xxxxx'],
|
||||
["role" => "user", "content" => '患者说:xxxxx'],
|
||||
];
|
||||
* author:wh
|
||||
*/
|
||||
function createReport(){
|
||||
@@ -46,15 +72,23 @@ class Reporttt
|
||||
|
||||
$answer_json_arr = [];
|
||||
|
||||
//$ticket = input('ticket');
|
||||
//if(empty($ticket)){
|
||||
// return json(Tools::set_fail('ticket必须'));
|
||||
//}
|
||||
$username = input('username');
|
||||
if(empty($username)){
|
||||
return json(Tools::set_fail('username不存在'));
|
||||
$ticket = input('ticket');
|
||||
if(empty($ticket)){
|
||||
return json(Tools::set_fail('对话票据ticket必须(用于隔离用户聊天历史记录),登陆时返回票据,每次诊断结束重新生成票据!'));
|
||||
}
|
||||
$user = Db::table('fa_tt_users')->where('username',$username)->find();
|
||||
|
||||
if(empty(input('from'))){
|
||||
return json(Tools::set_fail('from必须'));
|
||||
}
|
||||
if(empty(input('hdrdepartment_id'))){
|
||||
return json(Tools::set_fail('hdrdepartment_id必须'));
|
||||
}
|
||||
//$username = input('username');
|
||||
//if(empty($username)){
|
||||
// return json(Tools::set_fail('username不存在'));
|
||||
//}
|
||||
|
||||
$user = Db::table('fa_hdrdoctorusers')->where('ticket',$ticket)->find();
|
||||
if(empty($user)){
|
||||
return json(Tools::set_res(530,'用户不存在'));
|
||||
}
|
||||
@@ -79,6 +113,10 @@ class Reporttt
|
||||
'address'=>input('address',''),//地址
|
||||
'phone'=>input('phone',''),//联系方式
|
||||
'wechat_no'=>input('wechat_no',''),//微信号
|
||||
'from'=>input('from',''),//来源
|
||||
'ticket'=>$ticket,//对话票据'
|
||||
'date'=>date('Y-m-d'),
|
||||
'hdrdepartment_id'=>input('hdrdepartment_id'),//科室
|
||||
];
|
||||
|
||||
$contentstr = input('content');
|
||||
@@ -113,7 +151,9 @@ class Reporttt
|
||||
//$content = [
|
||||
// //["role" => "user", "content" => '']
|
||||
//];
|
||||
//设置聊天记录
|
||||
|
||||
|
||||
//chatGpt设置前置聊天上下文
|
||||
$chatobj->setBefore($sub_content);
|
||||
|
||||
//回答
|
||||
@@ -147,10 +187,25 @@ class Reporttt
|
||||
Db::startTrans();
|
||||
try {
|
||||
foreach ($data as $item){
|
||||
|
||||
//新增统一基本信息
|
||||
$hdruserbaseinfo_id = Db::table('fa_hdruserbaseinfo')->insertGetId($basedata);
|
||||
//只新增不修改
|
||||
$DATAID = Db::table('fa_tt_userbaseinfo')->insert($basedata);
|
||||
$item['userbaseid'] = $DATAID;
|
||||
$userbaseinfo_id = Db::table('fa_tt_userbaseinfo')->insert($basedata);
|
||||
//保存疼痛科聊天记录
|
||||
$this->setTtChatHistory($sub_content,$user['username'],$hdruserbaseinfo_id,$userbaseinfo_id,$ticket);
|
||||
$item['userbaseid'] = $userbaseinfo_id;
|
||||
$item['hdruserbaseinfo_id'] = $hdruserbaseinfo_id;//统一病历基本信息ID
|
||||
$item['hdrdepartment_id'] = input('hdrdepartment_id');
|
||||
$item['from'] = input('from','');//来源:num_per=数智人,ty=听译助手,h5=h5网页问诊
|
||||
//保存报告
|
||||
Db::table('fa_tt_medical_report')->insert($item);
|
||||
//日期
|
||||
//$item['date'] = date('Y-m-d');
|
||||
|
||||
|
||||
////统一存档(暂时不用)
|
||||
//Db::table(TabConf::$fa_hdrmedical_report)->insert($item);
|
||||
}
|
||||
|
||||
Db::commit();
|
||||
@@ -162,6 +217,30 @@ class Reporttt
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* desc:保存疼痛科聊天记录
|
||||
* author:wh
|
||||
* @param $sub_content
|
||||
*/
|
||||
private function setTtChatHistory($sub_content,$username,$hdruserbaseinfo_id,$userbaseinfo_id,$ticket){
|
||||
//$content = [
|
||||
// //["role" => "user", "content" => '']
|
||||
//];
|
||||
$data = [];
|
||||
foreach ($sub_content as $item){
|
||||
$content = explode(':',$item['content']);
|
||||
$d = [
|
||||
'username'=>$username,
|
||||
'type'=>empty($content[0])?'':$content[0],
|
||||
'chat_msg'=>$item['content'],
|
||||
'ticket'=>$ticket,
|
||||
'userbaseinfo_id'=>$userbaseinfo_id,
|
||||
'hdruserbaseinfo_id'=>$hdruserbaseinfo_id
|
||||
];
|
||||
$data[] = $d;
|
||||
}
|
||||
Db::table(TabConf::$fa_tt_chathistory)->insertAll($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* desc:查询报告详情
|
||||
@@ -219,7 +298,6 @@ class Reporttt
|
||||
//if(empty($ticket)){
|
||||
// return Tools::set_fail('ticket必须');
|
||||
//}
|
||||
//$user = Db::table('fa_tt_users')->where('ticket',$ticket)->find();
|
||||
//修改基本信息
|
||||
$data = [
|
||||
//'username'=>$user['username'],//医生
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
namespace app\api\controller;
|
||||
|
||||
|
||||
use app\common\model\TabConf;
|
||||
use GatewayWorker\Lib\Gateway;
|
||||
use think\Db;
|
||||
use wanghua\general_utility_tools_php\gpt\chat\ChatGPT;
|
||||
@@ -20,13 +21,16 @@ use wanghua\general_utility_tools_php\tool\Tools;
|
||||
* Class Reportty
|
||||
* @package app\api\controller
|
||||
*/
|
||||
class Reportty
|
||||
class Reportty extends BaseHttpApi
|
||||
{
|
||||
|
||||
/**
|
||||
* desc:听译-生成听诊报告
|
||||
*
|
||||
* api/Reportty/createReport
|
||||
* 参数:ticket
|
||||
* from 来源
|
||||
* client_id
|
||||
*
|
||||
* author:wh
|
||||
*/
|
||||
@@ -47,23 +51,19 @@ class Reportty
|
||||
|
||||
$answer_json_arr = [];
|
||||
|
||||
//$ticket = input('ticket');
|
||||
//if(empty($ticket)){
|
||||
// return json(Tools::set_fail('ticket必须'));
|
||||
//}
|
||||
$username = input('username');
|
||||
if(empty($username)){
|
||||
return json(Tools::set_fail('username必须'));
|
||||
$ticket = input('ticket');
|
||||
if(empty($ticket)){
|
||||
return json(Tools::set_fail('ticket必须'));
|
||||
}
|
||||
$user = Db::table('fa_ty_users')->where('username',$username)->find();
|
||||
$user = Db::table('fa_hdrdoctorusers')->where('ticket',$ticket)->find();
|
||||
if(empty($user)){
|
||||
return json(Tools::set_fail('用户不存在'));
|
||||
return json(Tools::set_fail('医生不存在,请确认ticket'));
|
||||
}
|
||||
|
||||
//$username = $user['username'];
|
||||
//查询历史聊天记录
|
||||
//$day3 = date('Y-m-d 00:00:00',strtotime('-3 day'));
|
||||
$his_record = Db::table('fa_ty_chathistory')
|
||||
->where('username',$user['username'])
|
||||
->where('ticket',$ticket)
|
||||
->order('id asc')
|
||||
//->where('createtime','>',$day3)//3天之内
|
||||
->select();
|
||||
@@ -73,24 +73,21 @@ class Reportty
|
||||
$content = [
|
||||
//["role" => "user", "content" => '']
|
||||
];
|
||||
$baseuser = [];
|
||||
//Db::table('fa_ty_userbaseinfo')
|
||||
//->where('phone',$user['username'])
|
||||
//->where('name',$user['name'])
|
||||
//->find();
|
||||
//病历
|
||||
$medicalrecord = [];
|
||||
|
||||
$name = isset($baseuser['name'])?$baseuser['name']:'未知';
|
||||
$gender = isset($baseuser['gender'])?$baseuser['gender']:'未知';
|
||||
$age = isset($baseuser['age'])?$baseuser['age']:'未知';
|
||||
$main_complaint = isset($baseuser['main_complaint'])?$baseuser['main_complaint']:'未知';
|
||||
$medical_history = isset($baseuser['medical_history'])?$baseuser['medical_history']:'未知';
|
||||
$past_history = isset($baseuser['past_history'])?$baseuser['past_history']:'未知';
|
||||
$allergy_history = isset($baseuser['allergy_history'])?$baseuser['allergy_history']:'未知';
|
||||
$family_history = isset($baseuser['family_history'])?$baseuser['family_history']:'未知';
|
||||
$personal_history = isset($baseuser['personal_history'])?$baseuser['personal_history']:'未知';
|
||||
$menstrual_marital_history = isset($baseuser['menstrual_marital_history'])?$baseuser['menstrual_marital_history']:'未知';
|
||||
$diagnosis = isset($baseuser['diagnosis'])?$baseuser['diagnosis']:'未知';
|
||||
$treatment = isset($baseuser['treatment'])?$baseuser['treatment']:'未知';
|
||||
$name = isset($medicalrecord['name'])?$medicalrecord['name']:'未知';
|
||||
$gender = isset($medicalrecord['gender'])?$medicalrecord['gender']:'未知';
|
||||
$age = isset($medicalrecord['age'])?$medicalrecord['age']:'未知';
|
||||
$main_complaint = isset($medicalrecord['main_complaint'])?$medicalrecord['main_complaint']:'未知';
|
||||
$medical_history = isset($medicalrecord['medical_history'])?$medicalrecord['medical_history']:'未知';
|
||||
$past_history = isset($medicalrecord['past_history'])?$medicalrecord['past_history']:'未知';
|
||||
$allergy_history = isset($medicalrecord['allergy_history'])?$medicalrecord['allergy_history']:'未知';
|
||||
$family_history = isset($medicalrecord['family_history'])?$medicalrecord['family_history']:'未知';
|
||||
$personal_history = isset($medicalrecord['personal_history'])?$medicalrecord['personal_history']:'未知';
|
||||
$menstrual_marital_history = isset($medicalrecord['menstrual_marital_history'])?$medicalrecord['menstrual_marital_history']:'未知';
|
||||
$diagnosis = isset($medicalrecord['diagnosis'])?$medicalrecord['diagnosis']:'未知';
|
||||
$treatment = isset($medicalrecord['treatment'])?$medicalrecord['treatment']:'未知';
|
||||
//构建基本信息
|
||||
$content[] = ["role" => "user", "content" => '【姓名】:'.$name];
|
||||
$content[] = ["role" => "user", "content" => '【性别】:'.$gender];
|
||||
@@ -123,18 +120,26 @@ class Reportty
|
||||
$data = [
|
||||
'doctor'=>$user['username'],
|
||||
//病人
|
||||
//'username'=>Db::table('fa_ty_users')->where('doctor',$user['username'])->value('username'),
|
||||
'report_content'=>$choice['message']['content'],
|
||||
'ticket'=>$ticket,
|
||||
'from'=>input('from','ty'),//来源
|
||||
];
|
||||
$report_id = Db::table('fa_ty_medical_report')->insertGetId($data);
|
||||
//日期
|
||||
$data['date'] = date('Y-m-d');
|
||||
//来源
|
||||
//$data['from'] = input('from','ty');
|
||||
|
||||
//统一存档(暂时不用)
|
||||
//Db::table(TabConf::$fa_hdrmedical_report)->insert($data);
|
||||
|
||||
$res_content[] = ['report_id'=>$report_id,'report_content'=>$choice['message']['content']];
|
||||
}
|
||||
}
|
||||
//点击生成报告删除历史聊天记录
|
||||
Db::table('fa_ty_chathistory')
|
||||
->where('username',$user['username'])
|
||||
->delete();
|
||||
//Db::table('fa_ty_chathistory')
|
||||
// ->where('username',$user['username'])
|
||||
// ->delete();
|
||||
|
||||
$client_id = input('client_id');
|
||||
if(empty($client_id)){
|
||||
@@ -143,12 +148,11 @@ class Reportty
|
||||
|
||||
//查询广播客户端id
|
||||
$arr = Db::table('fa_device')
|
||||
->where('username',$username)
|
||||
->where('clientid','neq',$client_id)
|
||||
->where('ticket',$ticket)
|
||||
->select();
|
||||
$clientid_arr = array_column($arr,'clientid');
|
||||
$json = Tools::wss_json_ok('Reportty/createReport','ok',['flow_code'=>'create_report_end']);
|
||||
Gateway::sendToAll($json,$clientid_arr);
|
||||
Gateway::sendToAll($json,$clientid_arr,[$client_id]);
|
||||
return json(Tools::set_ok($res_content));
|
||||
}
|
||||
|
||||
@@ -202,17 +206,31 @@ class Reportty
|
||||
menstrual_marital_history 月经婚育史
|
||||
diagnosis 诊断
|
||||
treatment 医嘱
|
||||
ticket 对话票据
|
||||
hdrdepartment_id 科室
|
||||
*/
|
||||
function editReport(){
|
||||
return Mmodel::catchJson(function (){
|
||||
//$ticket = input('ticket');
|
||||
//if(empty($ticket)){
|
||||
// return Tools::set_fail('ticket必须');
|
||||
//}
|
||||
//$user = Db::table('fa_ty_users')->where('ticket',$ticket)->find();
|
||||
//修改基本信息
|
||||
$ticket = input('ticket');
|
||||
if(empty($ticket)){
|
||||
return Tools::set_fail('ticket必须');
|
||||
}
|
||||
|
||||
if(empty(input('username'))){
|
||||
return Tools::set_fail('医生登录账号必须');
|
||||
}
|
||||
if(empty(input('name',''))){
|
||||
return Tools::set_fail('病人姓名必须');
|
||||
}
|
||||
if(empty(input('phone',''))){
|
||||
return Tools::set_fail('病人手机号必须');
|
||||
}
|
||||
if(empty(input('diagnosis'))){
|
||||
return Tools::set_fail('diagnosis诊断内容必须');
|
||||
}
|
||||
//听译问诊-患者病历信息
|
||||
$data = [
|
||||
//'username'=>$user['username'],//医生
|
||||
'username'=>input('username'),//医生
|
||||
'name'=>input('name',''),//病人姓名
|
||||
'gender'=>input('gender',''),//病人性别: M=男性, F=女性
|
||||
'age'=>input('age',''),//病人年龄
|
||||
@@ -225,22 +243,55 @@ class Reportty
|
||||
'menstrual_marital_history'=>input('menstrual_marital_history',''),//月经婚育史
|
||||
'diagnosis'=>input('diagnosis',''),//诊断
|
||||
'treatment'=>input('treatment',''),//医嘱
|
||||
'ticket'=>$ticket,
|
||||
'hdrdepartment_id'=>input('hdrdepartment_id'),//科室
|
||||
];
|
||||
//查询基本信息
|
||||
$baseuser = Db::table('fa_ty_userbaseinfo')
|
||||
//新增统一基本信息,修改报告的基本信息id
|
||||
$base_data = [
|
||||
'doctor'=>input('username'),
|
||||
'from'=>input('from','ty'),
|
||||
'name'=>input('name',''),
|
||||
'gender'=>input('gender',''),//病人性别: M=男性, F=女性
|
||||
'age'=>input('age',''),//病人年龄
|
||||
'phone'=>input('phone',''),
|
||||
'diagnosis'=>input('diagnosis',''),//诊断
|
||||
];
|
||||
$baseinfo = Db::table('fa_hdruserbaseinfo')
|
||||
->where('ticket',$ticket)
|
||||
->find();
|
||||
//if(empty($baseinfo)){
|
||||
$baseinfo['ticket'] = $ticket;
|
||||
$baseinfo['date'] = date('Y-m-d');
|
||||
//新增统一基本信息
|
||||
$hdruserbaseinfo_id = Db::table('fa_hdruserbaseinfo')
|
||||
->insertGetId($base_data);
|
||||
|
||||
//修改历史记录的hdruserbaseinfo_id
|
||||
Db::table('fa_ty_chathistory')
|
||||
->where('ticket',$ticket)
|
||||
->update(['hdruserbaseinfo_id'=>$hdruserbaseinfo_id]);
|
||||
//}else{
|
||||
// Db::table('fa_hdruserbaseinfo')
|
||||
// ->where('ticket',$ticket)
|
||||
// ->update($data);
|
||||
//}
|
||||
//听译问诊-患者病历信息
|
||||
$medicalrecord = Db::table('fa_ty_userbaseinfo')
|
||||
->where('name',input('name',''))
|
||||
->find();
|
||||
if(empty($baseuser)){
|
||||
//新增基本信息
|
||||
if(empty($medicalrecord)){
|
||||
$data['ticket'] = $ticket;
|
||||
//新增听译病历信息
|
||||
$userbaseid = Db::table('fa_ty_userbaseinfo')->insertGetId($data);
|
||||
|
||||
}else{
|
||||
$userbaseid = $baseuser['id'];
|
||||
$userbaseid = $medicalrecord['id'];
|
||||
Db::table('fa_ty_userbaseinfo')
|
||||
->where('id',$userbaseid)
|
||||
->where('ticket',$ticket)
|
||||
->update($data);
|
||||
}
|
||||
|
||||
|
||||
//修改报告
|
||||
$str = <<<EOF
|
||||
【姓名】:{$data['name']}
|
||||
@@ -267,11 +318,28 @@ EOF;
|
||||
Db::table('fa_ty_medical_report')
|
||||
->where('id',$dataid)
|
||||
->data([
|
||||
//病历信息id
|
||||
'userbaseid'=>$userbaseid,//创建报告的时候这个字段是空,修改报告再补填这个字段
|
||||
'report_content'=>$str
|
||||
'report_content'=>$str,
|
||||
'name'=>$data['name'],
|
||||
'gender'=>$data['gender'],
|
||||
'hdruserbaseinfo_id'=>$hdruserbaseinfo_id,//统一病历基本信息ID
|
||||
])
|
||||
->update();
|
||||
|
||||
|
||||
//统一存档(暂时不用)
|
||||
//Db::table(TabConf::$fa_hdrmedical_report)
|
||||
// ->where('id',$dataid)
|
||||
// ->data([
|
||||
// //病历信息id
|
||||
// 'userbaseid'=>$usermedicalrecord_id,//创建报告的时候这个字段是空,修改报告再补填这个字段
|
||||
// 'report_content'=>$str,
|
||||
// 'name'=>$data['name'],
|
||||
// 'gender'=>$data['gender'],
|
||||
// ])
|
||||
// ->update();
|
||||
|
||||
return Tools::set_ok();
|
||||
});
|
||||
}
|
||||
|
||||
85
digital_doctor/application/api/controller/Ttchathistory.php
Normal file
85
digital_doctor/application/api/controller/Ttchathistory.php
Normal file
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use think\Db;
|
||||
use app\common\model\TabConf;
|
||||
use wanghua\general_utility_tools_php\file\upload\FileUpload;
|
||||
use wanghua\general_utility_tools_php\tool\Tools;
|
||||
use wanghua\general_utility_tools_php\Validate;
|
||||
use think\Controller;
|
||||
|
||||
class Ttchathistory extends BaseHttpApi
|
||||
{
|
||||
protected $controller_comments = '疼痛科聊天历史';
|
||||
|
||||
/**
|
||||
* desc:获取疼痛科聊天历史
|
||||
*
|
||||
* api/Ttchathistory/getTtchathistoryList
|
||||
*
|
||||
* 参数:
|
||||
* 带分页
|
||||
* current_page 当前页码
|
||||
* list_rows 每页显示条数 默认15
|
||||
* hdruserbaseinfo_id 统一基本信息 统一基本信息 必须
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* username 用户
|
||||
* type 聊天角色
|
||||
* chat_msg 问诊内容
|
||||
* ticket 对话票据(用于隔离用户聊天历史记录)
|
||||
* userbaseinfo_id 基本信息ID
|
||||
* create_time 创建时间
|
||||
* hdruserbaseinfo_id 统一基本信息
|
||||
|
||||
* author:wh
|
||||
*/
|
||||
function getTtchathistoryList(){
|
||||
Tools::log_to_write_txt(['获取疼痛科聊天历史 入参:'=>input()]);
|
||||
$api_desc = '获取疼痛科聊天历史';
|
||||
try {
|
||||
|
||||
$hdruserbaseinfo_id = input('hdruserbaseinfo_id');
|
||||
if(empty($hdruserbaseinfo_id)){
|
||||
return json(Tools::set_fail('hdruserbaseinfo_id参数错误'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
$model_obj = Db::table(TabConf::$fa_tt_chathistory);
|
||||
|
||||
if(input('hdruserbaseinfo_id')){
|
||||
$model_obj->where('hdruserbaseinfo_id',input('hdruserbaseinfo_id'));
|
||||
}
|
||||
|
||||
$data = $model_obj->paginate(['page'=>input('current_page',1),'list_rows'=>input('list_rows',15)])
|
||||
->each(function($item, $key){
|
||||
|
||||
|
||||
|
||||
return $item;
|
||||
});
|
||||
|
||||
// ['total'] => int(30)
|
||||
// ['per_page'] => int(15)
|
||||
// ['current_page'] => int(1)
|
||||
// ['last_page''] => int(2)
|
||||
$data = $data->toArray();//包含 data列表
|
||||
|
||||
|
||||
|
||||
|
||||
return json(Tools::set_ok('ok',$data));
|
||||
}catch(\Exception $e){
|
||||
Tools::log_to_write_txt([
|
||||
'error'=>'获取疼痛科聊天历史.异常.'.$e->getMessage(),
|
||||
'参数'=>input(),
|
||||
'error_info'=>$e->getTraceAsString()
|
||||
]);
|
||||
return json(Tools::set_res(500,'操作异常',[]));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
179
digital_doctor/application/api/controller/Ttmedicalreport.php
Normal file
179
digital_doctor/application/api/controller/Ttmedicalreport.php
Normal file
@@ -0,0 +1,179 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use think\Db;
|
||||
use app\common\model\TabConf;
|
||||
use wanghua\general_utility_tools_php\file\upload\FileUpload;
|
||||
use wanghua\general_utility_tools_php\tool\Tools;
|
||||
use wanghua\general_utility_tools_php\Validate;
|
||||
use think\Controller;
|
||||
|
||||
class Ttmedicalreport extends BaseHttpApi
|
||||
{
|
||||
protected $controller_comments = '疼痛科病历报告(听译问诊)(一个基本信息对应一个报告)';
|
||||
|
||||
/**
|
||||
* desc:获取疼痛科病历报告(一个基本信息对应一个报告)
|
||||
*
|
||||
* api/Ttmedicalreport/getTtmedicalreportDetail
|
||||
*
|
||||
* 参数:
|
||||
* hdruserbaseinfo_id 统一基本信息 统一基本信息 必须
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* userbaseid 基本信息ID
|
||||
* doctor 所属医生
|
||||
* username 病人
|
||||
* report_content 报告内容
|
||||
* name 病人姓名
|
||||
* phone 病人电话
|
||||
* from 来源:num_per=数智人,ty=听译助手,h5=h5网页问诊
|
||||
* create_time 生成时间
|
||||
* ticket 对话票据(数据隔离)
|
||||
* hdruserbaseinfo_id 统一基本信息
|
||||
|
||||
* author:wh
|
||||
*/
|
||||
function getTtmedicalreportDetail(){
|
||||
Tools::log_to_write_txt(['获取疼痛科病历报告(一个基本信息对应一个报告) 入参:'=>input()]);
|
||||
$api_desc = '获取疼痛科病历报告(一个基本信息对应一个报告)';
|
||||
try {
|
||||
|
||||
$hdruserbaseinfo_id = input('hdruserbaseinfo_id');
|
||||
if(empty($hdruserbaseinfo_id)){
|
||||
return json(Tools::set_fail('hdruserbaseinfo_id参数错误'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
$model_obj = Db::table(TabConf::$fa_tt_medical_report);
|
||||
|
||||
if(input('hdruserbaseinfo_id')){
|
||||
$model_obj->where('hdruserbaseinfo_id',input('hdruserbaseinfo_id'));
|
||||
}
|
||||
$item = $model_obj->find();
|
||||
$data = $item;
|
||||
|
||||
|
||||
|
||||
return json(Tools::set_ok('ok',$data));
|
||||
}catch(\Exception $e){
|
||||
Tools::log_to_write_txt([
|
||||
'error'=>'获取疼痛科病历报告(一个基本信息对应一个报告).异常.'.$e->getMessage(),
|
||||
'参数'=>input(),
|
||||
'error_info'=>$e->getTraceAsString()
|
||||
]);
|
||||
return json(Tools::set_res(500,'操作异常',[]));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* desc:获取疼痛科病历报告(听译问诊)(一个基本信息对应一个报告)
|
||||
*
|
||||
* api/Ttmedicalreport/getTtmedicalreportList
|
||||
*
|
||||
* 参数:
|
||||
* 带分页
|
||||
* current_page 当前页码
|
||||
* list_rows 每页显示条数 默认15
|
||||
* userbaseid 基本信息ID
|
||||
* doctor 所属医生
|
||||
* username 病人
|
||||
* report_content 报告内容
|
||||
* name 病人姓名
|
||||
* phone 病人电话
|
||||
* from 来源:num_per=数智人,ty=听译助手,h5=h5网页问诊
|
||||
* hdruserbaseinfo_id 统一基本信息
|
||||
* hdrdepartment_id 科室
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* userbaseid 基本信息ID
|
||||
* doctor 所属医生
|
||||
* username 病人
|
||||
* report_content 报告内容
|
||||
* name 病人姓名
|
||||
* phone 病人电话
|
||||
* from 来源:num_per=数智人,ty=听译助手,h5=h5网页问诊
|
||||
* create_time 生成时间
|
||||
* ticket 对话票据(数据隔离)
|
||||
* hdruserbaseinfo_id 统一基本信息
|
||||
* hdrdepartment_id 科室
|
||||
|
||||
* author:wh
|
||||
*/
|
||||
function getTtmedicalreportList(){
|
||||
Tools::log_to_write_txt(['获取疼痛科病历报告(听译问诊)(一个基本信息对应一个报告) 入参:'=>input()]);
|
||||
$api_desc = '获取疼痛科病历报告(听译问诊)(一个基本信息对应一个报告)';
|
||||
try {
|
||||
|
||||
$userbaseid = input('userbaseid');
|
||||
$doctor = input('doctor');
|
||||
$username = input('username');
|
||||
$report_content = input('report_content');
|
||||
$name = input('name');
|
||||
$phone = input('phone');
|
||||
$from = input('from');
|
||||
$hdruserbaseinfo_id = input('hdruserbaseinfo_id');
|
||||
$hdrdepartment_id = input('hdrdepartment_id');
|
||||
|
||||
|
||||
$model_obj = Db::table(TabConf::$fa_tt_medical_report);
|
||||
|
||||
if(input('userbaseid')){
|
||||
$model_obj->where('userbaseid',input('userbaseid'));
|
||||
}
|
||||
if(input('doctor')){
|
||||
$model_obj->where('doctor',input('doctor'));
|
||||
}
|
||||
if(input('username')){
|
||||
$model_obj->where('username',input('username'));
|
||||
}
|
||||
if(input('report_content')){
|
||||
$model_obj->where('report_content',input('report_content'));
|
||||
}
|
||||
if(input('name')){
|
||||
$model_obj->where('name',input('name'));
|
||||
}
|
||||
if(input('phone')){
|
||||
$model_obj->where('phone',input('phone'));
|
||||
}
|
||||
if(input('from')){
|
||||
$model_obj->where('from',input('from'));
|
||||
}
|
||||
if(input('hdruserbaseinfo_id')){
|
||||
$model_obj->where('hdruserbaseinfo_id',input('hdruserbaseinfo_id'));
|
||||
}
|
||||
if(input('hdrdepartment_id')){
|
||||
$model_obj->where('hdrdepartment_id',input('hdrdepartment_id'));
|
||||
}
|
||||
|
||||
$data = $model_obj->paginate(['page'=>input('current_page',1),'list_rows'=>input('list_rows',15)])
|
||||
->each(function($item, $key){
|
||||
|
||||
|
||||
|
||||
return $item;
|
||||
});
|
||||
|
||||
// ['total'] => int(30)
|
||||
// ['per_page'] => int(15)
|
||||
// ['current_page'] => int(1)
|
||||
// ['last_page''] => int(2)
|
||||
$data = $data->toArray();//包含 data列表
|
||||
|
||||
|
||||
|
||||
|
||||
return json(Tools::set_ok('ok',$data));
|
||||
}catch(\Exception $e){
|
||||
Tools::log_to_write_txt([
|
||||
'error'=>'获取疼痛科病历报告(听译问诊)(一个基本信息对应一个报告).异常.'.$e->getMessage(),
|
||||
'参数'=>input(),
|
||||
'error_info'=>$e->getTraceAsString()
|
||||
]);
|
||||
return json(Tools::set_res(500,'操作异常',[]));
|
||||
}
|
||||
}
|
||||
85
digital_doctor/application/api/controller/Ttuserbaseinfo.php
Normal file
85
digital_doctor/application/api/controller/Ttuserbaseinfo.php
Normal file
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use think\Db;
|
||||
use app\common\model\TabConf;
|
||||
use wanghua\general_utility_tools_php\file\upload\FileUpload;
|
||||
use wanghua\general_utility_tools_php\tool\Tools;
|
||||
use wanghua\general_utility_tools_php\Validate;
|
||||
use think\Controller;
|
||||
|
||||
class Ttuserbaseinfo extends BaseHttpApi
|
||||
{
|
||||
protected $controller_comments = '疼痛科用户基本信息';
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* desc:获取疼痛科用户基本信息
|
||||
*
|
||||
* api/Ttuserbaseinfo/getTtuserbaseinfoDetail
|
||||
*
|
||||
* 参数:
|
||||
* id ID ID 必须
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* date 日期
|
||||
* doctor 所属医生
|
||||
* name 病人姓名
|
||||
* gender 病人性别
|
||||
* age 病人年龄
|
||||
* edu 教育程度
|
||||
* career_year 职业及年限
|
||||
* power 体力要求
|
||||
* satisfaction 经济满意度
|
||||
* old_career_year 过往职业及年限
|
||||
* old_career_power 过往职业体力要求
|
||||
* support 社会支持度
|
||||
* marriage 婚姻状况
|
||||
* live 居住情况
|
||||
* home 家庭关系
|
||||
* address 地址
|
||||
* phone 联系方式
|
||||
* wechat_no 微信号
|
||||
* create_time 创建时间
|
||||
* is_flow 是否接受随访:yes=是,no=否
|
||||
* ticket 对话票据(数据隔离)
|
||||
* hdrdepartment_id 科室
|
||||
* from 来源:num_per=数智人,ty=听译助手,h5=h5网页问诊
|
||||
|
||||
* author:wh
|
||||
*/
|
||||
function getTtuserbaseinfoDetail(){
|
||||
Tools::log_to_write_txt(['获取疼痛科用户基本信息 入参:'=>input()]);
|
||||
$api_desc = '获取疼痛科用户基本信息';
|
||||
try {
|
||||
|
||||
$id = input('id');
|
||||
if(empty($id)){
|
||||
return json(Tools::set_fail('id参数错误'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
$model_obj = Db::table(TabConf::$fa_tt_userbaseinfo);
|
||||
|
||||
if(input('id')){
|
||||
$model_obj->where('id',input('id'));
|
||||
}
|
||||
$item = $model_obj->find();
|
||||
$data = $item;
|
||||
|
||||
|
||||
|
||||
return json(Tools::set_ok('ok',$data));
|
||||
}catch(\Exception $e){
|
||||
Tools::log_to_write_txt([
|
||||
'error'=>'获取疼痛科用户基本信息.异常.'.$e->getMessage(),
|
||||
'参数'=>input(),
|
||||
'error_info'=>$e->getTraceAsString()
|
||||
]);
|
||||
return json(Tools::set_res(500,'操作异常',[]));
|
||||
}
|
||||
}
|
||||
84
digital_doctor/application/api/controller/Tychathistory.php
Normal file
84
digital_doctor/application/api/controller/Tychathistory.php
Normal file
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use think\Db;
|
||||
use app\common\model\TabConf;
|
||||
use wanghua\general_utility_tools_php\file\upload\FileUpload;
|
||||
use wanghua\general_utility_tools_php\tool\Tools;
|
||||
use wanghua\general_utility_tools_php\Validate;
|
||||
use think\Controller;
|
||||
|
||||
class Tychathistory extends BaseHttpApi
|
||||
{
|
||||
protected $controller_comments = '听译-聊天历史';
|
||||
|
||||
/**
|
||||
* desc:获取听译-聊天历史
|
||||
*
|
||||
* api/Tychathistory/getTychathistoryList
|
||||
*
|
||||
* 参数:
|
||||
* 带分页
|
||||
* current_page 当前页码
|
||||
* list_rows 每页显示条数 默认15
|
||||
* hdruserbaseinfo_id 统一基本信息 统一基本信息 必须
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* username 用户
|
||||
* type 聊天角色
|
||||
* chat_msg 问诊内容
|
||||
* ticket 对话票据(数据隔离)
|
||||
* create_time 创建时间
|
||||
* hdruserbaseinfo_id 统一基本信息
|
||||
|
||||
* author:wh
|
||||
*/
|
||||
function getTychathistoryList(){
|
||||
Tools::log_to_write_txt(['获取听译-聊天历史 入参:'=>input()]);
|
||||
$api_desc = '获取听译-聊天历史';
|
||||
try {
|
||||
|
||||
$hdruserbaseinfo_id = input('hdruserbaseinfo_id');
|
||||
if(empty($hdruserbaseinfo_id)){
|
||||
return json(Tools::set_fail('hdruserbaseinfo_id参数错误'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
$model_obj = Db::table(TabConf::$fa_ty_chathistory);
|
||||
|
||||
if(input('hdruserbaseinfo_id')){
|
||||
$model_obj->where('hdruserbaseinfo_id',input('hdruserbaseinfo_id'));
|
||||
}
|
||||
|
||||
$data = $model_obj->paginate(['page'=>input('current_page',1),'list_rows'=>input('list_rows',15)])
|
||||
->each(function($item, $key){
|
||||
|
||||
|
||||
|
||||
return $item;
|
||||
});
|
||||
|
||||
// ['total'] => int(30)
|
||||
// ['per_page'] => int(15)
|
||||
// ['current_page'] => int(1)
|
||||
// ['last_page''] => int(2)
|
||||
$data = $data->toArray();//包含 data列表
|
||||
|
||||
|
||||
|
||||
|
||||
return json(Tools::set_ok('ok',$data));
|
||||
}catch(\Exception $e){
|
||||
Tools::log_to_write_txt([
|
||||
'error'=>'获取听译-聊天历史.异常.'.$e->getMessage(),
|
||||
'参数'=>input(),
|
||||
'error_info'=>$e->getTraceAsString()
|
||||
]);
|
||||
return json(Tools::set_res(500,'操作异常',[]));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
67
digital_doctor/application/api/controller/Tyfollowup.php
Normal file
67
digital_doctor/application/api/controller/Tyfollowup.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use think\Db;
|
||||
use app\common\model\TabConf;
|
||||
use wanghua\general_utility_tools_php\file\upload\FileUpload;
|
||||
use wanghua\general_utility_tools_php\tool\Tools;
|
||||
use wanghua\general_utility_tools_php\Validate;
|
||||
use think\Controller;
|
||||
|
||||
class Tyfollowup extends BaseHttpApi
|
||||
{
|
||||
protected $controller_comments = '随访记录(听译助手)';
|
||||
|
||||
/**
|
||||
* desc:获取随访记录(听译助手)
|
||||
*
|
||||
* api/Tyfollowup/getTyfollowupDetail
|
||||
*
|
||||
* 参数:
|
||||
* report_dataid 报告ID 报告ID 必须
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* report_dataid 报告ID
|
||||
* name 姓名
|
||||
* phone 电话
|
||||
* content 随访内容
|
||||
* create_time 随访时间
|
||||
|
||||
* author:wh
|
||||
*/
|
||||
function getTyfollowupDetail(){
|
||||
Tools::log_to_write_txt(['获取随访记录(听译助手) 入参:'=>input()]);
|
||||
$api_desc = '获取随访记录(听译助手)';
|
||||
try {
|
||||
|
||||
$report_dataid = input('report_dataid');
|
||||
if(empty($report_dataid)){
|
||||
return json(Tools::set_fail('report_dataid参数错误'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
$model_obj = Db::table(TabConf::$fa_ty_followup);
|
||||
|
||||
if(input('report_dataid')){
|
||||
$model_obj->where('report_dataid',input('report_dataid'));
|
||||
}
|
||||
$item = $model_obj->find();
|
||||
$data = $item;
|
||||
|
||||
|
||||
|
||||
return json(Tools::set_ok('ok',$data));
|
||||
}catch(\Exception $e){
|
||||
Tools::log_to_write_txt([
|
||||
'error'=>'获取随访记录(听译助手).异常.'.$e->getMessage(),
|
||||
'参数'=>input(),
|
||||
'error_info'=>$e->getTraceAsString()
|
||||
]);
|
||||
return json(Tools::set_res(500,'操作异常',[]));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use think\Db;
|
||||
use app\common\model\TabConf;
|
||||
use wanghua\general_utility_tools_php\file\upload\FileUpload;
|
||||
use wanghua\general_utility_tools_php\tool\Tools;
|
||||
use wanghua\general_utility_tools_php\Validate;
|
||||
use think\Controller;
|
||||
|
||||
class Tymedicalreport extends BaseHttpApi
|
||||
{
|
||||
protected $controller_comments = '听译-病历报告(听译问诊)(一个基本信息对应一个报告)';
|
||||
|
||||
/**
|
||||
* desc:获取听译-病历报告(听译问诊)(一个基本信息对应一个报告)
|
||||
*
|
||||
* api/Tymedicalreport/getTymedicalreportDetail
|
||||
*
|
||||
* 参数:
|
||||
* hdruserbaseinfo_id 统一基本信息 统一基本信息 必须
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* userbaseid 听译病历ID
|
||||
* doctor 所属医生
|
||||
* username 病人
|
||||
* report_content 报告内容
|
||||
* name 病人姓名
|
||||
* gender 病人性别
|
||||
* from 来源:num_per=数智人,ty=听译助手,h5=h5网页问诊
|
||||
* ticket 对话票据(数据隔离)
|
||||
* diagnostic_result 诊断结果
|
||||
* create_time 生成时间
|
||||
* hdruserbaseinfo_id 统一基本信息
|
||||
|
||||
* author:wh
|
||||
*/
|
||||
function getTymedicalreportDetail(){
|
||||
Tools::log_to_write_txt(['获取听译-病历报告(听译问诊)(一个基本信息对应一个报告) 入参:'=>input()]);
|
||||
$api_desc = '获取听译-病历报告(听译问诊)(一个基本信息对应一个报告)';
|
||||
try {
|
||||
|
||||
$hdruserbaseinfo_id = input('hdruserbaseinfo_id');
|
||||
if(empty($hdruserbaseinfo_id)){
|
||||
return json(Tools::set_fail('hdruserbaseinfo_id参数错误'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
$model_obj = Db::table(TabConf::$fa_ty_medical_report);
|
||||
|
||||
if(input('hdruserbaseinfo_id')){
|
||||
$model_obj->where('hdruserbaseinfo_id',input('hdruserbaseinfo_id'));
|
||||
}
|
||||
$item = $model_obj->find();
|
||||
$data = $item;
|
||||
|
||||
|
||||
|
||||
return json(Tools::set_ok('ok',$data));
|
||||
}catch(\Exception $e){
|
||||
Tools::log_to_write_txt([
|
||||
'error'=>'获取听译-病历报告(听译问诊)(一个基本信息对应一个报告).异常.'.$e->getMessage(),
|
||||
'参数'=>input(),
|
||||
'error_info'=>$e->getTraceAsString()
|
||||
]);
|
||||
return json(Tools::set_res(500,'操作异常',[]));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -29,6 +29,21 @@ use wanghua\general_utility_tools_php\wechat\UserAuth;
|
||||
*/
|
||||
class Userstt extends BaseHttpApi
|
||||
{
|
||||
/**
|
||||
* desc:获取对话票据,隔离用户历史记录,每次诊断完,重新生成新的对话票据
|
||||
* (首次对话票据在登录时返回)
|
||||
* 参数:无
|
||||
*
|
||||
* api/Userstt/getSayTicket
|
||||
*
|
||||
* author:wh
|
||||
*/
|
||||
function getSayTicket(){
|
||||
return Mmodel::catchJson(function (){
|
||||
$ticket = md5(time());
|
||||
return Tools::set_ok('ok',['ticket'=>$ticket]);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* desc:疼痛科-根据id查询用户
|
||||
* api/Userstt/getUserById
|
||||
@@ -42,7 +57,7 @@ class Userstt extends BaseHttpApi
|
||||
if(empty($dataid)){
|
||||
return Tools::set_fail('参数错误');
|
||||
}
|
||||
$data = Db::table('fa_tt_users')
|
||||
$data = Db::table('fa_hdrdoctorusers')
|
||||
->where('id',$dataid)
|
||||
->find();
|
||||
return Tools::set_res(200,'查询成功',$data);
|
||||
@@ -77,7 +92,7 @@ class Userstt extends BaseHttpApi
|
||||
if(empty($password)){
|
||||
return Tools::set_fail('参数错误:2');
|
||||
}
|
||||
$user = Db::table('fa_tt_users')
|
||||
$user = Db::table('fa_hdrdoctorusers')
|
||||
->where('username',$username)
|
||||
->find();
|
||||
if(empty($user)){
|
||||
@@ -91,22 +106,22 @@ class Userstt extends BaseHttpApi
|
||||
|
||||
unset($user['password']);
|
||||
|
||||
$expires = 7*86400+time();
|
||||
//$expires = 7*86400+time();//报告完成之后重新获取票据
|
||||
|
||||
|
||||
//返回票据
|
||||
$ticketstr = md5($user['username'].$expires);
|
||||
$ticketstr = md5($user['username']);
|
||||
|
||||
//修改有效期
|
||||
Db::table('fa_tt_users')
|
||||
Db::table('fa_hdrdoctorusers')
|
||||
->data([
|
||||
'ticket'=>$ticketstr,
|
||||
'expires'=>$expires,//7天
|
||||
//'expires'=>$expires,//7天
|
||||
//'clientid'=>$clientid,
|
||||
])
|
||||
->where('username',$username)
|
||||
->update();
|
||||
return Tools::set_ok('登录成功',['ticket'=>$ticketstr,'username'=>$username]);
|
||||
return Tools::set_ok('登录成功',['ticket'=>$ticketstr,'username'=>$username,'user'=>$user]);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -156,7 +171,7 @@ class Userstt extends BaseHttpApi
|
||||
if(empty($ticket)){
|
||||
return Tools::set_fail('ticket必须');
|
||||
}
|
||||
$user = Db::table('fa_tt_users')->where('ticket',$ticket)->find();
|
||||
$user = Db::table('fa_hdrdoctorusers')->where('ticket',$ticket)->find();
|
||||
if(empty($user)){
|
||||
return Tools::set_fail('ticket错误');
|
||||
}
|
||||
@@ -189,4 +204,64 @@ class Userstt extends BaseHttpApi
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* desc:提交自由问答记录(后台需要单独列出来,对话时前端缓存在本地,对话结束提交)
|
||||
*
|
||||
* 参数:
|
||||
* ticket 对话票据(结束问诊时重新生成)
|
||||
* username 用户名
|
||||
* content 对话内容,格式:
|
||||
* content = [
|
||||
["role" => "user", "content" => '1'],
|
||||
["role" => "user", "content" => '2'],
|
||||
["role" => "user", "content" => '3'],
|
||||
];
|
||||
*
|
||||
* api/Userstt/subFreeQuestionAnswerRecord
|
||||
*
|
||||
* author:wh
|
||||
*/
|
||||
function subFreeQuestionAnswerRecord(){
|
||||
return Mmodel::catchJson(function (){
|
||||
$ticket = input('ticket');
|
||||
if(empty($ticket)){
|
||||
return Tools::set_fail('ticket必须');
|
||||
}
|
||||
$content = input('content');
|
||||
if(empty($content)){
|
||||
return Tools::set_fail('content对话内容必须');
|
||||
}
|
||||
$username = input('username');
|
||||
if(empty($username)){
|
||||
return Tools::set_fail('username必须');
|
||||
}
|
||||
|
||||
$this->setTtFreeChatHistory($content,$username,$ticket);
|
||||
|
||||
return Tools::set_ok();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* desc:保存疼痛科自由对话聊天记录
|
||||
* author:wh
|
||||
* @param $sub_content
|
||||
*/
|
||||
private function setTtFreeChatHistory($sub_content,$username,$ticket){
|
||||
//$content = [
|
||||
// //["role" => "user", "content" => '']
|
||||
//];
|
||||
$data = [];
|
||||
foreach ($sub_content as $item){
|
||||
$content = explode(':',$item['content']);
|
||||
$d = [
|
||||
'username'=>$username,
|
||||
'type'=>empty($content[0])?'':$content[0],
|
||||
'chat_msg'=>$item['content'],
|
||||
'ticket'=>$ticket,
|
||||
];
|
||||
$data[] = $d;
|
||||
}
|
||||
Db::table(TabConf::$fa_tt_free_chathistory)->insertAll($data);
|
||||
}
|
||||
}
|
||||
@@ -57,11 +57,11 @@ class Usersty extends BaseHttpApi
|
||||
if(empty($password)){
|
||||
return Tools::set_fail('参数错误:2');
|
||||
}
|
||||
$user = Db::table('fa_ty_users')
|
||||
$user = Db::table('fa_hdrdoctorusers')
|
||||
->where('username',$username)
|
||||
->find();
|
||||
if(empty($user)){
|
||||
return Tools::set_fail('参数错误');
|
||||
return Tools::set_fail('用户不存在');
|
||||
}
|
||||
if($password != $user['password']){
|
||||
return Tools::set_fail('密码错误');
|
||||
@@ -71,23 +71,26 @@ class Usersty extends BaseHttpApi
|
||||
|
||||
unset($user['password']);
|
||||
|
||||
$expires = 7*86400+time();
|
||||
|
||||
//表示已登陆
|
||||
if($user['ticket']){
|
||||
//返回票据
|
||||
$ticketstr = $user['ticket'];
|
||||
}else{
|
||||
//未登录
|
||||
$expires = 7*86400+time();
|
||||
$ticketstr = md5($user['username'].$expires);
|
||||
//修改有效期
|
||||
Db::table('fa_hdrdoctorusers')
|
||||
->data([
|
||||
'ticket'=>$ticketstr,
|
||||
'expires'=>$expires,//7天
|
||||
])
|
||||
->where('username',$username)
|
||||
->update();
|
||||
}
|
||||
|
||||
//返回票据
|
||||
$ticketstr = md5($user['username'].$expires);
|
||||
|
||||
//修改有效期
|
||||
Db::table('fa_ty_users')
|
||||
->data([
|
||||
'ticket'=>$ticketstr,
|
||||
'expires'=>$expires,//7天
|
||||
])
|
||||
->where('username',$username)
|
||||
->update();
|
||||
|
||||
|
||||
return Tools::set_ok('登录成功',['ticket'=>$ticketstr]);
|
||||
return Tools::set_ok('登录成功',['ticket'=>$ticketstr,'user'=>$user]);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -101,20 +104,20 @@ class Usersty extends BaseHttpApi
|
||||
* clientid
|
||||
* type 用户类型:user=用户,doc=医生
|
||||
*/
|
||||
function bindDevice(){
|
||||
return Mmodel::catchJson(function (){
|
||||
//绑定设备
|
||||
$devidata = [
|
||||
'username'=>input('username'),
|
||||
'clientid'=>input('clientid'),
|
||||
'type'=>input('type'),
|
||||
'login_time'=>Tools::get_now_date(),
|
||||
];
|
||||
Mmodel::existsUpdateInsert('fa_device',[
|
||||
'username'=>input('username'),
|
||||
'clientid'=>input('clientid'),
|
||||
],$devidata);
|
||||
return Tools::set_ok('绑定成功');
|
||||
});
|
||||
}
|
||||
//function bindDevice(){
|
||||
// return Mmodel::catchJson(function (){
|
||||
// //绑定设备
|
||||
// $devidata = [
|
||||
// 'username'=>input('username'),
|
||||
// 'clientid'=>input('clientid'),
|
||||
// 'type'=>input('type'),
|
||||
// 'login_time'=>Tools::get_now_date(),
|
||||
// ];
|
||||
// Mmodel::existsUpdateInsert('fa_device',[
|
||||
// 'username'=>input('username'),
|
||||
// 'clientid'=>input('clientid'),
|
||||
// ],$devidata);
|
||||
// return Tools::set_ok('绑定成功');
|
||||
// });
|
||||
//}
|
||||
}
|
||||
@@ -27,9 +27,9 @@ class Wsspush extends BaseWssApi
|
||||
{
|
||||
|
||||
/**
|
||||
* desc:
|
||||
* desc:向指定客户端发送信息
|
||||
*
|
||||
* index/wsspush/index/socketTaskId/xxxx
|
||||
* api/wsspush/index/socketTaskId/xxxx
|
||||
*
|
||||
* author:wh
|
||||
*/
|
||||
@@ -49,8 +49,8 @@ class Wsspush extends BaseWssApi
|
||||
* @throws \Exception
|
||||
*/
|
||||
function pushToAll(){
|
||||
$json = Tools::wss_json_ok('Reportty/createReport','ok',['flow_code'=>'create_report_end']);
|
||||
Gateway::sendToAll($json);
|
||||
//$json = Tools::wss_json_ok('Reportty/createReport','ok',['flow_code'=>'create_report_end']);
|
||||
//Gateway::sendToAll($json);
|
||||
}
|
||||
public function hello($name = 'ThinkPHP5')
|
||||
{
|
||||
|
||||
@@ -71,7 +71,7 @@ class TtchatLogic extends BaseLogic
|
||||
if(empty($ticket)){
|
||||
return json(Tools::set_fail('ticket必须'));
|
||||
}
|
||||
$user = Db::table('fa_ty_users')->where('ticket',$ticket)->find();
|
||||
$user = Db::table('fa_hdrdoctorusers')->where('ticket',$ticket)->find();
|
||||
if(empty($user)){
|
||||
return json(Tools::set_fail('用户不存在'));
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ namespace app\api\logic;
|
||||
|
||||
|
||||
use app\api\controller\BaseWssApi;
|
||||
use app\common\model\TabConf;
|
||||
use GatewayWorker\Lib\Gateway;
|
||||
use think\Db;
|
||||
use wanghua\general_utility_tools_php\gpt\chat\ChatGPT;
|
||||
@@ -47,56 +48,53 @@ class TychatLogic extends BaseLogic
|
||||
if(empty($data['items']['type'])){
|
||||
$json = Tools::wss_json_fail($action, 'type参数错误,缺少角色类型:doc、user');
|
||||
return Gateway::sendToClient($client_id, $json);
|
||||
|
||||
}
|
||||
$type = $data['items']['type'];//角色类型
|
||||
//if(empty($data['items']['username'])){
|
||||
// $json = Tools::wss_json_fail($action, 'username参数错误');
|
||||
// return Gateway::sendToClient($client_id, $json);
|
||||
//}
|
||||
$chat_msg = $data['items']['chat_msg'];
|
||||
|
||||
$user = Db::table('fa_device')
|
||||
->where('clientid',$client_id)
|
||||
->find();
|
||||
Tools::log_to_write_txt(['保存历史记录,$user'=>$user]);
|
||||
if(empty($user)){
|
||||
$json = Tools::wss_json_fail($action, '用户不存在,请绑定设备');
|
||||
if(empty($data['items']['ticket'])){
|
||||
$json = Tools::wss_json_fail($action, 'ticket参数错误');
|
||||
return Gateway::sendToClient($client_id, $json);
|
||||
}
|
||||
$username = $user['username'];
|
||||
//保存记录
|
||||
$this->saveHistory($username,$chat_msg,$type);
|
||||
$type = $data['items']['type'];//角色类型
|
||||
$ticket = $data['items']['ticket'];//对话票据
|
||||
$chat_msg = $data['items']['chat_msg'];//对话内容
|
||||
|
||||
|
||||
//广播消息
|
||||
//查询广播客户端id
|
||||
$arr = Db::table('fa_device')
|
||||
->where('username',$username)
|
||||
->where('clientid','neq',$client_id)
|
||||
$arr = Db::table(TabConf::$fa_device)
|
||||
->where('ticket',$ticket)
|
||||
->where('clientid','neq',$client_id)//不给自己发
|
||||
->select();
|
||||
if(empty($arr)){
|
||||
$json = Tools::wss_json_fail($action, '未找到广播对象,请确认目标对象是否登录并绑定设备关系');
|
||||
return Gateway::sendToClient($client_id, $json);
|
||||
}
|
||||
$username = $arr[0]['username'];
|
||||
$clientid_arr = array_column($arr,'clientid');
|
||||
|
||||
//保存记录
|
||||
$this->saveHistory($username,$chat_msg,$type,$ticket);
|
||||
|
||||
//向客户端发送消息
|
||||
$json = Tools::wss_json_ok($action, $chat_msg);
|
||||
Gateway::sendToAll($json,null,[$client_id]);
|
||||
Gateway::sendToAll($json,$clientid_arr);
|
||||
|
||||
//健康小洞察
|
||||
$this->getHealthInsight2($client_id,$clientid_arr,$chat_msg);
|
||||
$this->getHealthInsight2($clientid_arr,$chat_msg);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* desc:保存听译聊天记录
|
||||
*
|
||||
*/
|
||||
private function saveHistory($username,$chat_content,$type){
|
||||
private function saveHistory($username,$chat_content,$type,$ticket){
|
||||
$data = [
|
||||
'chat_msg'=>$chat_content,
|
||||
'username'=>$username,
|
||||
'type'=>$type//聊天角色
|
||||
'type'=>$type,//聊天角色
|
||||
'ticket'=>$ticket,//对话凭据
|
||||
];
|
||||
Db::table('fa_ty_chathistory')->insert($data);
|
||||
|
||||
//这里做健康小洞察
|
||||
//$this->getHealthInsight();
|
||||
|
||||
return Tools::set_ok();
|
||||
}
|
||||
@@ -106,12 +104,12 @@ class TychatLogic extends BaseLogic
|
||||
*/
|
||||
function getChatHistory(){
|
||||
return Mmodel::catchJson(function (){
|
||||
$username = input('username');
|
||||
if(empty($username)){
|
||||
return Tools::set_fail('参数错误');
|
||||
$ticket = input('ticket');
|
||||
if(empty($ticket)){
|
||||
return Tools::set_fail('ticket参数错误');
|
||||
}
|
||||
$list = Db::table('fa_ty_chathistory')
|
||||
->where('username',$username)
|
||||
->where('ticket',$ticket)
|
||||
->order('id desc')
|
||||
->select();
|
||||
return Tools::set_ok('查询成功',$list);
|
||||
@@ -130,7 +128,7 @@ class TychatLogic extends BaseLogic
|
||||
* ]
|
||||
* author:wh
|
||||
*/
|
||||
function getHealthInsight2($client_id,$clientid_arr,$chat_msg){
|
||||
private function getHealthInsight2($clientid_arr,$chat_msg){
|
||||
Tools::log_to_write_txt(['健康洞察,入参'=>['域名'=>request()->controller().'/'.request()->action()]]);
|
||||
$action = 'Tychat/getHealthInsight2';
|
||||
|
||||
@@ -155,11 +153,77 @@ class TychatLogic extends BaseLogic
|
||||
$chatobj->setBefore($content);
|
||||
|
||||
$chatobj->returnAnswer($question,$config,$answer_json_arr);
|
||||
Tools::log_to_write_txt(['健康洞察,gpt请求参数'=>$chatobj->post_msg_body]);
|
||||
//return json(Tools::set_ok('查询成功',$answer_json_arr));
|
||||
Tools::log_to_write_txt(['健康洞察,出参'=>$answer_json_arr]);
|
||||
//Tools::log_to_write_txt(['健康洞察,gpt请求参数'=>$chatobj->post_msg_body]);
|
||||
////return json(Tools::set_ok('查询成功',$answer_json_arr));
|
||||
//Tools::log_to_write_txt(['健康洞察,出参'=>$answer_json_arr]);
|
||||
|
||||
$json = Tools::wss_json_ok($action, 'ok',$answer_json_arr);
|
||||
Gateway::sendToAll($json);
|
||||
Gateway::sendToAll($json,$clientid_arr);
|
||||
}
|
||||
|
||||
/**
|
||||
* desc:医生打开诊断窗口记录,打开诊断窗口时调用该接口,发送对话数据给客户端,客户端拿本地登录的票据与该票据参数做相等匹配,
|
||||
* 相等表示同一个医生,否则提示切换医生登录账号
|
||||
*
|
||||
* 请求类型:wss
|
||||
* action: Tychat/openChatRoomWriteRecord
|
||||
* items:[
|
||||
* doctor_name //医生姓名
|
||||
doctor_phone //医生电话
|
||||
name //患者姓名
|
||||
phone //患者电话
|
||||
ticket //对话票据
|
||||
* ]
|
||||
* author:wh
|
||||
*/
|
||||
function openChatRoomWriteRecord($client_id,$data){
|
||||
return Mmodel::catchJson(function () use ($client_id,$data){
|
||||
Tools::log_to_write_txt(['打开诊断窗口记录,入参'=>$data]);
|
||||
$action = 'Tychat/openChatRoomWriteRecord';
|
||||
if(empty($data['items'])){
|
||||
$json = Tools::wss_json_fail($action, 'items参数错误');
|
||||
return Gateway::sendToClient($client_id, $json);
|
||||
}
|
||||
if(empty($data['items']['doctor_name'])){
|
||||
$json = Tools::wss_json_fail($action, 'doctor_name参数错误');
|
||||
return Gateway::sendToClient($client_id, $json);
|
||||
}
|
||||
if(empty($data['items']['doctor_phone'])){
|
||||
$json = Tools::wss_json_fail($action, 'doctor_phone参数错误');
|
||||
return Gateway::sendToClient($client_id, $json);
|
||||
}
|
||||
if(empty($data['items']['name'])){
|
||||
$json = Tools::wss_json_fail($action, 'name 参数错误');
|
||||
return Gateway::sendToClient($client_id, $json);
|
||||
}
|
||||
if(empty($data['items']['phone'])){
|
||||
$json = Tools::wss_json_fail($action, 'phone 参数错误');
|
||||
return Gateway::sendToClient($client_id, $json);
|
||||
}
|
||||
if(empty($data['items']['ticket'])){
|
||||
$json = Tools::wss_json_fail($action, 'ticket 参数错误');
|
||||
return Gateway::sendToClient($client_id, $json);
|
||||
}
|
||||
$data = [
|
||||
'doctor_name'=>$data['items']['doctor_name'],
|
||||
'doctor_phone'=>$data['items']['doctor_phone'],
|
||||
'name'=>$data['items']['name'],
|
||||
'phone'=>$data['items']['phone'],
|
||||
'ticket'=>$data['items']['ticket'],
|
||||
];
|
||||
Db::table(TabConf::$fa_hdropen_chat_room_record)
|
||||
->insert($data);
|
||||
|
||||
//查询绑定的设备
|
||||
$device = Db::table(TabConf::$fa_device)
|
||||
->where('ticket',$data['items']['ticket'])
|
||||
->find();
|
||||
|
||||
$client_id_arr = array_column($device,'clientid');
|
||||
|
||||
//向客户端发消息
|
||||
$json = Tools::wss_json($action,'诊断医生已打开诊断窗口');
|
||||
Gateway::sendToAll($json, $client_id_arr, [$client_id]);//不向自己发送
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,7 @@ class TyuserLogic extends BaseLogic
|
||||
Mmodel::catchTrans(function () use ($client_id){
|
||||
Tools::log_to_write_txt(['服务端收到客户端离线消息:client_id:' . $client_id]);
|
||||
|
||||
$user = Db::table('fa_device')
|
||||
$user = Db::table(TabConf::$fa_device)
|
||||
->where('clientid', $client_id)
|
||||
->find();
|
||||
if(empty($user)){
|
||||
@@ -40,10 +40,17 @@ class TyuserLogic extends BaseLogic
|
||||
}
|
||||
|
||||
Tools::log_to_write_txt(['设置离线时间:clientid:' . $client_id]);
|
||||
Db::table('fa_device')
|
||||
$username = $user['username'];
|
||||
Db::table(TabConf::$fa_device)
|
||||
->where('clientid', $client_id)
|
||||
->delete();
|
||||
|
||||
//把ticket设置为空,标识离线
|
||||
Db::table('fa_hdrdoctorusers')
|
||||
->data([
|
||||
'ticket'=>'',//修改为离线
|
||||
])
|
||||
->where('username',$username)
|
||||
->update();
|
||||
|
||||
//在$client_id无效的情况下可能会抛出异常
|
||||
//$json = BaseWssApi::wss_json('ok', '用户已离线');
|
||||
@@ -53,15 +60,16 @@ class TyuserLogic extends BaseLogic
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* desc:听译-绑定医患关系,医患客户端初始化后绑定关系
|
||||
* desc:登录选择角色时绑定设备关系
|
||||
* 请求类型:wss
|
||||
*请求参数:
|
||||
* json消息格式:[
|
||||
'action'=>'Tyuser/bindRelation',
|
||||
'items'=>[
|
||||
'action'=>'Tyuser/bindRelation',
|
||||
'items'=>[
|
||||
'username'=>'13333322323',
|
||||
'type'=>'doc',//用户类型:user=用户,doc=医生
|
||||
'ticket'=>'sadddddddddddddddddddddddddddd',
|
||||
]
|
||||
]
|
||||
* author:wh
|
||||
@@ -77,20 +85,18 @@ class TyuserLogic extends BaseLogic
|
||||
$json = Tools::wss_json($action,'username参数错误');
|
||||
return Gateway::sendToClient($clientid, $json);
|
||||
}
|
||||
if(empty($items['type'])){
|
||||
$json = Tools::wss_json($action,'type参数错误');
|
||||
if(empty($items['ticket'])){
|
||||
$json = Tools::wss_json($action,'ticket参数错误');
|
||||
return Gateway::sendToClient($clientid, $json);
|
||||
}
|
||||
//绑定设备
|
||||
$devidata = [
|
||||
'username'=>$items['username'],
|
||||
'clientid'=>$clientid,
|
||||
'type'=>$items['type'],
|
||||
];
|
||||
Mmodel::existsUpdateInsert('fa_device',[
|
||||
'username'=>$items['username'],
|
||||
'clientid'=>$clientid,
|
||||
],$devidata);
|
||||
Db::table(TabConf::$fa_device)
|
||||
->insert([
|
||||
'username'=>$items['username'],
|
||||
'clientid'=>$clientid,
|
||||
'ticket'=>$items['ticket'],//对话票据,根据票据分发消息
|
||||
]);
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1355,6 +1355,6 @@ function api_user_info($field = '')
|
||||
if($api_user_info){
|
||||
return $api_user_info;
|
||||
}
|
||||
$api_user_info = Db::table('fa_ty_users')->where('openid',$openid2)->find();
|
||||
$api_user_info = Db::table('fa_hdrdoctorusers')->where('openid',$openid2)->find();
|
||||
return $field?$api_user_info[$field]:$api_user_info;
|
||||
}
|
||||
|
||||
@@ -6,77 +6,237 @@ class TabConf
|
||||
{
|
||||
|
||||
/**
|
||||
* 用户植物合成记录
|
||||
* 登录设备(一个医生有多个病历,一个医生同时只有一个客户端)
|
||||
*/
|
||||
static $__fa_userplantconflaterecord = '__fa_userplantconflaterecord';
|
||||
|
||||
|
||||
static $fa_usereliminate = 'fa_usereliminate';
|
||||
|
||||
/**
|
||||
* 好友申请记录
|
||||
*/
|
||||
static $fa_friend_apply_record = 'fa_friend_apply_record';
|
||||
static $__fa_hdrdevice = '__fa_hdrdevice';
|
||||
|
||||
|
||||
/**
|
||||
* 好友离线奖品领取记录
|
||||
* 医生账号信息
|
||||
*/
|
||||
static $fa_friend_offline_prize_got_record = 'fa_friend_offline_prize_got_record';
|
||||
static $__fa_hdrdoctor = '__fa_hdrdoctor';
|
||||
|
||||
|
||||
/**
|
||||
* 游戏邮件
|
||||
* 医生账户信息
|
||||
*/
|
||||
static $fa_gameemail = 'fa_gameemail';
|
||||
static $__fa_hdrdoctorusers = '__fa_hdrdoctorusers';
|
||||
|
||||
|
||||
/**
|
||||
* 游戏好友
|
||||
* 问诊报告存档(疼痛科、听译、h5问诊统一存放)(一个基本信息对应一个报告)
|
||||
*/
|
||||
static $fa_gamefriend = 'fa_gamefriend';
|
||||
static $__fa_hdrmedical_report = '__fa_hdrmedical_report';
|
||||
|
||||
|
||||
/**
|
||||
* 游戏关卡
|
||||
* 医患问答对话记录
|
||||
*/
|
||||
static $fa_gamelevel = 'fa_gamelevel';
|
||||
static $__fa_hdrqarecord = '__fa_hdrqarecord';
|
||||
|
||||
|
||||
/**
|
||||
* 游戏系统道具表(上线后不允许删道具,会导致已领取的离线奖励不存在,给用户造成损失)
|
||||
* 患者账号信息
|
||||
*/
|
||||
static $fa_gameprop = 'fa_gameprop';
|
||||
static $__fa_hdrusers = '__fa_hdrusers';
|
||||
|
||||
|
||||
/**
|
||||
* 游戏道具类型表
|
||||
* 智语医助-设备关联表
|
||||
*/
|
||||
static $fa_gameproptype = 'fa_gameproptype';
|
||||
static $__fa_healdevicerelation = '__fa_healdevicerelation';
|
||||
|
||||
|
||||
/**
|
||||
* 登录记录
|
||||
* 医生新消息
|
||||
*/
|
||||
static $fa_login_record = 'fa_login_record';
|
||||
static $__fa_message = '__fa_message';
|
||||
|
||||
|
||||
/**
|
||||
* 游戏公告
|
||||
* 随访记录(数智人医生)
|
||||
*/
|
||||
static $fa_notice = 'fa_notice';
|
||||
static $__fa_tt_followup = '__fa_tt_followup';
|
||||
|
||||
|
||||
/**
|
||||
* 系统植物表
|
||||
* 疼痛科自由对话聊天历史
|
||||
*/
|
||||
static $fa_plant = 'fa_plant';
|
||||
static $__fa_tt_free_chathistory = '__fa_tt_free_chathistory';
|
||||
|
||||
|
||||
/**
|
||||
* 兑换码(只能增加不能删数据)
|
||||
* 随访记录(听译助手)
|
||||
*/
|
||||
static $fa_redeem_code = 'fa_redeem_code';
|
||||
static $__fa_ty_followup = '__fa_ty_followup';
|
||||
|
||||
|
||||
/**
|
||||
* 听译-用户基本信息
|
||||
*/
|
||||
static $__fa_ty_userbaseinfo = '__fa_ty_userbaseinfo';
|
||||
|
||||
|
||||
/**
|
||||
* 管理员表
|
||||
*/
|
||||
static $fa_admin = 'fa_admin';
|
||||
|
||||
|
||||
/**
|
||||
* 管理员日志表
|
||||
*/
|
||||
static $fa_admin_log = 'fa_admin_log';
|
||||
|
||||
|
||||
/**
|
||||
* 地区表
|
||||
*/
|
||||
static $fa_area = 'fa_area';
|
||||
|
||||
|
||||
/**
|
||||
* 附件表
|
||||
*/
|
||||
static $fa_attachment = 'fa_attachment';
|
||||
|
||||
|
||||
/**
|
||||
* 分组表
|
||||
*/
|
||||
static $fa_auth_group = 'fa_auth_group';
|
||||
|
||||
|
||||
/**
|
||||
* 权限分组表
|
||||
*/
|
||||
static $fa_auth_group_access = 'fa_auth_group_access';
|
||||
|
||||
|
||||
/**
|
||||
* 节点表
|
||||
*/
|
||||
static $fa_auth_rule = 'fa_auth_rule';
|
||||
|
||||
|
||||
/**
|
||||
* 分类表
|
||||
*/
|
||||
static $fa_category = 'fa_category';
|
||||
|
||||
|
||||
/**
|
||||
* 在线命令表
|
||||
*/
|
||||
static $fa_command = 'fa_command';
|
||||
|
||||
|
||||
/**
|
||||
* 系统配置
|
||||
*/
|
||||
static $fa_config = 'fa_config';
|
||||
|
||||
|
||||
/**
|
||||
* 登录设备(一个医生有多个病历,一个医生同时只有一个客户端)
|
||||
*/
|
||||
static $fa_device = 'fa_device';
|
||||
|
||||
|
||||
/**
|
||||
* 邮箱验证码表
|
||||
*/
|
||||
static $fa_ems = 'fa_ems';
|
||||
|
||||
|
||||
/**
|
||||
* 短信发送记录
|
||||
*/
|
||||
static $fa_hdr_sms_record = 'fa_hdr_sms_record';
|
||||
|
||||
|
||||
/**
|
||||
* 管理员
|
||||
*/
|
||||
static $fa_hdradmin = 'fa_hdradmin';
|
||||
|
||||
|
||||
/**
|
||||
* 科室
|
||||
*/
|
||||
static $fa_hdrdepartment = 'fa_hdrdepartment';
|
||||
|
||||
|
||||
/**
|
||||
* 医生账户信息
|
||||
*/
|
||||
static $fa_hdrdoctorusers = 'fa_hdrdoctorusers';
|
||||
|
||||
|
||||
/**
|
||||
* 统一随访记录
|
||||
*/
|
||||
static $fa_hdrfollowup = 'fa_hdrfollowup';
|
||||
|
||||
|
||||
/**
|
||||
* 问诊报告存档(疼痛科、听译、h5问诊统一存放)(一个基本信息对应一个报告)
|
||||
*/
|
||||
static $fa_hdrmedical_report = 'fa_hdrmedical_report';
|
||||
|
||||
|
||||
/**
|
||||
* 打开对话窗口记录(同时向患者端发送当前对话患者信息)
|
||||
*/
|
||||
static $fa_hdropen_chat_room_record = 'fa_hdropen_chat_room_record';
|
||||
|
||||
|
||||
/**
|
||||
* 人格测试结果
|
||||
*/
|
||||
static $fa_hdrpersonalitytest = 'fa_hdrpersonalitytest';
|
||||
|
||||
|
||||
/**
|
||||
* 科室问卷答案
|
||||
*/
|
||||
static $fa_hdrquestionnaireanswer = 'fa_hdrquestionnaireanswer';
|
||||
|
||||
|
||||
/**
|
||||
* 科室问卷问题(一个问题对应多个答案)
|
||||
*/
|
||||
static $fa_hdrquestionnairequestion = 'fa_hdrquestionnairequestion';
|
||||
|
||||
|
||||
/**
|
||||
* 患者挂号列表(可重复挂号)
|
||||
*/
|
||||
static $fa_hdrregister = 'fa_hdrregister';
|
||||
|
||||
|
||||
/**
|
||||
* 统一问诊用户基本信息
|
||||
*/
|
||||
static $fa_hdruserbaseinfo = 'fa_hdruserbaseinfo';
|
||||
|
||||
|
||||
/**
|
||||
* 智语医助-设备关联表
|
||||
*/
|
||||
static $fa_healdevicerelation = 'fa_healdevicerelation';
|
||||
|
||||
|
||||
/**
|
||||
* 医生新消息
|
||||
*/
|
||||
static $fa_message = 'fa_message';
|
||||
|
||||
|
||||
/**
|
||||
* 短信验证码表
|
||||
*/
|
||||
static $fa_sms = 'fa_sms';
|
||||
|
||||
|
||||
/**
|
||||
@@ -86,62 +246,128 @@ class TabConf
|
||||
|
||||
|
||||
/**
|
||||
* 用户邮件
|
||||
* 测试表
|
||||
*/
|
||||
static $fa_user_email = 'fa_user_email';
|
||||
static $fa_test = 'fa_test';
|
||||
|
||||
|
||||
/**
|
||||
* 用户邮件阅读记录(存在数据表示已读)
|
||||
* 疼痛科聊天历史
|
||||
*/
|
||||
static $fa_user_email_read_record = 'fa_user_email_read_record';
|
||||
static $fa_tt_chathistory = 'fa_tt_chathistory';
|
||||
|
||||
|
||||
/**
|
||||
* 用户离线奖品表(定时任务写入,领取后删除),用户也可以一直不领取,最多也只有n小时以内的奖励
|
||||
* 随访记录(数智人医生)
|
||||
*/
|
||||
static $fa_user_offline_prize = 'fa_user_offline_prize';
|
||||
static $fa_tt_followup = 'fa_tt_followup';
|
||||
|
||||
|
||||
/**
|
||||
* 用户离线奖品领取记录
|
||||
* 疼痛科自由对话聊天历史
|
||||
*/
|
||||
static $fa_user_offline_prize_got_record = 'fa_user_offline_prize_got_record';
|
||||
static $fa_tt_free_chathistory = 'fa_tt_free_chathistory';
|
||||
|
||||
|
||||
/**
|
||||
* 用户离线记录
|
||||
* 疼痛科病历报告(听译问诊)(一个基本信息对应一个报告)
|
||||
*/
|
||||
static $fa_user_offline_record = 'fa_user_offline_record';
|
||||
static $fa_tt_medical_report = 'fa_tt_medical_report';
|
||||
|
||||
|
||||
/**
|
||||
* 用户拥有的游戏道具表
|
||||
* 疼痛科用户基本信息
|
||||
*/
|
||||
static $fa_usergameprop = 'fa_usergameprop';
|
||||
static $fa_tt_userbaseinfo = 'fa_tt_userbaseinfo';
|
||||
|
||||
|
||||
/**
|
||||
* 用户拥有的植物表
|
||||
* 疼痛科用户
|
||||
*/
|
||||
static $fa_userplant = 'fa_userplant';
|
||||
static $fa_tt_users = 'fa_tt_users';
|
||||
|
||||
|
||||
/**
|
||||
* 用户植物合成记录
|
||||
* 听译-聊天历史
|
||||
*/
|
||||
static $fa_userplantconflaterecord = 'fa_userplantconflaterecord';
|
||||
static $fa_ty_chathistory = 'fa_ty_chathistory';
|
||||
|
||||
|
||||
/**
|
||||
* 用户表
|
||||
* 随访记录(听译助手)
|
||||
*/
|
||||
static $fa_users = 'fa_ty_users';
|
||||
static $fa_ty_followup = 'fa_ty_followup';
|
||||
|
||||
|
||||
/**
|
||||
* 系统杂项配置
|
||||
* 听译-病历报告(听译问诊)(一个基本信息对应一个报告)
|
||||
*/
|
||||
static $fa_zc_sundry_config = 'fa_zc_sundry_config';
|
||||
static $fa_ty_medical_report = 'fa_ty_medical_report';
|
||||
|
||||
|
||||
/**
|
||||
* 听译问诊-患者病历信息
|
||||
*/
|
||||
static $fa_ty_userbaseinfo = 'fa_ty_userbaseinfo';
|
||||
|
||||
|
||||
/**
|
||||
* 听译问诊-患者病历信息
|
||||
*/
|
||||
static $fa_ty_usermedicalrecord = 'fa_ty_usermedicalrecord';
|
||||
|
||||
|
||||
/**
|
||||
* 听译-医生账号
|
||||
*/
|
||||
static $fa_ty_users = 'fa_ty_users';
|
||||
|
||||
|
||||
/**
|
||||
* 会员表
|
||||
*/
|
||||
static $fa_user = 'fa_user';
|
||||
|
||||
|
||||
/**
|
||||
* 会员组表
|
||||
*/
|
||||
static $fa_user_group = 'fa_user_group';
|
||||
|
||||
|
||||
/**
|
||||
* 会员余额变动表
|
||||
*/
|
||||
static $fa_user_money_log = 'fa_user_money_log';
|
||||
|
||||
|
||||
/**
|
||||
* 会员规则表
|
||||
*/
|
||||
static $fa_user_rule = 'fa_user_rule';
|
||||
|
||||
|
||||
/**
|
||||
* 会员积分变动表
|
||||
*/
|
||||
static $fa_user_score_log = 'fa_user_score_log';
|
||||
|
||||
|
||||
/**
|
||||
* 会员Token表
|
||||
*/
|
||||
static $fa_user_token = 'fa_user_token';
|
||||
|
||||
|
||||
/**
|
||||
* 用户
|
||||
*/
|
||||
static $fa_users = 'fa_users';
|
||||
|
||||
|
||||
/**
|
||||
* 版本表
|
||||
*/
|
||||
static $fa_version = 'fa_version';
|
||||
|
||||
}
|
||||
2872
digital_doctor/application/data/sql/digital_doctor-数智人医生1.0封版.sql
Normal file
2872
digital_doctor/application/data/sql/digital_doctor-数智人医生1.0封版.sql
Normal file
File diff suppressed because one or more lines are too long
@@ -88,8 +88,108 @@ dump($requestUrl);
|
||||
// 运行事件循环
|
||||
$loop->run();
|
||||
}
|
||||
//function stringToColor($string) {
|
||||
// // 使用crc32函数计算字符串的哈希值
|
||||
// $hash = crc32($string);
|
||||
//
|
||||
// // 将整数哈希值转换为16进制,并填充0以确保6位长度
|
||||
// $color = sprintf("%06X", $hash & 0xFFFFFF);
|
||||
//
|
||||
// // 返回颜色码
|
||||
// return '#' . $color;
|
||||
//}
|
||||
function stringToColor($string) {
|
||||
// 使用crc32函数计算字符串的哈希值
|
||||
$hash = crc32($string);
|
||||
|
||||
// 将整数哈希值转换为16进制,并填充0以确保6位长度
|
||||
$color = sprintf("%06X", $hash & 0xFFFFFF);
|
||||
|
||||
// 分解颜色码为RGB三个部分
|
||||
$r = hexdec(substr($color, 0, 2));
|
||||
$g = hexdec(substr($color, 2, 2));
|
||||
$b = hexdec(substr($color, 4, 2));
|
||||
|
||||
// 计算亮度调整
|
||||
$brightnessFactor = 30; // 减少亮度因子以使颜色更浅
|
||||
$contrastThreshold = 80; // 进一步降低对比度阈值以允许更浅的颜色
|
||||
$maxBrightness = 100; // 降低最大亮度限制,防止生成过于接近白色的颜色
|
||||
|
||||
// 调整RGB值以确保颜色足够亮且与黑色有足够的对比度
|
||||
$r = min($maxBrightness, max($r + $brightnessFactor, $contrastThreshold));
|
||||
$g = min($maxBrightness, max($g + $brightnessFactor, $contrastThreshold));
|
||||
$b = min($maxBrightness, max($b + $brightnessFactor, $contrastThreshold));
|
||||
|
||||
// 将调整后的RGB值转换回16进制颜色码
|
||||
$adjustedColor = sprintf("#%02X%02X%02X", $r, $g, $b);
|
||||
|
||||
// 返回颜色码
|
||||
return $adjustedColor;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function test()
|
||||
{
|
||||
$api_cache_arr['aaa'][] = ['api_name'=>111,'doc_txt'=>222];
|
||||
$api_cache_arr['bb'][] = ['api_name'=>777,'doc_txt'=>777];
|
||||
$api_cache_arr['aaa'][] = ['api_name'=>666,'doc_txt'=>666];
|
||||
$api_cache_arr['ccc'][] = ['api_name'=>111,'doc_txt'=>222];
|
||||
$api_cache_arr['aaa'][] = ['api_name'=>555,'doc_txt'=>555];
|
||||
$api_cache_arr['ccc'][] = ['api_name'=>333,'doc_txt'=>333];
|
||||
|
||||
dump($api_cache_arr);die;
|
||||
// 使用示例
|
||||
$color = $this->stringToColor("example string");
|
||||
//echo $color; // 输出颜色码
|
||||
echo '<div style="background-color:#f0f8ff">test</div>';
|
||||
echo '<div style="background-color:#f0ffff">test</div>';
|
||||
echo '<div style="background-color:#f5f5dc">test</div>';
|
||||
echo '<div style="background-color:#ffe4c4">test</div>';
|
||||
echo '<div style="background-color:#f5f5f5">test</div>';
|
||||
echo '<div style="background-color:#f5fffa">test</div>';
|
||||
echo '<div style="background-color:#fff5ee">test</div>';
|
||||
echo '<div style="background-color:#f8f8ff">test</div>';
|
||||
echo '<div style="background-color:#fffaf0">test</div>';
|
||||
echo '<div style="background-color:#fffff0">test</div>';
|
||||
echo '<div style="background-color:#fafad2">test</div>';
|
||||
echo '<div style="background-color:#f0fff0">test</div>';
|
||||
echo '<div style="background-color:#fff0f5">test</div>';
|
||||
echo '<div style="background-color:#ffe4e1">test</div>';
|
||||
echo '<div style="background-color:#f0ffff">test</div>';
|
||||
echo '<div style="background-color:#f0f8ff">test</div>';
|
||||
echo '<div style="background-color:#f8f8ff">test</div>';
|
||||
echo '<div style="background-color:#faebd7">test</div>';
|
||||
echo '<div style="background-color:#fff0f5">test</div>';
|
||||
echo '<div style="background-color:#ffe4e1">test</div>';
|
||||
echo '<div style="background-color:#ffe4b5">test</div>';
|
||||
echo '<div style="background-color:#ffdead">test</div>';
|
||||
echo '<div style="background-color:#dcdcdc">test</div>';
|
||||
echo '<div style="background-color:#dda0dd">test</div>';
|
||||
echo '<div style="background-color:#fffaf0">test</div>';
|
||||
echo '<div style="background-color:#eee8aa">test</div>';
|
||||
echo '<div style="background-color:#fffafa">test</div>';
|
||||
echo '<div style="background-color:#f0fff0">test</div>';
|
||||
echo '<div style="background-color:#f0fff0">test</div>';
|
||||
echo '<div style="background-color:#f0f8ff">test</div>';
|
||||
echo '<div style="background-color:#f0ffff">test</div>';
|
||||
echo '<div style="background-color:#f5f5dc">test</div>';
|
||||
echo '<div style="background-color:#ffe4c4">test</div>';
|
||||
echo '<div style="background-color:#f5f5f5">test</div>';
|
||||
echo '<div style="background-color:#f5fffa">test</div>';
|
||||
echo '<div style="background-color:#fff5ee">test</div>';
|
||||
echo '<div style="background-color:#f8f8ff">test</div>';
|
||||
echo '<div style="background-color:#fffaf0">test</div>';
|
||||
die;
|
||||
|
||||
die;
|
||||
$color_code = substr(md5('asdfasdf'),0,6);
|
||||
echo '<div style="background-color:'.$color_code.'">test</div>';die;
|
||||
|
||||
// 使用示例
|
||||
$color = $this->stringToColor("example string");
|
||||
echo $color; // 输出颜色码
|
||||
die;
|
||||
// 配置您的讯飞应用信息
|
||||
$appId = 'd482af59';
|
||||
$apiKey = '0d20dab630904ad8676d9075375a1914';
|
||||
|
||||
BIN
digital_doctor/public/ai/assets.zip
Executable file
BIN
digital_doctor/public/ai/assets.zip
Executable file
Binary file not shown.
1
digital_doctor/public/ai/assets/404-b0d1a3d9.svg
Executable file
1
digital_doctor/public/ai/assets/404-b0d1a3d9.svg
Executable file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 28 KiB |
3
digital_doctor/public/ai/assets/Generatereports-1ca07921.js
Executable file
3
digital_doctor/public/ai/assets/Generatereports-1ca07921.js
Executable file
@@ -0,0 +1,3 @@
|
||||
import{M as Q,O as G,au as H,av as J,aw as b,d as $,Q as U,ax as X,ay as Y,az as g,aA as Z,S as ee,K as y,aB as te,aC as _,aD as le,aE as ae,V as M,u as se,q as ne,r as a,c as oe,ae as re,e as ue,f,i as e,w as l,h as t,g as ie,o as ce,N as u,n as de,m as D}from"./index-fd641271.js";const fe=J(24,null).map((c,s)=>{const o=s+1,d=`calc(100% / 24 * ${o})`;return[b(`${o}-span`,{width:d}),b(`${o}-offset`,{marginLeft:d}),b(`${o}-push`,{left:d}),b(`${o}-pull`,{right:d})]}),pe=Q([G("row",{width:"100%",display:"flex",flexWrap:"wrap"}),G("col",{verticalAlign:"top",boxSizing:"border-box",display:"inline-block",position:"relative",zIndex:"auto"},[H("box",{position:"relative",zIndex:"auto",width:"100%",height:"100%"}),fe])]),V=te("n-row"),he={gutter:{type:[Array,Number,String],default:0},alignItems:String,justifyContent:String},_e=$({name:"Row",props:he,setup(c){const{mergedClsPrefixRef:s,mergedRtlRef:o}=U(c);X("-legacy-grid",pe,s);const d=Y("Row",o,s),h=g(()=>{const{gutter:r}=c;return Array.isArray(r)&&r[1]||0}),p=g(()=>{const{gutter:r}=c;return Array.isArray(r)?r[0]:Number(r)});return Z(V,{mergedClsPrefixRef:s,gutterRef:ee(c,"gutter"),verticalGutterRef:h,horizontalGutterRef:p}),{mergedClsPrefix:s,rtlEnabled:d,styleMargin:g(()=>`-${_(h.value,{c:.5})} -${_(p.value,{c:.5})}`),styleWidth:g(()=>`calc(100% + ${_(p.value)})`)}},render(){return y("div",{class:[`${this.mergedClsPrefix}-row`,this.rtlEnabled&&`${this.mergedClsPrefix}-row--rtl`],style:{margin:this.styleMargin,width:this.styleWidth,alignItems:this.alignItems,justifyContent:this.justifyContent}},this.$slots)}}),be={span:{type:[String,Number],default:1},push:{type:[String,Number],default:0},pull:{type:[String,Number],default:0},offset:{type:[String,Number],default:0}},i=$({name:"Col",props:be,setup(c){const s=le(V,null);return s||ae("col","`n-col` must be placed inside `n-row`."),{mergedClsPrefix:s.mergedClsPrefixRef,gutter:s.gutterRef,stylePadding:M(()=>`${_(s.verticalGutterRef.value,{c:.5})} ${_(s.horizontalGutterRef.value,{c:.5})}`),mergedPush:M(()=>Number(c.push)-Number(c.pull))}},render(){const{$slots:c,span:s,mergedPush:o,offset:d,stylePadding:h,gutter:p,mergedClsPrefix:r}=this;return y("div",{class:[`${r}-col`,{[`${r}-col--${s}-span`]:!0,[`${r}-col--${o}-push`]:o>0,[`${r}-col--${-o}-pull`]:o<0,[`${r}-col--${d}-offset`]:d}],style:{padding:h}},p?y("div",null,c):c)}}),ge={class:"flex flex-col w-full h-full dark:bg-[#121212]"},ve={class:"flex-1 h-full overflow-hidden overflow-y-auto"},me={class:"blbox"},ye={class:"report-box"},$e=f("p",{class:"text-[24px] font-bold bgtitle"},"初诊报告",-1),xe={class:"bztext"},we={class:"w-full d-c-c mb-[20px]"},Ce={class:"w-[40%]"},Re=f("text",{class:"font-mono",style:{color:"#fff","font-size":"18px"}},"把报告发给医生",-1),ze={class:"w-[40%] ml-[20px]"},Ne=f("text",{class:"font-mono",style:{color:"#127FFF","font-size":"18px"}},"返回重新问诊",-1),Pe=$({__name:"Generatereports",setup(c){const s=se(),o=ne(),d=a(null),h=oe({}),p=a([]),r=a(""),x=a(""),w=a(""),C=a(""),R=a(""),z=a(""),N=a(""),S=a(""),P=a(""),k=a(""),F=a(""),I=a(""),j=a(""),A=a(""),E=a(""),q=a("");function K(){s.push("/chat")}function W(){s.push("/results")}re(async()=>{L()});function L(){p.value=o.reportContent;let n=o.reportContent.formData,B=o.reportContent.res_content[0].split(`
|
||||
|
||||
`),v=[];for(let m=0;m<B.length;m++){let T=B[m].split(":");v.push(T[1])}r.value=`姓名:${n.name}`,x.value=`性别:${n.gender}`,w.value=`年龄:${n.age}`,C.value=`教育程度:${n.edu}`,R.value=`时间:${new Date().toISOString().replace(/T/g," ").replace(/\..+/,"")}`,z.value=`当前职业/体力要求/经济满意度:${n.career_year}/${n.power}/${n.satisfaction}`,N.value=`过往职业/体力要求/社会支持度:${n.old_career_year}/${n.power}/${n.support}`,S.value=`婚姻状况:${n.marriage}`,P.value=`居住情况:${n.live}`,k.value=`家庭关系:${n.home}`,F.value=`地址:${n.address}`,I.value=`联系方式:${n.phone}`,j.value=`微信:${n.wechat_no}`,A.value=`初步诊断:${v[0]}`,E.value=`康复建议:${v[1]}`}return(n,O)=>(ce(),ue("div",ge,[f("main",ve,[f("div",me,[f("div",ye,[$e,e(t(de),{ref_key:"formRef",ref:d,inline:"","label-width":80,model:h},{default:l(()=>[e(t(_e),null,{default:l(()=>[e(t(i),{span:"6"},{default:l(()=>[e(t(u),{label:r.value},null,8,["label"])]),_:1}),e(t(i),{span:"6"},{default:l(()=>[e(t(u),{label:x.value},null,8,["label"])]),_:1}),e(t(i),{span:"6"},{default:l(()=>[e(t(u),{label:w.value},null,8,["label"])]),_:1}),e(t(i),{span:"8"},{default:l(()=>[e(t(u),{label:C.value},null,8,["label"])]),_:1}),e(t(i),{span:"12"},{default:l(()=>[e(t(u),{label:R.value},null,8,["label"])]),_:1}),e(t(i),{span:"12"},{default:l(()=>[e(t(u),{label:z.value},null,8,["label"])]),_:1}),e(t(i),{span:"18"},{default:l(()=>[e(t(u),{label:N.value},null,8,["label"])]),_:1}),e(t(i),{span:"8"},{default:l(()=>[e(t(u),{label:S.value},null,8,["label"])]),_:1}),e(t(i),{span:"12"},{default:l(()=>[e(t(u),{label:P.value},null,8,["label"])]),_:1}),e(t(i),{span:"8"},{default:l(()=>[e(t(u),{label:k.value},null,8,["label"])]),_:1}),e(t(i),{span:"8"},{default:l(()=>[e(t(u),{label:F.value},null,8,["label"])]),_:1}),e(t(i),{span:"8"},{default:l(()=>[e(t(u),{label:I.value},null,8,["label"])]),_:1}),e(t(i),{span:"12"},{default:l(()=>[e(t(u),{label:j.value},null,8,["label"])]),_:1}),e(t(i),{span:"24"},{default:l(()=>[e(t(u),{label:A.value},null,8,["label"])]),_:1}),e(t(i),{span:"24"},{default:l(()=>[e(t(u),{label:E.value},null,8,["label"])]),_:1})]),_:1})]),_:1},8,["model"]),f("p",xe,ie(q.value),1)]),f("div",we,[f("div",Ce,[e(t(D),{onClick:W,style:{width:"100%",height:"3rem","background-color":"#127FFF","border-radius":"8px"}},{default:l(()=>[Re]),_:1})]),f("div",ze,[e(t(D),{onClick:K,style:{width:"100%",height:"3rem",border:"1px solid #127FFF","border-radius":"8px"}},{default:l(()=>[Ne]),_:1})])])])])]))}});export{Pe as default};
|
||||
1
digital_doctor/public/ai/assets/Generatereports-bf82ee9c.css
Executable file
1
digital_doctor/public/ai/assets/Generatereports-bf82ee9c.css
Executable file
File diff suppressed because one or more lines are too long
BIN
digital_doctor/public/ai/assets/KaTeX_AMS-Regular-0cdd387c.woff2
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_AMS-Regular-0cdd387c.woff2
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_AMS-Regular-30da91e8.woff
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_AMS-Regular-30da91e8.woff
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_AMS-Regular-68534840.ttf
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_AMS-Regular-68534840.ttf
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Caligraphic-Bold-07d8e303.ttf
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Caligraphic-Bold-07d8e303.ttf
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Caligraphic-Bold-1ae6bd74.woff
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Caligraphic-Bold-1ae6bd74.woff
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Caligraphic-Bold-de7701e4.woff2
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Caligraphic-Bold-de7701e4.woff2
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Caligraphic-Regular-3398dd02.woff
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Caligraphic-Regular-3398dd02.woff
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Caligraphic-Regular-5d53e70a.woff2
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Caligraphic-Regular-5d53e70a.woff2
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Caligraphic-Regular-ed0b7437.ttf
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Caligraphic-Regular-ed0b7437.ttf
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Fraktur-Bold-74444efd.woff2
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Fraktur-Bold-74444efd.woff2
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Fraktur-Bold-9163df9c.ttf
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Fraktur-Bold-9163df9c.ttf
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Fraktur-Bold-9be7ceb8.woff
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Fraktur-Bold-9be7ceb8.woff
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Fraktur-Regular-1e6f9579.ttf
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Fraktur-Regular-1e6f9579.ttf
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Fraktur-Regular-51814d27.woff2
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Fraktur-Regular-51814d27.woff2
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Fraktur-Regular-5e28753b.woff
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Fraktur-Regular-5e28753b.woff
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Main-Bold-0f60d1b8.woff2
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Main-Bold-0f60d1b8.woff2
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Main-Bold-138ac28d.ttf
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Main-Bold-138ac28d.ttf
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Main-Bold-c76c5d69.woff
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Main-Bold-c76c5d69.woff
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Main-BoldItalic-70ee1f64.ttf
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Main-BoldItalic-70ee1f64.ttf
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Main-BoldItalic-99cd42a3.woff2
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Main-BoldItalic-99cd42a3.woff2
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Main-BoldItalic-a6f7ec0d.woff
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Main-BoldItalic-a6f7ec0d.woff
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Main-Italic-0d85ae7c.ttf
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Main-Italic-0d85ae7c.ttf
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Main-Italic-97479ca6.woff2
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Main-Italic-97479ca6.woff2
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Main-Italic-f1d6ef86.woff
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Main-Italic-f1d6ef86.woff
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Main-Regular-c2342cd8.woff2
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Main-Regular-c2342cd8.woff2
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Main-Regular-c6368d87.woff
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Main-Regular-c6368d87.woff
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Main-Regular-d0332f52.ttf
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Main-Regular-d0332f52.ttf
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Math-BoldItalic-850c0af5.woff
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Math-BoldItalic-850c0af5.woff
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Math-BoldItalic-dc47344d.woff2
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Math-BoldItalic-dc47344d.woff2
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Math-BoldItalic-f9377ab0.ttf
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Math-BoldItalic-f9377ab0.ttf
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Math-Italic-08ce98e5.ttf
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Math-Italic-08ce98e5.ttf
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Math-Italic-7af58c5e.woff2
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Math-Italic-7af58c5e.woff2
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Math-Italic-8a8d2445.woff
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Math-Italic-8a8d2445.woff
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_SansSerif-Bold-1ece03f7.ttf
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_SansSerif-Bold-1ece03f7.ttf
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_SansSerif-Bold-e99ae511.woff2
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_SansSerif-Bold-e99ae511.woff2
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_SansSerif-Bold-ece03cfd.woff
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_SansSerif-Bold-ece03cfd.woff
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_SansSerif-Italic-00b26ac8.woff2
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_SansSerif-Italic-00b26ac8.woff2
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_SansSerif-Italic-3931dd81.ttf
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_SansSerif-Italic-3931dd81.ttf
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_SansSerif-Italic-91ee6750.woff
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_SansSerif-Italic-91ee6750.woff
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_SansSerif-Regular-11e4dc8a.woff
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_SansSerif-Regular-11e4dc8a.woff
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_SansSerif-Regular-68e8c73e.woff2
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_SansSerif-Regular-68e8c73e.woff2
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_SansSerif-Regular-f36ea897.ttf
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_SansSerif-Regular-f36ea897.ttf
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Script-Regular-036d4e95.woff2
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Script-Regular-036d4e95.woff2
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Script-Regular-1c67f068.ttf
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Script-Regular-1c67f068.ttf
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Script-Regular-d96cdf2b.woff
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Script-Regular-d96cdf2b.woff
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Size1-Regular-6b47c401.woff2
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Size1-Regular-6b47c401.woff2
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Size1-Regular-95b6d2f1.ttf
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Size1-Regular-95b6d2f1.ttf
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Size1-Regular-c943cc98.woff
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Size1-Regular-c943cc98.woff
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Size2-Regular-2014c523.woff
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Size2-Regular-2014c523.woff
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Size2-Regular-a6b2099f.ttf
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Size2-Regular-a6b2099f.ttf
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Size2-Regular-d04c5421.woff2
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Size2-Regular-d04c5421.woff2
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Size3-Regular-500e04d5.ttf
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Size3-Regular-500e04d5.ttf
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Size3-Regular-6ab6b62e.woff
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Size3-Regular-6ab6b62e.woff
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Size4-Regular-99f9c675.woff
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Size4-Regular-99f9c675.woff
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Size4-Regular-a4af7d41.woff2
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Size4-Regular-a4af7d41.woff2
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Size4-Regular-c647367d.ttf
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Size4-Regular-c647367d.ttf
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Typewriter-Regular-71d517d6.woff2
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Typewriter-Regular-71d517d6.woff2
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Typewriter-Regular-e14fed02.woff
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Typewriter-Regular-e14fed02.woff
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/KaTeX_Typewriter-Regular-f01f3e87.ttf
Executable file
BIN
digital_doctor/public/ai/assets/KaTeX_Typewriter-Regular-f01f3e87.ttf
Executable file
Binary file not shown.
1
digital_doctor/public/ai/assets/Results-f3239de2.js
Executable file
1
digital_doctor/public/ai/assets/Results-f3239de2.js
Executable file
@@ -0,0 +1 @@
|
||||
import{d as n,u as l,r as c,ae as r,e as i,f as e,g as _,i as d,w as u,h as f,L as m,o as p,m as x}from"./index-fd641271.js";const h={class:"flex flex-col w-full h-full dark:bg-[#121212]"},v={class:"flex-1 overflow-hidden"},b={class:"blbox",style:{"margin-top":"10rem"}},g=e("div",{class:"icon-box"},[e("img",{class:"icon",src:m,alt:""})],-1),y=e("p",{class:"text-3xl text-center font-bold mb-6"},"初诊报告已发送给医生",-1),k=e("p",{class:"text-3xl text-center font-bold mb-6"},"请耐心等待候诊",-1),w={class:"djs"},B={style:{width:"20rem",margin:"auto"}},C=e("text",{class:"font-mono",style:{color:"#fff","font-size":"18px"}},"回到门诊",-1),I=n({__name:"Results",setup(F){const a=l(),t=c(3);function s(){a.push("/chat")}return r(()=>{let o=setInterval(()=>{t.value--,t.value<=0&&(clearInterval(o),s())},1e3)}),(o,N)=>(p(),i("div",h,[e("main",v,[e("div",b,[g,y,k,e("p",w,_(t.value)+"秒后将自动回到问诊",1),e("div",B,[d(f(x),{onClick:s,style:{"margin-top":"3rem",width:"18rem",height:"3rem","background-color":"#127FFF","border-radius":"8px 8px 8px 8px"}},{default:u(()=>[C]),_:1})])])])]))}});export{I as default};
|
||||
BIN
digital_doctor/public/ai/assets/SpaceGrotesk-Regular-b5b8c387.ttf
Executable file
BIN
digital_doctor/public/ai/assets/SpaceGrotesk-Regular-b5b8c387.ttf
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/SpaceMono-Regular-74ea8049.ttf
Executable file
BIN
digital_doctor/public/ai/assets/SpaceMono-Regular-74ea8049.ttf
Executable file
Binary file not shown.
BIN
digital_doctor/public/ai/assets/avatar-ceeb03f6.jpg
Executable file
BIN
digital_doctor/public/ai/assets/avatar-ceeb03f6.jpg
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 5.0 KiB |
BIN
digital_doctor/public/ai/assets/back-71f47591.png
Executable file
BIN
digital_doctor/public/ai/assets/back-71f47591.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 153 KiB |
BIN
digital_doctor/public/ai/assets/bg-030c0bf9.png
Executable file
BIN
digital_doctor/public/ai/assets/bg-030c0bf9.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 930 KiB |
BIN
digital_doctor/public/ai/assets/bg3-5f10fa86.png
Executable file
BIN
digital_doctor/public/ai/assets/bg3-5f10fa86.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 534 KiB |
1
digital_doctor/public/ai/assets/copy-ee710165.js
Executable file
1
digital_doctor/public/ai/assets/copy-ee710165.js
Executable file
@@ -0,0 +1 @@
|
||||
function t(o){return new Promise((c,n)=>{try{console.log(o);const e=document.createElement("textarea");e.setAttribute("readonly","readonly"),e.value=o,document.body.appendChild(e),e.select(),document.execCommand("copy")&&document.execCommand("copy"),document.body.removeChild(e),c(o)}catch(e){n(e)}})}export{t as c};
|
||||
BIN
digital_doctor/public/ai/assets/forword-15bf4aaa.png
Executable file
BIN
digital_doctor/public/ai/assets/forword-15bf4aaa.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 144 KiB |
1
digital_doctor/public/ai/assets/index-09299d1f.js
Executable file
1
digital_doctor/public/ai/assets/index-09299d1f.js
Executable file
@@ -0,0 +1 @@
|
||||
import{d as L,u as O,a as j,r as i,b as R,c as T,t as r,e as V,f as o,g as v,h as e,i as n,w as d,o as E,N as _,j as k,k as U,l as q,m as H,n as M,p as W}from"./index-fd641271.js";import{a as $,c as G,u as J}from"./validator-3b4c866c.js";const K=""+new URL("pt-77ca63a5.png",import.meta.url).href,P={class:"flex w-screen h-screen justify-center items-center",style:{"background-image":"url('@/assets/bg1.png')"}},Q=o("div",{class:"flex justify-center items-center"},[o("img",{style:{height:"40rem"},src:K,alt:"",srcset:""})],-1),X={class:"flex justify-center items-center",style:{"background-color":"#fff",width:"40%",height:"40rem","border-top-right-radius":"20px","border-bottom-right-radius":"20px"}},Y={class:"text-40 mb-6 font-mono",style:{"font-size":"35px",color:"#127FFF","font-weight":"600","font-family":"Arial, Helvetica, sans-serif"}},Z={class:"text-40 mb-6 font-mono",style:{"font-size":"35px","font-weight":"600","font-family":"Arial, Helvetica, sans-serif"}},ee=o("div",null,null,-1),te={class:"relative w-full"},se=o("div",{class:"tracking-widest text-sm"},[o("div",{style:{color:"#999999"}}," 忘记密码 ")],-1),le={class:"font-mono font-bold"},ne=L({__name:"index",setup(ae){const F=O(),N=j(),h=i(null),c=R(),S=i("medium"),y=T({fontSize:"14px",fontWeight:500});let a=i({username:"",password:""}),I={username:{required:!0,message:r("user.text19"),trigger:["input","blur"]},password:{required:!0,trigger:["input","blur"],validator:(s,t)=>$(t,6)?G(t)?!0:new Error("At least 1 number"):new Error("The value contains as least 6 characters")}};const f=J.emailTipsOptions;let b=i([{label:"",key:""},{label:"",key:""},{label:"",key:""},{label:"",key:""},{label:"",key:""}]),u=i(!1),g=i(!0),z=i(!1);function A(){let s=a.value.username;for(let t=0;t<f.value.length;t++){let l=f.value[t];if(s.indexOf(l.label)!=-1)return}s&&(u.value=!0),x();for(let t=0;t<f.value.length;t++){s.indexOf("@")!=-1&&(s=s.slice(0,s.indexOf("@")));let l=f.value[t],p=b.value[t];p.label=s+l.label,p.key=s+l.key}}function B(){x()}function x(){z.value&&a.value.password&&a.value.username?g.value=!1:g.value=!0}function C(s){var t;s.preventDefault(),(t=h.value)==null||t.validate(async l=>{if(l)console.log(l),c.error("Invalid");else{let p={username:a.value.username,password:a.value.password},w=c.loading("loading",{duration:0}),m=await W(p);if(m.code!=200){w.destroy(),c.error(m.msg);return}w.destroy(),c.success("Login Success"),N.setToken(m.data.username),setTimeout(()=>{console.log("123"),F.replace({name:"Chat"})},1e3)}})}function D(s){u.value=!1,a.value.username=s}return(s,t)=>(E(),V("div",P,[Q,o("div",X,[o("div",null,[o("div",Y,v(e(r)("user.text2")),1),o("div",Z,v(e(r)("user.tetx37")),1),n(e(M),{ref_key:"formRef",ref:h,"label-width":80,model:e(a),rules:e(I),size:S.value},{default:d(()=>[n(e(_),{label:e(r)("user.text3"),path:"username","label-style":y},{default:d(()=>[n(e(k),{value:e(a).username,"onUpdate:value":t[0]||(t[0]=l=>e(a).username=l),placeholder:e(r)("user.text19"),class:"input-style",onInput:A},null,8,["value","placeholder"])]),_:1},8,["label","label-style"]),n(e(U),{class:"dropdown",show:e(u),options:e(b),onSelect:D,onClickoutside:t[1]||(t[1]=l=>{q(u)?u.value=!1:u=!1})},{default:d(()=>[ee]),_:1},8,["show","options"]),n(e(_),{label:e(r)("user.text30"),path:"password","label-style":y},{default:d(()=>[o("div",te,[n(e(k),{type:"password",value:e(a).password,"onUpdate:value":t[2]||(t[2]=l=>e(a).password=l),placeholder:e(r)("user.text20"),class:"input-style",onInput:B},null,8,["value","placeholder"])])]),_:1},8,["label","label-style"]),se,n(e(_),null,{default:d(()=>[n(e(H),{disabled:!1,class:"button-style",block:!0,"attr-type":"button",onClick:C,type:"primary",style:{"background-color":"#127FFF"}},{default:d(()=>[o("text",le,v(e(r)("user.tetx38")),1)]),_:1})]),_:1})]),_:1},8,["model","rules","size"])])])]))}});export{ne as default};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user