This commit is contained in:
2024-08-05 14:49:45 +08:00
parent eb8390593d
commit 146d828c0e
9 changed files with 192 additions and 56 deletions

View 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 科室名称
* authorwh
*/
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,'操作异常',[]));
}
}
}

View File

@@ -19,11 +19,12 @@ class Hdrquestionnaireanswer extends BaseHttpApi
* api/Hdrquestionnaireanswer/getHdrquestionnaireanswerList * api/Hdrquestionnaireanswer/getHdrquestionnaireanswerList
* *
* 参数: * 参数:
* answer 问卷答案 * 带分页
* current_page 当前页码
* list_rows 每页显示条数 默认15
* id ID * id ID
* hdrquestionnairequestion_id 问卷问题ID * hdrquestionnairequestion_id 问卷问题ID
* answer 问卷答案 * answer 问卷答案
* create_time 创建时间
* *
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span> * 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>
* id ID * id ID
@@ -42,29 +43,33 @@ class Hdrquestionnaireanswer extends BaseHttpApi
$id = input('id'); $id = input('id');
$hdrquestionnairequestion_id = input('hdrquestionnairequestion_id'); $hdrquestionnairequestion_id = input('hdrquestionnairequestion_id');
$answer = input('answer'); $answer = input('answer');
$create_time = input('create_time');
$model_obj = Db::table(TabConf::$fa_hdrquestionnaireanswer); $model_obj = Db::table(TabConf::$fa_hdrquestionnaireanswer);
if(input('answer')){
$model_obj->whereLike('answer','%'.input('answer').'%');
}
if(input('id')){ if(input('id')){
$model_obj->where('id',input('id')); $model_obj->where('id',input('id'));
} }
if(input('hdrquestionnairequestion_id')){ if(input('hdrquestionnairequestion_id')){
$model_obj->where('hdrquestionnairequestion_id',input('hdrquestionnairequestion_id')); $model_obj->where('hdrquestionnairequestion_id',input('hdrquestionnairequestion_id'));
} }
if(input('create_time')){ if(input('answer')){
$model_obj->where('create_time',input('create_time')); $model_obj->where('answer',input('answer'));
}
$data = $model_obj->select();
if(empty($data)){
return json(Tools::set_ok('ok',$data));
} }
$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列表

View File

@@ -19,19 +19,19 @@ class Hdrquestionnairequestion extends BaseHttpApi
* api/Hdrquestionnairequestion/getHdrquestionnairequestionList * api/Hdrquestionnairequestion/getHdrquestionnairequestionList
* *
* 参数: * 参数:
* question 问卷问题 * 带分页
* current_page 当前页码
* list_rows 每页显示条数 默认15
* id ID * id ID
* hdrdepartment_id 所属科室 * hdrdepartment_id 所属科室
* question 问卷问题 * question 问卷问题
* fit_sex 适合对象:all=全部,gg=男,mm=女
* create_time 创建时间
* update_time 更新时间
* *
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span> * 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>
* id ID * id ID
* hdrdepartment_id 所属科室 * hdrdepartment_id 所属科室
* question 问卷问题 * question 问卷问题
* fit_sex 适合对象:all=全部,gg=男,mm=女 * fit_sex 适合对象:all=全部,gg=男,mm=女
* type 选项类型:one=单选,more=多选
* create_time 创建时间 * create_time 创建时间
* update_time 更新时间 * update_time 更新时间
@@ -45,37 +45,33 @@ class Hdrquestionnairequestion extends BaseHttpApi
$id = input('id'); $id = input('id');
$hdrdepartment_id = input('hdrdepartment_id'); $hdrdepartment_id = input('hdrdepartment_id');
$question = input('question'); $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); $model_obj = Db::table(TabConf::$fa_hdrquestionnairequestion);
if(input('question')){
$model_obj->whereLike('question','%'.input('question').'%');
}
if(input('id')){ if(input('id')){
$model_obj->where('id',input('id')); $model_obj->where('id',input('id'));
} }
if(input('hdrdepartment_id')){ if(input('hdrdepartment_id')){
$model_obj->where('hdrdepartment_id',input('hdrdepartment_id')); $model_obj->where('hdrdepartment_id',input('hdrdepartment_id'));
} }
if(input('fit_sex')){ if(input('question')){
$model_obj->where('fit_sex',input('fit_sex')); $model_obj->where('question',input('question'));
}
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));
} }
$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列表

View File

@@ -28,6 +28,23 @@ class Reporttt
* *
* api/Reporttt/createReport * api/Reporttt/createReport
* *
* name 病人姓名
gender 病人性别
age 病人年龄
edu 教育程度
career_year 职业及年限
power 体力要求
satisfaction 经济满意度
old_career_year 过往职业及年限
support 社会支持度
marriage 婚姻状况
live 居住情况
home 家庭关系
address 地址
phone 联系方式
wechat_no 微信号
ticket 对话票据
hdrdepartment_id 科室
* authorwh * authorwh
*/ */
function createReport(){ function createReport(){
@@ -82,7 +99,8 @@ class Reporttt
'wechat_no'=>input('wechat_no',''),//微信号 'wechat_no'=>input('wechat_no',''),//微信号
'form'=>'num_per', 'form'=>'num_per',
'ticket'=>$ticket,//对话票据' 'ticket'=>$ticket,//对话票据'
'date'=>date('Y-m-d') 'date'=>date('Y-m-d'),
'hdrdepartment_id'=>input('hdrdepartment_id'),//科室
]; ];
$contentstr = input('content'); $contentstr = input('content');

View File

@@ -205,6 +205,8 @@ class Reportty
menstrual_marital_history 月经婚育史 menstrual_marital_history 月经婚育史
diagnosis 诊断 diagnosis 诊断
treatment 医嘱 treatment 医嘱
ticket 对话票据
hdrdepartment_id 科室
*/ */
function editReport(){ function editReport(){
return Mmodel::catchJson(function (){ return Mmodel::catchJson(function (){
@@ -238,7 +240,8 @@ class Reportty
'menstrual_marital_history'=>input('menstrual_marital_history',''),//月经婚育史 'menstrual_marital_history'=>input('menstrual_marital_history',''),//月经婚育史
'diagnosis'=>input('diagnosis',''),//诊断 'diagnosis'=>input('diagnosis',''),//诊断
'treatment'=>input('treatment',''),//医嘱 'treatment'=>input('treatment',''),//医嘱
'ticket'=>$ticket 'ticket'=>$ticket,
'hdrdepartment_id'=>input('hdrdepartment_id'),//科室
]; ];
//听译问诊-患者病历信息 //听译问诊-患者病历信息
$medicalrecord = Db::table('fa_ty_usermedicalrecord') $medicalrecord = Db::table('fa_ty_usermedicalrecord')

View File

@@ -121,7 +121,7 @@ class Userstt extends BaseHttpApi
]) ])
->where('username',$username) ->where('username',$username)
->update(); ->update();
return Tools::set_ok('登录成功',['ticket'=>$ticketstr,'username'=>$username]); return Tools::set_ok('登录成功',['ticket'=>$ticketstr,'username'=>$username,'user'=>$user]);
}); });
} }

View File

@@ -87,7 +87,7 @@ class Usersty extends BaseHttpApi
->update(); ->update();
return Tools::set_ok('登录成功',['ticket'=>$ticketstr]); return Tools::set_ok('登录成功',['ticket'=>$ticketstr,'user'=>$user]);
}); });
} }

View File

@@ -6,7 +6,35 @@
</head> </head>
<body> <body>
<div> <div>
<div id="api_hdrquestionnaireanswer_getHdrquestionnaireanswerList"> <div id="api_hdrdepartment_getHdrdepartmentList">
<div class="markdown_content">
***
```
/**
* desc获取科室
*
* api/Hdrdepartment/getHdrdepartmentList
*
* 参数:
*
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>
* id ID
* name 科室名称
* authorwh
* api/hdrdepartment/getHdrdepartmentList
*/
```
</div>
<div>
按需填写其它接口参数:
<textarea name="" id="api_hdrdepartment_getHdrdepartmentList_textarea" cols="100" rows="3">/api/hdrdepartment/getHdrdepartmentList</textarea>
<a href='JavaScript:;' onclick="DocObject.api_hdrdepartment_getHdrdepartmentList()">测试</a>
</div>
<div class="api_hdrdepartment_getHdrdepartmentList_response_result"></div>
</div><div id="api_hdrquestionnaireanswer_getHdrquestionnaireanswerList">
<div class="markdown_content"> <div class="markdown_content">
*** ***
``` ```
@@ -16,11 +44,12 @@
* api/Hdrquestionnaireanswer/getHdrquestionnaireanswerList * api/Hdrquestionnaireanswer/getHdrquestionnaireanswerList
* *
* 参数: * 参数:
* answer 问卷答案 * 带分页
* current_page 当前页码
* list_rows 每页显示条数 默认15
* id ID * id ID
* hdrquestionnairequestion_id 问卷问题ID * hdrquestionnairequestion_id 问卷问题ID
* answer 问卷答案 * answer 问卷答案
* create_time 创建时间
* *
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span> * 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>
* id ID * id ID
@@ -51,19 +80,19 @@
* api/Hdrquestionnairequestion/getHdrquestionnairequestionList * api/Hdrquestionnairequestion/getHdrquestionnairequestionList
* *
* 参数: * 参数:
* question 问卷问题 * 带分页
* current_page 当前页码
* list_rows 每页显示条数 默认15
* id ID * id ID
* hdrdepartment_id 所属科室 * hdrdepartment_id 所属科室
* question 问卷问题 * question 问卷问题
* fit_sex 适合对象:all=全部,gg=男,mm=女
* create_time 创建时间
* update_time 更新时间
* *
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span> * 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>
* id ID * id ID
* hdrdepartment_id 所属科室 * hdrdepartment_id 所属科室
* question 问卷问题 * question 问卷问题
* fit_sex 适合对象:all=全部,gg=男,mm=女 * fit_sex 适合对象:all=全部,gg=男,mm=女
* type 选项类型:one=单选,more=多选
* create_time 创建时间 * create_time 创建时间
* update_time 更新时间 * update_time 更新时间
@@ -382,7 +411,13 @@
$(ele).html(marked.parse($(ele).html())); $(ele).html(marked.parse($(ele).html()));
}); });
}, },
api_hdrquestionnaireanswer_getHdrquestionnaireanswerList(){ 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"));
$('.api_hdrdepartment_getHdrdepartmentList_response_result').attr('style','color:green');
},'json');
}, api_hdrquestionnaireanswer_getHdrquestionnaireanswerList(){
let url = $('#api_hdrquestionnaireanswer_getHdrquestionnaireanswerList_textarea').val(); let url = $('#api_hdrquestionnaireanswer_getHdrquestionnaireanswerList_textarea').val();
$.post(url,{},function(res) { $.post(url,{},function(res) {
$('.api_hdrquestionnaireanswer_getHdrquestionnaireanswerList_response_result').html(JSON.stringify(res, null, "\t")); $('.api_hdrquestionnaireanswer_getHdrquestionnaireanswerList_response_result').html(JSON.stringify(res, null, "\t"));

View File

@@ -4,6 +4,25 @@
##### 请求域名http://127.0.0.1:8080/ ##### 请求域名http://127.0.0.1:8080/
##### 请求方式POST默认 ##### 请求方式POST默认
***
```
/**
* desc获取科室
*
* api/Hdrdepartment/getHdrdepartmentList
*
* 参数:
*
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>
* id ID
* name 科室名称
* authorwh
* api/hdrdepartment/getHdrdepartmentList
*/
```
*** ***
``` ```
/** /**
@@ -12,11 +31,12 @@
* api/Hdrquestionnaireanswer/getHdrquestionnaireanswerList * api/Hdrquestionnaireanswer/getHdrquestionnaireanswerList
* *
* 参数: * 参数:
* answer 问卷答案 * 带分页
* current_page 当前页码
* list_rows 每页显示条数 默认15
* id ID * id ID
* hdrquestionnairequestion_id 问卷问题ID * hdrquestionnairequestion_id 问卷问题ID
* answer 问卷答案 * answer 问卷答案
* create_time 创建时间
* *
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span> * 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>
* id ID * id ID
@@ -38,19 +58,19 @@
* api/Hdrquestionnairequestion/getHdrquestionnairequestionList * api/Hdrquestionnairequestion/getHdrquestionnairequestionList
* *
* 参数: * 参数:
* question 问卷问题 * 带分页
* current_page 当前页码
* list_rows 每页显示条数 默认15
* id ID * id ID
* hdrdepartment_id 所属科室 * hdrdepartment_id 所属科室
* question 问卷问题 * question 问卷问题
* fit_sex 适合对象:all=全部,gg=男,mm=女
* create_time 创建时间
* update_time 更新时间
* *
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span> * 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>
* id ID * id ID
* hdrdepartment_id 所属科室 * hdrdepartment_id 所属科室
* question 问卷问题 * question 问卷问题
* fit_sex 适合对象:all=全部,gg=男,mm=女 * fit_sex 适合对象:all=全部,gg=男,mm=女
* type 选项类型:one=单选,more=多选
* create_time 创建时间 * create_time 创建时间
* update_time 更新时间 * update_time 更新时间