|
@ -1,12 +1,10 @@
|
|
|
package com.yihu.wlyy.web.third.specialist;
|
|
|
package com.yihu.wlyy.web.doctor.specialist.rehabilitation;
|
|
|
|
|
|
import com.yihu.wlyy.entity.doctor.profile.Doctor;
|
|
|
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
|
|
|
import com.yihu.wlyy.entity.patient.SignFamily;
|
|
|
import com.yihu.wlyy.service.app.family.FamilyService;
|
|
|
import com.yihu.wlyy.service.app.team.AdminTeamService;
|
|
|
import com.yihu.wlyy.service.common.account.DoctorService;
|
|
|
import com.yihu.wlyy.service.specialist.RehabilitationPlanService;
|
|
|
import com.yihu.wlyy.service.specialist.rehabilitation.RehabilitationPlanService;
|
|
|
import com.yihu.wlyy.web.BaseController;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
@ -23,9 +21,9 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
* Created by humingfen on 2018/8/22.
|
|
|
*/
|
|
|
@RestController
|
|
|
@RequestMapping(value = "/third/rehabilitaionPlan",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
|
@Api(description = "康复服务套餐管理")
|
|
|
public class ThirdRehabilitationPlanController extends BaseController {
|
|
|
@RequestMapping(value = "/doctor/specialist/rehabilitationPlan",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
|
@Api(description = "医生端-康复服务套餐管理")
|
|
|
public class DoctorRehabilitationPlanController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
|
private RehabilitationPlanService rehabilitationPlanService;
|
|
@ -33,17 +31,17 @@ public class ThirdRehabilitationPlanController extends BaseController {
|
|
|
private AdminTeamService teamService;
|
|
|
@Autowired
|
|
|
private DoctorService doctorService;
|
|
|
@Autowired
|
|
|
private FamilyService familyService;
|
|
|
|
|
|
@RequestMapping(value = "/findTemplateList", method = RequestMethod.GET)
|
|
|
@ApiOperation(value = "获取康复服务套餐模板列表")
|
|
|
public String templateList(@ApiParam(name = "doctor", value = "医生标识")
|
|
|
@RequestParam(required = true)String doctor,
|
|
|
@RequestParam(required = false)String doctor,
|
|
|
@ApiParam(name = "patient", value = "居民标识")
|
|
|
@RequestParam(required = false)String patient){
|
|
|
@RequestParam(required = false)String patient){
|
|
|
try {
|
|
|
|
|
|
if(!StringUtils.isNotBlank(doctor)){
|
|
|
doctor = getUID();
|
|
|
}
|
|
|
return write(200, "获取成功", "data", rehabilitationPlanService.findTemplateInfo(doctor, patient));
|
|
|
} catch (Exception e) {
|
|
|
error(e);
|
|
@ -54,7 +52,7 @@ public class ThirdRehabilitationPlanController extends BaseController {
|
|
|
@RequestMapping(value = "/findTemplateDetail", method = RequestMethod.GET)
|
|
|
@ApiOperation(value = "获取康复服务套餐模板明细")
|
|
|
public String findTemplateDetail(@ApiParam(name = "templateId", value = "模板id")
|
|
|
@RequestParam(required = true)String templateId){
|
|
|
@RequestParam(required = true)String templateId){
|
|
|
try {
|
|
|
return write(200, "获取成功", "data", rehabilitationPlanService.findTemplateDetailInfo(templateId));
|
|
|
} catch (Exception e) {
|
|
@ -66,10 +64,13 @@ public class ThirdRehabilitationPlanController extends BaseController {
|
|
|
@RequestMapping(value = "/createTemplate", method = RequestMethod.POST)
|
|
|
@ApiOperation(value = "创建康复服务套餐模板")
|
|
|
public String createTemplate(@ApiParam(name = "doctor", value = "医生标识")
|
|
|
@RequestParam(required = true)String doctor,
|
|
|
@RequestParam(required = false)String doctor,
|
|
|
@ApiParam(name = "title", value = "康复服务模板名称")
|
|
|
@RequestParam(required = true) String title){
|
|
|
@RequestParam(required = true) String title){
|
|
|
try {
|
|
|
if(!StringUtils.isNotBlank(doctor)){
|
|
|
doctor = getUID();
|
|
|
}
|
|
|
AdminTeam team = teamService.findByLeaderCode(doctor);
|
|
|
Doctor d = doctorService.findDoctorByCode(doctor);
|
|
|
return write(200, "获取成功", "data", rehabilitationPlanService.createTemplate(title,d,team.getId()));
|
|
@ -82,12 +83,15 @@ public class ThirdRehabilitationPlanController extends BaseController {
|
|
|
@RequestMapping(value = "/createTemplateDetail", method = RequestMethod.POST)
|
|
|
@ApiOperation(value = "创建康复服务套餐模板明细")
|
|
|
public String createTemplateDetail(@ApiParam(name = "doctor", value = "医生标识")
|
|
|
@RequestParam(required = true)String doctor,
|
|
|
@RequestParam(required = false)String doctor,
|
|
|
@ApiParam(name = "json", value = "康复服务模板明细")
|
|
|
@RequestParam(required = true) String json,
|
|
|
@RequestParam(required = true) String json,
|
|
|
@ApiParam(name = "type", value = "create或者edit")
|
|
|
@RequestParam(required = true) String type){
|
|
|
@RequestParam(required = true) String type){
|
|
|
try {
|
|
|
if(!StringUtils.isNotBlank(doctor)){
|
|
|
doctor = getUID();
|
|
|
}
|
|
|
Doctor d = doctorService.findDoctorByCode(doctor);
|
|
|
return write(200, "获取成功", "data", rehabilitationPlanService.createTemplateDetail(json, type, d));
|
|
|
} catch (Exception e) {
|
|
@ -108,32 +112,16 @@ public class ThirdRehabilitationPlanController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/findServiceItemsByHospital", method = RequestMethod.GET)
|
|
|
@ApiOperation(value = "获取机构服务项目列表")
|
|
|
public String findServiceItemsByHospital(@ApiParam(name = "doctor", value = "医生标识")
|
|
|
@RequestParam(required = true)String doctor,
|
|
|
@ApiParam(name = "patient", value = "居民标识")
|
|
|
@RequestParam(required = false)String patient){
|
|
|
try {
|
|
|
SignFamily signFamily = new SignFamily();
|
|
|
Doctor d = doctorService.findDoctorByCode(doctor);
|
|
|
if(StringUtils.isNotBlank(patient)) {
|
|
|
signFamily = familyService.findByPatient(patient);
|
|
|
}
|
|
|
return write(200, "获取成功", "data", rehabilitationPlanService.findServiceItemsByHospital(d.getHospital(), signFamily.getHospital()));
|
|
|
} catch (Exception e) {
|
|
|
error(e);
|
|
|
return error(-1, "请求失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/createRehabilitationPlan", method = RequestMethod.POST)
|
|
|
@ApiOperation(value = "创建居民康复计划")
|
|
|
public String createRehabilitationPlan(@ApiParam(name = "doctor", value = "医生标识")
|
|
|
@RequestParam(required = true)String doctor,
|
|
|
@RequestParam(required = false)String doctor,
|
|
|
@ApiParam(name = "json", value = "康复计划json")
|
|
|
@RequestParam(required = true) String json){
|
|
|
@RequestParam(required = true) String json){
|
|
|
try {
|
|
|
if(!StringUtils.isNotBlank(doctor)){
|
|
|
doctor = getUID();
|
|
|
}
|
|
|
Doctor d = doctorService.findDoctorByCode(doctor);
|
|
|
return write(200, "获取成功", "data", rehabilitationPlanService.createRehabilitationPlan(json,d));
|
|
|
} catch (Exception e) {
|