|  | @ -180,7 +180,7 @@ public class HealthCareService {
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 2.3.1	医师身份验证(处方权,多点执业等)
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public void doctorAuthentication(String doctorId) throws Exception{
 | 
	
		
			
				|  |  |     public String doctorAuthentication(String doctorId) throws Exception{
 | 
	
		
			
				|  |  |         BaseDoctorDO doctorDO = doctorDao.findOne(doctorId);
 | 
	
		
			
				|  |  |         if (doctorDO == null){
 | 
	
		
			
				|  |  |             throw new Exception("医生不存在");
 | 
	
	
		
			
				|  | @ -195,11 +195,22 @@ public class HealthCareService {
 | 
	
		
			
				|  |  |         data.put("his_dept_name",doctorHospitalDO.getDeptName());//his内部科室名称
 | 
	
		
			
				|  |  | //        data.put("dept_code","");//医保科室编码	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");//医师证件类型
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         requestYlz(data,"N20.17.02.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();
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         return result;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
	
		
			
				|  | @ -207,7 +218,7 @@ public class HealthCareService {
 | 
	
		
			
				|  |  |      * @param doctorId
 | 
	
		
			
				|  |  |      * @throws Exception
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public void doctorFaceCheckInAddress(String doctorId)throws Exception{
 | 
	
		
			
				|  |  |     public String doctorFaceCheckInAddress(String doctorId)throws Exception{
 | 
	
		
			
				|  |  |         WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findOne("ylzConfigFaceReturnUrl");
 | 
	
		
			
				|  |  |         if(hospitalSysDictDO == null){
 | 
	
		
			
				|  |  |             throw new Exception("未配置回调地址");
 | 
	
	
		
			
				|  | @ -221,13 +232,23 @@ public class HealthCareService {
 | 
	
		
			
				|  |  |         data.put("idcard",doctorDO.getIdcard());//医师证件号
 | 
	
		
			
				|  |  |         data.put("cert_type","01");//医师证件类型
 | 
	
		
			
				|  |  |         data.put("redirect_url",hospitalSysDictDO.getDictValue());//回调地址
 | 
	
		
			
				|  |  |         requestYlz(data,"N20.17.02.02","医师人脸签到表单地址");
 | 
	
		
			
				|  |  |         String result = requestYlz(data,"N20.17.02.02","医师人脸签到表单地址");
 | 
	
		
			
				|  |  |         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.3.3	获取医师人脸签到数据
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public void doctorFaceCheckInData(String doctorId)throws Exception{
 | 
	
		
			
				|  |  |     public String doctorFaceCheckInData(String doctorId)throws Exception{
 | 
	
		
			
				|  |  |         BaseDoctorDO doctorDO = doctorDao.findOne(doctorId);
 | 
	
		
			
				|  |  |         if (doctorDO == null){
 | 
	
		
			
				|  |  |             throw new Exception("医生不存在");
 | 
	
	
		
			
				|  | @ -236,13 +257,23 @@ public class HealthCareService {
 | 
	
		
			
				|  |  |         data.put("name",doctorDO.getName());//医师姓名
 | 
	
		
			
				|  |  |         data.put("idcard",doctorDO.getIdcard());//医师证件号
 | 
	
		
			
				|  |  |         data.put("cert_type","01");//医师证件类型
 | 
	
		
			
				|  |  |         requestYlz(data,"N20.17.02.05","获取医师人脸签到数据");
 | 
	
		
			
				|  |  |         String result = requestYlz(data,"N20.17.02.05","获取医师人脸签到数据");
 | 
	
		
			
				|  |  |         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 事前提醒
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public void advanceWarning(String outpatientId) throws Exception{
 | 
	
		
			
				|  |  |     public String advanceWarning(String outpatientId) throws Exception{
 | 
	
		
			
				|  |  |         WlyyOutpatientDO outpatientDO = outpatientDao.findOne(outpatientId);
 | 
	
		
			
				|  |  |         if (outpatientDO == null){
 | 
	
		
			
				|  |  |             throw new Exception("事前提醒失败:门诊信息不存在");
 | 
	
	
		
			
				|  | @ -349,14 +380,24 @@ public class HealthCareService {
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         data.put("mxlist",mxlist);
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         requestYlz(data,"N20.17.03.03","事前提醒");
 | 
	
		
			
				|  |  |         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;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 2.4.2	医师开方上传
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public void doctorPrescriptionUpload(String prescriptionId)throws Exception{
 | 
	
		
			
				|  |  |     public String doctorPrescriptionUpload(String prescriptionId)throws Exception{
 | 
	
		
			
				|  |  |         WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(prescriptionId);
 | 
	
		
			
				|  |  |         if (wlyyPrescriptionDO == null){
 | 
	
		
			
				|  |  |             throw new Exception("续方信息不存在");
 | 
	
	
		
			
				|  | @ -482,13 +523,23 @@ public class HealthCareService {
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         data.put("mxlist",mxlist);
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         requestYlz(data,"N20.17.03.01","医师开方上传");
 | 
	
		
			
				|  |  |         String result = requestYlz(data,"N20.17.03.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();
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         return result;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 2.4.3	医师开方上传取消(N20.17.03.06)
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public void doctorPrescriptionUploadCancle(String prescriptionId,String cancelReason)throws Exception{
 | 
	
		
			
				|  |  |     public String doctorPrescriptionUploadCancle(String prescriptionId,String cancelReason)throws Exception{
 | 
	
		
			
				|  |  |         WlyyPrescriptionDO prescriptionDO = prescriptionDao.findOne(prescriptionId);
 | 
	
		
			
				|  |  |         JSONObject data = new JSONObject();
 | 
	
		
			
				|  |  |         data.put("transaction_no","");//处方上传流水号  	String	Y
 | 
	
	
		
			
				|  | @ -501,13 +552,23 @@ public class HealthCareService {
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         data.put("data_source","");//数据来源	String	Y	参见编码附件
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         requestYlz(data,"N20.17.03.06","医师开方上传取消");
 | 
	
		
			
				|  |  |         String result = requestYlz(data,"N20.17.03.06","医师开方上传取消");
 | 
	
		
			
				|  |  |         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.6.1	电子处方订单接收(N20.17.05.02)
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public void electronicPrescriptionReceiving(String outpatientId)throws Exception{
 | 
	
		
			
				|  |  |     public String electronicPrescriptionReceiving(String outpatientId)throws Exception{
 | 
	
		
			
				|  |  |         WlyyOutpatientDO outpatientDO = outpatientDao.findOne(outpatientId);
 | 
	
		
			
				|  |  |         if (outpatientDO == null){
 | 
	
		
			
				|  |  |             throw new Exception("门诊信息不存在");
 | 
	
	
		
			
				|  | @ -583,13 +644,23 @@ public class HealthCareService {
 | 
	
		
			
				|  |  | //        item_code	医保项目编码	String	Y
 | 
	
		
			
				|  |  | //        supervision_code	药品电子监管码	String	N	非必填
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         requestYlz(data,"N20.17.05.02","电子处方订单接收");
 | 
	
		
			
				|  |  |         String result = requestYlz(data,"N20.17.05.02","电子处方订单接收");
 | 
	
		
			
				|  |  |         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.6.2	电子处方订单取消(N20.17.05.03)
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public void electronicPrescriptionCancle(String outpatientId)throws Exception{
 | 
	
		
			
				|  |  |     public String electronicPrescriptionCancle(String outpatientId)throws Exception{
 | 
	
		
			
				|  |  |         WlyyOutpatientDO outpatientDO = outpatientDao.findOne(outpatientId);
 | 
	
		
			
				|  |  |         if (outpatientDO == null){
 | 
	
		
			
				|  |  |             throw new Exception("门诊信息不存在");
 | 
	
	
		
			
				|  | @ -609,13 +680,23 @@ public class HealthCareService {
 | 
	
		
			
				|  |  |         data.put("cancel_time","");//订单取消时间  取消时必填
 | 
	
		
			
				|  |  |         data.put("cancel_reason","");//取消原因
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         requestYlz(data,"N20.17.05.03","电子处方订单取消");
 | 
	
		
			
				|  |  |         String result = requestYlz(data,"N20.17.05.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;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 2.6.3 获取处方流转平台药师审方结果(N20.17.05.04)
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public void pharmacistReviewResults(String outpatientId)throws Exception{
 | 
	
		
			
				|  |  |     public String pharmacistReviewResults(String outpatientId)throws Exception{
 | 
	
		
			
				|  |  |         WlyyOutpatientDO outpatientDO = outpatientDao.findOne(outpatientId);
 | 
	
		
			
				|  |  |         if (outpatientDO == null){
 | 
	
		
			
				|  |  |             throw new Exception("门诊信息不存在");
 | 
	
	
		
			
				|  | @ -628,7 +709,17 @@ public class HealthCareService {
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         data.put("prescription_code",wlyyPrescriptionDOS.get(0).getRealOrder());//医院处方编号
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         String response = requestYlz(data,"N20.17.05.04","获取处方流转平台药师审方结果");
 | 
	
		
			
				|  |  |         String result = requestYlz(data,"N20.17.05.04","获取处方流转平台药师审方结果");
 | 
	
		
			
				|  |  |         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;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     public String getYlzToken() throws Exception {
 |