|
@ -38,19 +38,13 @@ public class ThirdRehabilitationPlanController extends BaseController {
|
|
|
|
|
|
@RequestMapping(value = "/findTemplateList", method = RequestMethod.GET)
|
|
|
@ApiOperation(value = "获取康复服务套餐模板列表")
|
|
|
public String templateList(@ApiParam(name = "patient", value = "居民标识")
|
|
|
public String templateList(@ApiParam(name = "doctor", value = "医生标识")
|
|
|
@RequestParam(required = true)String doctor,
|
|
|
@ApiParam(name = "patient", value = "居民标识")
|
|
|
@RequestParam(required = false)String patient){
|
|
|
try {
|
|
|
Long adminTeamId = null;
|
|
|
if(StringUtils.isNotBlank(patient)) {
|
|
|
SignFamily signFamily = familyService.findByPatientAndDoctor(patient, getUID());
|
|
|
adminTeamId = signFamily.getAdminTeamId();
|
|
|
}else {
|
|
|
AdminTeam team = teamService.findByLeaderCode(getUID());
|
|
|
adminTeamId = team.getId();
|
|
|
}
|
|
|
return write(200, "获取成功", "data", rehabilitationPlanService.findTemplateInfo(adminTeamId));
|
|
|
// return write(200, "获取成功", "data", rehabilitationPlanService.findTemplateInfo((long) 646));
|
|
|
|
|
|
return write(200, "获取成功", "data", rehabilitationPlanService.findTemplateInfo(doctor, patient));
|
|
|
} catch (Exception e) {
|
|
|
error(e);
|
|
|
return error(-1, "请求失败");
|
|
@ -63,7 +57,6 @@ public class ThirdRehabilitationPlanController extends BaseController {
|
|
|
@RequestParam(required = true)String templateId){
|
|
|
try {
|
|
|
return write(200, "获取成功", "data", rehabilitationPlanService.findTemplateDetailInfo(templateId));
|
|
|
// return write(200, "获取成功", "data", rehabilitationPlanService.findTemplateInfo((long) 646));
|
|
|
} catch (Exception e) {
|
|
|
error(e);
|
|
|
return error(-1, "请求失败");
|
|
@ -72,14 +65,14 @@ public class ThirdRehabilitationPlanController extends BaseController {
|
|
|
|
|
|
@RequestMapping(value = "/createTemplate", method = RequestMethod.POST)
|
|
|
@ApiOperation(value = "创建康复服务套餐模板")
|
|
|
public String createTemplate(@ApiParam(name = "title", value = "康复服务模板名称")
|
|
|
@RequestParam(required = true) String title){
|
|
|
public String createTemplate(@ApiParam(name = "doctor", value = "医生标识")
|
|
|
@RequestParam(required = true)String doctor,
|
|
|
@ApiParam(name = "title", value = "康复服务模板名称")
|
|
|
@RequestParam(required = true) String title){
|
|
|
try {
|
|
|
AdminTeam team = teamService.findByLeaderCode(getUID());
|
|
|
Doctor doctor = doctorService.findDoctorByCode(getUID());
|
|
|
return write(200, "获取成功", "data", rehabilitationPlanService.createTemplate(title,doctor,team.getId()));
|
|
|
// Doctor doctor = doctorService.findDoctorByCode("0272469a6dcf11e69f7c005056850d66");
|
|
|
// return write(200, "获取成功", "data", rehabilitationPlanService.createTemplate(title,doctor,(long) 646));
|
|
|
AdminTeam team = teamService.findByLeaderCode(doctor);
|
|
|
Doctor d = doctorService.findDoctorByCode(doctor);
|
|
|
return write(200, "获取成功", "data", rehabilitationPlanService.createTemplate(title,d,team.getId()));
|
|
|
} catch (Exception e) {
|
|
|
error(e);
|
|
|
return error(-1, "请求失败");
|
|
@ -88,15 +81,27 @@ public class ThirdRehabilitationPlanController extends BaseController {
|
|
|
|
|
|
@RequestMapping(value = "/createTemplateDetail", method = RequestMethod.POST)
|
|
|
@ApiOperation(value = "创建康复服务套餐模板明细")
|
|
|
public String createTemplateDetail(@ApiParam(name = "json", value = "康复服务模板明细")
|
|
|
@RequestParam(required = true) String json,
|
|
|
public String createTemplateDetail(@ApiParam(name = "doctor", value = "医生标识")
|
|
|
@RequestParam(required = true)String doctor,
|
|
|
@ApiParam(name = "json", value = "康复服务模板明细")
|
|
|
@RequestParam(required = true) String json,
|
|
|
@ApiParam(name = "type", value = "create或者edit")
|
|
|
@RequestParam(required = true) String type){
|
|
|
@RequestParam(required = true) String type){
|
|
|
try {
|
|
|
Doctor d = doctorService.findDoctorByCode(doctor);
|
|
|
return write(200, "获取成功", "data", rehabilitationPlanService.createTemplateDetail(json, type, d));
|
|
|
} catch (Exception e) {
|
|
|
error(e);
|
|
|
return error(-1, "请求失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/deleteTemplate", method = RequestMethod.POST)
|
|
|
@ApiOperation(value = "删除康复服务套餐模板")
|
|
|
public String deleteTemplate(@ApiParam(name = "templateId", value = "模板id")
|
|
|
@RequestParam(required = true)String templateId){
|
|
|
try {
|
|
|
// Doctor doctor = doctorService.findDoctorByCode(getUID());
|
|
|
// return write(200, "获取成功", "data", rehabilitationPlanService.createTemplate(title,doctor,team.getId()));
|
|
|
Doctor doctor = doctorService.findDoctorByCode("0272469a6dcf11e69f7c005056850d66");
|
|
|
return write(200, "获取成功", "data", rehabilitationPlanService.createTemplateDetail(json,type,doctor));
|
|
|
return write(200, "获取成功", "data", rehabilitationPlanService.deleteTemplate(templateId));
|
|
|
} catch (Exception e) {
|
|
|
error(e);
|
|
|
return error(-1, "请求失败");
|
|
@ -104,14 +109,18 @@ public class ThirdRehabilitationPlanController extends BaseController {
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/findServiceItemsByHospital", method = RequestMethod.GET)
|
|
|
@ApiOperation(value = "根据机构查找服务项目列表")
|
|
|
public String findServiceItemsByHospital(@ApiParam(name = "patient", value = "居民标识")
|
|
|
@RequestParam(required = true)String patient){
|
|
|
@ApiOperation(value = "获取机构服务项目列表")
|
|
|
public String findServiceItemsByHospital(@ApiParam(name = "doctor", value = "医生标识")
|
|
|
@RequestParam(required = true)String doctor,
|
|
|
@ApiParam(name = "patient", value = "居民标识")
|
|
|
@RequestParam(required = false)String patient){
|
|
|
try {
|
|
|
// Doctor doctor = doctorService.findDoctorByCode(getUID());
|
|
|
SignFamily signFamily = familyService.findByPatientAndDoctor(patient, getUID());
|
|
|
Doctor doctor = doctorService.findDoctorByCode("0272469a6dcf11e69f7c005056850d66");
|
|
|
return write(200, "获取成功", "data", rehabilitationPlanService.findServiceItemsByHospital(signFamily,doctor));
|
|
|
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, "请求失败");
|
|
@ -120,12 +129,27 @@ public class ThirdRehabilitationPlanController extends BaseController {
|
|
|
|
|
|
@RequestMapping(value = "/createRehabilitationPlan", method = RequestMethod.POST)
|
|
|
@ApiOperation(value = "创建居民康复计划")
|
|
|
public String createRehabilitationPlan(@ApiParam(name = "json", value = "康复计划json")
|
|
|
@RequestParam(required = true) String json){
|
|
|
public String createRehabilitationPlan(@ApiParam(name = "doctor", value = "医生标识")
|
|
|
@RequestParam(required = true)String doctor,
|
|
|
@ApiParam(name = "json", value = "康复计划json")
|
|
|
@RequestParam(required = true) String json){
|
|
|
try {
|
|
|
Doctor d = doctorService.findDoctorByCode(doctor);
|
|
|
return write(200, "获取成功", "data", rehabilitationPlanService.createRehabilitationPlan(json,d));
|
|
|
} catch (Exception e) {
|
|
|
error(e);
|
|
|
return error(-1, "请求失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/getPatientInfoByDoctor", method = RequestMethod.GET)
|
|
|
@ApiOperation(value = "根据医生code获取签约居民信息")
|
|
|
public String getPatientInfoByDoctor(@ApiParam(name = "doctor", value = "医生标识")
|
|
|
@RequestParam(required = true)String doctor,
|
|
|
@ApiParam(name = "patientInfo", value = "居民信息")
|
|
|
@RequestParam(required = false)String patientInfo){
|
|
|
try {
|
|
|
// Doctor doctor = doctorService.findDoctorByCode(getUID());
|
|
|
Doctor doctor = doctorService.findDoctorByCode("0272469a6dcf11e69f7c005056850d66");
|
|
|
return write(200, "获取成功", "data", rehabilitationPlanService.createRehabilitationPlan(json,doctor));
|
|
|
return write(200, "获取成功", "data", rehabilitationPlanService.getPatientInfoByDoctor(doctor, patientInfo));
|
|
|
} catch (Exception e) {
|
|
|
error(e);
|
|
|
return error(-1, "请求失败");
|