/// <summary> /// 取门诊单据费用明细(退费前用) /// </summary> /// <param name="mzlsh">门诊流水号</param> /// <param name="djh"></param> /// <param name="theMZFY"></param> /// <param name="errMsg"></param> /// <returns></returns> public bool GetMZFYMX(string mzlsh, string djh, out MZFYDetail[] theMZFY, out string errMsg) { IiopClientChannel channel = new IiopClientChannel(); try { NamingContext nameService = (NamingContext)RemotingServices.Connect(typeof(NamingContext), strior); NameComponent[] name = new NameComponent[] { new NameComponent("MZYL", "Service") }; intMZ mz = (intMZ)nameService.resolve(name); short[] res = mz.GetMZFYMX(yljgbm, mzlsh, djh, czybm, czy, out theMZFY); ChannelServices.UnregisterChannel(channel); string resStr = TransSAToString(res); if (resStr.StartsWith(SUCCESS)) { errMsg = string.Empty; return(true); } else { errMsg = resStr.Substring(resStr.IndexOf(")") + 1); return(false); } } catch (Exception ex) { ChannelServices.UnregisterChannel(channel); if (isSaveExceptionLog) { //DataLog.SaveLog(String.Format("GetMZFYMX:{0}\n", ex.Message)); } errMsg = EXCEPTION; theMZFY = null; return(false); } }
/// <summary> /// 取个人基本信息 /// </summary> /// <param name="ylzh">医疗证号(解析前)</param> /// <param name="mm">医疗证号密码</param> /// <param name="theGRXX">个人基本信息</param> /// <param name="errMsg">异常信息</param> /// <returns></returns> public bool GetGRXBXX(string ylzh, string mm, out GRXX theGRXX, out string errMsg) { System.Collections.IDictionary dic = new System.Collections.Hashtable(); //dic.Add(IiopClientChannel.ALLOW_REQUEST_MULTIPLEX_KEY,"9"); //dic.Add(IiopClientChannel.CLIENT_CONNECTION_LIMIT_KEY,30000); //dic.Add(IiopClientChannel.CLIENT_RECEIVE_TIMEOUT_KEY, 30000); //dic.Add(IiopClientChannel.CLIENT_REQUEST_TIMEOUT_KEY, 30000); //dic.Add(IiopClientChannel.CLIENT_SEND_TIMEOUT_KEY, 30000); //dic.Add(IiopClientChannel.CLIENT_UNUSED_CONNECTION_KEEPALIVE_KEY, "3"); //dic.Add(IiopClientChannel.MAX_NUMBER_OF_MULTIPLEXED_REQUESTS_KEY, "3"); //dic.Add(IiopClientChannel.MAX_NUMBER_OF_RETRIES_KEY, "3"); //dic.Add(IiopClientChannel.RETRY_DELAY_KEY,30000); dic.Add(IiopClientChannel.CLIENT_RECEIVE_TIMEOUT_KEY, 30000); //30s dic.Add(IiopClientChannel.CLIENT_REQUEST_TIMEOUT_KEY, 30000); //30s dic.Add(IiopClientChannel.CLIENT_SEND_TIMEOUT_KEY, 30000); //30s IiopClientChannel channel = new IiopClientChannel(dic); try { if (string.IsNullOrEmpty(mm)) { mm = ""; } ChannelServices.RegisterChannel(channel, false); NamingContext nameService = (NamingContext)RemotingServices.Connect(typeof(NamingContext), strior); NameComponent[] name = new NameComponent[] { new NameComponent("MZYL", "Service") }; intMZ mz = (intMZ)nameService.resolve(name); short[] res = mz.GetGRJBXX(yljgbm, ylzh, mm, czybm, czy, out theGRXX); ChannelServices.UnregisterChannel(channel); string resStr = TransSAToString(res); if (resStr.StartsWith(SUCCESS)) { ////DataLog.SaveLog("获取患者医保个人信息成功"); errMsg = string.Empty; return(true); } else { if (isSaveExceptionLog) { ////DataLog.SaveLog(String.Format("GetGRXBXX:{0}\n", resStr)); } errMsg = resStr.Substring(resStr.IndexOf(")") + 1); return(false); } } catch (Exception ex) { ChannelServices.UnregisterChannel(channel); if (isSaveExceptionLog) { ////DataLog.SaveLog(String.Format("GetGRXBXX:{0}\n", ex.Message)); } errMsg = EXCEPTION; theGRXX = new GRXX(); return(false); } }
private void Destroy() { mz = null; sys = null; nameService = null; ChannelServices.UnregisterChannel(channel); channel = null; }
public static void Demo() { string yljgbm = "XX100"; string ylzh = "%ABCDEFGHIJK?;0123456789?"; string pass = ""; //string zzyybm = "*****"; string czybm = "XX101"; string czy = "某某某"; short[] czyxm = ShenzhenMi.TransfromSa(czy); hi.GRXX hr; hi.modSysInfo.XXDetail[] msg; intMZ mz = ShenzhenMi.Current.MZService; Console.WriteLine(); //测试方法 short[] res = mz.GetGRJBXX(yljgbm, ylzh, pass, czybm, czyxm, out hr); Console.WriteLine(ShenzhenMi.TransformAs(res)); Console.WriteLine(hr.ACCOUNT); Console.WriteLine(hr.YLZH); Console.WriteLine(hr.XB); Console.WriteLine("finished!"); ShenzhenMi.CleanUp(); //Thread.Sleep(30000); intSys sys = ShenzhenMi.Current.SysService; string strres; short[] res1 = sys.GetState(out strres); Console.WriteLine(ShenzhenMi.TransformAs(res1)); Console.WriteLine(strres); Console.ReadLine(); res1 = sys.GetMassage(out msg); Console.WriteLine(ShenzhenMi.TransformAs(res1)); Console.WriteLine(msg.Length); Console.ReadLine(); foreach (var detail in msg) { Console.WriteLine(string.Format("{0},{1},{2}", ShenzhenMi.TransformAs(detail.TZBT), ShenzhenMi.TransformAs(detail.TZNR), detail.XXBM)); } ShenzhenMi.CleanUp(); }