|  | @ -286,6 +286,38 @@ public class HealthCareService {
 | 
	
		
			
				|  |  |         return result;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 2.3.4	医师人脸签到微信小程序二维码(N20.17.02.06)
 | 
	
		
			
				|  |  |      * @param doctorId
 | 
	
		
			
				|  |  |      * @throws Exception
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public String doctorFaceCheckInAddressBase64(String doctorId)throws Exception{
 | 
	
		
			
				|  |  |         WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findOne("ylzConfigFaceReturnUrl");
 | 
	
		
			
				|  |  |         if(hospitalSysDictDO == null){
 | 
	
		
			
				|  |  |             throw new Exception("未配置回调地址");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         BaseDoctorDO doctorDO = doctorDao.findOne(doctorId);
 | 
	
		
			
				|  |  |         if (doctorDO == null){
 | 
	
		
			
				|  |  |             throw new Exception("医生不存在");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         JSONObject data = new JSONObject();
 | 
	
		
			
				|  |  |         data.put("name",doctorDO.getName());//医师姓名
 | 
	
		
			
				|  |  |         data.put("idcard",doctorDO.getIdcard());//医师证件号
 | 
	
		
			
				|  |  |         data.put("cert_type","01");//医师证件类型
 | 
	
		
			
				|  |  |         data.put("redirect_url",hospitalSysDictDO.getDictValue());//回调地址
 | 
	
		
			
				|  |  |         String result = requestYlz(data,"N20.17.02.06","2.3.3\t获取医师人脸签到数据");
 | 
	
		
			
				|  |  |         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;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 2.4.1 事前提醒
 | 
	
		
			
				|  |  |      */
 | 
	
	
		
			
				|  | @ -365,8 +397,10 @@ public class HealthCareService {
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         JSONObject data;
 | 
	
		
			
				|  |  |         //获取his处方信息
 | 
	
		
			
				|  |  |         String infoResponse = xzzxEntranceService.presUpload(icCardNo,his_serial,org_code);
 | 
	
		
			
				|  |  |         JSONObject infoObject = JSONObject.parseObject(infoResponse);
 | 
	
		
			
				|  |  |         JSONObject infoObject= xzzxEntranceService.presUploadToEntrance(icCardNo,his_serial,org_code);
 | 
	
		
			
				|  |  |        /* if (infoObject!=null){
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         }*/
 | 
	
		
			
				|  |  |         if("0".equals(infoObject.getString("ret_code"))){
 | 
	
		
			
				|  |  |             data = infoObject;
 | 
	
		
			
				|  |  |         }else {
 | 
	
	
		
			
				|  | @ -406,6 +440,26 @@ public class HealthCareService {
 | 
	
		
			
				|  |  |         return result;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 2.4.2	医师开方上传
 | 
	
		
			
				|  |  |      *
 | 
	
		
			
				|  |  |      * @param prescriptionId
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      * @throws Exception
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public String doctorPrescriptionUploadEntrance(String prescriptionId) throws Exception{
 | 
	
		
			
				|  |  |         String result = "";
 | 
	
		
			
				|  |  |         String response="";
 | 
	
		
			
				|  |  |         String url = entranceHealthCareUrl+"doctorPrescriptionUpload?prescriptionId="+prescriptionId;
 | 
	
		
			
				|  |  |         response = httpClientUtil.get(url,"GBK");
 | 
	
		
			
				|  |  |         logger.info("response:"+response);
 | 
	
		
			
				|  |  |         JSONObject object = JSONObject.parseObject(response);
 | 
	
		
			
				|  |  |         if (object.getInteger("status")==200){
 | 
	
		
			
				|  |  |             result = object.getString("obj");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         return result;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 2.4.3	医师开方上传取消(N20.17.03.06)
 | 
	
		
			
				|  |  |      */
 | 
	
	
		
			
				|  | @ -439,6 +493,26 @@ public class HealthCareService {
 | 
	
		
			
				|  |  |         return result;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 2.4.3	医师开方上传取消(N20.17.03.06)
 | 
	
		
			
				|  |  |      *
 | 
	
		
			
				|  |  |      * @param prescriptionId
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      * @throws Exception
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public String doctorPrescriptionUploadCancleEntrance(String prescriptionId,String cancelReason) throws Exception{
 | 
	
		
			
				|  |  |         String result = "";
 | 
	
		
			
				|  |  |         String response="";
 | 
	
		
			
				|  |  |         String url = entranceHealthCareUrl+"doctorPrescriptionUploadCancle?prescriptionId="+prescriptionId+"&cancelReason"+cancelReason;
 | 
	
		
			
				|  |  |         response = httpClientUtil.get(url,"GBK");
 | 
	
		
			
				|  |  |         logger.info("response:"+response);
 | 
	
		
			
				|  |  |         JSONObject object = JSONObject.parseObject(response);
 | 
	
		
			
				|  |  |         if (object.getInteger("status")==200){
 | 
	
		
			
				|  |  |             result = object.getString("obj");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         return result;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 2.6.1	电子处方订单接收(N20.17.05.02)
 | 
	
		
			
				|  |  |      */
 | 
	
	
		
			
				|  | @ -896,6 +970,59 @@ public class HealthCareService {
 | 
	
		
			
				|  |  |         return result;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 2.2.3医保在线服务授权表单(H5表单/小程序)(N20.17.01.03)
 | 
	
		
			
				|  |  |      *
 | 
	
		
			
				|  |  |      * @param patient
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      * @throws Exception
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public String medicareOnlineBase64(String patient) throws Exception{
 | 
	
		
			
				|  |  |         String funid = "N20.17.01.03";
 | 
	
		
			
				|  |  |         WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("ylzConfigRedirectUrl");
 | 
	
		
			
				|  |  |         if (hospitalSysDictDO==null){
 | 
	
		
			
				|  |  |             throw new Exception("回调地址为空!");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         BasePatientDO patientDO = patientDao.findById(patient);
 | 
	
		
			
				|  |  |         if (patientDO==null){
 | 
	
		
			
				|  |  |             throw new Exception("患者信息不存在");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(patient);
 | 
	
		
			
				|  |  |         if (patientMappingDO==null){
 | 
	
		
			
				|  |  |             throw new Exception("患者his信息不存在");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         JSONObject data = new JSONObject();
 | 
	
		
			
				|  |  |         data.put("service_id","100000");
 | 
	
		
			
				|  |  |         data.put("name",patientDO.getName());
 | 
	
		
			
				|  |  |         data.put("idcard",patientDO.getIdcard());
 | 
	
		
			
				|  |  |         data.put("cert_type","01");//TODO
 | 
	
		
			
				|  |  |         data.put("phone",patientDO.getMobile());
 | 
	
		
			
				|  |  |         data.put("user_id",patientMappingDO.getMappingCode());
 | 
	
		
			
				|  |  |         data.put("redirect_url",hospitalSysDictDO.getDictValue());
 | 
	
		
			
				|  |  |         String result = requestYlz(data,funid,"医保在线服务授权表单");
 | 
	
		
			
				|  |  |         return result;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 2.2.3医保在线服务授权表单(H5表单/小程序)(N20.17.01.03)
 | 
	
		
			
				|  |  |      *
 | 
	
		
			
				|  |  |      * @param patient
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      * @throws Exception
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public String medicareOnlineBase64ToEntrance(String patient) throws Exception{
 | 
	
		
			
				|  |  |         String result = "";
 | 
	
		
			
				|  |  |         String response="";
 | 
	
		
			
				|  |  |         String url = entranceHealthCareUrl+"medicareOnline?patient="+patient;
 | 
	
		
			
				|  |  |         response = httpClientUtil.get(url,"GBK");
 | 
	
		
			
				|  |  |         logger.info("response:"+response);
 | 
	
		
			
				|  |  |         JSONObject object = JSONObject.parseObject(response);
 | 
	
		
			
				|  |  |         if (object.getInteger("status")==200){
 | 
	
		
			
				|  |  |             result = object.getString("obj");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         return result;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 2.5.1医保挂号(N20.17.04.01)
 | 
	
		
			
				|  |  |      *
 | 
	
	
		
			
				|  | @ -1433,6 +1560,80 @@ public class HealthCareService {
 | 
	
		
			
				|  |  |         return result;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 2.5.8获取医保结算页面地址(N20.17.04.08)
 | 
	
		
			
				|  |  |      *
 | 
	
		
			
				|  |  |      * 返回值
 | 
	
		
			
				|  |  |      *
 | 
	
		
			
				|  |  |      * @param registerNo 挂号号
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      * @throws Exception
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public String getSettlementResultUrlBase64(String registerNo) throws Exception{
 | 
	
		
			
				|  |  |         String funid = "N20.17.04.08";
 | 
	
		
			
				|  |  |         JSONObject data = new JSONObject();
 | 
	
		
			
				|  |  |         YlzMedicalRelationDO ylzMedicalRelationDO = ylzMedicailRelationDao.findByOutpatient(registerNo);
 | 
	
		
			
				|  |  |         if (ylzMedicalRelationDO==null){
 | 
	
		
			
				|  |  |             throw new Exception("获取医保结算页面地址:结算信息为空!");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         WlyyHospitalSysDictDO wlyyHospitalSysDictDO = hospitalSysDictDao.findById("ResultRedirectUrl");
 | 
	
		
			
				|  |  |         if (wlyyHospitalSysDictDO==null){
 | 
	
		
			
				|  |  |             throw new Exception("获取医保结算页面地址失败:回调地址为空");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         data.put("region_code",ylzMedicalRelationDO.getRegionCode());//参保地区划代码
 | 
	
		
			
				|  |  |         data.put("name",ylzMedicalRelationDO.getName());//姓名
 | 
	
		
			
				|  |  |         data.put("idcard",ylzMedicalRelationDO.getIdcard());//证件号码
 | 
	
		
			
				|  |  |         data.put("cert_type",ylzMedicalRelationDO.getCertType());//证件类型
 | 
	
		
			
				|  |  |         data.put("medical_mode",ylzMedicalRelationDO.getMedicalMode());//医疗就诊方式
 | 
	
		
			
				|  |  |         data.put("medical_type",ylzMedicalRelationDO.getMedicalType());//医疗类别
 | 
	
		
			
				|  |  |         data.put("insurance_serial",ylzMedicalRelationDO.getInsuranceSerial());//
 | 
	
		
			
				|  |  |         data.put("his_bill_serial",ylzMedicalRelationDO.getHisBillSerial());//his收费单据流水号
 | 
	
		
			
				|  |  |         data.put("date",ylzMedicalRelationDO.getDate());//实际就诊日期
 | 
	
		
			
				|  |  |         data.put("leave_method","09");//离院方式
 | 
	
		
			
				|  |  |         data.put("pre_count",ylzMedicalRelationDO.getPreCount());//处方项目数
 | 
	
		
			
				|  |  |         data.put("total_amount",ylzMedicalRelationDO.getTotalAmount());//医疗费总金额
 | 
	
		
			
				|  |  |         data.put("person_cash",ylzMedicalRelationDO.getPersonCash());//个人现金支付金额(实付现金)
 | 
	
		
			
				|  |  |         data.put("person_account",ylzMedicalRelationDO.getPersonAccount());//个人账户支付金额
 | 
	
		
			
				|  |  |         data.put("fund_price",ylzMedicalRelationDO.getFundPrice());//基金支付总额
 | 
	
		
			
				|  |  |         data.put("data_source",ylzMedicalRelationDO.getDataSource());//数据来源
 | 
	
		
			
				|  |  |         data.put("his_serial",ylzMedicalRelationDO.getHisSerial());//his流水号
 | 
	
		
			
				|  |  |         data.put("doctor_level",ylzMedicalRelationDO.getDoctorLevel());//医师诊查费等级
 | 
	
		
			
				|  |  |         data.put("redirect_url",wlyyHospitalSysDictDO.getDictValue());//回调地址
 | 
	
		
			
				|  |  |         String result = requestYlz(data,funid,"获取医保结算结果");
 | 
	
		
			
				|  |  |         if (result==null){
 | 
	
		
			
				|  |  |             throw new Exception("获取医保结算结果失败!");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         return result;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 2.5.8获取医保结算页面地址(N20.17.04.08)
 | 
	
		
			
				|  |  |      *
 | 
	
		
			
				|  |  |      * 返回值
 | 
	
		
			
				|  |  |      *
 | 
	
		
			
				|  |  |      * @param registerNo 挂号号
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      * @throws Exception
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public String getSettlementResultUrlBase64ToEntrance(String registerNo) throws Exception{
 | 
	
		
			
				|  |  |         String result = "";
 | 
	
		
			
				|  |  |         String response="";
 | 
	
		
			
				|  |  |         String url = entranceHealthCareUrl+"getSettlementResultUrlBase64?registerNo="+registerNo;
 | 
	
		
			
				|  |  |         response = httpClientUtil.get(url,"GBK");
 | 
	
		
			
				|  |  |         logger.info("response:"+response);
 | 
	
		
			
				|  |  |         JSONObject object = JSONObject.parseObject(response);
 | 
	
		
			
				|  |  |         if (object.getInteger("status")==200){
 | 
	
		
			
				|  |  |             result = object.getString("obj");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         return result;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 2.5.8获取医保结算结果(N20.17.04.08)
 | 
	
		
			
				|  |  |      *
 |