fixed
This commit is contained in:
110
digital_doctor/application/api/controller/H5userbaseinfo.php
Normal file
110
digital_doctor/application/api/controller/H5userbaseinfo.php
Normal file
@@ -0,0 +1,110 @@
|
||||
<?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 H5userbaseinfo extends BaseHttpApi
|
||||
{
|
||||
protected $controller_comments = 'h5问诊用户基本信息';
|
||||
|
||||
|
||||
/**
|
||||
* 新增h5问诊用户基本信息
|
||||
*
|
||||
* 参数:
|
||||
* doctor 所属医生
|
||||
* name 病人姓名
|
||||
* gender 病人性别
|
||||
* age 病人年龄
|
||||
* edu 教育程度
|
||||
* career_year 职业及年限
|
||||
* power 体力要求
|
||||
* satisfaction 经济满意度
|
||||
* old_career_year 过往职业及年限
|
||||
* support 社会支持度
|
||||
* marriage 婚姻状况
|
||||
* live 居住情况
|
||||
* home 家庭关系
|
||||
* address 地址
|
||||
* phone 联系方式
|
||||
* wechat_no 微信号
|
||||
* api/H5userbaseinfo/addH5userbaseinfo
|
||||
*/
|
||||
function addH5userbaseinfo(){
|
||||
Tools::log_to_write_txt(['新增h5问诊用户基本信息'=>input()]);
|
||||
$api_desc = '新增h5问诊用户基本信息';
|
||||
Db::startTrans();
|
||||
try {
|
||||
|
||||
$doctor = input('doctor');
|
||||
if(empty($doctor)){
|
||||
return json(Tools::set_fail('参数错误.0'));
|
||||
}
|
||||
|
||||
$name = input('name');
|
||||
if(empty($name)){
|
||||
return json(Tools::set_fail('参数错误.1'));
|
||||
}
|
||||
|
||||
$gender = input('gender');
|
||||
$age = input('age');
|
||||
$edu = input('edu');
|
||||
$career_year = input('career_year');
|
||||
$power = input('power');
|
||||
$satisfaction = input('satisfaction');
|
||||
$old_career_year = input('old_career_year');
|
||||
$support = input('support');
|
||||
$marriage = input('marriage');
|
||||
$live = input('live');
|
||||
$home = input('home');
|
||||
$address = input('address');
|
||||
$phone = input('phone');
|
||||
if(empty($phone)){
|
||||
return json(Tools::set_fail('参数错误.14'));
|
||||
}
|
||||
|
||||
$wechat_no = input('wechat_no');
|
||||
|
||||
$data = [
|
||||
'doctor'=>$doctor?:'',
|
||||
'name'=>$name?:'',
|
||||
'gender'=>$gender?:'',
|
||||
'age'=>$age?:'',
|
||||
'edu'=>$edu?:'',
|
||||
'career_year'=>$career_year?:'',
|
||||
'power'=>$power?:'',
|
||||
'satisfaction'=>$satisfaction?:'',
|
||||
'old_career_year'=>$old_career_year?:'',
|
||||
'support'=>$support?:'',
|
||||
'marriage'=>$marriage?:'',
|
||||
'live'=>$live?:'',
|
||||
'home'=>$home?:'',
|
||||
'address'=>$address?:'',
|
||||
'phone'=>$phone?:'',
|
||||
'wechat_no'=>$wechat_no?:'',
|
||||
];
|
||||
|
||||
|
||||
$dataid = Db::table(TabConf::$fa_h5userbaseinfo)->insertGetId($data);
|
||||
|
||||
$this->operateLog('新增h5问诊用户基本信息',api_user_info('id'));
|
||||
Db::commit();
|
||||
return json(Tools::set_ok('ok',$dataid));
|
||||
}catch (\Exception $e){
|
||||
Db::rollback();
|
||||
Tools::log_to_write_txt([
|
||||
'error'=>'新增h5问诊用户基本信息.异常.'.$e->getMessage(),
|
||||
'input'=>input(),
|
||||
'error_info'=>$e->getTraceAsString()
|
||||
]);
|
||||
return json(Tools::set_fail());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
<?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 Hdrmedicalreport extends BaseHttpApi
|
||||
{
|
||||
protected $controller_comments = '问诊报告存档(疼痛科、听译、h5问诊统一存放)(一个基本信息对应一个报告)';
|
||||
|
||||
|
||||
/**
|
||||
* 新增问诊报告存档(疼痛科、听译、h5问诊统一存放)(一个基本信息对应一个报告)
|
||||
*
|
||||
* 参数:
|
||||
* userbaseid 基本信息ID
|
||||
* doctor 所属医生
|
||||
* username 病人
|
||||
* report_content 报告内容
|
||||
* name 病人姓名
|
||||
* phone 患者手机
|
||||
* gender 病人性别
|
||||
* api/Hdrmedicalreport/addHdrmedicalreport
|
||||
*/
|
||||
function addHdrmedicalreport(){
|
||||
Tools::log_to_write_txt(['新增问诊报告存档(疼痛科、听译、h5问诊统一存放)(一个基本信息对应一个报告)'=>input()]);
|
||||
$api_desc = '新增问诊报告存档(疼痛科、听译、h5问诊统一存放)(一个基本信息对应一个报告)';
|
||||
Db::startTrans();
|
||||
try {
|
||||
|
||||
$userbaseid = input('userbaseid');
|
||||
if(empty($userbaseid)){
|
||||
return json(Tools::set_fail('参数错误.0'));
|
||||
}
|
||||
|
||||
$doctor = input('doctor');
|
||||
if(empty($doctor)){
|
||||
return json(Tools::set_fail('参数错误.1'));
|
||||
}
|
||||
|
||||
$username = input('username');
|
||||
$report_content = input('report_content');
|
||||
$name = input('name');
|
||||
if(empty($name)){
|
||||
return json(Tools::set_fail('参数错误.4'));
|
||||
}
|
||||
|
||||
$phone = input('phone');
|
||||
if(empty($phone)){
|
||||
return json(Tools::set_fail('参数错误.5'));
|
||||
}
|
||||
|
||||
$gender = input('gender');
|
||||
|
||||
$data = [
|
||||
'userbaseid'=>$userbaseid?:'',
|
||||
'doctor'=>$doctor?:'',
|
||||
'username'=>$username?:'',
|
||||
'report_content'=>$report_content?:'',
|
||||
'name'=>$name?:'',
|
||||
'phone'=>$phone?:'',
|
||||
'gender'=>$gender?:'',
|
||||
];
|
||||
|
||||
|
||||
$dataid = Db::table(TabConf::$fa_hdrmedical_report)->insertGetId($data);
|
||||
|
||||
$this->operateLog('新增问诊报告存档(疼痛科、听译、h5问诊统一存放)(一个基本信息对应一个报告)',api_user_info('id'));
|
||||
Db::commit();
|
||||
return json(Tools::set_ok('ok',$dataid));
|
||||
}catch (\Exception $e){
|
||||
Db::rollback();
|
||||
Tools::log_to_write_txt([
|
||||
'error'=>'新增问诊报告存档(疼痛科、听译、h5问诊统一存放)(一个基本信息对应一个报告).异常.'.$e->getMessage(),
|
||||
'input'=>input(),
|
||||
'error_info'=>$e->getTraceAsString()
|
||||
]);
|
||||
return json(Tools::set_fail());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
<?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
|
||||
*
|
||||
* 参数:
|
||||
* answer 问卷答案
|
||||
* id ID
|
||||
* hdrquestionnairequestion_id 问卷问题ID
|
||||
* answer 问卷答案
|
||||
* create_time 创建时间
|
||||
*
|
||||
* 所有字段说明<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');
|
||||
$create_time = input('create_time');
|
||||
|
||||
|
||||
$model_obj = Db::table(TabConf::$fa_hdrquestionnaireanswer);
|
||||
|
||||
if(input('answer')){
|
||||
$model_obj->whereLike('answer','%'.input('answer').'%');
|
||||
}
|
||||
|
||||
if(input('id')){
|
||||
$model_obj->where('id',input('id'));
|
||||
}
|
||||
if(input('hdrquestionnairequestion_id')){
|
||||
$model_obj->where('hdrquestionnairequestion_id',input('hdrquestionnairequestion_id'));
|
||||
}
|
||||
if(input('create_time')){
|
||||
$model_obj->where('create_time',input('create_time'));
|
||||
}
|
||||
$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,'操作异常',[]));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
<?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 = '科室问卷问题(一个问题对应多个答案)';
|
||||
|
||||
/**
|
||||
* desc:获取科室问卷问题(一个问题对应多个答案)
|
||||
*
|
||||
* api/Hdrquestionnairequestion/getHdrquestionnairequestionList
|
||||
*
|
||||
* 参数:
|
||||
* question 问卷问题
|
||||
* id ID
|
||||
* hdrdepartment_id 所属科室
|
||||
* question 问卷问题
|
||||
* fit_sex 适合对象:all=全部,gg=男,mm=女
|
||||
* create_time 创建时间
|
||||
* update_time 更新时间
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* hdrdepartment_id 所属科室
|
||||
* question 问卷问题
|
||||
* fit_sex 适合对象:all=全部,gg=男,mm=女
|
||||
* create_time 创建时间
|
||||
* update_time 更新时间
|
||||
|
||||
* author:wh
|
||||
*/
|
||||
function getHdrquestionnairequestionList(){
|
||||
Tools::log_to_write_txt(['获取科室问卷问题(一个问题对应多个答案) 入参:'=>input()]);
|
||||
$api_desc = '获取科室问卷问题(一个问题对应多个答案)';
|
||||
try {
|
||||
|
||||
$id = input('id');
|
||||
$hdrdepartment_id = input('hdrdepartment_id');
|
||||
$question = input('question');
|
||||
$fit_sex = input('fit_sex');
|
||||
$create_time = input('create_time');
|
||||
$update_time = input('update_time');
|
||||
|
||||
|
||||
$model_obj = Db::table(TabConf::$fa_hdrquestionnairequestion);
|
||||
|
||||
if(input('question')){
|
||||
$model_obj->whereLike('question','%'.input('question').'%');
|
||||
}
|
||||
|
||||
if(input('id')){
|
||||
$model_obj->where('id',input('id'));
|
||||
}
|
||||
if(input('hdrdepartment_id')){
|
||||
$model_obj->where('hdrdepartment_id',input('hdrdepartment_id'));
|
||||
}
|
||||
if(input('fit_sex')){
|
||||
$model_obj->where('fit_sex',input('fit_sex'));
|
||||
}
|
||||
if(input('create_time')){
|
||||
$model_obj->where('create_time',input('create_time'));
|
||||
}
|
||||
if(input('update_time')){
|
||||
$model_obj->where('update_time',input('update_time'));
|
||||
}
|
||||
$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,'操作异常',[]));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -80,6 +80,7 @@ class Reporttt
|
||||
'address'=>input('address',''),//地址
|
||||
'phone'=>input('phone',''),//联系方式
|
||||
'wechat_no'=>input('wechat_no',''),//微信号
|
||||
'form'=>'num_per'
|
||||
];
|
||||
|
||||
$contentstr = input('content');
|
||||
@@ -156,6 +157,8 @@ class Reporttt
|
||||
$DATAID = Db::table('fa_tt_userbaseinfo')->insert($basedata);
|
||||
$item['userbaseid'] = $DATAID;
|
||||
Db::table('fa_tt_medical_report')->insert($item);
|
||||
//统一存档
|
||||
Db::table(TabConf::$fa_hdrmedical_report)->insert($item);
|
||||
}
|
||||
|
||||
Db::commit();
|
||||
|
||||
@@ -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;
|
||||
@@ -47,23 +48,23 @@ class Reportty
|
||||
|
||||
$answer_json_arr = [];
|
||||
|
||||
//$ticket = input('ticket');
|
||||
//if(empty($ticket)){
|
||||
// return json(Tools::set_fail('ticket必须'));
|
||||
//}
|
||||
$ticket = input('ticket');
|
||||
if(empty($ticket)){
|
||||
return json(Tools::set_fail('ticket必须'));
|
||||
}
|
||||
$username = input('username');
|
||||
if(empty($username)){
|
||||
return json(Tools::set_fail('username必须'));
|
||||
}
|
||||
$user = Db::table('fa_ty_users')->where('username',$username)->find();
|
||||
if(empty($user)){
|
||||
return json(Tools::set_fail('用户不存在'));
|
||||
return json(Tools::set_fail('医生不存在'));
|
||||
}
|
||||
|
||||
//查询历史聊天记录
|
||||
//$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 +74,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];
|
||||
@@ -125,16 +123,20 @@ class Reportty
|
||||
//病人
|
||||
//'username'=>Db::table('fa_ty_users')->where('doctor',$user['username'])->value('username'),
|
||||
'report_content'=>$choice['message']['content'],
|
||||
'ticket'=>$ticket,
|
||||
];
|
||||
$report_id = Db::table('fa_ty_medical_report')->insertGetId($data);
|
||||
|
||||
//统一存档
|
||||
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 +145,11 @@ class Reportty
|
||||
|
||||
//查询广播客户端id
|
||||
$arr = Db::table('fa_device')
|
||||
->where('username',$username)
|
||||
->where('clientid','neq',$client_id)
|
||||
->where('say_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));
|
||||
}
|
||||
|
||||
@@ -205,14 +206,24 @@ class Reportty
|
||||
*/
|
||||
function editReport(){
|
||||
return Mmodel::catchJson(function (){
|
||||
//$ticket = input('ticket');
|
||||
//if(empty($ticket)){
|
||||
// return Tools::set_fail('ticket必须');
|
||||
//}
|
||||
$ticket = input('ticket');
|
||||
if(empty($ticket)){
|
||||
return Tools::set_fail('ticket必须');
|
||||
}
|
||||
//$user = Db::table('fa_ty_users')->where('ticket',$ticket)->find();
|
||||
//修改基本信息
|
||||
|
||||
if(empty(input('username'))){
|
||||
return Tools::set_fail('医生登录账号必须');
|
||||
}
|
||||
if(empty(input('name',''))){
|
||||
return Tools::set_fail('病人姓名必须');
|
||||
}
|
||||
if(empty(input('phone',''))){
|
||||
return Tools::set_fail('病人手机号必须');
|
||||
}
|
||||
//听译问诊-患者病历信息
|
||||
$data = [
|
||||
//'username'=>$user['username'],//医生
|
||||
'username'=>input('username'),//医生
|
||||
'name'=>input('name',''),//病人姓名
|
||||
'gender'=>input('gender',''),//病人性别: M=男性, F=女性
|
||||
'age'=>input('age',''),//病人年龄
|
||||
@@ -225,19 +236,43 @@ class Reportty
|
||||
'menstrual_marital_history'=>input('menstrual_marital_history',''),//月经婚育史
|
||||
'diagnosis'=>input('diagnosis',''),//诊断
|
||||
'treatment'=>input('treatment',''),//医嘱
|
||||
'ticket'=>$ticket
|
||||
];
|
||||
//查询基本信息
|
||||
$baseuser = Db::table('fa_ty_userbaseinfo')
|
||||
//听译问诊-患者病历信息
|
||||
$medicalrecord = Db::table('fa_ty_usermedicalrecord')
|
||||
->where('name',input('name',''))
|
||||
->find();
|
||||
if(empty($baseuser)){
|
||||
//新增基本信息
|
||||
$userbaseid = Db::table('fa_ty_userbaseinfo')->insertGetId($data);
|
||||
if(empty($medicalrecord)){
|
||||
$data['ticket'] = $ticket;
|
||||
//新增听译病历信息
|
||||
$userbaseid = Db::table('fa_ty_usermedicalrecord')->insertGetId($data);
|
||||
|
||||
}else{
|
||||
$userbaseid = $baseuser['id'];
|
||||
Db::table('fa_ty_userbaseinfo')
|
||||
->where('id',$userbaseid)
|
||||
$userbaseid = $medicalrecord['id'];
|
||||
Db::table('fa_ty_usermedicalrecord')
|
||||
->where('ticket',$ticket)
|
||||
->update($data);
|
||||
}
|
||||
//新增统一基本信息
|
||||
$base_data = [
|
||||
'doctor'=>input('username'),
|
||||
'form'=>'ty',
|
||||
'name'=>input('name',''),
|
||||
'gender'=>input('gender',''),//病人性别: M=男性, F=女性
|
||||
'age'=>input('age',''),//病人年龄
|
||||
'phone'=>input('phone',''),
|
||||
];
|
||||
$baseinfo = Db::table('fa_hdruserbaseinfo')
|
||||
->where('ticket',$ticket)
|
||||
->find();
|
||||
if(empty($baseinfo)){
|
||||
$baseinfo['ticket'] = $ticket;
|
||||
//新增统一基本信息
|
||||
Db::table('fa_hdruserbaseinfo')
|
||||
->insertGetId($base_data);
|
||||
}else{
|
||||
Db::table('fa_hdruserbaseinfo')
|
||||
->where('ticket',$ticket)
|
||||
->update($data);
|
||||
}
|
||||
|
||||
@@ -265,6 +300,18 @@ EOF;
|
||||
}
|
||||
|
||||
Db::table('fa_ty_medical_report')
|
||||
->where('id',$dataid)
|
||||
->data([
|
||||
'userbaseid'=>$userbaseid,//创建报告的时候这个字段是空,修改报告再补填这个字段
|
||||
'report_content'=>$str,
|
||||
'name'=>$data['name'],
|
||||
'gender'=>$data['gender'],
|
||||
])
|
||||
->update();
|
||||
|
||||
|
||||
//更新统一存档
|
||||
Db::table(TabConf::$fa_hdrmedical_report)
|
||||
->where('id',$dataid)
|
||||
->data([
|
||||
'userbaseid'=>$userbaseid,//创建报告的时候这个字段是空,修改报告再补填这个字段
|
||||
|
||||
@@ -90,7 +90,8 @@ class TychatLogic extends BaseLogic
|
||||
$data = [
|
||||
'chat_msg'=>$chat_content,
|
||||
'username'=>$username,
|
||||
'type'=>$type//聊天角色
|
||||
'type'=>$type,//聊天角色
|
||||
'ticket'=>$ticket,//对话凭据
|
||||
];
|
||||
Db::table('fa_ty_chathistory')->insert($data);
|
||||
|
||||
@@ -121,12 +122,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);
|
||||
@@ -228,7 +229,7 @@ class TychatLogic extends BaseLogic
|
||||
'phone'=>$data['items']['phone'],
|
||||
'say_ticket'=>$data['items']['ticket'],
|
||||
];
|
||||
Db::table(TabConf::$fa_dgropen_chat_room_record)
|
||||
Db::table(TabConf::$fa_hdropen_chat_room_record)
|
||||
->insert($data);
|
||||
|
||||
//查询绑定的设备
|
||||
|
||||
@@ -119,6 +119,12 @@ class TabConf
|
||||
static $fa_hdrdepartment = 'fa_hdrdepartment';
|
||||
|
||||
|
||||
/**
|
||||
* 问诊报告存档(疼痛科、听译、h5问诊统一存放)(一个基本信息对应一个报告)
|
||||
*/
|
||||
static $fa_hdrmedical_report = 'fa_hdrmedical_report';
|
||||
|
||||
|
||||
/**
|
||||
* 打开对话窗口记录(同时向患者端发送当前对话患者信息)
|
||||
*/
|
||||
@@ -155,6 +161,12 @@ class TabConf
|
||||
static $fa_hdrregister = 'fa_hdrregister';
|
||||
|
||||
|
||||
/**
|
||||
* 统一问诊用户基本信息
|
||||
*/
|
||||
static $fa_hdruserbaseinfo = 'fa_hdruserbaseinfo';
|
||||
|
||||
|
||||
/**
|
||||
* 短信验证码表
|
||||
*/
|
||||
@@ -228,9 +240,9 @@ class TabConf
|
||||
|
||||
|
||||
/**
|
||||
* 听译-用户基本信息
|
||||
* 听译问诊-患者病历信息
|
||||
*/
|
||||
static $fa_ty_userbaseinfo = 'fa_ty_userbaseinfo';
|
||||
static $fa_ty_usermedicalrecord = 'fa_ty_usermedicalrecord';
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,7 +6,243 @@
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
<div id="api_userstt_getUserById">
|
||||
<div id="api_h5userbaseinfo_addH5userbaseinfo">
|
||||
<div class="markdown_content">
|
||||
***
|
||||
```
|
||||
/**
|
||||
* 新增h5问诊用户基本信息
|
||||
*
|
||||
* 参数:
|
||||
* doctor 所属医生
|
||||
* name 病人姓名
|
||||
* gender 病人性别
|
||||
* age 病人年龄
|
||||
* edu 教育程度
|
||||
* career_year 职业及年限
|
||||
* power 体力要求
|
||||
* satisfaction 经济满意度
|
||||
* old_career_year 过往职业及年限
|
||||
* support 社会支持度
|
||||
* marriage 婚姻状况
|
||||
* live 居住情况
|
||||
* home 家庭关系
|
||||
* address 地址
|
||||
* phone 联系方式
|
||||
* wechat_no 微信号
|
||||
* api/H5userbaseinfo/addH5userbaseinfo
|
||||
* api/h5userbaseinfo/addH5userbaseinfo
|
||||
*/
|
||||
```
|
||||
</div>
|
||||
<div>
|
||||
按需填写其它接口参数:
|
||||
<textarea name="" id="api_h5userbaseinfo_addH5userbaseinfo_textarea" cols="100" rows="3">/api/h5userbaseinfo/addH5userbaseinfo</textarea>
|
||||
<a href='JavaScript:;' onclick="DocObject.api_h5userbaseinfo_addH5userbaseinfo()">测试</a>
|
||||
</div>
|
||||
<div class="api_h5userbaseinfo_addH5userbaseinfo_response_result"></div>
|
||||
|
||||
</div><div id="api_hdrquestionnaireanswer_getHdrquestionnaireanswerList">
|
||||
<div class="markdown_content">
|
||||
***
|
||||
```
|
||||
/**
|
||||
* desc:获取科室问卷答案
|
||||
*
|
||||
* api/Hdrquestionnaireanswer/getHdrquestionnaireanswerList
|
||||
*
|
||||
* 参数:
|
||||
* answer 问卷答案
|
||||
* id ID
|
||||
* hdrquestionnairequestion_id 问卷问题ID
|
||||
* answer 问卷答案
|
||||
* create_time 创建时间
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* hdrquestionnairequestion_id 问卷问题ID
|
||||
* answer 问卷答案
|
||||
* create_time 创建时间
|
||||
* update_time 更新时间
|
||||
|
||||
* author:wh
|
||||
* api/hdrquestionnaireanswer/getHdrquestionnaireanswerList
|
||||
*/
|
||||
```
|
||||
</div>
|
||||
<div>
|
||||
按需填写其它接口参数:
|
||||
<textarea name="" id="api_hdrquestionnaireanswer_getHdrquestionnaireanswerList_textarea" cols="100" rows="3">/api/hdrquestionnaireanswer/getHdrquestionnaireanswerList</textarea>
|
||||
<a href='JavaScript:;' onclick="DocObject.api_hdrquestionnaireanswer_getHdrquestionnaireanswerList()">测试</a>
|
||||
</div>
|
||||
<div class="api_hdrquestionnaireanswer_getHdrquestionnaireanswerList_response_result"></div>
|
||||
|
||||
</div><div id="api_hdrquestionnairequestion_getHdrquestionnairequestionList">
|
||||
<div class="markdown_content">
|
||||
***
|
||||
```
|
||||
/**
|
||||
* desc:获取科室问卷问题(一个问题对应多个答案)
|
||||
*
|
||||
* api/Hdrquestionnairequestion/getHdrquestionnairequestionList
|
||||
*
|
||||
* 参数:
|
||||
* question 问卷问题
|
||||
* id ID
|
||||
* hdrdepartment_id 所属科室
|
||||
* question 问卷问题
|
||||
* fit_sex 适合对象:all=全部,gg=男,mm=女
|
||||
* create_time 创建时间
|
||||
* update_time 更新时间
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* hdrdepartment_id 所属科室
|
||||
* question 问卷问题
|
||||
* fit_sex 适合对象:all=全部,gg=男,mm=女
|
||||
* create_time 创建时间
|
||||
* update_time 更新时间
|
||||
|
||||
* author:wh
|
||||
* api/hdrquestionnairequestion/getHdrquestionnairequestionList
|
||||
*/
|
||||
```
|
||||
</div>
|
||||
<div>
|
||||
按需填写其它接口参数:
|
||||
<textarea name="" id="api_hdrquestionnairequestion_getHdrquestionnairequestionList_textarea" cols="100" rows="3">/api/hdrquestionnairequestion/getHdrquestionnairequestionList</textarea>
|
||||
<a href='JavaScript:;' onclick="DocObject.api_hdrquestionnairequestion_getHdrquestionnairequestionList()">测试</a>
|
||||
</div>
|
||||
<div class="api_hdrquestionnairequestion_getHdrquestionnairequestionList_response_result"></div>
|
||||
|
||||
</div><div id="api_hdrregister_addHdrregister">
|
||||
<div class="markdown_content">
|
||||
***
|
||||
```
|
||||
/**
|
||||
* 新增患者挂号列表(可重复挂号)
|
||||
*
|
||||
* 参数:
|
||||
* date 挂号日期
|
||||
* name 患者姓名(可重复挂号)
|
||||
* doctor_name 医生名称
|
||||
* age 病人年龄
|
||||
* gender 病人性别
|
||||
* phone 手机号
|
||||
* qa_type 问答类型(患者定):1=自由问答,2=固定问答,3=健康问答
|
||||
* say_ticket 对话凭据(便于查询)
|
||||
* api/Hdrregister/addHdrregister
|
||||
* api/hdrregister/addHdrregister
|
||||
*/
|
||||
```
|
||||
</div>
|
||||
<div>
|
||||
按需填写其它接口参数:
|
||||
<textarea name="" id="api_hdrregister_addHdrregister_textarea" cols="100" rows="3">/api/hdrregister/addHdrregister</textarea>
|
||||
<a href='JavaScript:;' onclick="DocObject.api_hdrregister_addHdrregister()">测试</a>
|
||||
</div>
|
||||
<div class="api_hdrregister_addHdrregister_response_result"></div>
|
||||
|
||||
</div><div id="api_hdrregister_getHdrregisterList">
|
||||
<div class="markdown_content">
|
||||
***
|
||||
```
|
||||
/**
|
||||
* 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=健康问答
|
||||
* say_ticket 对话凭据(便于查询)
|
||||
|
||||
* author:wh
|
||||
* api/hdrregister/getHdrregisterList
|
||||
*/
|
||||
```
|
||||
</div>
|
||||
<div>
|
||||
按需填写其它接口参数:
|
||||
<textarea name="" id="api_hdrregister_getHdrregisterList_textarea" cols="100" rows="3">/api/hdrregister/getHdrregisterList</textarea>
|
||||
<a href='JavaScript:;' onclick="DocObject.api_hdrregister_getHdrregisterList()">测试</a>
|
||||
</div>
|
||||
<div class="api_hdrregister_getHdrregisterList_response_result"></div>
|
||||
|
||||
</div><div id="api_ttchathistory_getTtchathistoryList">
|
||||
<div class="markdown_content">
|
||||
***
|
||||
```
|
||||
/**
|
||||
* desc:获取数智人固定问答聊天历史
|
||||
*
|
||||
* api/Ttchathistory/getTtchathistoryList
|
||||
*
|
||||
* 参数:
|
||||
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* username 聊天用户
|
||||
* relation 医生患者关系
|
||||
* chat_msg 问诊内容
|
||||
* create_time 创建时间
|
||||
|
||||
* author:wh
|
||||
* api/ttchathistory/getTtchathistoryList
|
||||
*/
|
||||
```
|
||||
</div>
|
||||
<div>
|
||||
按需填写其它接口参数:
|
||||
<textarea name="" id="api_ttchathistory_getTtchathistoryList_textarea" cols="100" rows="3">/api/ttchathistory/getTtchathistoryList</textarea>
|
||||
<a href='JavaScript:;' onclick="DocObject.api_ttchathistory_getTtchathistoryList()">测试</a>
|
||||
</div>
|
||||
<div class="api_ttchathistory_getTtchathistoryList_response_result"></div>
|
||||
|
||||
</div><div id="api_userstt_getSayTicket">
|
||||
<div class="markdown_content">
|
||||
***
|
||||
```
|
||||
/**
|
||||
* desc:获取对话票据,隔离用户历史记录,每次诊断完,重新生成新的对话票据
|
||||
* (首次对话票据在登录时返回)
|
||||
* 参数:无
|
||||
*
|
||||
* api/Userstt/getSayTicket
|
||||
*
|
||||
* author:wh
|
||||
* api/userstt/getSayTicket
|
||||
*/
|
||||
```
|
||||
</div>
|
||||
<div>
|
||||
按需填写其它接口参数:
|
||||
<textarea name="" id="api_userstt_getSayTicket_textarea" cols="100" rows="3">/api/userstt/getSayTicket</textarea>
|
||||
<a href='JavaScript:;' onclick="DocObject.api_userstt_getSayTicket()">测试</a>
|
||||
</div>
|
||||
<div class="api_userstt_getSayTicket_response_result"></div>
|
||||
|
||||
</div><div id="api_userstt_getUserById">
|
||||
<div class="markdown_content">
|
||||
***
|
||||
```
|
||||
@@ -108,6 +344,37 @@
|
||||
</div>
|
||||
<div class="api_userstt_editBaseinfo_response_result"></div>
|
||||
|
||||
</div><div id="api_userstt_subFreeQuestionAnswerRecord">
|
||||
<div class="markdown_content">
|
||||
***
|
||||
```
|
||||
/**
|
||||
* desc:提交自由问答记录(后台需要单独列出来,对话时前端缓存在本地,对话结束提交)
|
||||
*
|
||||
* 参数:
|
||||
* ticket 对话票据(结束问诊时重新生成)
|
||||
* username 用户名
|
||||
* content 对话内容,格式:
|
||||
* content = [
|
||||
["role" => "user", "content" => '1'],
|
||||
["role" => "user", "content" => '2'],
|
||||
["role" => "user", "content" => '3'],
|
||||
];
|
||||
*
|
||||
* api/Userstt/subFreeQuestionAnswerRecord
|
||||
*
|
||||
* author:wh
|
||||
* api/userstt/subFreeQuestionAnswerRecord
|
||||
*/
|
||||
```
|
||||
</div>
|
||||
<div>
|
||||
按需填写其它接口参数:
|
||||
<textarea name="" id="api_userstt_subFreeQuestionAnswerRecord_textarea" cols="100" rows="3">/api/userstt/subFreeQuestionAnswerRecord</textarea>
|
||||
<a href='JavaScript:;' onclick="DocObject.api_userstt_subFreeQuestionAnswerRecord()">测试</a>
|
||||
</div>
|
||||
<div class="api_userstt_subFreeQuestionAnswerRecord_response_result"></div>
|
||||
|
||||
</div><div id="api_usersty_login">
|
||||
<div class="markdown_content">
|
||||
***
|
||||
@@ -133,29 +400,6 @@
|
||||
</div>
|
||||
<div class="api_usersty_login_response_result"></div>
|
||||
|
||||
</div><div id="api_usersty_bindDevice">
|
||||
<div class="markdown_content">
|
||||
***
|
||||
```
|
||||
/**
|
||||
* desc: 绑定设备(选择角色时调用)
|
||||
*
|
||||
* api/Usersty/bindDevice
|
||||
*
|
||||
* 参数:username
|
||||
* clientid
|
||||
* type 用户类型:user=用户,doc=医生
|
||||
* api/usersty/bindDevice
|
||||
*/
|
||||
```
|
||||
</div>
|
||||
<div>
|
||||
按需填写其它接口参数:
|
||||
<textarea name="" id="api_usersty_bindDevice_textarea" cols="100" rows="3">/api/usersty/bindDevice</textarea>
|
||||
<a href='JavaScript:;' onclick="DocObject.api_usersty_bindDevice()">测试</a>
|
||||
</div>
|
||||
<div class="api_usersty_bindDevice_response_result"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
@@ -174,7 +418,49 @@
|
||||
$(ele).html(marked.parse($(ele).html()));
|
||||
});
|
||||
},
|
||||
api_userstt_getUserById(){
|
||||
api_h5userbaseinfo_addH5userbaseinfo(){
|
||||
let url = $('#api_h5userbaseinfo_addH5userbaseinfo_textarea').val();
|
||||
$.post(url,{},function(res) {
|
||||
$('.api_h5userbaseinfo_addH5userbaseinfo_response_result').html(JSON.stringify(res, null, "\t"));
|
||||
$('.api_h5userbaseinfo_addH5userbaseinfo_response_result').attr('style','color:green');
|
||||
},'json');
|
||||
}, api_hdrquestionnaireanswer_getHdrquestionnaireanswerList(){
|
||||
let url = $('#api_hdrquestionnaireanswer_getHdrquestionnaireanswerList_textarea').val();
|
||||
$.post(url,{},function(res) {
|
||||
$('.api_hdrquestionnaireanswer_getHdrquestionnaireanswerList_response_result').html(JSON.stringify(res, null, "\t"));
|
||||
$('.api_hdrquestionnaireanswer_getHdrquestionnaireanswerList_response_result').attr('style','color:green');
|
||||
},'json');
|
||||
}, api_hdrquestionnairequestion_getHdrquestionnairequestionList(){
|
||||
let url = $('#api_hdrquestionnairequestion_getHdrquestionnairequestionList_textarea').val();
|
||||
$.post(url,{},function(res) {
|
||||
$('.api_hdrquestionnairequestion_getHdrquestionnairequestionList_response_result').html(JSON.stringify(res, null, "\t"));
|
||||
$('.api_hdrquestionnairequestion_getHdrquestionnairequestionList_response_result').attr('style','color:green');
|
||||
},'json');
|
||||
}, api_hdrregister_addHdrregister(){
|
||||
let url = $('#api_hdrregister_addHdrregister_textarea').val();
|
||||
$.post(url,{},function(res) {
|
||||
$('.api_hdrregister_addHdrregister_response_result').html(JSON.stringify(res, null, "\t"));
|
||||
$('.api_hdrregister_addHdrregister_response_result').attr('style','color:green');
|
||||
},'json');
|
||||
}, api_hdrregister_getHdrregisterList(){
|
||||
let url = $('#api_hdrregister_getHdrregisterList_textarea').val();
|
||||
$.post(url,{},function(res) {
|
||||
$('.api_hdrregister_getHdrregisterList_response_result').html(JSON.stringify(res, null, "\t"));
|
||||
$('.api_hdrregister_getHdrregisterList_response_result').attr('style','color:green');
|
||||
},'json');
|
||||
}, api_ttchathistory_getTtchathistoryList(){
|
||||
let url = $('#api_ttchathistory_getTtchathistoryList_textarea').val();
|
||||
$.post(url,{},function(res) {
|
||||
$('.api_ttchathistory_getTtchathistoryList_response_result').html(JSON.stringify(res, null, "\t"));
|
||||
$('.api_ttchathistory_getTtchathistoryList_response_result').attr('style','color:green');
|
||||
},'json');
|
||||
}, api_userstt_getSayTicket(){
|
||||
let url = $('#api_userstt_getSayTicket_textarea').val();
|
||||
$.post(url,{},function(res) {
|
||||
$('.api_userstt_getSayTicket_response_result').html(JSON.stringify(res, null, "\t"));
|
||||
$('.api_userstt_getSayTicket_response_result').attr('style','color:green');
|
||||
},'json');
|
||||
}, api_userstt_getUserById(){
|
||||
let url = $('#api_userstt_getUserById_textarea').val();
|
||||
$.post(url,{},function(res) {
|
||||
$('.api_userstt_getUserById_response_result').html(JSON.stringify(res, null, "\t"));
|
||||
@@ -198,18 +484,18 @@
|
||||
$('.api_userstt_editBaseinfo_response_result').html(JSON.stringify(res, null, "\t"));
|
||||
$('.api_userstt_editBaseinfo_response_result').attr('style','color:green');
|
||||
},'json');
|
||||
}, api_userstt_subFreeQuestionAnswerRecord(){
|
||||
let url = $('#api_userstt_subFreeQuestionAnswerRecord_textarea').val();
|
||||
$.post(url,{},function(res) {
|
||||
$('.api_userstt_subFreeQuestionAnswerRecord_response_result').html(JSON.stringify(res, null, "\t"));
|
||||
$('.api_userstt_subFreeQuestionAnswerRecord_response_result').attr('style','color:green');
|
||||
},'json');
|
||||
}, api_usersty_login(){
|
||||
let url = $('#api_usersty_login_textarea').val();
|
||||
$.post(url,{},function(res) {
|
||||
$('.api_usersty_login_response_result').html(JSON.stringify(res, null, "\t"));
|
||||
$('.api_usersty_login_response_result').attr('style','color:green');
|
||||
},'json');
|
||||
}, api_usersty_bindDevice(){
|
||||
let url = $('#api_usersty_bindDevice_textarea').val();
|
||||
$.post(url,{},function(res) {
|
||||
$('.api_usersty_bindDevice_response_result').html(JSON.stringify(res, null, "\t"));
|
||||
$('.api_usersty_bindDevice_response_result').attr('style','color:green');
|
||||
},'json');
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,179 @@
|
||||
##### 请求域名:http://127.0.0.1:8080/
|
||||
##### 请求方式:POST(默认)
|
||||
|
||||
***
|
||||
```
|
||||
/**
|
||||
* 新增h5问诊用户基本信息
|
||||
*
|
||||
* 参数:
|
||||
* doctor 所属医生
|
||||
* name 病人姓名
|
||||
* gender 病人性别
|
||||
* age 病人年龄
|
||||
* edu 教育程度
|
||||
* career_year 职业及年限
|
||||
* power 体力要求
|
||||
* satisfaction 经济满意度
|
||||
* old_career_year 过往职业及年限
|
||||
* support 社会支持度
|
||||
* marriage 婚姻状况
|
||||
* live 居住情况
|
||||
* home 家庭关系
|
||||
* address 地址
|
||||
* phone 联系方式
|
||||
* wechat_no 微信号
|
||||
* api/H5userbaseinfo/addH5userbaseinfo
|
||||
* api/h5userbaseinfo/addH5userbaseinfo
|
||||
*/
|
||||
```
|
||||
|
||||
***
|
||||
```
|
||||
/**
|
||||
* desc:获取科室问卷答案
|
||||
*
|
||||
* api/Hdrquestionnaireanswer/getHdrquestionnaireanswerList
|
||||
*
|
||||
* 参数:
|
||||
* answer 问卷答案
|
||||
* id ID
|
||||
* hdrquestionnairequestion_id 问卷问题ID
|
||||
* answer 问卷答案
|
||||
* create_time 创建时间
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* hdrquestionnairequestion_id 问卷问题ID
|
||||
* answer 问卷答案
|
||||
* create_time 创建时间
|
||||
* update_time 更新时间
|
||||
|
||||
* author:wh
|
||||
* api/hdrquestionnaireanswer/getHdrquestionnaireanswerList
|
||||
*/
|
||||
```
|
||||
|
||||
***
|
||||
```
|
||||
/**
|
||||
* desc:获取科室问卷问题(一个问题对应多个答案)
|
||||
*
|
||||
* api/Hdrquestionnairequestion/getHdrquestionnairequestionList
|
||||
*
|
||||
* 参数:
|
||||
* question 问卷问题
|
||||
* id ID
|
||||
* hdrdepartment_id 所属科室
|
||||
* question 问卷问题
|
||||
* fit_sex 适合对象:all=全部,gg=男,mm=女
|
||||
* create_time 创建时间
|
||||
* update_time 更新时间
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* hdrdepartment_id 所属科室
|
||||
* question 问卷问题
|
||||
* fit_sex 适合对象:all=全部,gg=男,mm=女
|
||||
* create_time 创建时间
|
||||
* update_time 更新时间
|
||||
|
||||
* author:wh
|
||||
* api/hdrquestionnairequestion/getHdrquestionnairequestionList
|
||||
*/
|
||||
```
|
||||
|
||||
***
|
||||
```
|
||||
/**
|
||||
* 新增患者挂号列表(可重复挂号)
|
||||
*
|
||||
* 参数:
|
||||
* date 挂号日期
|
||||
* name 患者姓名(可重复挂号)
|
||||
* doctor_name 医生名称
|
||||
* age 病人年龄
|
||||
* gender 病人性别
|
||||
* phone 手机号
|
||||
* qa_type 问答类型(患者定):1=自由问答,2=固定问答,3=健康问答
|
||||
* say_ticket 对话凭据(便于查询)
|
||||
* api/Hdrregister/addHdrregister
|
||||
* api/hdrregister/addHdrregister
|
||||
*/
|
||||
```
|
||||
|
||||
***
|
||||
```
|
||||
/**
|
||||
* 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=健康问答
|
||||
* say_ticket 对话凭据(便于查询)
|
||||
|
||||
* author:wh
|
||||
* api/hdrregister/getHdrregisterList
|
||||
*/
|
||||
```
|
||||
|
||||
***
|
||||
```
|
||||
/**
|
||||
* desc:获取数智人固定问答聊天历史
|
||||
*
|
||||
* api/Ttchathistory/getTtchathistoryList
|
||||
*
|
||||
* 参数:
|
||||
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* username 聊天用户
|
||||
* relation 医生患者关系
|
||||
* chat_msg 问诊内容
|
||||
* create_time 创建时间
|
||||
|
||||
* author:wh
|
||||
* api/ttchathistory/getTtchathistoryList
|
||||
*/
|
||||
```
|
||||
|
||||
***
|
||||
```
|
||||
/**
|
||||
* desc:获取对话票据,隔离用户历史记录,每次诊断完,重新生成新的对话票据
|
||||
* (首次对话票据在登录时返回)
|
||||
* 参数:无
|
||||
*
|
||||
* api/Userstt/getSayTicket
|
||||
*
|
||||
* author:wh
|
||||
* api/userstt/getSayTicket
|
||||
*/
|
||||
```
|
||||
|
||||
***
|
||||
```
|
||||
/**
|
||||
@@ -70,6 +243,28 @@
|
||||
*/
|
||||
```
|
||||
|
||||
***
|
||||
```
|
||||
/**
|
||||
* desc:提交自由问答记录(后台需要单独列出来,对话时前端缓存在本地,对话结束提交)
|
||||
*
|
||||
* 参数:
|
||||
* ticket 对话票据(结束问诊时重新生成)
|
||||
* username 用户名
|
||||
* content 对话内容,格式:
|
||||
* content = [
|
||||
["role" => "user", "content" => '1'],
|
||||
["role" => "user", "content" => '2'],
|
||||
["role" => "user", "content" => '3'],
|
||||
];
|
||||
*
|
||||
* api/Userstt/subFreeQuestionAnswerRecord
|
||||
*
|
||||
* author:wh
|
||||
* api/userstt/subFreeQuestionAnswerRecord
|
||||
*/
|
||||
```
|
||||
|
||||
***
|
||||
```
|
||||
/**
|
||||
@@ -85,17 +280,3 @@
|
||||
* api/usersty/login
|
||||
*/
|
||||
```
|
||||
|
||||
***
|
||||
```
|
||||
/**
|
||||
* desc: 绑定设备(选择角色时调用)
|
||||
*
|
||||
* api/Usersty/bindDevice
|
||||
*
|
||||
* 参数:username
|
||||
* clientid
|
||||
* type 用户类型:user=用户,doc=医生
|
||||
* api/usersty/bindDevice
|
||||
*/
|
||||
```
|
||||
|
||||
@@ -93,7 +93,7 @@ class Followup extends Backend
|
||||
$report_dataid = input('report_dataid');
|
||||
$report = Db::table('fa_ty_medical_report')->where('id',$report_dataid)->find();
|
||||
|
||||
$userbaseinfo = Db::table('fa_ty_userbaseinfo')->where('id',$report['id'])->find();
|
||||
$userbaseinfo = Db::table('fa_ty_usermedicalrecord')->where('id',$report['id'])->find();
|
||||
$this->assign('user',$userbaseinfo);
|
||||
$html = view('add')->getContent();
|
||||
return json(Tools::set_ok('ok',$html));
|
||||
@@ -110,7 +110,7 @@ class Followup extends Backend
|
||||
}
|
||||
$report = Db::table('fa_ty_medical_report')->where('id',$report_dataid)->find();
|
||||
|
||||
$userbase = Db::table('fa_ty_userbaseinfo')
|
||||
$userbase = Db::table('fa_ty_usermedicalrecord')
|
||||
->where('id',$report['userbaseid'])
|
||||
->find();
|
||||
if(empty($userbase)){
|
||||
|
||||
Reference in New Issue
Block a user