diff --git a/digital_doctor/application/api/controller/Hdruserbaseinfo.php b/digital_doctor/application/api/controller/Hdruserbaseinfo.php index 1b18c46..798eef5 100644 --- a/digital_doctor/application/api/controller/Hdruserbaseinfo.php +++ b/digital_doctor/application/api/controller/Hdruserbaseinfo.php @@ -1,103 +1,192 @@ -(可能有部分额外字段未在此体现): + * 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 + * * 参数: - * doctor 所属医生 所属医生 必须 - * name 病人姓名 病人姓名 必须 - * phone 联系方式 联系方式 必须 - * + * id ID ID 必须 + * * 所有字段说明(可能有部分额外字段未在此体现): - * 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 getHdruserbaseinfoDetail(){ - Tools::log_to_write_txt(['根据所属医生账号、病患姓名和病患电话查询病历 入参:'=>input()]); - $api_desc = '根据所属医生账号、病患姓名和病患电话查询病历'; - try { - - $doctor = input('doctor'); - if(empty($doctor)){ - return json(Tools::set_fail('doctor参数错误')); - } - - $name = input('name'); - if(empty($name)){ - return json(Tools::set_fail('name参数错误')); - } - - $phone = input('phone'); - if(empty($phone)){ - return json(Tools::set_fail('phone参数错误')); - } - - - - $model_obj = Db::table(TabConf::$fa_hdruserbaseinfo); - - if(input('doctor')){ - $model_obj->where('doctor',input('doctor')); - } - if(input('name')){ - $model_obj->where('name',input('name')); - } - if(input('phone')){ - $model_obj->where('phone',input('phone')); - } - $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,'操作异常',[])); - } - } - + * 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,'操作异常',[])); + } + } } \ No newline at end of file diff --git a/digital_doctor/application/api/controller/Reporttt.php b/digital_doctor/application/api/controller/Reporttt.php index 3d86a87..46ea1cf 100644 --- a/digital_doctor/application/api/controller/Reporttt.php +++ b/digital_doctor/application/api/controller/Reporttt.php @@ -181,11 +181,14 @@ class Reporttt extends BaseHttpApi Db::startTrans(); try { foreach ($data as $item){ + + //新增统一基本信息 + $hdruserbaseinfo_id = Db::table('fa_hdruserbaseinfo')->insertGetId($basedata); //只新增不修改 - $hdruserbaseinfo_id = Db::table('fa_tt_userbaseinfo')->insert($basedata); + $userbaseinfo_id = Db::table('fa_tt_userbaseinfo')->insert($basedata); //保存疼痛科聊天记录 - $this->setTtChatHistory($sub_content,$user['username'],$hdruserbaseinfo_id,$ticket); - $item['userbaseid'] = $hdruserbaseinfo_id; + $this->setTtChatHistory($sub_content,$user['username'],$hdruserbaseinfo_id,$userbaseinfo_id,$ticket); + $item['userbaseid'] = $userbaseinfo_id; $item['hdruserbaseinfo_id'] = $hdruserbaseinfo_id;//统一病历基本信息ID $item['from'] = input('from','num_per');//来源:num_per=数智人,ty=听译助手,h5=h5网页问诊 //保存报告 @@ -212,7 +215,7 @@ class Reporttt extends BaseHttpApi * author:wh * @param $sub_content */ - private function setTtChatHistory($sub_content,$username,$userbaseinfo_id,$ticket){ + private function setTtChatHistory($sub_content,$username,$hdruserbaseinfo_id,$userbaseinfo_id,$ticket){ //$content = [ // //["role" => "user", "content" => ''] //]; @@ -225,6 +228,7 @@ class Reporttt extends BaseHttpApi 'chat_msg'=>$item['content'], 'ticket'=>$ticket, 'userbaseinfo_id'=>$userbaseinfo_id, + 'hdruserbaseinfo_id'=>$hdruserbaseinfo_id ]; $data[] = $d; } diff --git a/digital_doctor/public/api_docs/api_list.html b/digital_doctor/public/api_docs/api_list.html index 29cefca..9c342a5 100644 --- a/digital_doctor/public/api_docs/api_list.html +++ b/digital_doctor/public/api_docs/api_list.html @@ -6,7 +6,26 @@
-
+
+
+*** +``` + /** + * desc:管理员登录 + * api/Hdradmin/adminLogin + * author:wh + * api/hdradmin/adminLogin + */ +``` +
+
+ 按需填写其它接口参数: + + 测试 +
+
+ +
*** ``` @@ -124,56 +143,6 @@
-
-
-*** -``` - /** - * desc:病历列表 - * - * api/Hdrmedicalreport/getHdrmedicalreportList - * - * 参数: - * 带分页 - * current_page 当前页码 - * list_rows 每页显示条数 默认15 - * report_content 报告内容 - * name 病人姓名 - * phone 患者手机 - * id ID - * date 日期 - * from 来源:num_per=数智人,ty=听译助手,h5=h5网页问诊 - * doctor 所属医生 所属医生 必须 - * report_content 报告内容 - * name 病人姓名 - * phone 患者手机 - * - * 所有字段说明(可能有部分额外字段未在此体现): - * id ID - * date 日期 - * userbaseid 基本信息ID - * from 来源:num_per=数智人,ty=听译助手,h5=h5网页问诊 - * doctor 所属医生 - * username 病人 - * report_content 报告内容 - * name 病人姓名 - * phone 患者手机 - * gender 病人性别 - * ticket 对话票据(数据隔离) - * create_time 生成时间 - - * author:wh - * api/hdrmedicalreport/getHdrmedicalreportList - */ -``` -
-
- 按需填写其它接口参数: - - 测试 -
-
-
*** @@ -328,19 +297,26 @@
-
+
*** ``` /** - * desc:根据所属医生账号、病患姓名和病患电话查询病历 + * desc:获取统一问诊用户基本信息列表(后台病历管理列表) * - * api/Hdruserbaseinfo/getHdruserbaseinfoDetail + * api/Hdruserbaseinfo/getHdruserbaseinfoList * * 参数: - * doctor 所属医生 所属医生 必须 - * name 病人姓名 病人姓名 必须 - * phone 联系方式 联系方式 必须 + * 带分页 + * current_page 当前页码 + * list_rows 每页显示条数 默认15 + * doctor 所属医生 + * id ID + * date 日期 + * doctor 所属医生 + * hdrdepartment_id 科室 + * from 来源:num_per=数智人,ty=听译助手,h5=h5网页问诊 + * name 病人姓名 * * 所有字段说明(可能有部分额外字段未在此体现): * id ID @@ -369,16 +345,66 @@ * is_flow 是否接受随访:yes=是,no=否 * author:wh - * api/hdruserbaseinfo/getHdruserbaseinfoDetail + * api/hdruserbaseinfo/getHdruserbaseinfoList */ ```
按需填写其它接口参数: - - 测试 + + 测试
-
+
+ +
+
+*** +``` + /** + * desc:获取统一问诊用户基本信息详情(后台病历管理详情) + * + * api/Hdruserbaseinfo/getHdruserbaseinfoDetailById + * + * 参数: + * id ID ID 必须 + * + * 所有字段说明(可能有部分额外字段未在此体现): + * 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 + * api/hdruserbaseinfo/getHdruserbaseinfoDetailById + */ +``` +
+
+ 按需填写其它接口参数: + + 测试 +
+
@@ -722,52 +748,6 @@
-
-
-*** -``` - /** - * desc:获取听译问诊-患者病历信息 - * - * api/Tyusermedicalrecord/getTyusermedicalrecordDetail - * - * 参数: - * username 所属医生 所属医生 必须 - * name 病人姓名 病人姓名 必须 - * phone 联系方式 联系方式 必须 - * - * 所有字段说明(可能有部分额外字段未在此体现): - * id ID - * username 所属医生 - * name 病人姓名 - * gender 病人性别 - * age 病人年龄 - * main_complaint 主诉 - * medical_history 病史 - * past_history 既往史 - * allergy_history 过敏史 - * family_history 家族史 - * personal_history 个人史 - * menstrual_marital_history 月经婚育史 - * diagnosis 诊断 - * treatment 医嘱 - * phone 联系方式 - * status 问诊状态 - * create_time 创建时间 - * ticket 对话票据 - - * author:wh - * api/tyusermedicalrecord/getTyusermedicalrecordDetail - */ -``` -
-
- 按需填写其它接口参数: - - 测试 -
-
-
*** @@ -967,7 +947,13 @@ $(ele).html(marked.parse($(ele).html())); }); }, - api_hdrdepartment_getHdrdepartmentList(){ + api_hdradmin_adminLogin(){ + let url = $('#api_hdradmin_adminLogin_textarea').val(); + $.post(url,{},function(res) { + $('.api_hdradmin_adminLogin_response_result').html(JSON.stringify(res, null, "\t")); + $('.api_hdradmin_adminLogin_response_result').attr('style','color:green'); + },'json'); + }, api_hdrdepartment_getHdrdepartmentList(){ let url = $('#api_hdrdepartment_getHdrdepartmentList_textarea').val(); $.post(url,{},function(res) { $('.api_hdrdepartment_getHdrdepartmentList_response_result').html(JSON.stringify(res, null, "\t")); @@ -991,12 +977,6 @@ $('.api_hdrfollowup_updateHdrfollowup_response_result').html(JSON.stringify(res, null, "\t")); $('.api_hdrfollowup_updateHdrfollowup_response_result').attr('style','color:green'); },'json'); - }, api_hdrmedicalreport_getHdrmedicalreportList(){ - let url = $('#api_hdrmedicalreport_getHdrmedicalreportList_textarea').val(); - $.post(url,{},function(res) { - $('.api_hdrmedicalreport_getHdrmedicalreportList_response_result').html(JSON.stringify(res, null, "\t")); - $('.api_hdrmedicalreport_getHdrmedicalreportList_response_result').attr('style','color:green'); - },'json'); }, api_hdrquestionnaireanswer_getHdrquestionnaireanswerList(){ let url = $('#api_hdrquestionnaireanswer_getHdrquestionnaireanswerList_textarea').val(); $.post(url,{},function(res) { @@ -1021,11 +1001,17 @@ $('.api_hdrregister_getHdrregisterList_response_result').html(JSON.stringify(res, null, "\t")); $('.api_hdrregister_getHdrregisterList_response_result').attr('style','color:green'); },'json'); - }, api_hdruserbaseinfo_getHdruserbaseinfoDetail(){ - let url = $('#api_hdruserbaseinfo_getHdruserbaseinfoDetail_textarea').val(); + }, api_hdruserbaseinfo_getHdruserbaseinfoList(){ + let url = $('#api_hdruserbaseinfo_getHdruserbaseinfoList_textarea').val(); $.post(url,{},function(res) { - $('.api_hdruserbaseinfo_getHdruserbaseinfoDetail_response_result').html(JSON.stringify(res, null, "\t")); - $('.api_hdruserbaseinfo_getHdruserbaseinfoDetail_response_result').attr('style','color:green'); + $('.api_hdruserbaseinfo_getHdruserbaseinfoList_response_result').html(JSON.stringify(res, null, "\t")); + $('.api_hdruserbaseinfo_getHdruserbaseinfoList_response_result').attr('style','color:green'); + },'json'); + }, api_hdruserbaseinfo_getHdruserbaseinfoDetailById(){ + let url = $('#api_hdruserbaseinfo_getHdruserbaseinfoDetailById_textarea').val(); + $.post(url,{},function(res) { + $('.api_hdruserbaseinfo_getHdruserbaseinfoDetailById_response_result').html(JSON.stringify(res, null, "\t")); + $('.api_hdruserbaseinfo_getHdruserbaseinfoDetailById_response_result').attr('style','color:green'); },'json'); }, api_reporttt_createReport(){ let url = $('#api_reporttt_createReport_textarea').val(); @@ -1093,12 +1079,6 @@ $('.api_tyfollowup_getTyfollowupDetail_response_result').html(JSON.stringify(res, null, "\t")); $('.api_tyfollowup_getTyfollowupDetail_response_result').attr('style','color:green'); },'json'); - }, api_tyusermedicalrecord_getTyusermedicalrecordDetail(){ - let url = $('#api_tyusermedicalrecord_getTyusermedicalrecordDetail_textarea').val(); - $.post(url,{},function(res) { - $('.api_tyusermedicalrecord_getTyusermedicalrecordDetail_response_result').html(JSON.stringify(res, null, "\t")); - $('.api_tyusermedicalrecord_getTyusermedicalrecordDetail_response_result').attr('style','color:green'); - },'json'); }, api_userstt_getSayTicket(){ let url = $('#api_userstt_getSayTicket_textarea').val(); $.post(url,{},function(res) { diff --git a/digital_doctor/public/api_docs/api_list.md b/digital_doctor/public/api_docs/api_list.md index ead35d6..dc0feb3 100644 --- a/digital_doctor/public/api_docs/api_list.md +++ b/digital_doctor/public/api_docs/api_list.md @@ -4,6 +4,16 @@ ##### 请求域名:http://127.0.0.1:8080/ ##### 请求方式:POST(默认) +*** +``` + /** + * desc:管理员登录 + * api/Hdradmin/adminLogin + * author:wh + * api/hdradmin/adminLogin + */ +``` + *** ``` /** @@ -86,47 +96,6 @@ */ ``` -*** -``` - /** - * desc:病历列表 - * - * api/Hdrmedicalreport/getHdrmedicalreportList - * - * 参数: - * 带分页 - * current_page 当前页码 - * list_rows 每页显示条数 默认15 - * report_content 报告内容 - * name 病人姓名 - * phone 患者手机 - * id ID - * date 日期 - * from 来源:num_per=数智人,ty=听译助手,h5=h5网页问诊 - * doctor 所属医生 所属医生 必须 - * report_content 报告内容 - * name 病人姓名 - * phone 患者手机 - * - * 所有字段说明(可能有部分额外字段未在此体现): - * id ID - * date 日期 - * userbaseid 基本信息ID - * from 来源:num_per=数智人,ty=听译助手,h5=h5网页问诊 - * doctor 所属医生 - * username 病人 - * report_content 报告内容 - * name 病人姓名 - * phone 患者手机 - * gender 病人性别 - * ticket 对话票据(数据隔离) - * create_time 生成时间 - - * author:wh - * api/hdrmedicalreport/getHdrmedicalreportList - */ -``` - *** ``` /** @@ -248,14 +217,21 @@ *** ``` /** - * desc:根据所属医生账号、病患姓名和病患电话查询病历 + * desc:获取统一问诊用户基本信息列表(后台病历管理列表) * - * api/Hdruserbaseinfo/getHdruserbaseinfoDetail + * api/Hdruserbaseinfo/getHdruserbaseinfoList * * 参数: - * doctor 所属医生 所属医生 必须 - * name 病人姓名 病人姓名 必须 - * phone 联系方式 联系方式 必须 + * 带分页 + * current_page 当前页码 + * list_rows 每页显示条数 默认15 + * doctor 所属医生 + * id ID + * date 日期 + * doctor 所属医生 + * hdrdepartment_id 科室 + * from 来源:num_per=数智人,ty=听译助手,h5=h5网页问诊 + * name 病人姓名 * * 所有字段说明(可能有部分额外字段未在此体现): * id ID @@ -284,7 +260,48 @@ * is_flow 是否接受随访:yes=是,no=否 * author:wh - * api/hdruserbaseinfo/getHdruserbaseinfoDetail + * api/hdruserbaseinfo/getHdruserbaseinfoList + */ +``` + +*** +``` + /** + * desc:获取统一问诊用户基本信息详情(后台病历管理详情) + * + * api/Hdruserbaseinfo/getHdruserbaseinfoDetailById + * + * 参数: + * id ID ID 必须 + * + * 所有字段说明(可能有部分额外字段未在此体现): + * 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 + * api/hdruserbaseinfo/getHdruserbaseinfoDetailById */ ``` @@ -531,43 +548,6 @@ */ ``` -*** -``` - /** - * desc:获取听译问诊-患者病历信息 - * - * api/Tyusermedicalrecord/getTyusermedicalrecordDetail - * - * 参数: - * username 所属医生 所属医生 必须 - * name 病人姓名 病人姓名 必须 - * phone 联系方式 联系方式 必须 - * - * 所有字段说明(可能有部分额外字段未在此体现): - * id ID - * username 所属医生 - * name 病人姓名 - * gender 病人性别 - * age 病人年龄 - * main_complaint 主诉 - * medical_history 病史 - * past_history 既往史 - * allergy_history 过敏史 - * family_history 家族史 - * personal_history 个人史 - * menstrual_marital_history 月经婚育史 - * diagnosis 诊断 - * treatment 医嘱 - * phone 联系方式 - * status 问诊状态 - * create_time 创建时间 - * ticket 对话票据 - - * author:wh - * api/tyusermedicalrecord/getTyusermedicalrecordDetail - */ -``` - *** ``` /**