|
@ -1,8 +1,10 @@
|
|
|
package com.yihu.jw.hospital.module.rehabilitation.controller;
|
|
|
|
|
|
|
|
|
import com.yihu.jw.entity.rehabilitation.RehabilitationguidancePatientDO;
|
|
|
import com.yihu.jw.entity.specialist.rehabilitation.PatientRehabilitationPlanDO;
|
|
|
import com.yihu.jw.entity.specialist.rehabilitation.RehabilitationOperateRecordsDO;
|
|
|
import com.yihu.jw.hospital.module.rehabilitation.service.RehabilitationGuidanceService;
|
|
|
import com.yihu.jw.hospital.module.rehabilitation.service.RehabilitationManageService;
|
|
|
import com.yihu.jw.hospital.module.rehabilitation.service.SynchronizePatientService;
|
|
|
import com.yihu.jw.restmodel.web.Envelop;
|
|
@ -20,7 +22,9 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
@ -36,6 +40,8 @@ public class RehabilitationManageController extends EnvelopRestEndpoint {
|
|
|
private RehabilitationManageService rehabilitationManageService;
|
|
|
@Autowired
|
|
|
private SynchronizePatientService synchronizePatientService;
|
|
|
@Autowired
|
|
|
private RehabilitationGuidanceService rehabilitationGuidanceService;
|
|
|
|
|
|
@PostMapping(value = "completePlan")
|
|
|
@ApiOperation("确认完成服务,填写服务笔记")
|
|
@ -106,6 +112,21 @@ public class RehabilitationManageController extends EnvelopRestEndpoint {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@GetMapping(value = "findLastGuidanceMessage")
|
|
|
@ApiOperation("查询最新一条指导留言")
|
|
|
public Envelop findLastGuidanceMessage(
|
|
|
@ApiParam(name = "planId", value = "康复计划id", required = true)
|
|
|
@RequestParam(value = "planId", required = true) String planId) {
|
|
|
try {
|
|
|
return ObjEnvelop.getSuccess("查询成功",rehabilitationManageService.findLastGuidanceMessage(planId));
|
|
|
}catch (ServiceException se){
|
|
|
return Envelop.getError(se.getMessage());
|
|
|
}catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return Envelop.getError("查询失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@PostMapping(value = "assignExecutor")
|
|
|
@ApiOperation("计划负责人分配执行人")
|
|
|
public Envelop assignExecutor(
|
|
@ -250,6 +271,133 @@ public class RehabilitationManageController extends EnvelopRestEndpoint {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "findGuidanceByType", method = RequestMethod.GET)
|
|
|
@ApiOperation("康复管理-查看指导模板")
|
|
|
public Envelop findGuidanceByType(@ApiParam(name = "type", value = "康复指导类型", required = true)
|
|
|
@RequestParam(value = "type", required = true) String type) {
|
|
|
|
|
|
try {
|
|
|
return ObjEnvelop.getSuccess("查询成功",rehabilitationGuidanceService.findByType(type));
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return Envelop.getError("查询失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "saveGuidandceTemplate", method = RequestMethod.POST)
|
|
|
@ApiOperation("康复管理-保存指导模板")
|
|
|
public Envelop saveGuidandceTemplate(@ApiParam(name = "type", value = "康复指导类型", required = true)
|
|
|
@RequestParam(value = "type", required = true) String type,
|
|
|
@ApiParam(name = "content", value = "模板内容", required = true)
|
|
|
@RequestParam(value = "content", required = true) String content,
|
|
|
@ApiParam(name = "typeName", value = "类型名称", required = true)
|
|
|
@RequestParam(value = "typeName", required = true) String typeName) {
|
|
|
try {
|
|
|
rehabilitationGuidanceService.saveGuidandceTemplate(content,type,typeName,getUID());
|
|
|
return Envelop.getSuccess("保存成功");
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return Envelop.getError("保存失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "selectGuidances", method = RequestMethod.GET)
|
|
|
@ApiOperation("康复管理-查看指导列表")
|
|
|
public Envelop selectType(@ApiParam(name = "type", value = "康复指导类型", required = false)
|
|
|
@RequestParam(value = "type", required = false) Integer type,
|
|
|
@ApiParam(name = "id", value = "康复指导模板id", required = false)
|
|
|
@RequestParam(value = "id", required = false) String id,
|
|
|
@ApiParam(name = "title", value = "康复指导名称", required = false)
|
|
|
@RequestParam(value = "title", required = false) String title,
|
|
|
@ApiParam(name = "planId", value = "计划id", required = false)
|
|
|
@RequestParam(value = "planId", required = false) String planId,
|
|
|
@ApiParam(name = "page", value = "页码", required = false)
|
|
|
@RequestParam(value = "page", required = false, defaultValue ="1") Integer page,
|
|
|
@ApiParam(name = "pagesize", value = "每页大小", required = false)
|
|
|
@RequestParam(value = "pagesize", required = false,defaultValue = "15") Integer pagesize) {
|
|
|
|
|
|
try {
|
|
|
return rehabilitationGuidanceService.select(title,type,id,planId,page,pagesize);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return Envelop.getError("查询失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "selectPatientGuidances", method = RequestMethod.GET)
|
|
|
@ApiOperation("康复管理-查看指导列表")
|
|
|
public Envelop selectPatientGuidances(@ApiParam(name = "patient", value = "居民code", required = false)
|
|
|
@RequestParam(value = "patient", required = false) String patient,
|
|
|
@ApiParam(name = "code", value = "康复指导模板code", required = false)
|
|
|
@RequestParam(value = "code", required = false) String code,
|
|
|
@ApiParam(name = "doctor", value = "医生code", required = false)
|
|
|
@RequestParam(value = "doctor", required = false) String doctor,
|
|
|
@ApiParam(name = "page", value = "页码", required = false)
|
|
|
@RequestParam(value = "page", required = false) Integer page,
|
|
|
@ApiParam(name = "pagesize", value = "每页大小", required = false)
|
|
|
@RequestParam(value = "pagesize", required = false) Integer pagesize) {
|
|
|
|
|
|
try {
|
|
|
return rehabilitationGuidanceService.selectPatientGuidances(patient,doctor,code,page,pagesize);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return Envelop.getError("查询失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "selectType", method = RequestMethod.GET)
|
|
|
@ApiOperation("康复管理-查看指导列表标题")
|
|
|
public Envelop selectType(@ApiParam(name="planId",value = "根据计划id取该计划对应疾病的指导",required = false)
|
|
|
@RequestParam(value = "planId",required = false)String planId) {
|
|
|
try {
|
|
|
return ListEnvelop.getSuccess("查询成功",rehabilitationGuidanceService.selectType(planId));
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return Envelop.getError("查询失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "selectByRelationCode", method = RequestMethod.GET)
|
|
|
@ApiOperation("康复管理-根据业务code查找康复指导")
|
|
|
public Envelop selectByRelationCode(@ApiParam(name = "relationCode", value = "业务关联code", required = false)
|
|
|
@RequestParam(value = "relationCode", required = false) String relationCode,
|
|
|
@ApiParam(name = "patient", value = "居民code", required = false)
|
|
|
@RequestParam(value = "patient", required = false) String patient,
|
|
|
@ApiParam(name = "doctor", value = "医生code", required = false)
|
|
|
@RequestParam(value = "doctor", required = false) String doctor) {
|
|
|
|
|
|
try {
|
|
|
return ListEnvelop.getSuccess("查询成功",rehabilitationGuidanceService.selectByRelationCode(patient,doctor,relationCode));
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return Envelop.getError("查询失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "sendGuidance", method = RequestMethod.POST)
|
|
|
@ApiOperation("康复管理-发送康复指导")
|
|
|
public Envelop selectType(@ApiParam(name = "json", value = "康复指导json", required = true)
|
|
|
@RequestParam(value = "json", required = true) String json,
|
|
|
@ApiParam(name = "planId", value = "计划ID", required = true)
|
|
|
@RequestParam(value = "planId", required = true) String planId) {
|
|
|
|
|
|
try {
|
|
|
com.alibaba.fastjson.JSONArray array = com.alibaba.fastjson.JSONArray.parseArray(json);
|
|
|
List<RehabilitationguidancePatientDO> rehabilitationguidancePatientDOS = new ArrayList<>();
|
|
|
for (int i=0;i<array.size();i++){
|
|
|
com.alibaba.fastjson.JSONObject object = array.getJSONObject(i);
|
|
|
RehabilitationguidancePatientDO rehabilitationguidancePatientDO = objectMapper.readValue(object.toJSONString(),RehabilitationguidancePatientDO.class);
|
|
|
rehabilitationguidancePatientDOS.add(rehabilitationguidancePatientDO);
|
|
|
}
|
|
|
|
|
|
return ListEnvelop.getSuccess("发送成功",rehabilitationGuidanceService.sendGuidanceToPatient(rehabilitationguidancePatientDOS,planId));
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return Envelop.getError("发送失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@PostMapping(value = "appointmentConsultation")
|
|
|
@ApiOperation(value = "康复管理-预约协诊")
|
|
|
public ObjEnvelop appointmentConsultation(
|