|
@ -0,0 +1,107 @@
|
|
|
package com.yihu.wlyy.web.patient.scheme;
|
|
|
|
|
|
import com.yihu.wlyy.service.app.label.SignPatientLabelInfoService;
|
|
|
import com.yihu.wlyy.service.app.scheme.DoctorSchemeService;
|
|
|
import com.yihu.wlyy.web.BaseController;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.json.JSONObject;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
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;
|
|
|
|
|
|
/**
|
|
|
* Created by Trick on 2018/1/9.
|
|
|
*/
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping(value = "/patient/scheme")
|
|
|
@Api(description = "患者端-监测方案相关接口")
|
|
|
public class PatientSchemeController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
|
private SignPatientLabelInfoService labelInfoService;
|
|
|
@Autowired
|
|
|
private DoctorSchemeService doctorSchemeService;
|
|
|
|
|
|
@RequestMapping(value = "/patient")
|
|
|
@ApiOperation("查询居民信息")
|
|
|
public String getPatient(String patient) {
|
|
|
try {
|
|
|
if (StringUtils.isEmpty(patient)) {
|
|
|
return error(-1, "居民不能为空");
|
|
|
}
|
|
|
JSONObject p = labelInfoService.getPatient(getUID(),null);
|
|
|
return write(200, "查询成功", "data", p);
|
|
|
} catch (Exception e) {
|
|
|
return error(-1, "查询失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value="getPatientHealthIndex",method = RequestMethod.GET)
|
|
|
@ApiOperation("获取最近一周血糖情况/血压情况")
|
|
|
public String getPatientHealthIndex(@ApiParam(name="startDate", value="开始时间,YYYY-MM-dd") @RequestParam(value = "startDate",required = true)String startDate,
|
|
|
@ApiParam(name="endDate", value="结束时间,YYYY-MM-dd") @RequestParam(value = "endDate",required = true)String endDate,
|
|
|
@ApiParam(name="type", value="0血糖,1.血压") @RequestParam(value = "type",required = true)String type){
|
|
|
try {
|
|
|
return write(200, "查询成功", "data",doctorSchemeService.getPatientHealthIndex(getUID(),startDate, endDate, type));
|
|
|
}catch (Exception e){
|
|
|
error(e);
|
|
|
//返回接口异常信息处理结果
|
|
|
return error(-1, "查询失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value="getTrackPatientInfo",method = RequestMethod.GET)
|
|
|
@ApiOperation("获取:微信运动,身高体重,血糖监测方案,血压监测方案")
|
|
|
public String getTrackPatientInfo(){
|
|
|
try {
|
|
|
return write(200, "查询成功", "data",doctorSchemeService.getTrackPatientInfo(getUID()));
|
|
|
}catch (Exception e){
|
|
|
error(e);
|
|
|
//返回接口异常信息处理结果
|
|
|
return error(-1, "查询失败");
|
|
|
}
|
|
|
}
|
|
|
@RequestMapping(value="getControlObjectives",method = RequestMethod.GET)
|
|
|
@ApiOperation("获取控制目标,血压,血糖")
|
|
|
public String getControlObjectives(){
|
|
|
try {
|
|
|
return write(200, "查询成功", "data",doctorSchemeService.getControlObjectives(getUID()));
|
|
|
}catch (Exception e){
|
|
|
error(e);
|
|
|
//返回接口异常信息处理结果
|
|
|
return error(-1, "查询失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value="getBodyInfo",method = RequestMethod.GET)
|
|
|
@ApiOperation("获取身高体重详情列表")
|
|
|
public String getBodyInfo(@ApiParam(name="startDate", value="开始时间,YYYY-MM-dd") @RequestParam(value = "startDate",required = true)String startDate,
|
|
|
@ApiParam(name="endDate", value="结束时间,YYYY—MM-dd") @RequestParam(value = "endDate",required = true)String endDate,
|
|
|
@ApiParam(name="page", value="起始页") @RequestParam(value = "page",required = true)Integer page,
|
|
|
@ApiParam(name="size", value="每页大小") @RequestParam(value = "size",required = true)Integer size){
|
|
|
try {
|
|
|
return write(200, "查询成功", "data",doctorSchemeService.getBodyInfo(getUID(),startDate,endDate,page,size));
|
|
|
}catch (Exception e){
|
|
|
error(e);
|
|
|
//返回接口异常信息处理结果
|
|
|
return error(-1, "查询失败");
|
|
|
}
|
|
|
}
|
|
|
@RequestMapping(value="getPatientScheme",method = RequestMethod.GET)
|
|
|
@ApiOperation("获取患者监控计划")
|
|
|
public String getPatientScheme(@ApiParam(name="type", value="1血糖,2血压") @RequestParam(value = "type",required = true)String type){
|
|
|
try {
|
|
|
return write(200, "查询成功", "data",doctorSchemeService.getPatientScheme(getUID(),type));
|
|
|
}catch (Exception e){
|
|
|
error(e);
|
|
|
//返回接口异常信息处理结果
|
|
|
return error(-1, "查询失败");
|
|
|
}
|
|
|
}
|
|
|
}
|