| 
					
				 | 
			
			
				@ -3014,12 +3014,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                rs.put("registerCount",0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //医生问诊量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//            List<WlyyOutpatientDO> wlyyOutpatientDOs = outpatientDao.findByDoctorAndStatus(doctor,"2"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//            if(wlyyOutpatientDOs!=null&&wlyyOutpatientDOs.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                rs.put("outpatientCount",wlyyOutpatientDOs.size()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//            }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                rs.put("outpatientCount",0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            List<WlyyOutpatientDO> wlyyOutpatientDOs = outpatientDao.findByDoctorList(doctor); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(wlyyOutpatientDOs!=null&&wlyyOutpatientDOs.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                rs.put("outpatientCount",wlyyOutpatientDOs.size()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                rs.put("outpatientCount",0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				// 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//            //协同门诊量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//            Integer coordinationCout = outpatientDao.countByDoctorAndStatusAndOutpatientType(doctor,"2","2"); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -5780,6 +5780,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        setInspectionParam(jsonData, doctorMappingDO, outpatientDO, wlyyPrescriptionDO, ins, outpatientDO.getIcd10()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    Map<String,Object> map = sendHisDiagnosis(jsonData, outpatientDO, wlyyPrescriptionDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    //同步电子病历 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    WlyyPrescriptionEmrDO prescriptionEmrDO = prescriptionEmrDao.findEmrByPrescriptionId(prescriptionId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    if (prescriptionEmrDO!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        writeOutPatient(outpatientDO.getRegisterNo(),prescriptionEmrDO.getComplaint(),prescriptionEmrDO.getMedicalHistory(),prescriptionEmrDO.getPastHistory(),prescriptionEmrDO.getPhysicalExamination(),prescriptionEmrDO.getAssistExamination()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    if (map.get("code").toString().equalsIgnoreCase("0")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        //  * @param applyDepaName @param applyDoctorName 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        WlyyPrescriptionDO prescriptionDO = prescriptionDao.findOne(prescriptionId); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -5801,8 +5806,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        if (patientMappingDO!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            userNo = patientMappingDO.getMappingCode(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        PatientMedicareCardDO patientMedicareCardDO = patientMedicareCardDao.findByTypeAndPatientCodeAndDel("A_01",patientCode,"1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        ylzPayService.msgPush("01",patientMedicareCardDO.getCode(),"01",patientDO.getMobile(),"03",userNo,userName,idcard,realerOrder,applyDepaName,applyDoctorName,recipeTime,free,"1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        String cardNo = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        if (!StringUtils.isNoneBlank(outpatientDO.getCardNo())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            cardNo = outpatientDO.getCardNo(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        ylzPayService.msgPush("01",cardNo,"01",patientDO.getMobile(),"03",userNo,userName,idcard,realerOrder,applyDepaName,applyDoctorName,recipeTime,free,"1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    //sendHisDiagnosis(jsonData, outpatientDO, wlyyPrescriptionDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -6172,7 +6180,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @throws Exception 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public String readOutPatientXml(String registerSn) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public WlyyPrescriptionEmrDO readOutPatientXml(String registerSn) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO = new WlyyPrescriptionEmrDO(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String url = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = hospitalSysDictDao.findById("HAI_TAI_URL"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (wlyyHospitalSysDictDO!=null){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -6182,7 +6191,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "<HtRequest>\n"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        xmlStr+="<REGISTER_SN>"+registerSn+"</REGISTER_SN>"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        xmlStr+="<SEARCH_IDS>CHIEF_COMPLAINT,HPI,ELAPSEMHIS,BODYCHECK,ASSISTANTCHECK</SEARCH_IDS>"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String reqTime = DateUtil.dateToStr(new Date(),"yyyyMMddHHmmssSSS"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String reqTime = DateUtil.dateToStr(new Date(),"yyyyMMddHHmmss"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        xmlStr+="<REQ_TIME>"+reqTime+"</REQ_TIME>"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        xmlStr+="</HtRequest>"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String returnValue = ""; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -6198,8 +6207,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        XMLSerializer xmlSerializer = new XMLSerializer(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        net.sf.json.JSON json = xmlSerializer.read(returnValue); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        logger.info("返回json"+json); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return json.toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(json.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        wlyyPrescriptionEmrDO.setComplaint(object.getString("CHIEF_COMPLAINT")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        wlyyPrescriptionEmrDO.setMedicalHistory(object.getString("HPI")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        wlyyPrescriptionEmrDO.setPastHistory(object.getString("ELAPSEMHIS")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        wlyyPrescriptionEmrDO.setPhysicalExamination(object.getString("BODYCHECK")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        wlyyPrescriptionEmrDO.setAssistExamination(object.getString("ASSISTANTCHECK")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return wlyyPrescriptionEmrDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public String writeOutPatient(String registerSn,String chiefComplaint,String hpi,String elapsemhis,String bodycheck,String assistanTcheck) throws Exception { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -6211,7 +6225,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String xmlStr = "<?xml version=\"1.0\" encoding=\"GBK\"?>\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "<HtRequest>\n"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        xmlStr+="<REGISTER_SN>"+registerSn+"</REGISTER_SN>"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String reqTime = DateUtil.dateToStr(new Date(),"yyyyMMddHHmmssSSS"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String reqTime = DateUtil.dateToStr(new Date(),"yyyyMMddHHmmss"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        xmlStr+="<REQ_TIME>"+reqTime+"</REQ_TIME>"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        xmlStr+="<OUTPATIENT_INFO>"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        xmlStr+="<CHIEF_COMPLAINT>"+chiefComplaint+"</CHIEF_COMPLAINT>"; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -6517,7 +6531,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public MixEnvelop selectByUrl(String prescriptionId,String wxId) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public MixEnvelop selectByUrl(String oupatientId,String prescriptionId,String wxId) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        WxWechatDO wxWechatDO = wechatDao.findById(wxId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (wxWechatDO==null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            throw new Exception("微信配置不存在!"); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -6531,11 +6545,16 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            throw new Exception("openid不存在!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        BasePatientWechatDo patientWechatDo = patientWechatDos.get(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        PatientMedicareCardDO patientMedicareCardDO = patientMedicareCardDao.findByTypeAndPatientCodeAndDel("A_01",prescriptionDO.getPatientCode(),"1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (patientMedicareCardDO==null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(oupatientId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String idcard=null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (wlyyOutpatientDO!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            idcard=wlyyOutpatientDO.getCardNo(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (!StringUtils.isNoneBlank(idcard)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            throw new Exception("就诊卡不存在!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String url = ylzPayService.createSicardPayUrl(wxWechatDO.getAppOriginId(),patientWechatDo.getOpenid(),patientMedicareCardDO.getCode(),"WX"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String url = ylzPayService.createSicardPayUrl(wxWechatDO.getAppOriginId(),patientWechatDo.getOpenid(),idcard,"WX"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(url); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find,object); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 |