|
@ -11,6 +11,7 @@ import com.yihu.wlyy.repository.patient.PatientDao;
|
|
|
import com.yihu.wlyy.repository.patient.SignFamilyDao;
|
|
|
import com.yihu.wlyy.service.app.consult.ConsultTeamService;
|
|
|
import com.yihu.wlyy.service.app.consult.DoctorCommentService;
|
|
|
import com.yihu.wlyy.service.app.prescription.PrescriptionDiagnosisService;
|
|
|
import com.yihu.wlyy.service.app.scheduling.DoctorWorkTimeService;
|
|
|
import com.yihu.wlyy.service.app.statistics.DoctorStatisticsService;
|
|
|
import com.yihu.wlyy.service.app.talk.TalkGroupService;
|
|
@ -66,6 +67,8 @@ public class ConsultController extends WeixinBaseController {
|
|
|
private SignFamilyDao signFamilyDao;
|
|
|
@Autowired
|
|
|
private DoctorDao doctorDao;
|
|
|
@Autowired
|
|
|
private PrescriptionDiagnosisService prescriptionDiagnosisService;
|
|
|
|
|
|
/**
|
|
|
* 患者咨询记录查询
|
|
@ -124,6 +127,53 @@ public class ConsultController extends WeixinBaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@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, "查询失败!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取医生的排班时间
|
|
|
*
|
|
@ -292,9 +342,7 @@ public class ConsultController extends WeixinBaseController {
|
|
|
@RequestMapping(value = "addPrescriptionConsult",method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
|
@ApiOperation("添加续方咨询")
|
|
|
public String addPrescriptionConsult(@ApiParam(name = "patient", value = "居民code", defaultValue = "1")
|
|
|
@RequestParam(value = "patient", required = true) String patient,
|
|
|
@ApiParam(name = "jwCode", value = "基位处方code", defaultValue = "10")
|
|
|
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,
|
|
@ -307,10 +355,10 @@ public class ConsultController extends WeixinBaseController {
|
|
|
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);
|
|
|
// 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, "家庭签约信息不存在或已过期,无法进行家庭医生咨询!");
|
|
|
return error(-1, "该处方存在未审核的续方,无法进行续方咨询!");
|
|
|
}
|
|
|
|
|
|
// Doctor doctor = doctorService.findDoctorByCode(consult.getDoctor());
|