|
@ -0,0 +1,224 @@
|
|
|
package com.yihu.wlyy.web.third.rehabilitation;
|
|
|
|
|
|
import com.yihu.wlyy.service.third.rehabilitation.RehabilitationService;
|
|
|
import com.yihu.wlyy.web.BaseController;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.MediaType;
|
|
|
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;
|
|
|
|
|
|
/**
|
|
|
* @author humingfen on 2018/5/4.
|
|
|
*/
|
|
|
@RestController
|
|
|
@RequestMapping(value = "/rehabilitation",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
|
@Api(description = "康复计划")
|
|
|
public class RehabilitationController extends BaseController {
|
|
|
@Autowired
|
|
|
private RehabilitationService rehabilitationService;
|
|
|
|
|
|
@RequestMapping(value = "/getPlanning", method = RequestMethod.GET)
|
|
|
@ApiOperation("查看康复计划")
|
|
|
public String getPlanning(@ApiParam(name = "patientId", value = "居民id", defaultValue = "")
|
|
|
@RequestParam(value = "patientId", required = false) String patientId,
|
|
|
@ApiParam(name = "programId", value = "康复计划id", defaultValue = "")
|
|
|
@RequestParam(value = "programId", required = false) String programId,
|
|
|
@ApiParam(name = "page", value = "第几页", defaultValue = "")
|
|
|
@RequestParam(value = "page", required = false) Integer page,
|
|
|
@ApiParam(name = "size", value = "每页记录数", defaultValue = "")
|
|
|
@RequestParam(value = "size", required = false) Integer size) {
|
|
|
try {
|
|
|
return write(200, "查询成功", "data", rehabilitationService.getPlanning(patientId, programId, page, size));
|
|
|
} catch (Exception e) {
|
|
|
error(e);
|
|
|
return error(-1, e.getMessage());
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/getPlanningById", method = RequestMethod.GET)
|
|
|
@ApiOperation("按id查询")
|
|
|
public String getPlanningById(@ApiParam(name = "id", value = "id", defaultValue = "")
|
|
|
@RequestParam(name = "id", required = true) String id) {
|
|
|
try {
|
|
|
return write(200, "查询成功", "data", rehabilitationService.getPlanningById(id));
|
|
|
} catch (Exception e) {
|
|
|
error(e);
|
|
|
return error(-1, e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/createPlanning", method = RequestMethod.POST)
|
|
|
@ApiOperation("创建康复计划")
|
|
|
public String createPlanning(@ApiParam(name = "jsonData", value = "json", defaultValue = "")
|
|
|
@RequestParam(value = "jsonData", required = true)String jsonData) {
|
|
|
try{
|
|
|
rehabilitationService.createPlanning(jsonData);
|
|
|
return success("创建成功");
|
|
|
} catch (Exception e) {
|
|
|
error(e);
|
|
|
return error(-1, e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/updatePlanning",method = RequestMethod.POST)
|
|
|
@ApiOperation("更新康复计划数据")
|
|
|
public String updatePlanning(@ApiParam(name = "jsonData", value = "json", defaultValue = "")
|
|
|
@RequestParam(value = "jsonData", required = true)String jsonData){
|
|
|
try {
|
|
|
rehabilitationService.updatePlanning(jsonData);
|
|
|
return success("更新成功");
|
|
|
}catch (Exception e){
|
|
|
error(e);
|
|
|
return error(-1,e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/delPlanning",method = RequestMethod.POST)
|
|
|
@ApiOperation("删除康复计划")
|
|
|
public String delPlanning(@ApiParam(name = "id", value = "id", defaultValue = "")
|
|
|
@RequestParam(name = "id", required = true) String id){
|
|
|
try {
|
|
|
rehabilitationService.delPlanning(id);
|
|
|
return success("删除成功");
|
|
|
}catch (Exception e){
|
|
|
error(e);
|
|
|
return error(-1,e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**************************************** 康复计划执行情况 *******************************/
|
|
|
@RequestMapping(value = "/getPerformance", method = RequestMethod.GET)
|
|
|
@ApiOperation("查看康复计划执行情况列表")
|
|
|
public String getPerformance(@ApiParam(name = "patientId", value = "居民id", defaultValue = "")
|
|
|
@RequestParam(value = "patientId", required = false) String patientId,
|
|
|
@ApiParam(name = "page", value = "第几页", defaultValue = "")
|
|
|
@RequestParam(value = "page", required = false) Integer page,
|
|
|
@ApiParam(name = "size", value = "每页记录数", defaultValue = "")
|
|
|
@RequestParam(value = "size", required = false) Integer size){
|
|
|
try {
|
|
|
return write(200, "查询成功", "data", rehabilitationService.getPerformance(patientId, page, size));
|
|
|
} catch (Exception e) {
|
|
|
error(e);
|
|
|
return error(-1, e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/getPerformanceByPatientId", method = RequestMethod.GET)
|
|
|
@ApiOperation("根据居民Id查找康复计划执行情况信息")
|
|
|
public String getPerformanceByPatientId(@ApiParam(name = "patientId", value = "patientId", defaultValue = "")
|
|
|
@RequestParam(name = "patientId", required = true) String patientId) {
|
|
|
try {
|
|
|
return write(200, "查询成功", "data", rehabilitationService.getPerformanceByPatientId(patientId));
|
|
|
} catch (Exception e) {
|
|
|
error(e);
|
|
|
return error(-1, e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/createPerformance", method = RequestMethod.POST)
|
|
|
@ApiOperation("创建康复计划执行情况")
|
|
|
public String createPerformance(@ApiParam(name = "jsonData", value = "json", defaultValue = "")
|
|
|
@RequestParam(value = "jsonData", required = true)String jsonData) {
|
|
|
try{
|
|
|
rehabilitationService.createPerformance(jsonData);
|
|
|
return success("创建成功");
|
|
|
} catch (Exception e) {
|
|
|
error(e);
|
|
|
return error(-1, e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/updatePerformance",method = RequestMethod.POST)
|
|
|
@ApiOperation("更新康复计划执行情况数据")
|
|
|
public String updatePerformance(@ApiParam(name = "jsonData", value = "json", defaultValue = "")
|
|
|
@RequestParam(value = "jsonData", required = true)String jsonData){
|
|
|
try {
|
|
|
rehabilitationService.updatePerformance(jsonData);
|
|
|
return success("更新成功");
|
|
|
}catch (Exception e){
|
|
|
error(e);
|
|
|
return error(-1,e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**************************************** 就诊信息 *************************************/
|
|
|
@RequestMapping(value = "/getInformation", method = RequestMethod.GET)
|
|
|
@ApiOperation("查看就诊信息")
|
|
|
public String getInformation(@ApiParam(name = "hospital", value = "就诊医院名称", defaultValue = "")
|
|
|
@RequestParam(value = "hospital", required = false) String hospital,
|
|
|
@ApiParam(name = "patientId", value = "居民id", defaultValue = "")
|
|
|
@RequestParam(value = "patientId", required = false) String patientId,
|
|
|
@ApiParam(name = "page", value = "第几页", defaultValue = "")
|
|
|
@RequestParam(value = "page", required = false) Integer page,
|
|
|
@ApiParam(name = "size", value = "每页记录数", defaultValue = "")
|
|
|
@RequestParam(value = "size", required = false) Integer size){
|
|
|
try {
|
|
|
return write(200, "查询成功", "data", rehabilitationService.getInformation(hospital, patientId, page, size));
|
|
|
} catch (Exception e) {
|
|
|
error(e);
|
|
|
return error(-1, e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/getInformationByPatientId", method = RequestMethod.GET)
|
|
|
@ApiOperation("根据居民Id查找就诊信息")
|
|
|
public String getInformationByPatientId(@ApiParam(name = "patientId", value = "patientId", defaultValue = "")
|
|
|
@RequestParam(name = "patientId", required = true) String patientId) {
|
|
|
try {
|
|
|
return write(200, "查询成功", "data", rehabilitationService.getInformationByPatientId(patientId));
|
|
|
} catch (Exception e) {
|
|
|
error(e);
|
|
|
return error(-1, e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**************************************** 治疗方案 *************************************/
|
|
|
@RequestMapping(value = "/getTreatmentProgram", method = RequestMethod.GET)
|
|
|
@ApiOperation("治疗方案列表")
|
|
|
public String getTreatmentProgram(@ApiParam(name = "name", value = "方案名称", defaultValue = "")
|
|
|
@RequestParam(value = "name", required = false) String name,
|
|
|
@ApiParam(name = "page", value = "第几页", defaultValue = "")
|
|
|
@RequestParam(value = "page", required = false) Integer page,
|
|
|
@ApiParam(name = "size", value = "每页记录数", defaultValue = "")
|
|
|
@RequestParam(value = "size", required = false) Integer size){
|
|
|
try {
|
|
|
return write(200, "查询成功", "data", rehabilitationService.getTreatmentProgram(name, page, size));
|
|
|
} catch (Exception e) {
|
|
|
error(e);
|
|
|
return error(-1, e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/createTreatmentProgram", method = RequestMethod.POST)
|
|
|
@ApiOperation("创建治疗方案")
|
|
|
public String createTreatmentProgram(@ApiParam(name = "jsonData", value = "json")
|
|
|
@RequestParam(name = "jsonData", required = true)String jsonData){
|
|
|
try {
|
|
|
rehabilitationService.createTreatmentProgram(jsonData);
|
|
|
return success("创建成功");
|
|
|
}catch (Exception e) {
|
|
|
error(e);
|
|
|
return error(-1, e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/updateTreatmentProgram", method = RequestMethod.POST)
|
|
|
@ApiOperation("更新治疗方案")
|
|
|
public String updateTreatmentProgram(@ApiParam(name = "jsonData", value = "json")
|
|
|
@RequestParam(name = "jsonData", required = true)String jsonData){
|
|
|
try{
|
|
|
rehabilitationService.updateTreatmentProgram(jsonData);
|
|
|
return success("更新成功");
|
|
|
}catch (Exception e) {
|
|
|
error(e);
|
|
|
return error(-1, e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|