|  | @ -527,5 +527,86 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  | 		return success(session_id);
 | 
	
		
			
				|  |  | 	}
 | 
	
		
			
				|  |  | 	
 | 
	
		
			
				|  |  | 	@GetMapping(value = BaseHospitalRequestMapping.DodtorIM.expertConsultRecords)
 | 
	
		
			
				|  |  | 	@ApiOperation(value = "(健康咨询)医生咨询记录查询")
 | 
	
		
			
				|  |  | 	public Envelop expertConsultRecords(
 | 
	
		
			
				|  |  | 			@ApiParam(name = "patient", value = "居民CODE")
 | 
	
		
			
				|  |  | 			@RequestParam(value = "patient",required = true) String patient,
 | 
	
		
			
				|  |  | 			@ApiParam(name = "doctor", value = "医生id")
 | 
	
		
			
				|  |  | 			@RequestParam(value = "doctor",required = true) String doctor,
 | 
	
		
			
				|  |  | 			@ApiParam(name = "title", value = "咨询标题关键字")
 | 
	
		
			
				|  |  | 			@RequestParam(value = "title",required = false) String title,
 | 
	
		
			
				|  |  | 			@ApiParam(name = "id", value = "咨询ID")
 | 
	
		
			
				|  |  | 			@RequestParam(value = "id",required = false) String id,
 | 
	
		
			
				|  |  | 			@ApiParam(name = "type", value = "咨询类型")
 | 
	
		
			
				|  |  | 			@RequestParam(value = "type",required = true) Integer type,
 | 
	
		
			
				|  |  | 			@ApiParam(name = "status", value = "咨询状态:0全部,1候诊中,2就诊中,3结束")
 | 
	
		
			
				|  |  | 			@RequestParam(value = "status",required = true) Integer status,
 | 
	
		
			
				|  |  | 			@ApiParam(name = "start_time", value = "开始时间 YYYY-MM-DD HH:MM:SS")
 | 
	
		
			
				|  |  | 			@RequestParam(value = "start_time",required = false) String start_time,
 | 
	
		
			
				|  |  | 			@ApiParam(name = "end_time", value = "结束时间 YYYY-MM-DD HH:MM:SS")
 | 
	
		
			
				|  |  | 			@RequestParam(value = "end_time",required = false) String end_time,
 | 
	
		
			
				|  |  | 			@ApiParam(name = "page", value = "第几页")
 | 
	
		
			
				|  |  | 			@RequestParam(value = "page",required = false) int page,
 | 
	
		
			
				|  |  | 			@ApiParam(name = "pagesize", value = "分页大小")
 | 
	
		
			
				|  |  | 			@RequestParam(value = "pagesize",required = false) int pagesize
 | 
	
		
			
				|  |  | 	)throws Exception{
 | 
	
		
			
				|  |  | 		JSONArray array = new JSONArray();
 | 
	
		
			
				|  |  | 		List<ConsultVO> data = imService.findexpertConsultRecordByDoctor(doctor, id,type,status, page,pagesize, title,start_time,end_time,patient);
 | 
	
		
			
				|  |  | 		
 | 
	
		
			
				|  |  | 		if (data != null) {
 | 
	
		
			
				|  |  | 			for (ConsultVO consult : data) {
 | 
	
		
			
				|  |  | 				if (consult == null) {
 | 
	
		
			
				|  |  | 					continue;
 | 
	
		
			
				|  |  | 				}
 | 
	
		
			
				|  |  | 				JSONObject json = new JSONObject();
 | 
	
		
			
				|  |  | 				json.put("id", consult.getId());
 | 
	
		
			
				|  |  | 				// 设置咨询类型:1专家咨询,9在线复诊,待扩展,13协同门诊
 | 
	
		
			
				|  |  | 				json.put("type", consult.getType());
 | 
	
		
			
				|  |  | 				
 | 
	
		
			
				|  |  | 				//如果是协同门诊,多返回全科医生的详细信息
 | 
	
		
			
				|  |  | 				if(13 == consult.getType() && StringUtils.isNoneBlank(consult.getGeneralDoctor())){
 | 
	
		
			
				|  |  | 					BaseDoctorDO baseDoctorDO = baseDoctorDao.findById(consult.getGeneralDoctor());
 | 
	
		
			
				|  |  | 					json.put("generalDoctorName", baseDoctorDO.getName());
 | 
	
		
			
				|  |  | 				}
 | 
	
		
			
				|  |  | 				
 | 
	
		
			
				|  |  | 				// 设置显示标题
 | 
	
		
			
				|  |  | 				json.put("title", consult.getTitle());
 | 
	
		
			
				|  |  | 				// 设置主诉
 | 
	
		
			
				|  |  | 				json.put("symptoms", consult.getSymptoms());
 | 
	
		
			
				|  |  | 				// 咨询状态
 | 
	
		
			
				|  |  | 				json.put("status", consult.getStatus());
 | 
	
		
			
				|  |  | 				// 设置咨询日期
 | 
	
		
			
				|  |  | 				json.put("czrq", DateUtil.dateToStrLong(consult.getCzrq()));
 | 
	
		
			
				|  |  | 				//是否评价
 | 
	
		
			
				|  |  | 				json.put("evaluate", consult.getEvaluate());
 | 
	
		
			
				|  |  | 				
 | 
	
		
			
				|  |  | 				//患者ID
 | 
	
		
			
				|  |  | 				json.put("patientId", consult.getPatientId());
 | 
	
		
			
				|  |  | 				//患者性别
 | 
	
		
			
				|  |  | 				json.put("patientsex", consult.getPatientsex());
 | 
	
		
			
				|  |  | 				//患者姓名
 | 
	
		
			
				|  |  | 				json.put("patientName", consult.getPatientName());
 | 
	
		
			
				|  |  | 				//患者年龄
 | 
	
		
			
				|  |  | 				json.put("patientAge", DateUtil.getAgeForIdcard(consult.getPatientIdcard()));
 | 
	
		
			
				|  |  | 				//就诊记录ID
 | 
	
		
			
				|  |  | 				json.put("outpatientId", consult.getOutpatientid());
 | 
	
		
			
				|  |  | 				//图文或者视频类型
 | 
	
		
			
				|  |  | 				json.put("consultType", consult.getConsultType());
 | 
	
		
			
				|  |  | 				//诊断
 | 
	
		
			
				|  |  | 				json.put("icd10Name", consult.getIcd10Name());
 | 
	
		
			
				|  |  | 				
 | 
	
		
			
				|  |  | 				array.add(json);
 | 
	
		
			
				|  |  | 			}
 | 
	
		
			
				|  |  | 		}
 | 
	
		
			
				|  |  | 		
 | 
	
		
			
				|  |  | 		Long total = imService.findexpertConsultRecordByDoctor(doctor, id,type,status,title,start_time,end_time,patient);
 | 
	
		
			
				|  |  | 		
 | 
	
		
			
				|  |  | 		JSONObject result = new JSONObject();
 | 
	
		
			
				|  |  | 		result.put("total",total);
 | 
	
		
			
				|  |  | 		result.put("list",array);
 | 
	
		
			
				|  |  | 		return success(result);
 | 
	
		
			
				|  |  | 	}
 | 
	
		
			
				|  |  | 	
 | 
	
		
			
				|  |  | 	
 | 
	
		
			
				|  |  | }
 |