| 
					
				 | 
			
			
				@ -2807,7 +2807,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param diagnosisJson 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public Map<String, Object> makeDiagnosis(String outPatientId,String prescriptionId, String advice, String type, String infoJsons, String diagnosisJson, String inspectionJson, String emrJson,String hisId) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public Map<String, Object> makeDiagnosis(String outPatientId,String prescriptionId, String advice, String type, String infoJsons, String diagnosisJson, String inspectionJson, String emrJson,String hisId,String diseaseCode,String diseaseName,String isDisease) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Map<String, Object> result = new HashedMap(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -2815,6 +2815,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        WlyyOutpatientDO outpatientDO = outpatientDao.findById(outPatientId).orElse(null); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //设置医嘱 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        outpatientDO.setAdvice(advice); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //设置特殊病种 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        outpatientDO.setDiseaseCode(diseaseCode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        outpatientDO.setDiseaseName(diseaseName); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        outpatientDO.setIsDisease(isDisease); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //========================处方操作============================================================= 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //创建处方记录 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -2824,6 +2829,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(StringUtils.isNotBlank(prescriptionId)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            wlyyPrescriptionDO1 = prescriptionDao.findListById(prescriptionId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            prescriptionDO =wlyyPrescriptionDO1.get(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            prescriptionDO.setIsDisease(isDisease); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            prescriptionDO.setDiseaseCode(diseaseCode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            prescriptionDO.setDiseaseName(diseaseName); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (StringUtils.isNotBlank(hisId)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                prescriptionDO.setHisId(hisId); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -2842,6 +2850,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            prescriptionDO.setDoctor(outpatientDO.getDoctor()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            prescriptionDO.setDoctorName(outpatientDO.getDoctorName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            prescriptionDO.setPayStatus(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            prescriptionDO.setIsDisease(isDisease); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            prescriptionDO.setDiseaseCode(diseaseCode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            prescriptionDO.setDiseaseName(diseaseName); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (wechatId.equalsIgnoreCase("xm_ykyy_wx")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                prescriptionDO.setAdmNo(outpatientDO.getAdmNo()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -5363,6 +5374,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if(dictDO==null||"0".equals(dictDO.getDictValue())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    //不发送 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    int i= dsyyPrescriptionService.SendSms(phone,content); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    logger.info("phone="+phone+";content="+content+","+i); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(StringUtils.isNotBlank(phone)&&StringUtils.isNotBlank(content)){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -5572,9 +5586,29 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (wxId.equalsIgnoreCase("xm_dsyy_wx")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    String content = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    String phone = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    if ("9".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        content = "患者"+outpatientDO.getConsumerName()+"取消了图文复诊,您无需再进行相关处理。"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    if ("16".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        content = "患者"+outpatientDO.getConsumerName()+"取消了视频复诊,您无需再进行相关处理。"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    if ("1".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        content = "患者"+outpatientDO.getConsumerName()+"取消了图文咨询,您无需再进行相关处理。"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    if ("17".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        content = "患者"+outpatientDO.getConsumerName()+"取消了视频咨询,您无需再进行相关处理。"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    if ("12".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    sendSms(doctorDO.getMobile(),content,"2"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                logger.info("patientCancel诊查费支付成功推送模板消息:outpatientId="+outpatientId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            }else if("systemCancelRemind".equalsIgnoreCase(titelType)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                //超过24小时未接诊,系统取消 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("isCloseRefund").orElse(null); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -5648,16 +5682,21 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } else if ("paySuccess".equalsIgnoreCase(titelType)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                String title = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if ("9".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    title = "图文复诊"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    contentMsg = "您已成功发起图文复诊,请耐心等待医生接单。如长时间未接诊,建议选择其他医生"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    first = outpatientDO.getConsumerName() + ",您好!您已成功发起图文复诊"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                }else if ("16".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    title = "视频复诊"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    contentMsg =  "您已成功发起视频复诊,请耐心等待医生接单。如长时间未接诊,建议选择其他医生"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    first = outpatientDO.getConsumerName() + ",您好!您已成功发起视频复诊"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                }else if ("1".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    title = "图文咨询"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    contentMsg =  "您已成功发起图文咨询,请耐心等待医生接单。如长时间未接诊,建议选择其他医生"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    first = outpatientDO.getConsumerName() + ",您好!您已成功发起图文咨询"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                }else if ("17".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    title = "视频咨询"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    contentMsg = "您已成功发起视频咨询,请耐心等待医生接单。如长时间未接诊,建议选择其他医生"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    first = outpatientDO.getConsumerName() + ",您好!您已成功发起视频咨询"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                }else { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -5665,6 +5704,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                logger.info("paySuccess诊查费支付成功推送模板消息:outpatientId="+outpatientId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if("xm_dsyy_wx".equalsIgnoreCase(wechatId)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    sendSms(doctorDO.getMobile(),"医生您好,患者"+outpatientDO.getPatientName()+"向您发起了"+title+",请及时前往互联网医院查看并答复。","2"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            }else if ("prescriptionPayRemind".equalsIgnoreCase(titelType)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                //开具处方后向患者发送支付提醒 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                first = outpatientDO.getConsumerName() + ",您好! 医生已为您开具处方,请及时支付。"; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -6346,6 +6388,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "room.patient_name AS \"name\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "outpatient.patient_name AS \"outPatientName\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "outpatient.patient AS \"outPatient\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "outpatient.card_no AS \"cardNo\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "patient.sex AS \"sex\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "patient.idcard AS \"idcard\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "patient.photo AS \"photo\"," + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -9073,6 +9116,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            JSONObject data = new JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            BasePatientDO patient = basePatientDao.findById(outpatient.getPatient()).orElse(null); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            BaseDoctorDO doctor = baseDoctorDao.findById(outpatient.getDoctor()).orElse(null); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String title = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //1.在线复诊2.协同门诊 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if ("2".equals(outpatient.getOutpatientType())) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -9146,9 +9190,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    ykyyService.pushNotificationToYktPatient(patient.getYktId(), systemMessageDO.getTitle(), data.get("msg").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if("xm_dsyy_wx".equalsIgnoreCase(wechatId)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    sendSms(patient.getMobile(),"医生您好,患者"+outpatient.getPatientName()+"向您发起了"+title+",请及时查看","2"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } else if ("1".equals(outpatient.getOutpatientType()))  {        //在线复诊 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                //1.图文 2.视频 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if ("1".equals(outpatient.getType())) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -9174,8 +9216,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                wlyyHttpLogDao.save(wlyyHttpLogDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    }else  if("xm_dsyy_wx".equalsIgnoreCase(wechatId)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        sendSms(patient.getMobile(),"医生您好,患者"+outpatient.getPatientName()+"向您发起了图文问诊,请及时查看","2"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    systemMessageDO.setTitle("视频复诊预约成功"); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -12172,6 +12212,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    if (null!=businessOrderDO){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        businessOrders.add(businessOrderDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    //物流信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    WlyyPrescriptionExpressageDO expressageDO = prescriptionExpressageDao.findByOupatientId(vo.getOutpatientId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    if (expressageDO!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        vo.setOneselfPickupFlg(expressageDO.getOneselfPickupFlg()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 |