| 
					
				 | 
			
			
				@ -116,7 +116,7 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					@PostMapping(value = BaseHospitalRequestMapping.DodtorIM.addPrescriptionConsult) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					@ApiOperation(value = "添加复诊咨询", notes = "添加复诊咨询") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					@ApiOperation(value = "添加(复诊咨询,协同门诊)", notes = "添加(复诊咨询,协同门诊)") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public Envelop addPrescriptionConsult(@ApiParam(name = "outpatientCode", value = "HIS就诊记录CODE", defaultValue = "1") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							@RequestParam(value = "outpatientCode", required = true) String outpatientCode, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							@ApiParam(name = "patientCode", value = "复诊居民", defaultValue = "9638fa184ad14a71ba7e4bf931670778") 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -153,50 +153,60 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								//2. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								result = imService.addPrescriptionConsult(outpatientCode, patientCode,doctorCode,consult,reason,type); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//			if (res == -1) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//				failed("该处方存在未审核的处方,无法进行复诊咨询!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				////				return error(-1, "该处方存在未审核的续方,无法进行续方咨询!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//			} if (res == -3) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//				failed("您当天有未完成的处方,不能发起复诊!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				////				return error(-1, "您当天有未完成的续方,不能发起续方咨询!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//			} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//            Doctor doctor = doctorService.findDoctorByCode(consult.getDoctor()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//            // 添加到统计队列 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//            if (consult.getType() == 2) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                DoctorStatisticsTask.getInstance(doctorStatisticsService).put(consult.getDoctor(), 1, 1, 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				// 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//			if(messageService.getMessageNoticeSettingByMessageType(doctor,"1",MessageNoticeSetting.MessageTypeEnum.prescriptionSwitch.getValue())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//				// 推送消息给医生 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//				pushMsgTask.put(doctor, MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM_PRESCRIPTION.D_CT_05.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM_PRESCRIPTION.续方咨询.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM_PRESCRIPTION.您有新的续方咨询.name(), consult.getConsult()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//				try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//					//            新增发送医生助手模板消息 v1.4.0 by wujunjie 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//					Doctor doctor1 = doctorDao.findByCode(doctor); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//					Patient patient = patientDao.findByCode(getRepUID()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//					String doctorOpenID = doctor1.getOpenid(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//					if (StringUtils.isNotEmpty(doctorOpenID)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//						String url = doctorAssistant + "/wlyy/feldsher/sendDoctorTemplates"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//						List<NameValuePair> params = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//						params.add(new BasicNameValuePair("type", "9")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//						params.add(new BasicNameValuePair("openId", doctorOpenID)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//						params.add(new BasicNameValuePair("url", targetUrl)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//						params.add(new BasicNameValuePair("first", doctor1.getName() + "医生您好。您的签约居民"+patient.getName()+"申请线上续方,请尽快审核。")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//						params.add(new BasicNameValuePair("remark", "请进入手机APP查看")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//						SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日 HH:mm"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//						String keywords = "续方审核" + "," + doctor1.getHospitalName()+","+doctor1.getName(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//						params.add(new BasicNameValuePair("keywords", keywords)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				// 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//						httpClientUtil.post(url, params, "UTF-8"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//					} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//				} catch (Exception e) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//					e.printStackTrace(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//				} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//			} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//			BusinessLogs.info(BusinessLogs.BusinessType.consult, getRepUID(), getUID(), new org.json.JSONObject(consult)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							return success("操作成功",result); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					@PostMapping(value = BaseHospitalRequestMapping.PatientIM.add) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					@ApiOperation(value = "居民添加咨询接口", notes = "居民添加咨询接口") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public Envelop add( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							@ApiParam(name = "patient", value = "居民CODE") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							@RequestParam(value = "patient",required = false) String patient, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							@ApiParam(name = "doctor", value = "医生CODE") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							@RequestParam(value = "doctor",required = true) String doctor, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							@ApiParam(name = "when", value = "发病时间") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							@RequestParam(value = "when",required = false) String when, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							@ApiParam(name = "symptoms", value = "主述") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							@RequestParam(value = "symptoms",required = false) String symptoms, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							@ApiParam(name = "images", value = "图片") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							@RequestParam(value = "images",required = false) String images, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							@ApiParam(name = "voice", value = "语音") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							@RequestParam(value = "voice",required = false) String voice, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							@ApiParam(name = "type", value = "咨询类型:1专家咨询 14导诊助手") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							@RequestParam(value = "type",required = false) Integer type)throws Exception{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						System.out.println("symptoms="+symptoms); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						if (type == null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							type = 1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//		if (type != 1 && type != 2) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//			return error(-1, "无效请求!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//		} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						ConsultTeamDo consult = new ConsultTeamDo(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						// 设置咨询类型:1专家咨询  14导诊助手 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						consult.setType(type); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						// 设置发病时间 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						consult.setWhen(when); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						// 设置主要症状 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						consult.setSymptoms(symptoms); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						// 设置咨询图片URL 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						consult.setImages(images); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						// 设置咨询语音URL 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						consult.setVoice(voice); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						// 保存到数据库 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//		int res = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//		JSONArray dts = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						synchronized (patient.intern()){//新增同步方法。设备保存写在service层但是不生效,写在controller层才生效 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							JSONObject re = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							re = imService.addTeamConsult(consult, patient,doctor); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//			res = re.getInteger("status"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//			dts = re.containsKey("doctor")?re.getJSONArray("doctor"):null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						return success("操作成功", consult); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					@PostMapping(value = BaseHospitalRequestMapping.DodtorIM.finish) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					@ApiOperation(value = "医生结束咨询", notes = "医生结束咨询") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public Envelop finish( 
			 |