| 
															
																@ -280,55 +280,63 @@ public class HealthCareService { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    /** 
															 | 
															
															 | 
															
																    /** 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     * 2.4.1 事前提醒 
															 | 
															
															 | 
															
																     * 2.4.1 事前提醒 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     */ 
															 | 
															
															 | 
															
																     */ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    public String advanceWarning(String outpatientId) throws Exception{ 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        WlyyOutpatientDO outpatientDO = outpatientDao.findOne(outpatientId); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        if (outpatientDO == null){ 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            throw new Exception("事前提醒失败:门诊信息不存在"); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        } 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("ylzConfigOrgCode"); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        if(hospitalSysDictDO == null){ 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            throw new Exception("未配置网点编号"); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        } 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        String icCardNo = outpatientDO.getCardNo(); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        String his_serial = outpatientDO.getRegisterNo(); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        String org_code = hospitalSysDictDO.getDictCode(); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    public String advanceWarning(String prescriptionId){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        try { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(prescriptionId); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            if (wlyyPrescriptionDO == null){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                throw new Exception("续方信息不存在"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            WlyyOutpatientDO outpatientDO = outpatientDao.findOne(wlyyPrescriptionDO.getOutpatientId()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            if (outpatientDO == null){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                throw new Exception("门诊信息不存在"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("ylzConfigOrgCode"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            if(hospitalSysDictDO == null){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                throw new Exception("未配置网点编号"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        JSONObject data; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        //获取his处方信息 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        String getSettleInfoUrl = entranceUrl + "getSettleInfo?icCardNo="+icCardNo+"&his_serial="+his_serial+"&org_code="+org_code; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        String infoResponse = httpClientUtil.get(getSettleInfoUrl,"GBK"); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        logger.info("处方infoResponse:"+infoResponse); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        JSONObject infoObject = JSONObject.parseObject(infoResponse); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        if (infoObject.getString("status").equalsIgnoreCase("200")) { 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            JSONObject obj = infoObject.getJSONObject("obj"); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            if("0".equals(obj.getString("ret_code"))){ 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                data = obj; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            String icCardNo = outpatientDO.getCardNo(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            String his_serial = outpatientDO.getRegisterNo(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            String org_code = hospitalSysDictDO.getDictCode(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            JSONObject data; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            //获取his处方信息 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            String getRecipeInfoUrl = entranceUrl + "getRecipeInfo?icCardNo="+icCardNo+"&his_serial="+his_serial+"&org_code="+org_code; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            String infoResponse = httpClientUtil.get(getRecipeInfoUrl,"GBK"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            logger.info("处方infoResponse:"+infoResponse); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            JSONObject infoObject = JSONObject.parseObject(infoResponse); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            if (infoObject.getString("status").equalsIgnoreCase("200")) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                JSONObject obj = infoObject.getJSONObject("obj"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                if("0".equals(obj.getString("ret_code"))){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    data = obj; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                }else { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    throw new Exception("获取his处方信息失败:"+obj.getString("ret_mess")); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            }else { 
															 | 
															
															 | 
															
																            }else { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                throw new Exception("获取his处方信息失败:"+obj.getString("ret_mess")); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                throw new Exception("获取his处方信息失败"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            } 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        }else { 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            throw new Exception("获取his处方信息失败"); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        } 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        data.remove("ret_code"); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        data.remove("ret_mess"); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        data.remove("log_no"); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            data.remove("ret_code"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            data.remove("ret_mess"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            data.remove("log_no"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        data.put("ticket_no","");//	单据流水号 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            data.put("ticket_no","");//	单据流水号 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        String result = requestYlz(data,"N20.17.03.03","事前提醒"); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        if(result == null){ 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            throw new Exception("医保请求失败"); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        } 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        logger.info("事前提醒:"+result); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        JSONObject object = JSONObject.parseObject(result); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        if (object.getString("flag").equalsIgnoreCase("1")){ 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            JSONObject encryptData = object.getJSONObject("encrypt_data"); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            return encryptData.toJSONString(); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            String result = requestYlz(data,"N20.17.03.03","事前提醒"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            if(result == null){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                throw new Exception("医保请求失败"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            logger.info("事前提醒:"+result); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            JSONObject object = JSONObject.parseObject(result); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            if (object.getString("flag").equalsIgnoreCase("1")){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                JSONObject encryptData = object.getJSONObject("encrypt_data"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                return encryptData.toJSONString(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            return result; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        }catch (Exception e){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            e.printStackTrace(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        } 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        return result; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        return null; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    } 
															 | 
															
															 | 
															
																    } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    /** 
															 | 
															
															 | 
															
																    /** 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -355,8 +363,8 @@ public class HealthCareService { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        JSONObject data; 
															 | 
															
															 | 
															
																        JSONObject data; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        //获取his处方信息 
															 | 
															
															 | 
															
																        //获取his处方信息 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        String getSettleInfoUrl = entranceUrl + "getSettleInfo?icCardNo="+icCardNo+"&his_serial="+his_serial+"&org_code="+org_code; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        String infoResponse = httpClientUtil.get(getSettleInfoUrl,"GBK"); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        String getRecipeInfoUrl = entranceUrl + "getRecipeInfo?icCardNo="+icCardNo+"&his_serial="+his_serial+"&org_code="+org_code; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        String infoResponse = httpClientUtil.get(getRecipeInfoUrl,"GBK"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        logger.info("处方infoResponse:"+infoResponse); 
															 | 
															
															 | 
															
																        logger.info("处方infoResponse:"+infoResponse); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        JSONObject infoObject = JSONObject.parseObject(infoResponse); 
															 | 
															
															 | 
															
																        JSONObject infoObject = JSONObject.parseObject(infoResponse); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        if (infoObject.getString("status").equalsIgnoreCase("200")) { 
															 | 
															
															 | 
															
																        if (infoObject.getString("status").equalsIgnoreCase("200")) { 
															 |