| 
					
				 | 
			
			
				@ -1185,6 +1185,81 @@ public class XzzxEntranceService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        logger.info(" GetLisApply json:"+json); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return json; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 互联网医院开处方信息更新到his 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param IoFlag  门诊住院标志 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param PayCardNo 就诊卡号 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param NullahNumber 挂号流水号 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param ApplyDept 执行科室 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param ApplyDoctor 开单医生 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param ExecuteDept 执行科室(药房) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param prescriptionInfoDOList 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @throws Exception 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public String savePrescriptionToHospital(String IoFlag,String PayCardNo,String NullahNumber, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                             String ApplyDept,String ApplyDoctor,String ExecuteDept,List<WlyyPrescriptionInfoDO> prescriptionInfoDOList)throws Exception{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String api = "savePrescriptionToHospital"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String msgHeader ="<?xml version=\"1.0\" encoding=\"utf-8\"?> " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "<root> " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "   <serverName>"+api+"</serverName>  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "   <format>xml</format>" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "   <callOperator></callOperator> " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "   <certificate>"+key+"</certificate> " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "</root>"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String condition =""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (!StringUtils.isEmpty(IoFlag)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            condition += "<IoFlag>"+IoFlag+"</IoFlag>"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (!StringUtils.isEmpty(PayCardNo)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            condition += "<PayCardNo>"+PayCardNo+"</PayCardNo>"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (!StringUtils.isEmpty(NullahNumber)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            condition += "<NullahNumber>"+NullahNumber+"</NullahNumber>"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (!StringUtils.isEmpty(ApplyDept)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            condition += "<ApplyDept>"+ApplyDept+"</ApplyDept>"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (!StringUtils.isEmpty(ApplyDoctor)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            condition += "<ApplyDoctor>"+ApplyDoctor+"</ApplyDoctor>"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (!StringUtils.isEmpty(ExecuteDept)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            condition += "<ExecuteDept>"+ExecuteDept+"</ExecuteDept>"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        condition +="<PresDetail>"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        for (WlyyPrescriptionInfoDO prescriptionInfoDO:prescriptionInfoDOList){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String condition1 = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            condition1 += "<PhysicCode>"+prescriptionInfoDO.getDrugNo()+"</PhysicCode>"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            condition1 += "<Doseage>"+prescriptionInfoDO.getDosage()+"</Doseage>"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            condition1 += "<DoseUnit>"+prescriptionInfoDO.getUnit()+"</DoseUnit>"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            condition1 += "<Frequency>"+prescriptionInfoDO.getFrequency()+"</Frequency>"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            condition1 += "<DayCount>"+prescriptionInfoDO.getDays()+"</DayCount>"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            condition1 += "<Usage>"+prescriptionInfoDO.getUsageCode()+"</Usage>"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            condition1 += "<TotalDoseage>"+prescriptionInfoDO.getQuantity()+"</TotalDoseage>"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            condition1 += "<TotalUnit>"+prescriptionInfoDO.getPackUnit()+"</TotalUnit>"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            condition1 += "<PrescribeMemo>"+"</PrescribeMemo>"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            condition1 += "<FryMode>"+"</FryMode>"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            condition1 += "<HerbalTakeMethodClass>"+"</HerbalTakeMethodClass>"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            condition1 += "<HerbalFryMethod>"+"</HerbalFryMethod>"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            condition1 += "<HerbalFryMethod2>"+"</HerbalFryMethod2>"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            condition+="<PresInfo>"+condition1+"</PresInfo>"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        condition+="</PresDetail>"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "<root>"+condition+"</root>"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Map<String,String> params = new HashedMap(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        params.put("msgHeader",msgHeader); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        params.put("msgBody",msgBody); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        logger.info("savePrescriptionToHospital params:"+params.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String xml = getXzzxWebServiceInfo("CallInterface",params,getSelectUrl()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        XMLSerializer xmlSerializer = new XMLSerializer(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String json = xmlSerializer.read(xml).toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        logger.info(" savePrescriptionToHospital json:"+json); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return json; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//=====================微信模板消息推送=================================== 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public String sendMes(String wxId,String patient,String cardNo,String first,String noticeContent,String remark,String redirectUrl){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -2222,6 +2297,40 @@ public class XzzxEntranceService{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return jsonArray; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param ioFlag 门诊住院标志 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param payCardNo 就诊卡号 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param nullahNumber 挂号流水号 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param applyDept 执行科室 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param applyDoctor 开单医生 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param executeDept 执行科室(药房) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param wlyyPrescriptionInfoVOS 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @throws Exception 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public JSONObject savePrescriptionToEntrance(String ioFlag,String payCardNo,String nullahNumber,String applyDept,String applyDoctor,String executeDept,List<WlyyPrescriptionInfoDO> wlyyPrescriptionInfoDOS) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        JSONObject jsonObject = new JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String response = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String url = entranceUrl+"savePrescriptionToHospital"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Map<String,String> params = new HashedMap(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        params.put("IoFlag",ioFlag); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        params.put("PayCardNo",payCardNo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        params.put("NullahNumber",nullahNumber); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        params.put("ApplyDept",applyDept); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        params.put("ApplyDoctor",applyDoctor); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        params.put("ExecuteDept",executeDept); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        params.put("prescriptionInfoDOS",wlyyPrescriptionInfoDOS.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        response = httpClientUtil.httpPost(url,params); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        logger.info("开方成功"+response); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        JSONObject object = JSONObject.parseObject(response); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(object.getInteger("status")==200){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             jsonObject = object.getJSONObject("obj"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return jsonObject; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//=====================hospital应用调用entrance应用============end================= 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 |