|  | @ -187,37 +187,42 @@ public class HealthCareService {
 | 
												
													
														
															|  |     /**
 |  |     /**
 | 
												
													
														
															|  |      * 2.3.1	医师身份验证(处方权,多点执业等)
 |  |      * 2.3.1	医师身份验证(处方权,多点执业等)
 | 
												
													
														
															|  |      */
 |  |      */
 | 
												
													
														
															|  |     public String doctorAuthentication(String doctorId) throws Exception{
 |  | 
 | 
												
													
														
															|  |         BaseDoctorDO doctorDO = doctorDao.findOne(doctorId);
 |  | 
 | 
												
													
														
															|  |         if (doctorDO == null){
 |  | 
 | 
												
													
														
															|  |             throw new Exception("医生不存在");
 |  | 
 | 
												
													
														
															|  |         }
 |  | 
 | 
												
													
														
															|  |         List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(doctorId);
 |  | 
 | 
												
													
														
															|  |         if(doctorHospitalDOS.size()<=0){
 |  | 
 | 
												
													
														
															|  |             throw new Exception("未找到医生科室编码");
 |  | 
 | 
												
													
														
															|  |         }
 |  | 
 | 
												
													
														
															|  |         BaseDoctorHospitalDO doctorHospitalDO = doctorHospitalDOS.get(0);
 |  | 
 | 
												
													
														
															|  |         JSONObject data = new JSONObject();
 |  | 
 | 
												
													
														
															|  |         data.put("his_dept_code",doctorHospitalDO.getDeptCode());//his内部科室编码
 |  | 
 | 
												
													
														
															|  |         data.put("his_dept_name",doctorHospitalDO.getDeptName());//his内部科室名称
 |  | 
 | 
												
													
														
															|  | 
 |  |     public String doctorAuthentication(String doctorId){
 | 
												
													
														
															|  | 
 |  |         try {
 | 
												
													
														
															|  | 
 |  |             BaseDoctorDO doctorDO = doctorDao.findOne(doctorId);
 | 
												
													
														
															|  | 
 |  |             if (doctorDO == null){
 | 
												
													
														
															|  | 
 |  |                 throw new Exception("医生不存在");
 | 
												
													
														
															|  | 
 |  |             }
 | 
												
													
														
															|  | 
 |  |             List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(doctorId);
 | 
												
													
														
															|  | 
 |  |             if(doctorHospitalDOS.size()<=0){
 | 
												
													
														
															|  | 
 |  |                 throw new Exception("未找到医生科室编码");
 | 
												
													
														
															|  | 
 |  |             }
 | 
												
													
														
															|  | 
 |  |             BaseDoctorHospitalDO doctorHospitalDO = doctorHospitalDOS.get(0);
 | 
												
													
														
															|  | 
 |  |             JSONObject data = new JSONObject();
 | 
												
													
														
															|  | 
 |  |             data.put("his_dept_code",doctorHospitalDO.getDeptCode());//his内部科室编码
 | 
												
													
														
															|  | 
 |  |             data.put("his_dept_name",doctorHospitalDO.getDeptName());//his内部科室名称
 | 
												
													
														
															|  | //        data.put("dept_code","");//医保科室编码	String	N
 |  | //        data.put("dept_code","");//医保科室编码	String	N
 | 
												
													
														
															|  | //        data.put("dept_name","");//医保科室名称	String	N
 |  | //        data.put("dept_name","");//医保科室名称	String	N
 | 
												
													
														
															|  |         data.put("medical_mode","10");//医疗就诊方式	10	门(急)诊
 |  | 
 | 
												
													
														
															|  |         data.put("name",doctorDO.getName());//医师姓名
 |  | 
 | 
												
													
														
															|  |         data.put("idcard",doctorDO.getIdcard());//医师证件号
 |  | 
 | 
												
													
														
															|  |         data.put("cert_type","01");//医师证件类型
 |  | 
 | 
												
													
														
															|  | 
 |  |             data.put("medical_mode","10");//医疗就诊方式	10	门(急)诊
 | 
												
													
														
															|  | 
 |  |             data.put("name",doctorDO.getName());//医师姓名
 | 
												
													
														
															|  | 
 |  |             data.put("idcard",doctorDO.getIdcard());//医师证件号
 | 
												
													
														
															|  | 
 |  |             data.put("cert_type","01");//医师证件类型
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         String result = requestYlz(data,"N20.17.02.01","医师身份验证");
 |  | 
 | 
												
													
														
															|  |         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.02.01","医师身份验证");
 | 
												
													
														
															|  | 
 |  |             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.getString("is_prescribe");
 | 
												
													
														
															|  | 
 |  |             }
 | 
												
													
														
															|  | 
 |  |             return result;
 | 
												
													
														
															|  | 
 |  |         }catch (Exception e){
 | 
												
													
														
															|  | 
 |  |             e.printStackTrace();
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  |         return result;
 |  | 
 | 
												
													
														
															|  | 
 |  |         return null;
 | 
												
													
														
															|  |     }
 |  |     }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |     /**
 |  |     /**
 |