|
@ -1,14 +1,20 @@
|
|
|
package com.yihu.wlyy.web.patient.consult;
|
|
|
|
|
|
import com.yihu.wlyy.aop.ObserverRequired;
|
|
|
import com.yihu.wlyy.entity.consult.Consult;
|
|
|
import com.yihu.wlyy.entity.consult.ConsultTeam;
|
|
|
import com.yihu.wlyy.entity.consult.ConsultTeamLog;
|
|
|
import com.yihu.wlyy.entity.doctor.profile.Doctor;
|
|
|
import com.yihu.wlyy.entity.patient.Patient;
|
|
|
import com.yihu.wlyy.entity.patient.SignFamily;
|
|
|
import com.yihu.wlyy.entity.patient.prescription.Prescription;
|
|
|
import com.yihu.wlyy.logs.BusinessLogs;
|
|
|
import com.yihu.wlyy.repository.consult.ConsultDao;
|
|
|
import com.yihu.wlyy.repository.consult.ConsultTeamDao;
|
|
|
import com.yihu.wlyy.repository.doctor.DoctorDao;
|
|
|
import com.yihu.wlyy.repository.patient.PatientDao;
|
|
|
import com.yihu.wlyy.repository.patient.SignFamilyDao;
|
|
|
import com.yihu.wlyy.repository.prescription.PrescriptionDao;
|
|
|
import com.yihu.wlyy.service.app.consult.ConsultTeamService;
|
|
|
import com.yihu.wlyy.service.app.consult.DoctorCommentService;
|
|
|
import com.yihu.wlyy.service.app.prescription.PrescriptionDiagnosisService;
|
|
@ -77,6 +83,12 @@ public class ConsultController extends WeixinBaseController {
|
|
|
private HttpUtil httpUtil;
|
|
|
@Autowired
|
|
|
private PushMsgTask pushMsgTask;
|
|
|
@Autowired
|
|
|
private ConsultTeamDao consultTeamDao;
|
|
|
@Autowired
|
|
|
private PrescriptionDao prescriptionDao;
|
|
|
@Autowired
|
|
|
private ConsultDao consultDao;
|
|
|
|
|
|
/**
|
|
|
* 患者咨询记录查询
|
|
@ -134,52 +146,7 @@ public class ConsultController extends WeixinBaseController {
|
|
|
return error(-1, "查询失败!");
|
|
|
}
|
|
|
}
|
|
|
@RequestMapping(value = "getPreConsultList",method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
@ApiOperation("获取续方咨询列表")
|
|
|
public String getPreConsultList(@RequestParam(required = false) String title,
|
|
|
@RequestParam(required = true) long id,@RequestParam(required = true) int pagesize){
|
|
|
try {
|
|
|
JSONArray array = new JSONArray();
|
|
|
// Page<Object> data = consultTeamService.findConsultRecordByType("a663d0cf7f8c4d38a8327cedc921e65f", id, pagesize,8, title);//8表示续方咨询
|
|
|
Page<Object> data = consultTeamService.findConsultRecordByType(getRepUID(), id, pagesize,8, title);//8表示续方咨询
|
|
|
if (data != null) {
|
|
|
for (Object consult : data.getContent()) {
|
|
|
if (consult == null) {
|
|
|
continue;
|
|
|
}
|
|
|
Object[] result = (Object[]) consult;
|
|
|
JSONObject json = new JSONObject();
|
|
|
json.put("id", result[0]);
|
|
|
// 设置咨询类型:1三师咨询,2视频咨询,3图文咨询,4公共咨询,5病友圈,8 续方咨询
|
|
|
json.put("type", result[1]);
|
|
|
// 设置咨询标识
|
|
|
json.put("code", result[2]);
|
|
|
// 设置显示标题
|
|
|
json.put("title", result[3]);
|
|
|
// 设置主诉
|
|
|
json.put("symptoms", result[4]);
|
|
|
// 咨询状态
|
|
|
json.put("status", result[6]);
|
|
|
// 设置咨询日期
|
|
|
json.put("czrq", DateUtil.dateToStrLong((Date) result[5]));
|
|
|
// 咨询状态
|
|
|
json.put("doctorCode", result[7]);
|
|
|
json.put("evaluate", result[8]);
|
|
|
String relationCode = result[9]==null?"":result[9].toString();
|
|
|
json.put("prescriptionCode",relationCode);//续方code
|
|
|
json.put("prescriptionDt",prescriptionDiagnosisService.getPrescriptionDiagnosis(relationCode));//续方疾病类型
|
|
|
json.put("prescriptionInfo",prescriptionDiagnosisService.getPrescriptionInfo(relationCode));//续方药品信息
|
|
|
|
|
|
array.put(json);
|
|
|
}
|
|
|
}
|
|
|
return write(200, "查询成功!", "list", array);
|
|
|
} catch (Exception e) {
|
|
|
error(e);
|
|
|
return error(-1, "查询失败!");
|
|
|
}
|
|
|
}
|
|
|
/**
|
|
|
* 获取医生的排班时间
|
|
|
*
|
|
@ -195,7 +162,7 @@ public class ConsultController extends WeixinBaseController {
|
|
|
|
|
|
return write(200, "查询成功!", "data", result);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
error(e);
|
|
|
return error(-1, "查询失败!");
|
|
|
}
|
|
|
}
|
|
@ -214,7 +181,7 @@ public class ConsultController extends WeixinBaseController {
|
|
|
|
|
|
return write(200, "查询成功!", "data", result);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
error(e);
|
|
|
return error(-1, "查询失败!");
|
|
|
}
|
|
|
}
|
|
@ -232,7 +199,7 @@ public class ConsultController extends WeixinBaseController {
|
|
|
JSONObject result = doctorWorkTimeService.isDoctorWorking(doctor);
|
|
|
return write(200, result.getString("msg"), "data", result.getString("status"));
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
error(e);
|
|
|
return error(-1, "查询失败");
|
|
|
}
|
|
|
}
|
|
@ -250,7 +217,7 @@ public class ConsultController extends WeixinBaseController {
|
|
|
JSONObject result = doctorWorkTimeService.isFamousDoctorWorking(doctor);
|
|
|
return write(200, result.getString("msg"), "data", result.getString("status"));
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
error(e);
|
|
|
return error(-1, "查询失败");
|
|
|
}
|
|
|
}
|
|
@ -268,7 +235,7 @@ public class ConsultController extends WeixinBaseController {
|
|
|
int result = doctorWorkTimeService.getDoctorConsultTimesRemain(doctor);
|
|
|
return write(200, "查询成功", "data", result);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
error(e);
|
|
|
return error(-1, "查询失败");
|
|
|
}
|
|
|
}
|
|
@ -287,7 +254,7 @@ public class ConsultController extends WeixinBaseController {
|
|
|
JSONArray result = new JSONArray(unfinishedConsult);
|
|
|
return write(200, "查询成功!", "data", result);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
error(e);
|
|
|
return error(-1, "查询失败!");
|
|
|
}
|
|
|
}
|
|
@ -311,78 +278,11 @@ public class ConsultController extends WeixinBaseController {
|
|
|
return write(200, "查询成功", "data", "");
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return error(-1, "查询失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "isPrescriptionConsult",method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
@ApiOperation("是否可以续方咨询")
|
|
|
public String isPrescriptConsult(String patient){
|
|
|
try{
|
|
|
SignFamily signFamily = signFamilyDao.findByPatient(patient);
|
|
|
if(signFamily==null){
|
|
|
return error(-1,"您还未签约,不能发起续方咨询!");
|
|
|
}
|
|
|
|
|
|
//点击后判断,如果用户当前存在可申请续方的处方记录,则进入续方申请流程,若不存在可续方记录,alert“当前没有可以申请续方的处方记录”
|
|
|
|
|
|
|
|
|
Doctor doctor = doctorDao.findByAdminTeamId(signFamily.getAdminTeamId());
|
|
|
JSONObject json = new JSONObject();
|
|
|
json.put("doctor",doctor.getCode());
|
|
|
json.put("doctorName",doctor.getName());
|
|
|
json.put("adminTeamId",signFamily.getAdminTeamId());
|
|
|
json.put("hospital",doctor.getHospital());
|
|
|
json.put("hospitalName",doctor.getHospitalName());
|
|
|
|
|
|
return write(200, "查询成功!", "data", json);
|
|
|
|
|
|
}catch (Exception e){
|
|
|
error(e);
|
|
|
return error(-1,"查询失败");
|
|
|
return error(-1, "查询失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "addPrescriptionConsult",method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
|
@ApiOperation("添加续方咨询")
|
|
|
public String addPrescriptionConsult(@ApiParam(name = "jwCode", value = "基位处方code", defaultValue = "10")
|
|
|
@RequestParam(value = "jwCode", required = true) String jwCode,
|
|
|
@ApiParam(name = "doctor", value = "咨询医生(开方医生、审核医生)", defaultValue = "86225d1365e711e69f7c005056850d66")
|
|
|
@RequestParam(value = "doctor", required = true) String doctor,
|
|
|
@ApiParam(name = "adminTeamId", value = "签约行政团队id", defaultValue = "224")
|
|
|
@RequestParam(value = "adminTeamId", required = true) Long adminTeamId,
|
|
|
@ApiParam(name = "reason", value = "续方说明", defaultValue = "续方申请")
|
|
|
@RequestParam(value = "reason", required = false) String reason){
|
|
|
try{
|
|
|
ConsultTeam consult = new ConsultTeam();
|
|
|
consult.setType(8);//续方咨询
|
|
|
consult.setAdminTeamId(adminTeamId);
|
|
|
// 保存到数据库
|
|
|
// int res = consultTeamService.addPrescriptionConsult(jwCode, "a663d0cf7f8c4d38a8327cedc921e65f","a663d0cf7f8c4d38a8327cedc921e65f",doctor,consult,reason);
|
|
|
int res = consultTeamService.addPrescriptionConsult(jwCode, getRepUID(),getUID(),doctor,consult,reason);
|
|
|
if (res == -1) {
|
|
|
return error(-1, "该处方存在未审核的续方,无法进行续方咨询!");
|
|
|
}
|
|
|
|
|
|
// Doctor doctor = doctorService.findDoctorByCode(consult.getDoctor());
|
|
|
// // 添加到统计队列
|
|
|
// if (consult.getType() == 2) {
|
|
|
// DoctorStatisticsTask.getInstance(doctorStatisticsService).put(consult.getDoctor(), 1, 1, 0);
|
|
|
// }
|
|
|
|
|
|
// 推送消息给医生
|
|
|
pushMsgTask.put(doctor, MessageType.MESSAGE_TYPE_DOCTOR_NEW_CONSULT_TEAM.D_CT_01.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM_PRESCRIPTION.续方咨询.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM_PRESCRIPTION.您有新的续方咨询.name(), consult.getConsult());
|
|
|
BusinessLogs.info(BusinessLogs.BusinessType.consult, getRepUID(), getUID(), new JSONObject(consult));
|
|
|
return write(200, "提交成功", "data", consult);
|
|
|
|
|
|
}catch (Exception e){
|
|
|
error(e);
|
|
|
return error(-1,"添加失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 三师咨询添加接口
|
|
@ -470,7 +370,7 @@ public class ConsultController extends WeixinBaseController {
|
|
|
}
|
|
|
|
|
|
// 推送消息给医生
|
|
|
pushMsgTask.put(consult.getDoctor(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_CONSULT_TEAM.D_CT_01.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_CONSULT_TEAM.指定咨询.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_CONSULT_TEAM.您有新的指定咨询.name(), consult.getConsult());
|
|
|
pushMsgTask.put(consult.getDoctor(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_CONSULT_TEAM.D_CT_01.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_CONSULT_TEAM.指定咨询.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_CONSULT_TEAM.您有新的指定咨询.name(), consult.getConsult());
|
|
|
BusinessLogs.info(BusinessLogs.BusinessType.consult, getRepUID(), getUID(), new JSONObject(consult));
|
|
|
return write(200, "提交成功", "data", consult);
|
|
|
} catch (Exception ex) {
|
|
@ -564,7 +464,7 @@ public class ConsultController extends WeixinBaseController {
|
|
|
//名医咨询次数减一
|
|
|
doctorWorkTimeService.setDoctorCurrentConsultTimesRemain(doctorCode);
|
|
|
// 推送消息给医生
|
|
|
pushMsgTask.put(consult.getDoctor(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM.D_CT_03.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM.名医咨询.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM.您有新的名医咨询.name(), consult.getConsult());
|
|
|
pushMsgTask.put(consult.getDoctor(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM.D_CT_03.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM.名医咨询.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM.您有新的名医咨询.name(), consult.getConsult());
|
|
|
BusinessLogs.info(BusinessLogs.BusinessType.consult, getRepUID(), getUID(), new JSONObject(consult));
|
|
|
return write(200, "提交成功", "data", resultConsult);
|
|
|
} catch (Exception ex) {
|
|
@ -739,7 +639,9 @@ public class ConsultController extends WeixinBaseController {
|
|
|
int row = consultTeamService.finishConsult(code, getRepUID(), 1);
|
|
|
if (row > 0) {
|
|
|
return success("操作成功!");
|
|
|
} else {
|
|
|
}else if(row == -2) {
|
|
|
return error(-1, "续方未审核,不能结束续方咨询!");
|
|
|
} else {
|
|
|
return error(-1, "操作失败!");
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
@ -989,7 +891,12 @@ public class ConsultController extends WeixinBaseController {
|
|
|
JSONArray array = doctorCommentService.consultComment(getRepUID(), consult, content, star, 2);
|
|
|
// 添加到统计队列
|
|
|
if (array != null) {
|
|
|
DoctorStatisticsTask.getInstance(doctorStatisticsService).put(array);
|
|
|
//新增判断 续方咨询暂不统计
|
|
|
ConsultTeam consultTeam = consultTeamDao.findByConsult(consult);
|
|
|
if(consultTeam.getType()!=8){
|
|
|
DoctorStatisticsTask.getInstance(doctorStatisticsService).put(array);
|
|
|
}
|
|
|
// DoctorStatisticsTask.getInstance(doctorStatisticsService).put(array);
|
|
|
}
|
|
|
// 添加评价记录
|
|
|
ConsultTeamLog log = new ConsultTeamLog();
|
|
@ -1013,6 +920,7 @@ public class ConsultController extends WeixinBaseController {
|
|
|
try{
|
|
|
return success(ImUtill.getTopic(consult).get("data").toString());
|
|
|
}catch (Exception e){
|
|
|
error(e);
|
|
|
return error(-1,e.getMessage());
|
|
|
}
|
|
|
}
|
|
@ -1023,7 +931,151 @@ public class ConsultController extends WeixinBaseController {
|
|
|
ConsultTeam consultTeam = consultTeamService.findByConsultCode(consult);
|
|
|
return write(200, "查询成功", "data", consultTeam);
|
|
|
}catch (Exception e){
|
|
|
error(e);
|
|
|
return error(-1,e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
/*===========================================续方咨询==============================================================*/
|
|
|
|
|
|
@RequestMapping(value = "isPrescriptionConsult",method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
@ApiOperation("是否可以续方咨询")
|
|
|
public String isPrescriptConsult(@ApiParam(name = "patient", value = "居民code") @RequestParam(value = "patient", required = true)String patient){
|
|
|
try{
|
|
|
SignFamily signFamily = signFamilyDao.findByPatient(patient);
|
|
|
if(signFamily==null){
|
|
|
return error(-1,"您还未签约,不能发起续方咨询!");
|
|
|
}
|
|
|
|
|
|
//点击后判断,如果用户当前存在可申请续方的处方记录,则进入续方申请流程,若不存在可续方记录,alert“当前没有可以申请续方的处方记录”
|
|
|
|
|
|
|
|
|
Doctor doctor = doctorDao.findByAdminTeamId(signFamily.getAdminTeamId());
|
|
|
JSONObject json = new JSONObject();
|
|
|
json.put("doctor",doctor.getCode());
|
|
|
json.put("doctorName",doctor.getName());
|
|
|
json.put("adminTeamId",signFamily.getAdminTeamId());
|
|
|
json.put("hospital",doctor.getHospital());
|
|
|
json.put("hospitalName",doctor.getHospitalName());
|
|
|
|
|
|
return write(200, "查询成功!", "data", json);
|
|
|
|
|
|
}catch (Exception e){
|
|
|
error(e);
|
|
|
return error(-1,"查询失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "addPrescriptionConsult",method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
|
@ObserverRequired
|
|
|
@ApiOperation("添加续方咨询")
|
|
|
public String addPrescriptionConsult(@ApiParam(name = "jwCode", value = "基位处方code", defaultValue = "10")
|
|
|
@RequestParam(value = "jwCode", required = true) String jwCode,
|
|
|
@ApiParam(name = "doctor", value = "咨询医生(开方医生、审核医生)", defaultValue = "86225d1365e711e69f7c005056850d66")
|
|
|
@RequestParam(value = "doctor", required = true) String doctor,
|
|
|
@ApiParam(name = "adminTeamId", value = "签约行政团队id", defaultValue = "224")
|
|
|
@RequestParam(value = "adminTeamId", required = true) Long adminTeamId,
|
|
|
@ApiParam(name = "reason", value = "续方说明", defaultValue = "续方申请")
|
|
|
@RequestParam(value = "reason", required = false) String reason){
|
|
|
try{
|
|
|
ConsultTeam consult = new ConsultTeam();
|
|
|
consult.setType(8);//续方咨询
|
|
|
consult.setAdminTeamId(adminTeamId);
|
|
|
// 保存到数据库
|
|
|
// int res = consultTeamService.addPrescriptionConsult(jwCode, "a663d0cf7f8c4d38a8327cedc921e65f","a663d0cf7f8c4d38a8327cedc921e65f",doctor,consult,reason);
|
|
|
int res = consultTeamService.addPrescriptionConsult(jwCode, getRepUID(),getUID(),doctor,consult,reason);
|
|
|
if (res == -1) {
|
|
|
return error(-1, "该处方存在未审核的续方,无法进行续方咨询!");
|
|
|
}
|
|
|
|
|
|
// Doctor doctor = doctorService.findDoctorByCode(consult.getDoctor());
|
|
|
// // 添加到统计队列
|
|
|
// if (consult.getType() == 2) {
|
|
|
// DoctorStatisticsTask.getInstance(doctorStatisticsService).put(consult.getDoctor(), 1, 1, 0);
|
|
|
// }
|
|
|
|
|
|
// 推送消息给医生
|
|
|
pushMsgTask.put(doctor, MessageType.MESSAGE_TYPE_DOCTOR_NEW_CONSULT_TEAM.D_CT_01.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM_PRESCRIPTION.续方咨询.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM_PRESCRIPTION.您有新的续方咨询.name(), consult.getConsult());
|
|
|
BusinessLogs.info(BusinessLogs.BusinessType.consult, getRepUID(), getUID(), new JSONObject(consult));
|
|
|
return write(200, "提交成功", "data", consult);
|
|
|
|
|
|
}catch (Exception e){
|
|
|
error(e);
|
|
|
return error(-1,"添加失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "getPreConsultList",method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
@ApiOperation("获取续方咨询列表")
|
|
|
public String getPreConsultList(@ApiParam(name = "title", value = "咨询标题") @RequestParam(required = false) String title,
|
|
|
@ApiParam(name = "id", value = "第几页") @RequestParam(required = true) long id,
|
|
|
@ApiParam(name = "pagesize", value = "页面大小") @RequestParam(required = true) int pagesize){
|
|
|
try {
|
|
|
JSONArray array = new JSONArray();
|
|
|
// Page<Object> data = consultTeamService.findConsultRecordByType("a663d0cf7f8c4d38a8327cedc921e65f", id, pagesize,8, title);//8表示续方咨询
|
|
|
Page<Object> data = consultTeamService.findConsultRecordByType(getRepUID(), id, pagesize,8, title);//8表示续方咨询
|
|
|
if (data != null) {
|
|
|
for (Object consult : data.getContent()) {
|
|
|
if (consult == null) {
|
|
|
continue;
|
|
|
}
|
|
|
Object[] result = (Object[]) consult;
|
|
|
JSONObject json = new JSONObject();
|
|
|
json.put("id", result[0]);
|
|
|
// 设置咨询类型:1三师咨询,2视频咨询,3图文咨询,4公共咨询,5病友圈,8 续方咨询
|
|
|
json.put("type", result[1]);
|
|
|
// 设置咨询标识
|
|
|
json.put("code", result[2]);
|
|
|
// 设置显示标题
|
|
|
json.put("title", result[3]);
|
|
|
// 设置主诉
|
|
|
json.put("symptoms", result[4]);
|
|
|
// 咨询状态
|
|
|
json.put("status", result[6]);
|
|
|
// 设置咨询日期
|
|
|
json.put("czrq", DateUtil.dateToStrLong((Date) result[5]));
|
|
|
// 咨询状态
|
|
|
json.put("doctorCode", result[7]);
|
|
|
json.put("evaluate", result[8]);
|
|
|
String relationCode = result[9]==null?"":result[9].toString();
|
|
|
json.put("prescriptionCode",relationCode);//续方code
|
|
|
json.put("prescriptionDt",prescriptionDiagnosisService.getPrescriptionDiagnosis(relationCode));//续方疾病类型
|
|
|
json.put("prescriptionInfo",prescriptionDiagnosisService.getPrescriptionInfo(relationCode));//续方药品信息
|
|
|
|
|
|
array.put(json);
|
|
|
}
|
|
|
}
|
|
|
return write(200, "查询成功!", "list", array);
|
|
|
} catch (Exception e) {
|
|
|
error(e);
|
|
|
return error(-1, "查询失败!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "prescriptionDetail",method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
@ApiOperation("获取续方信息")
|
|
|
public String prescriptionDetail(@ApiParam(name = "consult", value = "咨询code") @RequestParam(required = true) String consult){
|
|
|
try {
|
|
|
JSONObject json = new JSONObject();
|
|
|
|
|
|
Consult consult1 = consultDao.findByCode(consult);
|
|
|
|
|
|
String prescriptionCode = consult1.getRelationCode();
|
|
|
Prescription prescription = prescriptionDao.findByCode(prescriptionCode);
|
|
|
json.put("status",prescription.getStatus());//状态 (-1 审核不通过 , 0 审核中, 10 审核通过/待支付 ,21支付失败 20 配药中/支付成功, 21 等待领药 ,30 配送中 ,100配送成功/已完成)
|
|
|
json.put("prescriptionDt",prescriptionDiagnosisService.getPrescriptionDiagnosis(prescriptionCode));//续方疾病类型
|
|
|
json.put("prescriptionInfo",prescriptionDiagnosisService.getPrescriptionInfo(prescriptionCode));//续方药品信息
|
|
|
|
|
|
return write(200, "查询成功!", "list", json);
|
|
|
}catch (Exception e){
|
|
|
error(e);
|
|
|
return error(-1, "查询失败!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|