|  | @ -76,12 +76,10 @@ import com.yihu.jw.util.common.IdCardUtil;
 | 
	
		
			
				|  |  | import com.yihu.jw.util.common.LatitudeUtils;
 | 
	
		
			
				|  |  | import com.yihu.jw.util.date.DateUtil;
 | 
	
		
			
				|  |  | import com.yihu.jw.util.wechat.WeixinMessagePushUtils;
 | 
	
		
			
				|  |  | import com.yihu.jw.utils.AdminException;
 | 
	
		
			
				|  |  | import com.yihu.jw.utils.Pkis.PKIService_PortType;
 | 
	
		
			
				|  |  | import com.yihu.jw.utils.Pkis.PKIService_ServiceLocator;
 | 
	
		
			
				|  |  | import com.yihu.jw.utils.WebserviceUtil;
 | 
	
		
			
				|  |  | import com.yihu.jw.utils.hibernate.HibenateUtils;
 | 
	
		
			
				|  |  | import com.yihu.jw.utils.sfutils.MyErrorCode;
 | 
	
		
			
				|  |  | import com.yihu.jw.wechat.dao.BasePatientWechatDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.wechat.dao.WechatDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.wechat.dao.WxPushLogDao;
 | 
	
	
		
			
				|  | @ -98,7 +96,6 @@ import jxl.write.*;
 | 
	
		
			
				|  |  | import net.sf.json.JSONArray;
 | 
	
		
			
				|  |  | import net.sf.json.JSONObject;
 | 
	
		
			
				|  |  | import net.sf.json.xml.XMLSerializer;
 | 
	
		
			
				|  |  | import org.apache.commons.codec.binary.*;
 | 
	
		
			
				|  |  | import org.apache.commons.collections.map.HashedMap;
 | 
	
		
			
				|  |  | import org.apache.commons.lang3.StringUtils;
 | 
	
		
			
				|  |  | import org.slf4j.Logger;
 | 
	
	
		
			
				|  | @ -113,18 +110,14 @@ import org.springframework.stereotype.Service;
 | 
	
		
			
				|  |  | import org.springframework.transaction.annotation.Transactional;
 | 
	
		
			
				|  |  | import org.springframework.util.CollectionUtils;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import javax.xml.rpc.ServiceException;
 | 
	
		
			
				|  |  | import java.io.IOException;
 | 
	
		
			
				|  |  | import java.io.OutputStream;
 | 
	
		
			
				|  |  | import java.lang.Boolean;
 | 
	
		
			
				|  |  | import java.math.BigDecimal;
 | 
	
		
			
				|  |  | import java.net.MalformedURLException;
 | 
	
		
			
				|  |  | import java.net.URL;
 | 
	
		
			
				|  |  | import java.text.DecimalFormat;
 | 
	
		
			
				|  |  | import java.text.ParseException;
 | 
	
		
			
				|  |  | import java.text.SimpleDateFormat;
 | 
	
		
			
				|  |  | import java.util.*;
 | 
	
		
			
				|  |  | import java.util.Base64;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | /**
 | 
	
		
			
				|  |  |  * Created by Trick on 2019/5/17.
 | 
	
	
		
			
				|  | @ -1655,7 +1648,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |                 outpatientDao.save(outpatientDO);
 | 
	
		
			
				|  |  |                 //调用电子病历注册
 | 
	
		
			
				|  |  |                 manageType = 2;
 | 
	
		
			
				|  |  |                 registDianziBingli(outpatientDO, basePatientDO, manageType, registerDO.getRegisterNo(), registerDO.getConNo());
 | 
	
		
			
				|  |  |                 try {
 | 
	
		
			
				|  |  |                     registDianziBingli(outpatientDO, basePatientDO, manageType, registerDO.getRegisterNo(), registerDO.getConNo());
 | 
	
		
			
				|  |  |                 }catch (Exception e){
 | 
	
		
			
				|  |  |                     e.printStackTrace();
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 return res;
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }
 | 
	
	
		
			
				|  | @ -1777,7 +1774,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |                 "<CardNO>" + outpatientDO.getCardNo() + "</CardNO>\n" +
 | 
	
		
			
				|  |  |                 "<PatientName>" + basePatientDO.getName() + "</PatientName>" +
 | 
	
		
			
				|  |  |                 "<SexCode>" + basePatientDO.getSex() + "</SexCode>";
 | 
	
		
			
				|  |  |         if (1 == basePatientDO.getSex()) {
 | 
	
		
			
				|  |  |         if (basePatientDO.getSex()!=null&&1 == basePatientDO.getSex()) {
 | 
	
		
			
				|  |  |             _xmlStr = _xmlStr + "<Sex>男</Sex>";
 | 
	
		
			
				|  |  |         } else {
 | 
	
		
			
				|  |  |             _xmlStr = _xmlStr + "<Sex>女</Sex>";
 | 
	
	
		
			
				|  | @ -7147,7 +7144,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |                     List<WlyyPrescriptionInfoDO> infoDOS = prescriptionInfoDao.findByPrescriptionId(prescriptionId, 1);
 | 
	
		
			
				|  |  |                     List<WlyyInspectionDO> inspectionDOS = wlyyInspectionDao.findByPrescriptionId(prescriptionId, 1);
 | 
	
		
			
				|  |  |                     DoctorMappingDO doctorMappingDO = doctorMappingService.findMappingCode(outpatientDO.getDoctor(), outpatientDO.getHospital());
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                     List<WlyyPrescriptionExpressageDO> expressageDOS = prescriptionExpressageDao.findByOutpatientId(outpatientDO.getId());
 | 
	
		
			
				|  |  |                     //his处方拼接开方条件
 | 
	
		
			
				|  |  |                     com.alibaba.fastjson.JSONArray jsonData = new com.alibaba.fastjson.JSONArray();
 | 
	
		
			
				|  |  |                     for (WlyyPrescriptionInfoDO info : infoDOS) {
 | 
	
	
		
			
				|  | @ -7158,6 +7155,20 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |                         //设置his药品查询条件
 | 
	
		
			
				|  |  |                         setInspectionParam(jsonData, doctorMappingDO, outpatientDO, wlyyPrescriptionDO, ins, outpatientDO.getIcd10());
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                     if (expressageDOS!=null&&expressageDOS.size()!=0){
 | 
	
		
			
				|  |  |                         WlyyPrescriptionExpressageDO prescriptionExpressageDO = expressageDOS.get(0);
 | 
	
		
			
				|  |  |                         if (prescriptionExpressageDO!=null&&prescriptionExpressageDO.getOneselfPickupFlg()==0){
 | 
	
		
			
				|  |  |                             for (int i=0;i<jsonData.size();i++){
 | 
	
		
			
				|  |  |                                 com.alibaba.fastjson.JSONObject object = jsonData.getJSONObject(i);
 | 
	
		
			
				|  |  |                                 object.put("selfDelivered",0);
 | 
	
		
			
				|  |  |                             }
 | 
	
		
			
				|  |  |                         }else if (prescriptionExpressageDO!=null&&prescriptionExpressageDO.getOneselfPickupFlg()==1){
 | 
	
		
			
				|  |  |                             for (int i=0;i<jsonData.size();i++){
 | 
	
		
			
				|  |  |                                 com.alibaba.fastjson.JSONObject object = jsonData.getJSONObject(i);
 | 
	
		
			
				|  |  |                                 object.put("selfDelivered",1);
 | 
	
		
			
				|  |  |                             }
 | 
	
		
			
				|  |  |                         }
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                     Map<String, Object> map = sendHisDiagnosis(jsonData, outpatientDO, wlyyPrescriptionDO);
 | 
	
		
			
				|  |  |                     //处方签名
 | 
	
		
			
				|  |  |                     logger.info("处方签名");
 |