|  | @ -2873,22 +2873,13 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         return map;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     //组装审药参数并发送到entrance
 | 
	
		
			
				|  |  |     public String checkInputInfo(String prescriptionId) throws Exception{
 | 
	
		
			
				|  |  |     public String checkInputInfo(String payType,String doctor,String patient,List<WlyyPrescriptionDiagnosisDO> diagnosisDOS,List<WlyyPrescriptionInfoDO> infos) throws Exception{
 | 
	
		
			
				|  |  |         JSONObject jsonObject = new JSONObject();
 | 
	
		
			
				|  |  |         //药品信息
 | 
	
		
			
				|  |  |         List<WlyyPrescriptionInfoDO> infos = new ArrayList<>();
 | 
	
		
			
				|  |  |         //诊断信息
 | 
	
		
			
				|  |  |         List<WlyyPrescriptionDiagnosisDO> diagnosisDOS = new ArrayList<>();
 | 
	
		
			
				|  |  |         String tjPrescriptionId = UUID.randomUUID().toString();
 | 
	
		
			
				|  |  |         //先查询处方获得支付方式
 | 
	
		
			
				|  |  |         WlyyPrescriptionDO prescriptionDO = prescriptionDao.findOne(prescriptionId);
 | 
	
		
			
				|  |  |         if (null!=prescriptionDO){
 | 
	
		
			
				|  |  |             infos = prescriptionInfoDao.findByPrescriptionId(prescriptionId,1);
 | 
	
		
			
				|  |  |             diagnosisDOS = prescriptionDiagnosisDao.findByPrescriptionId(prescriptionId,1);
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(prescriptionDO.getDoctor());
 | 
	
		
			
				|  |  |         BaseDoctorDO baseDoctorDO = baseDoctorDao.findById(prescriptionDO.getDoctor());
 | 
	
		
			
				|  |  |         DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctor);
 | 
	
		
			
				|  |  |         BaseDoctorDO baseDoctorDO = baseDoctorDao.findById(doctor);
 | 
	
		
			
				|  |  |         jsonObject.put("DOCTOR_NAME", baseDoctorDO.getName());
 | 
	
		
			
				|  |  |         jsonObject.put("DEPT_CODE", baseDoctorDO.getVisitDept());
 | 
	
		
			
				|  |  |         jsonObject.put("DEPT_NAME", baseDoctorDO.getVisitDeptName());
 | 
	
	
		
			
				|  | @ -2896,8 +2887,8 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
 | 
	
		
			
				|  |  |             jsonObject.put("doctorId", doctorMappingDO.getMappingCode());
 | 
	
		
			
				|  |  |             jsonObject.put("POSITION", baseDoctorDO.getJobTitleName());
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(prescriptionDO.getPatientCode());
 | 
	
		
			
				|  |  |         BasePatientDO basePatientDO = patientDao.findById(prescriptionDO.getPatientCode());
 | 
	
		
			
				|  |  |         PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(patient);
 | 
	
		
			
				|  |  |         BasePatientDO basePatientDO = patientDao.findById(patient);
 | 
	
		
			
				|  |  |         jsonObject.put("patientName", basePatientDO.getName());
 | 
	
		
			
				|  |  |         SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
 | 
	
		
			
				|  |  |         if (null != patientMappingDO && null != basePatientDO) {
 | 
	
	
		
			
				|  | @ -2906,23 +2897,25 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
 | 
	
		
			
				|  |  |             jsonObject.put("birth", sdf.format(basePatientDO.getBirthday()));
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         if (null!=infos&&infos.size()>0) {
 | 
	
		
			
				|  |  |             if (null != prescriptionDO) {
 | 
	
		
			
				|  |  |                 jsonObject.put("PATIENT_PRES_ID", prescriptionDO.getId());
 | 
	
		
			
				|  |  |                 jsonObject.put("FEE_TYPE", prescriptionDO.getPayType() == 1 ? "医保" : "自费");
 | 
	
		
			
				|  |  |                 jsonObject.put("createDate", sdf.format(prescriptionDO.getCreateTime()));
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             jsonObject.put("PATIENT_PRES_ID", tjPrescriptionId);
 | 
	
		
			
				|  |  |             jsonObject.put("FEE_TYPE", "1".equalsIgnoreCase(payType) ? "医保" : "自费");
 | 
	
		
			
				|  |  |             jsonObject.put("createDate", sdf.format(new Date()));
 | 
	
		
			
				|  |  |             //组装诊断参数
 | 
	
		
			
				|  |  |             if (null != diagnosisDOS && diagnosisDOS.size() > 0) {
 | 
	
		
			
				|  |  |                 List diagnosises = new ArrayList();
 | 
	
		
			
				|  |  |                 for (WlyyPrescriptionDiagnosisDO wlyyPrescriptionDiagnosisDO : diagnosisDOS) {
 | 
	
		
			
				|  |  |                     diagnosises.add(wlyyPrescriptionDiagnosisDO.getName());
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 jsonObject.put("diagnosises", diagnosises.toArray());
 | 
	
		
			
				|  |  |                 jsonObject.put("diagnosises", StringUtils.strip(diagnosises.toString(),"[]"));
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             String response = "";
 | 
	
		
			
				|  |  |             String returnJson = "";
 | 
	
		
			
				|  |  |             String url = entranceUrl + "checkPrescription?infos=" + infos + "&patientAndDoctor=" + jsonObject.toString();
 | 
	
		
			
				|  |  |             response = httpClientUtil.get(url, "GBK");
 | 
	
		
			
				|  |  |             JSONArray array = new JSONArray();
 | 
	
		
			
				|  |  |             for (WlyyPrescriptionInfoDO infoDO:infos){
 | 
	
		
			
				|  |  |                 array.add(infoDO);
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             String url = entranceUrl + "checkPrescription?infos=" + array.toJSONString() + "&patientAndDoctor=" + jsonObject.toString();
 | 
	
		
			
				|  |  |             response = httpClientUtil.sendPost(url, "GBK");
 | 
	
		
			
				|  |  |             logger.info("请求checkPrescription:" + response);
 | 
	
		
			
				|  |  |             JSONObject object = JSONObject.parseObject(response);
 | 
	
		
			
				|  |  |             WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
 | 
	
	
		
			
				|  | @ -2934,7 +2927,7 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
 | 
	
		
			
				|  |  |                     List<Map<String,Object>> returnList = transXmlCommen(obj);
 | 
	
		
			
				|  |  |                     returnJson = JSONArray.toJSONString(returnList);
 | 
	
		
			
				|  |  |                     logger.info("返回到互联网医院的解析后的结果:"+returnJson);
 | 
	
		
			
				|  |  |                     wlyyHttpLogDO.setDoctor(prescriptionDO.getDoctor());
 | 
	
		
			
				|  |  |                     wlyyHttpLogDO.setDoctor(doctor);
 | 
	
		
			
				|  |  |                     wlyyHttpLogDO.setCreateTime(new Date());
 | 
	
		
			
				|  |  |                     wlyyHttpLogDO.setRequest(infos + jsonObject.toString());
 | 
	
		
			
				|  |  |                     wlyyHttpLogDO.setResponse(returnJson);
 | 
	
	
		
			
				|  | @ -2943,7 +2936,7 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
 | 
	
		
			
				|  |  |                     returnJson = "审方返回接口为空请检查参数是否正确";
 | 
	
		
			
				|  |  |                     logger.info(returnJson);
 | 
	
		
			
				|  |  |                     wlyyHttpLogDO.setCode("error");
 | 
	
		
			
				|  |  |                     wlyyHttpLogDO.setDoctor(prescriptionDO.getDoctor());
 | 
	
		
			
				|  |  |                     wlyyHttpLogDO.setDoctor(doctor);
 | 
	
		
			
				|  |  |                     wlyyHttpLogDO.setCreateTime(new Date());
 | 
	
		
			
				|  |  |                     wlyyHttpLogDO.setRequest(infos + jsonObject.toString());
 | 
	
		
			
				|  |  |                     wlyyHttpLogDO.setResponse(returnJson);
 | 
	
	
		
			
				|  | @ -2952,7 +2945,7 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
 | 
	
		
			
				|  |  |             } else {
 | 
	
		
			
				|  |  |                 returnJson = "entranceUrl接口调用失败";
 | 
	
		
			
				|  |  |                 wlyyHttpLogDO.setCode("error");
 | 
	
		
			
				|  |  |                 wlyyHttpLogDO.setDoctor(prescriptionDO.getDoctor());
 | 
	
		
			
				|  |  |                 wlyyHttpLogDO.setDoctor(doctor);
 | 
	
		
			
				|  |  |                 wlyyHttpLogDO.setCreateTime(new Date());
 | 
	
		
			
				|  |  |                 wlyyHttpLogDO.setRequest(infos + jsonObject.toString());
 | 
	
		
			
				|  |  |                 wlyyHttpLogDO.setResponse(returnJson);
 |