|
@ -517,12 +517,12 @@ public class ImService {
|
|
|
}
|
|
|
|
|
|
String content = "进入了咨询";
|
|
|
BasePatientDO p = basePatientDao.getOne(currentUid);
|
|
|
BasePatientDO p = basePatientDao.findById(currentUid).orElse(null);
|
|
|
String intoUserName = p.getName();
|
|
|
// if (currentUid.equals(uid)) {
|
|
|
// content = intoUserName + content;
|
|
|
// } else {
|
|
|
BasePatientDO member = basePatientDao.getOne(currentUid);
|
|
|
BasePatientDO member = basePatientDao.findById(currentUid).orElse(null);
|
|
|
content = intoUserName + content;
|
|
|
//目前没有家人关系,所以家人名称的名字获取暂时注释
|
|
|
// content = member.getName() + "(" + relations.get(familyMember.getFamilyRelation()) + ")" + content;
|
|
@ -595,7 +595,7 @@ public class ImService {
|
|
|
arr = new String[]{content};
|
|
|
}
|
|
|
// Patient patient = patientDao.findByCode(getUID());
|
|
|
BasePatientDO patient = basePatientDao.getOne(patientcode);
|
|
|
BasePatientDO patient = basePatientDao.findById(patientcode).orElse(null);
|
|
|
int i = 0;
|
|
|
List<String> failed = new ArrayList<>();
|
|
|
|
|
@ -674,7 +674,7 @@ public class ImService {
|
|
|
arr = new String[]{content};
|
|
|
}
|
|
|
// Patient patient = patientDao.findByCode(getUID());
|
|
|
BasePatientDO patient = basePatientDao.getOne(patientcode);
|
|
|
BasePatientDO patient = basePatientDao.findById(patientcode).orElse(null);
|
|
|
int i = 0;
|
|
|
List<String> failed = new ArrayList<>();
|
|
|
|
|
@ -1006,7 +1006,7 @@ public class ImService {
|
|
|
JSONObject re = new JSONObject();
|
|
|
boolean boo = StringUtils.isEmpty(getUnfinishedConsult(patient, doctor));
|
|
|
logger.info("boo" + boo);
|
|
|
WlyyHospitalSysDictDO sysDictDO = hospitalSysDictDao.getOne("consultClose");
|
|
|
WlyyHospitalSysDictDO sysDictDO = hospitalSysDictDao.findById("consultClose").orElse(null);
|
|
|
boolean flag = false;
|
|
|
if (sysDictDO != null) {
|
|
|
if (sysDictDO.getDictCode().equalsIgnoreCase("1")) {
|
|
@ -1046,7 +1046,7 @@ public class ImService {
|
|
|
// 设置患者信息
|
|
|
ct.setPatient(patient);
|
|
|
// 查询患者信息
|
|
|
BasePatientDO tempPatient = basePatientDao.getOne(patient);
|
|
|
BasePatientDO tempPatient = basePatientDao.findById(patient).orElse(null);
|
|
|
// 设置患者姓名
|
|
|
ct.setName(tempPatient.getName());
|
|
|
// 设置患者生日
|
|
@ -1238,7 +1238,7 @@ public class ImService {
|
|
|
synchronized (outpatientCode.intern()) {
|
|
|
|
|
|
//1、获取his就诊记录详情(保存续方表、药品续方信息表、续方疾病类型表)
|
|
|
WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.getOne(outpatientCode);
|
|
|
WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(outpatientCode).orElse(null);
|
|
|
|
|
|
if (wxId.equalsIgnoreCase("xm_ykyy_wx")) {
|
|
|
//眼科接诊时更新眼科通状态
|
|
@ -1257,12 +1257,12 @@ public class ImService {
|
|
|
BaseDoctorDO doctor = baseDoctorDao.findByIdAndDel(doctorCode);
|
|
|
// doctorCode = doctor.getCode();
|
|
|
// 查询患者信息
|
|
|
BasePatientDO p = basePatientDao.getOne(patient);
|
|
|
BasePatientDO p = basePatientDao.findById(patient).orElse(null);
|
|
|
|
|
|
if (!"0".equals(wlyyOutpatientDO.getStatus())) {
|
|
|
throw new RuntimeException("该就诊记录已被取消,无法接单!");
|
|
|
}
|
|
|
BasePatientDO patientDO = basePatientDao.getOne(wlyyOutpatientDO.getPatient());
|
|
|
BasePatientDO patientDO = basePatientDao.findById(wlyyOutpatientDO.getPatient()).orElse(null);
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("title", patientDO.getName() + "申请复诊");
|
|
|
jsonObject.put("content", wlyyOutpatientDO.getDescription());
|
|
@ -1496,11 +1496,11 @@ public class ImService {
|
|
|
*/
|
|
|
public JSONObject addConsult(String outpatientCode, String patient, String doctorCode, ConsultTeamDo ct, String reason, Integer type, String wxId, String source) throws Exception {
|
|
|
//1、获取his就诊记录详情(保存续方表、药品续方信息表、续方疾病类型表)
|
|
|
WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.getOne(outpatientCode);
|
|
|
WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(outpatientCode).orElse(null);
|
|
|
BaseDoctorDO doctor = baseDoctorDao.findByIdAndDel(doctorCode);
|
|
|
// doctorCode = doctor.getCode();
|
|
|
// 查询患者信息
|
|
|
BasePatientDO p = basePatientDao.getOne(patient);
|
|
|
BasePatientDO p = basePatientDao.findById(patient).orElse(null);
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
if ("3".equals(wlyyOutpatientDO.getOutpatientType())) {
|
|
|
jsonObject.put("title", p.getName() + "申请咨询");
|
|
@ -1514,7 +1514,7 @@ public class ImService {
|
|
|
jsonObject.put("sex", p.getSex());
|
|
|
jsonObject.put("name", p.getName());
|
|
|
if (null != wlyyOutpatientDO) {
|
|
|
BasePatientDO outPatient = basePatientDao.getOne(wlyyOutpatientDO.getPatient());
|
|
|
BasePatientDO outPatient = basePatientDao.findById(wlyyOutpatientDO.getPatient()).orElse(null);
|
|
|
if (null != outPatient) {
|
|
|
jsonObject.put("age", DateUtil.getAgeForIdcard(outPatient.getIdcard()));
|
|
|
jsonObject.put("sex", outPatient.getSex());
|
|
@ -1743,7 +1743,7 @@ public class ImService {
|
|
|
|
|
|
ConsultTeamDo consultTeam = consultTeamDao.findByConsult(consult);
|
|
|
|
|
|
ConsultDo cons = consultDao.getOne(consult);
|
|
|
ConsultDo cons = consultDao.findById(consult).orElse(null);
|
|
|
|
|
|
if (consultTeam.getStatus() == 1) {
|
|
|
return -1;
|
|
@ -1757,7 +1757,7 @@ public class ImService {
|
|
|
* 发送评价消息
|
|
|
*/
|
|
|
BaseDoctorDO doctor = baseDoctorDao.findByIdAndDel(consultTeam.getDoctor());
|
|
|
BasePatientDO patient = basePatientDao.getOne(consultTeam.getPatient());
|
|
|
BasePatientDO patient = basePatientDao.findById(consultTeam.getPatient()).orElse(null);
|
|
|
JSONObject evalueContent = new JSONObject();
|
|
|
evalueContent.put("patientCode", consultTeam.getPatient());
|
|
|
evalueContent.put("patientName", patient.getName());
|
|
@ -1774,7 +1774,7 @@ public class ImService {
|
|
|
JSONObject obj = new JSONObject();
|
|
|
//结束咨询才发送推送给IM文字消息
|
|
|
if (endType == 1) {
|
|
|
BasePatientDO p = basePatientDao.getOne(endOperator);
|
|
|
BasePatientDO p = basePatientDao.findById(endOperator).orElse(null);
|
|
|
endName = p.getName();
|
|
|
endId = p.getId();
|
|
|
obj = imUtil.endTopics(consultTeam.getPatient(), endId, endName, consultTeam.getConsult());
|
|
@ -1820,9 +1820,6 @@ public class ImService {
|
|
|
if(org.apache.commons.lang3.StringUtils.isNotBlank(wlyyOutpatientDO.getPlanId())){
|
|
|
ServiceItemPlanDO serviceItemPlanDO = serviceItemPlanDao.findById(wlyyOutpatientDO.getPlanId()).orElse(null);
|
|
|
if(serviceItemPlanDO!=null){
|
|
|
if(!org.springframework.util.StringUtils.isEmpty(serviceItemPlanDO.getRelationCode())){
|
|
|
throw new RuntimeException("该计划已发起过咨询,请选择其他计划发起!");
|
|
|
}
|
|
|
serviceItemPlanDO.setStatus("1");
|
|
|
serviceItemPlanDO.setCompleteTime(DateUtil.getStringDate());
|
|
|
serviceItemPlanDao.save(serviceItemPlanDO);
|
|
@ -1897,7 +1894,7 @@ public class ImService {
|
|
|
|
|
|
ConsultTeamDo consultTeam = consultTeamDao.findByConsult(consult);
|
|
|
|
|
|
ConsultDo cons = consultDao.getOne(consult);
|
|
|
ConsultDo cons = consultDao.findById(consult).orElse(null);
|
|
|
|
|
|
if (consultTeam.getStatus() == 1) {
|
|
|
return -1;
|
|
@ -1911,7 +1908,7 @@ public class ImService {
|
|
|
* 发送评价消息
|
|
|
*/
|
|
|
BaseDoctorDO doctor = baseDoctorDao.findByIdAndDel(consultTeam.getDoctor());
|
|
|
BasePatientDO patient = basePatientDao.getOne(consultTeam.getPatient());
|
|
|
BasePatientDO patient = basePatientDao.findById(consultTeam.getPatient()).orElse(null);
|
|
|
/*JSONObject evalueContent = new JSONObject();
|
|
|
evalueContent.put("patientCode",consultTeam.getPatient());
|
|
|
evalueContent.put("patientName",patient.getName());
|
|
@ -1931,7 +1928,7 @@ public class ImService {
|
|
|
JSONObject obj = new JSONObject();
|
|
|
//结束咨询才发送推送给IM文字消息
|
|
|
if (endType == 1) {
|
|
|
BasePatientDO p = basePatientDao.getOne(endOperator);
|
|
|
BasePatientDO p = basePatientDao.findById(endOperator).orElse(null);
|
|
|
endName = p.getName();
|
|
|
endId = p.getId();
|
|
|
obj = imUtil.endTopics(consultTeam.getPatient(), endId, endName, consultTeam.getConsult());
|
|
@ -2026,7 +2023,7 @@ public class ImService {
|
|
|
|
|
|
net.sf.json.JSONObject data = new net.sf.json.JSONObject();
|
|
|
data.put("name", patient.getName());
|
|
|
WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.getOne(consultTeam.getRelationCode());
|
|
|
WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(consultTeam.getRelationCode()).orElse(null);
|
|
|
if (wlyyOutpatientDO!=null){
|
|
|
data.put("consumerName",wlyyOutpatientDO.getConsumerName());
|
|
|
}
|
|
@ -2087,7 +2084,7 @@ public class ImService {
|
|
|
|
|
|
ConsultTeamDo consultTeamDo = consultTeamDao.findByConsult(consult);
|
|
|
|
|
|
ConsultDo consultDo = consultDao.getOne(consult);
|
|
|
ConsultDo consultDo = consultDao.findById(consult).orElse(null);
|
|
|
|
|
|
object.put("doctorCode", consultTeamDo.getDoctor());
|
|
|
//支付状态
|
|
@ -2117,7 +2114,7 @@ public class ImService {
|
|
|
result.put("consultDo", null);
|
|
|
}
|
|
|
BasePatientDO basePatientDO = null;
|
|
|
basePatientDO = basePatientDao.getOne(patientCode);
|
|
|
basePatientDO = basePatientDao.findById(patientCode).orElse(null);
|
|
|
|
|
|
JSONObject patientinfoObj = new JSONObject();
|
|
|
patientinfoObj.put("name", basePatientDO.getName());
|
|
@ -2278,11 +2275,11 @@ public class ImService {
|
|
|
consultTeamDo.setEvaluateTime(new Date());
|
|
|
consultTeamDao.save(consultTeamDo);
|
|
|
|
|
|
ConsultDo consultDo = consultDao.getOne(consult);
|
|
|
ConsultDo consultDo = consultDao.findById(consult).orElse(null);
|
|
|
|
|
|
//如果是复诊咨询,或者协同门诊,则修改成已评价
|
|
|
if (9 == consultDo.getType() || 12 == consultDo.getType() || 16 == consultDo.getType()) {
|
|
|
WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.getOne(consultTeamDo.getRelationCode());
|
|
|
WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(consultTeamDo.getRelationCode()).orElse(null);
|
|
|
wlyyOutpatientDO.setEvaluateStatus("1");
|
|
|
outpatientDao.save(wlyyOutpatientDO);
|
|
|
}
|
|
@ -2382,7 +2379,7 @@ public class ImService {
|
|
|
//获取诊断
|
|
|
List<WlyyPrescriptionDiagnosisVO> wlyyPrescriptionDiagnosisVOS = wlyyPrescriptionVO.getDiagnosisVOs();
|
|
|
if (wlyyPrescriptionDiagnosisVOS != null && wlyyPrescriptionDiagnosisVOS.size() != 0) {
|
|
|
WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.getOne(wlyyPrescriptionVO.getOutpatientId());
|
|
|
WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(wlyyPrescriptionVO.getOutpatientId()).orElse(null);
|
|
|
if (wlyyOutpatientDO.getOutpatientType() != null) {
|
|
|
if (wlyyOutpatientDO.getOutpatientType().equalsIgnoreCase("1") && wlyyOutpatientDO.getType().equalsIgnoreCase("1")) {
|
|
|
String response = imUtil.sendImMsg(wlyyPrescriptionVO.getDoctor(), wlyyPrescriptionVO.getDoctorName(), wlyyOutpatientDO.getConsumer() + "_" + wlyyPrescriptionVO.getOutpatientId() + "_9", "24", JSON.toJSONString(wlyyPrescriptionDiagnosisVOS), "1", null);
|
|
@ -2400,7 +2397,7 @@ public class ImService {
|
|
|
object.put("prescriptionid", wlyyPrescriptionVO.getId());
|
|
|
object.put("ispay", wlyyPrescriptionVO.getPayStatus());
|
|
|
if (infoVOs != null && infoVOs.size() != 0) {
|
|
|
WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.getOne(wlyyPrescriptionVO.getOutpatientId());
|
|
|
WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(wlyyPrescriptionVO.getOutpatientId()).orElse(null);
|
|
|
if (wlyyOutpatientDO.getOutpatientType() != null) {
|
|
|
if (wlyyOutpatientDO.getOutpatientType().equalsIgnoreCase("1") && wlyyOutpatientDO.getType().equalsIgnoreCase("1")) {
|
|
|
String response = imUtil.sendImMsg(wlyyPrescriptionVO.getDoctor(), wlyyPrescriptionVO.getDoctorName(), wlyyOutpatientDO.getConsumer() + "_" + wlyyPrescriptionVO.getOutpatientId() + "_9", "27", JSON.toJSONString(object), "1", null);
|
|
@ -3206,6 +3203,37 @@ public class ImService {
|
|
|
imUtil.sendMessage(sender, reciver, contentType, content);
|
|
|
}
|
|
|
|
|
|
//发送在线候诊室消息
|
|
|
public void sendConstomerImg(String patientCode,String outpatientId,String outpatientType,String doctorCode){
|
|
|
try {
|
|
|
//808080eb8223c9e50182249cd6ff0000_guidance_26
|
|
|
String session_id26 = patientCode +"_guidance_26";
|
|
|
String session_id27 = patientCode +"_guidance_27";
|
|
|
BaseDoctorDO doctorDO = baseDoctorDao.findByIdAndDel(doctorCode);
|
|
|
String msg = "您好,"+doctorDO.getName()+"医生已接诊,请您及时进入诊室与您的医生沟通。医生将会与您详细讨论病情,并为您提供专业的治疗建议。我们将竭诚为您服务,为您的健康保驾护航。";
|
|
|
JSONObject json = new JSONObject();
|
|
|
json.put("outpatientId",outpatientId);
|
|
|
json.put("outpatientType",outpatientType);
|
|
|
json.put("msg",msg);
|
|
|
WlyyHospitalSysDictDO dictDO = hospitalSysDictDao.findById("customer").orElse(null);
|
|
|
String sender_id = "customer";
|
|
|
String sender_name = "客服";
|
|
|
if(dictDO!=null){
|
|
|
sender_id = dictDO.getDictCode();
|
|
|
sender_name = dictDO.getDictValue();
|
|
|
}
|
|
|
if(imUtil.sessionIsExist(session_id26)){
|
|
|
imUtil.sendImMsg(sender_id, sender_name, session_id26, "51", json.toJSONString(), "2", null);
|
|
|
}
|
|
|
if(imUtil.sessionIsExist(session_id27)){
|
|
|
imUtil.sendImMsg(sender_id, sender_name, session_id27, "51", json.toJSONString(), "2", null);
|
|
|
}
|
|
|
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 导诊的咨询对话
|
|
|
*
|
|
@ -3222,7 +3250,7 @@ public class ImService {
|
|
|
} else {
|
|
|
JSONObject participants = new JSONObject();
|
|
|
participants.put(patientCode, 0);
|
|
|
BasePatientDO basePatientDO = basePatientDao.getOne(patientCode);
|
|
|
BasePatientDO basePatientDO = basePatientDao.findById(patientCode).orElse(null);
|
|
|
String patientSex = "";
|
|
|
if (basePatientDO.getSex() != null && 1 == basePatientDO.getSex()) {
|
|
|
patientSex = "男";
|
|
@ -3303,7 +3331,7 @@ public class ImService {
|
|
|
BaseDoctorDO specialDoctor = baseDoctorDao.findByIdAndDel(special_doctor);
|
|
|
// doctorCode = doctor.getCode();
|
|
|
// 查询患者信息
|
|
|
BasePatientDO p = basePatientDao.getOne(patient_code);
|
|
|
BasePatientDO p = basePatientDao.findById(patient_code).orElse(null);
|
|
|
|
|
|
String consultTitle = "居民:" + p.getName() + "(医生:)-" + specialDoctor.getName() + "发起咨询!";
|
|
|
|
|
@ -3702,7 +3730,7 @@ public class ImService {
|
|
|
BaseDoctorDO doctor = baseDoctorDao.findByIdAndDel(outpatient.getDoctor());
|
|
|
// doctorCode = doctor.getCode();
|
|
|
// 查询患者信息
|
|
|
BasePatientDO p = basePatientDao.getOne(outpatient.getPatient());
|
|
|
BasePatientDO p = basePatientDao.findById(outpatient.getPatient()).orElse(null);
|
|
|
|
|
|
String title = "";
|
|
|
//协同门诊
|
|
@ -4301,7 +4329,7 @@ public class ImService {
|
|
|
}
|
|
|
}
|
|
|
if (map.get("outpatientId") != null) {
|
|
|
WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.getOne(map.get("outpatientId").toString());
|
|
|
WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(map.get("outpatientId").toString()).orElse(null);
|
|
|
map.put("deptName", wlyyOutpatientDO.getDeptName());
|
|
|
}
|
|
|
if (map.get("outpatientType") != null) {
|
|
@ -4574,7 +4602,7 @@ public class ImService {
|
|
|
}
|
|
|
}
|
|
|
if (map.get("outpatientId") != null) {
|
|
|
WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.getOne(map.get("outpatientId").toString());
|
|
|
WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(map.get("outpatientId").toString()).orElse(null);
|
|
|
map.put("deptName", wlyyOutpatientDO.getDeptName());
|
|
|
}
|
|
|
if (map.get("outpatientType") != null) {
|