|
@ -0,0 +1,725 @@
|
|
|
package com.yihu.jw.hospital.module.followup.controller;
|
|
|
|
|
|
import com.yihu.jw.entity.followup.Followup;
|
|
|
import com.yihu.jw.hospital.module.common.BaseController;
|
|
|
import com.yihu.jw.hospital.module.followup.service.FollowUpService;
|
|
|
import com.yihu.jw.hospital.module.followup.service.FollowupDrugsService;
|
|
|
import com.yihu.jw.util.entity.ServiceException;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.json.JSONArray;
|
|
|
import org.json.JSONObject;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* 医生端:随访接口
|
|
|
*
|
|
|
* @author hzp add 2016-12-07
|
|
|
*/
|
|
|
@RestController
|
|
|
@RequestMapping(value = "/doctor/followup")
|
|
|
@Api(description = "医生端-随访接口")
|
|
|
public class DoctorFollowUpController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
|
private FollowUpService followUpService;
|
|
|
@Autowired
|
|
|
private FollowupDrugsService followupDrugsService;
|
|
|
@Autowired
|
|
|
private JdbcTemplate jdbcTemplate;
|
|
|
|
|
|
/*************************************** 随访计划 ****************************************************************************/
|
|
|
@ApiOperation("获取随访列表")
|
|
|
@RequestMapping(value = "/list", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
|
|
|
public String getList(@ApiParam(name = "startTime", value = "开始时间", defaultValue = "2016-12-07 00:00:00")
|
|
|
@RequestParam(value = "startTime", required = true) String startTime,
|
|
|
@ApiParam(name = "endTime", value = "结束时间", defaultValue = "2016-12-14 00:00:00")
|
|
|
@RequestParam(value = "endTime", required = true) String endTime) {
|
|
|
try {
|
|
|
List<Map<String, Object>> result = followUpService.getListByDoctor(getUID(), startTime, endTime); //"64de9952-5b15-11e6-8344-fa163e8aee56"
|
|
|
|
|
|
return write(200, "获取随访列表成功!", "data", result);
|
|
|
} catch (ServiceException se) {
|
|
|
return write(-1,se.getMessage());
|
|
|
} catch (Exception e) {
|
|
|
return invalidUserException(e, -1, "获取随访列表失败!" + e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 查询居民随访列表
|
|
|
*
|
|
|
* @param patient
|
|
|
* @param teamCode
|
|
|
* @param page
|
|
|
* @param pagesize
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/list_by_team", method = {RequestMethod.GET,RequestMethod.POST})
|
|
|
@ApiOperation(value = "查询居民随访列表")
|
|
|
public String getListByPatientAndTeam(@RequestParam @ApiParam(value = "居民Code") String patient,
|
|
|
@RequestParam @ApiParam(value = "医生Code") String doctor,
|
|
|
@RequestParam @ApiParam(value = "团队code") Long teamCode,
|
|
|
@RequestParam @ApiParam(value = "第几页") int page,
|
|
|
@RequestParam @ApiParam(value = "页大小") int pagesize,
|
|
|
@RequestParam(value = "type",required = false) @ApiParam(value = "类型:放空为全部,1计划,2记录",defaultValue = "0") String type) {
|
|
|
try {
|
|
|
if (StringUtils.isEmpty(patient)) {
|
|
|
return error(-1, "请输入需查询的居民");
|
|
|
}
|
|
|
if (teamCode == null || teamCode < 1) {
|
|
|
return error(-1, "请输入需查询的居民的团队");
|
|
|
}
|
|
|
|
|
|
page = page > 0 ? page - 1 : 0;
|
|
|
JSONArray result = followUpService.getListByPatientAndTeam(patient,doctor, teamCode, page, pagesize,type);
|
|
|
return write(200, "查询成功", "data", result);
|
|
|
} catch (Exception e) {
|
|
|
return errorResult(e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 查询居民随访列表
|
|
|
*
|
|
|
* @param patient
|
|
|
* @param page
|
|
|
* @param pagesize
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/list_by", method = {RequestMethod.GET,RequestMethod.POST})
|
|
|
@ApiOperation(value = "查询居民随访列表")
|
|
|
public String getListByPatient(@RequestParam @ApiParam(value = "居民Code") String patient,
|
|
|
@RequestParam @ApiParam(value = "第几页") int page,
|
|
|
@RequestParam @ApiParam(value = "页大小") int pagesize,
|
|
|
@RequestParam(value = "type",required = false) @ApiParam(value = "类型:放空为全部,1计划,2记录",defaultValue = "0") String type) {
|
|
|
try {
|
|
|
if (StringUtils.isEmpty(patient)) {
|
|
|
return error(-1, "请输入需查询的居民");
|
|
|
}
|
|
|
page = page > 0 ? page - 1 : 0;
|
|
|
JSONArray result = followUpService.getListByPatient(patient, page, pagesize,type);
|
|
|
return write(200, "查询成功", "data", result);
|
|
|
} catch (Exception e) {
|
|
|
return errorResult(e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("获取随访列表(创建者)")
|
|
|
@RequestMapping(value = "/createrList", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
|
|
|
public String getCreaterList(@ApiParam(name = "startTime", value = "开始时间", defaultValue = "2016-12-07 00:00:00")
|
|
|
@RequestParam(value = "startTime", required = true) String startTime,
|
|
|
@ApiParam(name = "endTime", value = "结束时间", defaultValue = "2016-12-14 00:00:00")
|
|
|
@RequestParam(value = "endTime", required = true) String endTime,
|
|
|
@ApiParam(name = "page", value = "第几页", defaultValue = "1")
|
|
|
@RequestParam(value = "page", required = true) String page,
|
|
|
@ApiParam(name = "pageSize", value = "每页几行", defaultValue = "10")
|
|
|
@RequestParam(value = "pageSize", required = true) String pageSize) {
|
|
|
try {
|
|
|
List<Map<String, String>> result = followUpService.getListByCreater(getUID(), startTime, endTime, page, pageSize); //"64de9952-5b15-11e6-8344-fa163e8aee56"
|
|
|
|
|
|
return write(200, "获取随访列表成功!", "data", result);
|
|
|
} catch (ServiceException se) {
|
|
|
return write(-1,se.getMessage());
|
|
|
} catch (Exception e) {
|
|
|
return invalidUserException(e, -1, "获取随访列表失败!" + e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@ApiOperation("新增随访计划(批量)")
|
|
|
@RequestMapping(value = "/addFollowupPlan", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
|
|
|
public String addFollowupPlan(@ApiParam(name = "patient", value = "患者代码", defaultValue = "443a196ef8744536a531260eb26c05d7")
|
|
|
@RequestParam(value = "patient", required = true) String patient,
|
|
|
@ApiParam(name = "data", value = "随访计划列表json", defaultValue = "[{\"date\":\"2016-12-16 20:00:00\",\"type\":\"10\",\"doctor\":\"64de9952-5b15-11e6-8344-fa163e8aee56\"},{\"date\":\"2016-12-17 15:00:00\",\"type\":\"3\",\"doctor\":\"64de9952-5b15-11e6-8344-fa163e8aee56\"}]")
|
|
|
@RequestParam(value = "data", required = true) String data) {
|
|
|
try {
|
|
|
Iterable<Followup> followups = followUpService.addFollowupPlan(getUID(), patient, data);
|
|
|
|
|
|
return write(200, "新增随访计划成功!","data",followups);
|
|
|
} catch (ServiceException se) {
|
|
|
return write(-1,se.getMessage());
|
|
|
} catch (Exception e) {
|
|
|
return invalidUserException(e, -1, "新增随访计划失败!" + e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@ApiOperation("编辑随访计划")
|
|
|
@RequestMapping(value = "/editFollowupPlan", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
|
|
|
public String editFollowupPlan(@ApiParam(name = "id", value = "随访记录ID", defaultValue = "")
|
|
|
@RequestParam(value = "id", required = true) String id,
|
|
|
@ApiParam(name = "planDate", value = "随访计划时间", defaultValue = "2016-12-14 20:00:00")
|
|
|
@RequestParam(value = "planDate", required = true) String planDate,
|
|
|
@ApiParam(name = "followupType", value = "随访方式【字典FOLLOWUP_WAY_DICT】", defaultValue = "12")
|
|
|
@RequestParam(value = "followupType", required = true) String followupType) {
|
|
|
try {
|
|
|
followUpService.editFollowupPlan(getUID(), id, planDate, followupType);
|
|
|
|
|
|
return write(200, "编辑随访计划成功!");
|
|
|
} catch (ServiceException se) {
|
|
|
return write(-1,se.getMessage());
|
|
|
} catch (Exception e) {
|
|
|
return invalidUserException(e, -1, "编辑随访计划失败!" + e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@ApiOperation("开始随访记录")
|
|
|
@RequestMapping(value = "/startFollowup", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
|
|
|
public String startFollowup(@ApiParam(name = "id", value = "随访记录ID", defaultValue = "")
|
|
|
@RequestParam(value = "id", required = true) String id,
|
|
|
@ApiParam(name = "followupNo", value = "随访记录编码")
|
|
|
@RequestParam(value = "followupNo", required = false) String followupNo,
|
|
|
@ApiParam(name = "date", value = "随访时间", defaultValue = "2016-12-14 20:00:00")
|
|
|
@RequestParam(value = "date", required = true) String date,
|
|
|
@ApiParam(name = "followupType", value = "随访方式【字典FOLLOWUP_WAY_DICT】", defaultValue = "12")
|
|
|
@RequestParam(value = "followupType", required = true) String followupType,
|
|
|
@ApiParam(name = "followupClass", value = "随访类别【1.高血压 2.糖尿病,3高糖】", defaultValue = "1")
|
|
|
@RequestParam(value = "followupClass", required = true) String followupClass,
|
|
|
@ApiParam(name = "followupManagerStatus", value = "随访管理状态【字典FOLLOWUP_MANAGER_STATUS】", defaultValue = "1")
|
|
|
@RequestParam(value = "followupManagerStatus", required = false) String followupManagerStatus,
|
|
|
@ApiParam(name = "plandate", value = "下次随访时间", defaultValue = "2016-12-14 20:00:00")
|
|
|
@RequestParam(value = "plandate", required = false) String plandate,
|
|
|
@ApiParam(name = "prescriptioncode", value = "续方CODE", defaultValue = "")
|
|
|
@RequestParam(value = "prescriptioncode", required = false) String prescriptioncode) {
|
|
|
try {
|
|
|
Followup followup = followUpService.startFollowup( id, followupNo, date, followupType, followupClass, followupManagerStatus,plandate,prescriptioncode);
|
|
|
followUpService.getNotStartFollowup(getUID(), followup.getFollowupPlanDate());
|
|
|
return write(200, "开始随访记录成功!");
|
|
|
} catch (ServiceException se) {
|
|
|
return write(-1,se.getMessage());
|
|
|
} catch (Exception e) {
|
|
|
return invalidUserException(e, -1, "开始随访记录失败!" + e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@ApiOperation("新增临时随访记录(返回ID)")
|
|
|
@RequestMapping(value = "/addFollowup", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
|
|
|
public String addFollowup(@ApiParam(name = "patient", value = "患者代码", defaultValue = "443a196ef8744536a531260eb26c05d7")
|
|
|
@RequestParam(value = "patient", required = true) String patient,
|
|
|
@ApiParam(name = "date", value = "下次随访时间", defaultValue = "2016-12-15 20:00:00")
|
|
|
@RequestParam(value = "date", required = true) String date,
|
|
|
@ApiParam(name = "followupType", value = "随访方式【字典FOLLOWUP_WAY_DICT】", defaultValue = "12")
|
|
|
@RequestParam(value = "followupType", required = true) String followupType,
|
|
|
@ApiParam(name = "followupClass", value = "随访类别【1.高血压 2.糖尿病 3高糖】", defaultValue = "1")
|
|
|
@RequestParam(value = "followupClass", required = true) String followupClass,
|
|
|
@ApiParam(name = "followupManagerStatus", value = "随访管理状态【字典FOLLOWUP_MANAGER_STATUS】", defaultValue = "1")
|
|
|
@RequestParam(value = "followupManagerStatus", required = false) String followupManagerStatus,
|
|
|
@ApiParam(name = "plandate", value = "下次随访时间", defaultValue = "2016-12-14 20:00:00")
|
|
|
@RequestParam(value = "plandate", required = false) String plandate,
|
|
|
@ApiParam(name = "prescriptioncode", value = "续方CODE", defaultValue = "续方CODE")
|
|
|
@RequestParam(value = "prescriptioncode", required = false) String prescriptioncode,
|
|
|
@ApiParam(name = "type", value = "随访类型", defaultValue = "0")
|
|
|
@RequestParam(value = "type", required = false) Integer type) {
|
|
|
try {
|
|
|
String response = followUpService.addFollowup(getUID(), patient, date, followupType, followupClass, followupManagerStatus,plandate,prescriptioncode,type);
|
|
|
|
|
|
return write(200, "新增临时随访记录成功!", "data", response);
|
|
|
} catch (ServiceException se) {
|
|
|
return write(-1,se.getMessage());
|
|
|
} catch (Exception e) {
|
|
|
return invalidUserException(e, -1, "新增临时随访记录失败!" + e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@ApiOperation("取消随访计划")
|
|
|
@RequestMapping(value = "/cancelFollowupPlan", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
|
|
|
public String cancelFollowupPlan(@ApiParam(name = "id", value = "随访记录ID", defaultValue = "")
|
|
|
@RequestParam(value = "id", required = true) String id) {
|
|
|
try {
|
|
|
followUpService.cancelFollowupPlan(id);
|
|
|
|
|
|
return write(200, "取消随访计划成功!");
|
|
|
} catch (ServiceException se) {
|
|
|
return write(-1,se.getMessage());
|
|
|
} catch (Exception e) {
|
|
|
return invalidUserException(e, -1, "取消随访计划失败!" + e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@ApiOperation("完成随访记录")
|
|
|
@RequestMapping(value = "/finishFollowup", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
|
|
|
public String finishFollowup(@ApiParam(name = "id", value = "随访记录ID", defaultValue = "")
|
|
|
@RequestParam(value = "id", required = true) String id) {
|
|
|
try {
|
|
|
followUpService.finishFollowup(id);
|
|
|
|
|
|
return write(200, "完成随访记录成功!");
|
|
|
} catch (ServiceException se) {
|
|
|
return write(-1,se.getMessage());
|
|
|
} catch (Exception e) {
|
|
|
return invalidUserException(e, -1, "完成随访记录失败!" + e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/*********************************** 随访详情 *******************************************************************/
|
|
|
@ApiOperation("获取随访信息")
|
|
|
@RequestMapping(value = "/getFollowup", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
|
|
|
public String getFollowup(@ApiParam(name = "id", value = "随访记录ID", defaultValue = "4")
|
|
|
@RequestParam(value = "id", required = true) String id) {
|
|
|
try {
|
|
|
Map<String, String> response = followUpService.getFollowup(id);
|
|
|
|
|
|
try {
|
|
|
String sql = "UPDATE `wlyy`.`wlyy_followup` SET `doctor_read_status`='1' WHERE (`id`='"+id+"') ";
|
|
|
jdbcTemplate.update(sql);
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
|
|
|
return write(200, "获取随访信息成功!", "data", response);
|
|
|
} catch (ServiceException se) {
|
|
|
return write(-1,se.getMessage());
|
|
|
} catch (Exception e) {
|
|
|
return invalidUserException(e, -1, "获取随访信息失败!" + e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@ApiOperation("获取随访项目列表")
|
|
|
@RequestMapping(value = "/getFollowupProject", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
|
|
|
public String getFollowupProject(@ApiParam(name = "id", value = "随访记录ID", defaultValue = "4")
|
|
|
@RequestParam(value = "id", required = true) String id) {
|
|
|
try {
|
|
|
List<Map<String, String>> list = followUpService.getFollowupProject(id);
|
|
|
|
|
|
return write(200, "获取随访项目列表成功!", "data", list);
|
|
|
} catch (Exception e) {
|
|
|
return invalidUserException(e, -1, "获取随访项目列表失败!" + e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@ApiOperation("获取随访项目数据")
|
|
|
@RequestMapping(value = "/getFollowupProjectData", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
|
|
|
public String getFollowupProjectData(@ApiParam(name = "id", value = "随访记录ID", defaultValue = "4")
|
|
|
@RequestParam(value = "id", required = true) String id,
|
|
|
@ApiParam(name = "followupProject", value = "随访项目")
|
|
|
@RequestParam(value = "followupProject", required = false) String followupProject) {
|
|
|
try {
|
|
|
Map<String, String> maps = followUpService.getFollowupProjectData(id, followupProject);
|
|
|
return write(200, "获取随访项目数据成功!", "data", maps);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return error(-1, "获取随访项目数据失败!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@ApiOperation("保存随访项目数据")
|
|
|
@RequestMapping(value = "/saveFollowupProjectData", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
|
|
|
public String saveFollowupProjectData(@ApiParam(name = "id", value = "随访记录ID", defaultValue = "4")
|
|
|
@RequestParam(value = "id", required = true) String id,
|
|
|
@ApiParam(name = "followupProject", value = "随访项目", defaultValue = "2")
|
|
|
@RequestParam(value = "followupProject", required = false) String followupProject,
|
|
|
@ApiParam(name = "followupProjectData", value = "随访项目数据", defaultValue = "{\"BLOOD_SUGAR\":\"33.3\",\"BLOOD_SUGAR_TYPE\":\"1\",\"WEIGHT\":\"76\",\"WEIGHT_EXP\":\"60\",\"BMI\":\"11\"}")
|
|
|
@RequestParam(value = "followupProjectData", required = true) String followupProjectData) {
|
|
|
try {
|
|
|
followUpService.saveFollowupProjectData(id, followupProject, followupProjectData);
|
|
|
return write(200, "保存随访项目数据成功!");
|
|
|
} catch (Exception e) {
|
|
|
return invalidUserException(e, -1, "保存随访项目数据失败!" + e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
/*********************************** 电话随访 *****************************************************************/
|
|
|
@ApiOperation("获取电话随访内容")
|
|
|
@RequestMapping(value = "/getFollowupPhone", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
|
|
|
public String getFollowupPhone(@ApiParam(name = "id", value = "随访记录ID", defaultValue = "")
|
|
|
@RequestParam(value = "id", required = true) String id) {
|
|
|
try {
|
|
|
String response = followUpService.getFollowupPhone(id);
|
|
|
|
|
|
return write(200, "获取电话随访内容成功!", "data", response);
|
|
|
} catch (ServiceException se) {
|
|
|
return write(-1,se.getMessage());
|
|
|
} catch (Exception e) {
|
|
|
return invalidUserException(e, -1, "获取电话随访内容失败!" + e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@ApiOperation("记录电话随访内容")
|
|
|
@RequestMapping(value = "/saveFollowupPhone", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
|
|
|
public String saveFollowupPhone(@ApiParam(name = "id", value = "随访记录ID", defaultValue = "")
|
|
|
@RequestParam(value = "id", required = true) String id,
|
|
|
@ApiParam(name = "content", value = "电话随访内容", defaultValue = "")
|
|
|
@RequestParam(value = "content", required = true) String content) {
|
|
|
try {
|
|
|
followUpService.saveFollowupPhone(id, content);
|
|
|
|
|
|
return write(200, "记录电话随访内容成功!");
|
|
|
} catch (ServiceException se) {
|
|
|
return write(-1,se.getMessage());
|
|
|
} catch (Exception e) {
|
|
|
return invalidUserException(e, -1, "记录电话随访内容失败!" + e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/*************************************** 上次随访 ********************************************/
|
|
|
@ApiOperation("获取上次随访")
|
|
|
@RequestMapping(value = "/getLastFollowup", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
|
|
|
public String getLastFollowup(@ApiParam(name = "patient", value = "患者代码", defaultValue = "P20161008001")
|
|
|
@RequestParam(value = "patient", required = true) String patient,
|
|
|
@ApiParam(name = "followClass", value = "随访类别", defaultValue = "1")
|
|
|
@RequestParam(value = "followClass", required = true) String followClass) {
|
|
|
try {
|
|
|
Map<String, String> response = followUpService.getLastFollowup(getUID(), patient, followClass);
|
|
|
|
|
|
return write(200, "获取上次随访成功!", "data", response);
|
|
|
} catch (Exception e) {
|
|
|
return invalidUserException(e, -1, "获取上次随访失败!" + e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// @ApiOperation("复制上次随访数据")
|
|
|
// @RequestMapping(value = "/copyFollowup", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
|
|
|
// public String copyFollowup(@ApiParam(name = "id", value = "本地随访ID", defaultValue = "")
|
|
|
// @RequestParam(value = "id", required = true) Long id,
|
|
|
// @ApiParam(name = "fromId", value = "拷贝随访记录ID", defaultValue = "")
|
|
|
// @RequestParam(value = "fromId", required = true) Long fromId) {
|
|
|
// try {
|
|
|
// followUpService.copyFollowup(id, fromId);
|
|
|
//
|
|
|
// return write(200, "复制上次随访成功!");
|
|
|
// } catch (Exception e) {
|
|
|
// return invalidUserException(e, -1, "复制上次随访失败!" + e.getMessage());
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
/*************************************** 发送随访计划消息 ********************************************/
|
|
|
@ApiOperation("发送随访计划消息")
|
|
|
@RequestMapping(value = "/sendMessage", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
|
|
|
public String sendMessage(@ApiParam(name = "date", value = "日期", defaultValue = "2017-01-05")
|
|
|
@RequestParam(value = "date", required = true) String date) {
|
|
|
try {
|
|
|
followUpService.sendMessage(date);
|
|
|
return write(200, "发送随访计划消息成功!");
|
|
|
} catch (Exception e) {
|
|
|
return invalidUserException(e, -1, "发送随访计划消息失败!" + e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
// @RequestMapping(value = "/checkfollowupcontent", method = RequestMethod.GET)
|
|
|
// @ApiOperation("检查续方关联的随访记录是否对应的详情记录")
|
|
|
// public String getfollowupcontent(
|
|
|
// @ApiParam(name = "followupid", value = "随访ID", defaultValue = "")
|
|
|
// @RequestParam(value = "followupid", required = true) String followupid,
|
|
|
// @ApiParam(name = "type", value = "支持传多个以英文逗号连接,drug为药品,1-9为随访分类", defaultValue = "")
|
|
|
// @RequestParam(value = "type", required = true) String type){
|
|
|
// try {
|
|
|
// int count = followUpService.getfollowupcontent(followupid,type);
|
|
|
// return write(200, "操作成功!","data",count);
|
|
|
// }catch (Exception e){
|
|
|
// //日志文件中记录异常信息
|
|
|
// //返回接口异常信息处理结果
|
|
|
// return errorResult(e);
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
// @RequestMapping(value = "/checkfollowupcompleted", method = RequestMethod.GET)
|
|
|
// @ApiOperation("检查续方关联的随访记录是否对应的详情记录")
|
|
|
// public String checkfollowupcompleted(
|
|
|
// @ApiParam(name = "followupid", value = "随访ID", defaultValue = "")
|
|
|
// @RequestParam(value = "followupid", required = true) String followupid){
|
|
|
// try {
|
|
|
// boolean completed = followUpService.checkfollowupcompleted(followupid);
|
|
|
// return write(200, "操作成功!","data",completed);
|
|
|
// }catch (Exception e){
|
|
|
// //日志文件中记录异常信息
|
|
|
// //返回接口异常信息处理结果
|
|
|
// return errorResult(e);
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
|
|
|
//=======================1.5.7上门访视相关接口====================================
|
|
|
|
|
|
@RequestMapping(value = "/findFollowupByMonth",produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
|
|
|
@ApiOperation("获取访视计划按月日历形式")
|
|
|
public String findFollowupByMonth(@ApiParam(name = "doctor", value = "医生", defaultValue = "zjm20190214")
|
|
|
@RequestParam(value = "doctor", required = true) String doctor,
|
|
|
@ApiParam(name = "patient", value = "居民")
|
|
|
@RequestParam(value = "patient", required = false) String patient,
|
|
|
@ApiParam(name = "followupClass", value = "随访类别,多类别“,”分割")
|
|
|
@RequestParam(value = "followupClass", required = false) String followupClass,
|
|
|
@ApiParam(name = "patientName", value = "居民姓名")
|
|
|
@RequestParam(value = "patientName", required = false) String patientName,
|
|
|
@ApiParam(value = "开始时间,格式(yyyy-MM-dd)", name = "startDate",required = false)
|
|
|
@RequestParam(value = "startDate", required = false) String startDate,
|
|
|
@ApiParam(value = "结束时间,格式(yyyy-MM-dd)", name = "endDate",required = false)
|
|
|
@RequestParam(value = "endDate", required = false) String endDate,
|
|
|
@ApiParam(name = "flag", value = "区分上门访视(1-是)")
|
|
|
@RequestParam(value = "flag", required = false) String flag,
|
|
|
@ApiParam(name = "type", value = "区分随访计划1、新增随访2、临时随访3、入户随访")
|
|
|
@RequestParam(value = "type", required = false) Integer type,
|
|
|
@ApiParam(name = "status", value = "随访状态")
|
|
|
@RequestParam(value = "status", required = false) String status){
|
|
|
try {
|
|
|
return write(200, "操作成功!","data",followUpService.findFollowupByMonth(doctor,patient,followupClass,patientName,startDate,endDate,flag,type,status));
|
|
|
}catch (Exception e){
|
|
|
//日志文件中记录异常信息
|
|
|
//返回接口异常信息处理结果
|
|
|
return errorResult(e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/findFollowupList",produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
|
|
|
@ApiOperation("获取访视列表形式")
|
|
|
public String findFollowupList(@ApiParam(name = "doctor", value = "医生", defaultValue = "zjm20190214")
|
|
|
@RequestParam(value = "doctor", required = true) String doctor,
|
|
|
@ApiParam(name = "patient", value = "居民")
|
|
|
@RequestParam(value = "patient", required = false) String patient,
|
|
|
@ApiParam(name = "followupClass", value = "随访类别,多类别“,”分割")
|
|
|
@RequestParam(value = "followupClass", required = false) String followupClass,
|
|
|
@ApiParam(name = "patientName", value = "居民姓名")
|
|
|
@RequestParam(value = "patientName", required = false) String patientName,
|
|
|
@ApiParam(value = "开始时间,格式(yyyy-MM-dd)", name = "startDate",required = false)
|
|
|
@RequestParam(value = "startDate", required = false) String startDate,
|
|
|
@ApiParam(value = "结束时间,格式(yyyy-MM-dd)", name = "endDate",required = false)
|
|
|
@RequestParam(value = "endDate", required = false) String endDate,
|
|
|
@ApiParam(name = "flag", value = "区分上门访视(1-是)")
|
|
|
@RequestParam(value = "flag", required = false) String flag,
|
|
|
@ApiParam(name = "type", value = "")
|
|
|
@RequestParam(value = "type", required = false) Integer type,
|
|
|
@ApiParam(name = "status", value = "随访状态")
|
|
|
@RequestParam(value = "status", required = false) String status){
|
|
|
try {
|
|
|
return write(200, "操作成功!","data",followUpService.findFollowupList(null,doctor,patient,followupClass,patientName,startDate,endDate,flag,type,status));
|
|
|
}catch (Exception e){
|
|
|
//日志文件中记录异常信息
|
|
|
//返回接口异常信息处理结果
|
|
|
return errorResult(e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/findLabelListWithCount",produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
|
|
|
@ApiOperation("获取随访标签列表带居民数")
|
|
|
public String findLabelListWithCount(){
|
|
|
try {
|
|
|
return write(200, "操作成功!","data",followUpService.findLabelListWithCount());
|
|
|
}catch (Exception e){
|
|
|
//日志文件中记录异常信息
|
|
|
//返回接口异常信息处理结果
|
|
|
return errorResult(e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/findFollowupLabel",produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
|
|
|
@ApiOperation("获取随访标签列表")
|
|
|
public String findFollowupLabel(){
|
|
|
try {
|
|
|
return write(200, "操作成功!","data",followUpService.findFollowupLabel());
|
|
|
}catch (Exception e){
|
|
|
//日志文件中记录异常信息
|
|
|
//返回接口异常信息处理结果
|
|
|
return errorResult(e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/findFollowUpPatient",produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
|
|
|
@ApiOperation("获取可随访居民列表")
|
|
|
public String findFollowUpPatient(@ApiParam(name = "namekey", value = "居民姓名模糊", defaultValue = "")
|
|
|
@RequestParam(value = "namekey", required = false)String namekey,
|
|
|
@ApiParam(name = "labelCode", value = "标签code", defaultValue = "1")
|
|
|
@RequestParam(value = "labelCode", required = false)String labelCode,
|
|
|
@ApiParam(name = "doctor", value = "医生", defaultValue = "zjm20190214")
|
|
|
@RequestParam(value = "doctor", required = true)String doctor,
|
|
|
@ApiParam(name = "page", value = "页数,1开始", defaultValue = "1")
|
|
|
@RequestParam(value = "page", required = true)Integer page,
|
|
|
@ApiParam(name = "size", value = "每页大小", defaultValue = "10")
|
|
|
@RequestParam(value = "size", required = true)Integer size)throws Exception {
|
|
|
try {
|
|
|
return write(200, "操作成功!","data",followUpService.findFollowUpPatient(namekey,doctor,labelCode,page,size));
|
|
|
}catch (Exception e){
|
|
|
//日志文件中记录异常信息
|
|
|
//返回接口异常信息处理结果
|
|
|
return errorResult(e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/findPatientInfo",produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
|
|
|
@ApiOperation("获取居民单条信息")
|
|
|
public String findPatientInfo(@ApiParam(name = "patient", value = "居民code", defaultValue = "")
|
|
|
@RequestParam(value = "patient", required = true)String patient) {
|
|
|
try {
|
|
|
return write(200, "操作成功!","data",followUpService.findPatientInfo(patient));
|
|
|
}catch (Exception e){
|
|
|
//日志文件中记录异常信息
|
|
|
//返回接口异常信息处理结果
|
|
|
return errorResult(e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/findPatientFollowList",produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
|
|
|
@ApiOperation("获取居民随访列表")
|
|
|
public String findPatientFollowList(@ApiParam(name = "patient", value = "居民code", defaultValue = "")
|
|
|
@RequestParam(value = "patient", required = true)String patient,
|
|
|
@ApiParam(name = "doctor", value = "医生code", defaultValue = "")
|
|
|
@RequestParam(value = "doctor", required = true)String doctor){
|
|
|
try {
|
|
|
return write(200, "操作成功!","data",followUpService.findPatientFollowList(patient,doctor));
|
|
|
}catch (Exception e){
|
|
|
//日志文件中记录异常信息
|
|
|
//返回接口异常信息处理结果
|
|
|
return errorResult(e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/saveFollowup",produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
|
|
|
@ApiOperation("保存随访访视")
|
|
|
public String saveFollowup(@ApiParam(name = "jsonFollowup", value = "创建访视json", defaultValue = "")
|
|
|
@RequestParam(value = "jsonFollowup", required = true)String jsonFollowup){
|
|
|
try {
|
|
|
return write(200, "操作成功!","data",followUpService.saveFollowup(jsonFollowup));
|
|
|
} catch (ServiceException se) {
|
|
|
return write(-1,se.getMessage());
|
|
|
} catch (Exception e){
|
|
|
//日志文件中记录异常信息
|
|
|
//返回接口异常信息处理结果
|
|
|
return errorResult(e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/delFollowup",produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
|
|
|
@ApiOperation("删除随访访视")
|
|
|
public String delFollowup(@ApiParam(name = "followupId", value = "随访ID", defaultValue = "")
|
|
|
@RequestParam(value = "followupId", required = true)Long followupId)throws Exception {
|
|
|
try {
|
|
|
Followup followup = followUpService.delFollowup(followupId);
|
|
|
followUpService.getNotStartFollowup(getUID(), followup.getFollowupPlanDate());
|
|
|
return write(200, "操作成功!","data", true);
|
|
|
} catch (ServiceException se) {
|
|
|
return write(-1,se.getMessage());
|
|
|
} catch (Exception e){
|
|
|
//日志文件中记录异常信息
|
|
|
//返回接口异常信息处理结果
|
|
|
return errorResult(e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/findFollowupInfo",produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
|
|
|
@ApiOperation("获取随访详情")
|
|
|
public String findFollowupInfo(@ApiParam(name = "followupId", value = "随访ID", defaultValue = "")
|
|
|
@RequestParam(value = "followupId", required = true)Long followupId) {
|
|
|
try {
|
|
|
return write(200, "操作成功!","data",followUpService.findFollowupInfo(followupId));
|
|
|
}catch (Exception e){
|
|
|
//日志文件中记录异常信息
|
|
|
//返回接口异常信息处理结果
|
|
|
return errorResult(e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/saveFollowupSign",produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
|
|
|
@ApiOperation("签到")
|
|
|
public String saveFollowupSign(@ApiParam(name = "jsonSign", value = "签到", defaultValue = "")
|
|
|
@RequestParam(value = "jsonSign", required = true)String jsonSign)throws Exception {
|
|
|
try {
|
|
|
return write(200, "操作成功!","data",followUpService.saveFollowupSign(jsonSign));
|
|
|
}catch (Exception e){
|
|
|
//日志文件中记录异常信息
|
|
|
//返回接口异常信息处理结果
|
|
|
return errorResult(e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/updateFollowupSign",produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
|
|
|
@ApiOperation("更新签到")
|
|
|
public String updateFollowupSign(@ApiParam(name = "jsonSign", value = "签到", defaultValue = "")
|
|
|
@RequestParam(value = "jsonSign", required = true)String jsonSign)throws Exception {
|
|
|
try {
|
|
|
return write(200, "操作成功!","data",followUpService.updateFollowupSign(jsonSign));
|
|
|
}catch (Exception e){
|
|
|
//日志文件中记录异常信息
|
|
|
//返回接口异常信息处理结果
|
|
|
return errorResult(e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/urlAnalysis",produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
|
|
|
@ApiOperation("门牌解析上门地址")
|
|
|
public String urlAnalysis(@ApiParam(name = "url", value = "地址解析", defaultValue = "")
|
|
|
@RequestParam(value = "url", required = true)String url)throws Exception {
|
|
|
try {
|
|
|
return write(200, "操作成功!","data",followUpService.urlAnalysis(url));
|
|
|
}catch (Exception e){
|
|
|
//日志文件中记录异常信息
|
|
|
//返回接口异常信息处理结果
|
|
|
return errorResult(e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/findByFollowupId",produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
|
|
|
@ApiOperation("签约详情")
|
|
|
public String findByFollowupId(@ApiParam(name = "followupId", value = "签到", defaultValue = "")
|
|
|
@RequestParam(value = "followupId", required = true)Long followupId) {
|
|
|
try {
|
|
|
return write(200, "操作成功!","data",followUpService.findByFollowupId(followupId));
|
|
|
}catch (Exception e){
|
|
|
//日志文件中记录异常信息
|
|
|
//返回接口异常信息处理结果
|
|
|
return errorResult(e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/isFirstTimeFollowup",produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
|
|
|
@ApiOperation("判断居民该类别随访是否为第一次")
|
|
|
public String isFirstTimeFollowup(@ApiParam(name = "patient", value = "居民code", defaultValue = "")
|
|
|
@RequestParam(value = "patient", required = true)String patient,
|
|
|
@ApiParam(name = "followupClass", value = "随访类别", defaultValue = "")
|
|
|
@RequestParam(value = "followupClass", required = true)String followupClass,
|
|
|
@ApiParam(name = "followupId", value = "随访类别", defaultValue = "")
|
|
|
@RequestParam(value = "followupId", required = true)Integer followupId) {
|
|
|
try {
|
|
|
return write(200, "操作成功!","data",followUpService.isFirstTimeFollowup(getUID(),patient,followupClass,followupId));
|
|
|
}catch (Exception e){
|
|
|
//日志文件中记录异常信息
|
|
|
//返回接口异常信息处理结果
|
|
|
return errorResult(e);
|
|
|
}
|
|
|
}
|
|
|
//=======================end ==================================================
|
|
|
|
|
|
@ApiOperation("保存全部随访表单数据")
|
|
|
@RequestMapping(value = "/saveAllFollowupProjectData", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
|
|
|
public String saveAllFollowupProjectData(@ApiParam(name = "id", value = "随访记录ID")
|
|
|
@RequestParam(value = "id", required = true) String id,
|
|
|
@ApiParam(name = "followupNo", value = "随访记录编码")
|
|
|
@RequestParam(value = "followupNo", required = false) String followupNo,
|
|
|
@ApiParam(name = "date", value = "随访时间", defaultValue = "2016-12-14 20:00:00")
|
|
|
@RequestParam(value = "date", required = false) String date,
|
|
|
@ApiParam(name = "followupType", value = "随访方式【字典FOLLOWUP_WAY_DICT】", defaultValue = "12")
|
|
|
@RequestParam(value = "followupType", required = false) String followupType,
|
|
|
@ApiParam(name = "followupClass", value = "随访类别【1.高血压 2.糖尿病,3高糖】", defaultValue = "1")
|
|
|
@RequestParam(value = "followupClass", required = false) String followupClass,
|
|
|
@ApiParam(name = "followupManagerStatus", value = "随访管理状态【字典FOLLOWUP_MANAGER_STATUS】", defaultValue = "1")
|
|
|
@RequestParam(value = "followupManagerStatus", required = false) String followupManagerStatus,
|
|
|
@ApiParam(name = "plandate", value = "下次随访时间", defaultValue = "2016-12-14 20:00:00")
|
|
|
@RequestParam(value = "plandate", required = false) String plandate,
|
|
|
@ApiParam(name = "prescriptioncode", value = "续方CODE")
|
|
|
@RequestParam(value = "prescriptioncode", required = false) String prescriptioncode,
|
|
|
@ApiParam(name = "followupProjectData", value = "随访项目数据", defaultValue = "{\"WEIGHT\":\"76\",\"WEIGHT_EXP\":\"60\",\"BMI\":\"11\"}")
|
|
|
@RequestParam(value = "followupProjectData", required = true) String followupProjectData) {
|
|
|
try {
|
|
|
JSONObject jsonObject = new JSONObject(followupProjectData);
|
|
|
Followup followup = followUpService.startFollowup(id, followupNo, date, followupType, followupClass, followupManagerStatus, plandate, prescriptioncode);
|
|
|
followUpService.finishFollowup(id);
|
|
|
// followUpService.saveAllFollowupProjectData(id, jsonObject.getJSONObject("followupProjectData").toString());
|
|
|
followupDrugsService.saveFollowupDrugs(id,jsonObject.getJSONArray("drugsData").toString());
|
|
|
return write(200, "保存随访项目数据成功!");
|
|
|
} catch (ServiceException se) {
|
|
|
return write(-1,se.getMessage());
|
|
|
} catch (Exception e) {
|
|
|
return invalidUserException(e, -1, "保存随访项目数据失败!" + e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
}
|