|  | @@ -18,10 +18,7 @@ import thyyxxk.webserver.entity.ResultVo;
 | 
	
		
			
				|  |  |  import thyyxxk.webserver.entity.dictionary.CodeName;
 | 
	
		
			
				|  |  |  import thyyxxk.webserver.entity.drg.AuxiliaryFillingOfDiagnosis;
 | 
	
		
			
				|  |  |  import thyyxxk.webserver.entity.login.UserInfo;
 | 
	
		
			
				|  |  | -import thyyxxk.webserver.entity.zhuyuanyisheng.emr.DischargedEmrModifyApply;
 | 
	
		
			
				|  |  | -import thyyxxk.webserver.entity.zhuyuanyisheng.emr.EmrDataElement;
 | 
	
		
			
				|  |  | -import thyyxxk.webserver.entity.zhuyuanyisheng.emr.EmrDataExtract;
 | 
	
		
			
				|  |  | -import thyyxxk.webserver.entity.zhuyuanyisheng.emr.EmrPatientData;
 | 
	
		
			
				|  |  | +import thyyxxk.webserver.entity.zhuyuanyisheng.emr.*;
 | 
	
		
			
				|  |  |  import thyyxxk.webserver.service.PublicServer;
 | 
	
		
			
				|  |  |  import thyyxxk.webserver.service.externalhttp.emr.EmrEditor;
 | 
	
		
			
				|  |  |  import thyyxxk.webserver.service.redislike.RedisLikeService;
 | 
	
	
		
			
				|  | @@ -40,14 +37,14 @@ public class EmrServer {
 | 
	
		
			
				|  |  |      private final EmrEditor emr;
 | 
	
		
			
				|  |  |      private final PublicServer publicServer;
 | 
	
		
			
				|  |  |      private final LoginDao loginDao;
 | 
	
		
			
				|  |  | -    private final RedisLikeService realtimeService;
 | 
	
		
			
				|  |  | +    private final RedisLikeService redisLikeService;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    public EmrServer(EmrPatientDao dao, EmrEditor emr, PublicServer publicServer, LoginDao loginDao, RedisLikeService realtimeService) {
 | 
	
		
			
				|  |  | +    public EmrServer(EmrPatientDao dao, EmrEditor emr, PublicServer publicServer, LoginDao loginDao, RedisLikeService redisLikeService) {
 | 
	
		
			
				|  |  |          this.dao = dao;
 | 
	
		
			
				|  |  |          this.emr = emr;
 | 
	
		
			
				|  |  |          this.publicServer = publicServer;
 | 
	
		
			
				|  |  |          this.loginDao = loginDao;
 | 
	
		
			
				|  |  | -        this.realtimeService = realtimeService;
 | 
	
		
			
				|  |  | +        this.redisLikeService = redisLikeService;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      /**
 | 
	
	
		
			
				|  | @@ -86,7 +83,7 @@ public class EmrServer {
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      public List<JSONObject> getDeptTemplate() {
 | 
	
		
			
				|  |  | -        UserInfo user = realtimeService.getUserInfoByToken();
 | 
	
		
			
				|  |  | +        UserInfo user = redisLikeService.getUserInfoByToken();
 | 
	
		
			
				|  |  |          JSONArray data = emr.getDeptList(user.getDeptCode());
 | 
	
		
			
				|  |  |          return emrToTree(data);
 | 
	
		
			
				|  |  |      }
 | 
	
	
		
			
				|  | @@ -623,5 +620,45 @@ public class EmrServer {
 | 
	
		
			
				|  |  |          return ResultVoUtil.success(emr.getHistory(documentId));
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    public ResultVo<List<MedicalHistoryPrompts>> getEmrTips() {
 | 
	
		
			
				|  |  | +        return ResultVoUtil.success(dao.selectEmrTips(TokenUtil.getTokenUserId()));
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    public ResultVo<String> addEmrTips(MedicalHistoryPrompts param) {
 | 
	
		
			
				|  |  | +        log.info("数据:{}", JSON.toJSONString(param));
 | 
	
		
			
				|  |  | +        UserInfo userInfo = redisLikeService.getUserInfoByToken();
 | 
	
		
			
				|  |  | +        param.setDept(userInfo.getDeptCode());
 | 
	
		
			
				|  |  | +        param.setCreatorId(userInfo.getCode());
 | 
	
		
			
				|  |  | +        dao.insertEmrTips(param);
 | 
	
		
			
				|  |  | +        return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION);
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    public ResultVo<String> updateEmrTips(MedicalHistoryPrompts param) {
 | 
	
		
			
				|  |  | +        if (param.getId() == null) {
 | 
	
		
			
				|  |  | +            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "id 为空无法更新。");
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        dao.updateEmrTips(param);
 | 
	
		
			
				|  |  | +        return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION);
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    public ResultVo<String> deleteEmrTips(Integer id) {
 | 
	
		
			
				|  |  | +        dao.delEmrTips(id);
 | 
	
		
			
				|  |  | +        return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION);
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    /**
 | 
	
		
			
				|  |  | +     * 在病程记录中获取文本数据
 | 
	
		
			
				|  |  | +     *
 | 
	
		
			
				|  |  | +     * @param name 名称
 | 
	
		
			
				|  |  | +     * @return 返回数据
 | 
	
		
			
				|  |  | +     */
 | 
	
		
			
				|  |  | +    public ResultVo<List<MedicalHistoryPrompts>> getEmrTipsData(String name, int typeCode) {
 | 
	
		
			
				|  |  | +        QueryWrapper<?> qw = new QueryWrapper<>();
 | 
	
		
			
				|  |  | +        qw.like("query_key", name)
 | 
	
		
			
				|  |  | +                .eq("type_code", typeCode)
 | 
	
		
			
				|  |  | +                .orderByDesc("count");
 | 
	
		
			
				|  |  | +        return ResultVoUtil.success(dao.getEmrTipsData(qw));
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  }
 |