Esempio n. 1
0
        /// <summary>
        /// 基于条件,查找匹配的医疗单的具体创建工厂对象;
        /// 针对住院的
        /// </summary>
        /// <param name="srv">医疗服务对象</param>
        /// <returns></returns>
        public EmsFactoryBase GetEmsFactory(MedSrvDO srv, BaseContext context, Ent4BannerDTO bannerDto)
        {
            string srvType = srv.Sd_srvtp;

            if (srvType.Length < 4)
            {
                throw new Exception(string.Format("服务类型有误长度不足4位!目前是{0},请检查", srvType));
            }

            EmsFactoryBase r = null;

            //缓存中没有,则实际获取,然后在缓存
            SrvMatchEmsParamDTO dto         = EmsMatchTool.GetSrvMatchEmsParamDTO(context.Org.Id_org, context.Group.Id_grp, context.Dept.Id_dep, context.PsnInfo.Id_psndoc, bannerDto.Code_entp, srv.Sd_srvtp, srv.Id_srv, EmsAppModeEnum.IVEMSAPPMODE);
            SrvMatchEmsRstDTO   matchResult = this.GetSrvMatchEmsParamDTO(dto);

            if (matchResult == null)
            {
                throw new Exception(
                          string.Format("服务类型{0}没有匹配到医疗单,请从检查医疗单维护节点检查配置信息", srvType));
            }

            string funcStr = matchResult.Funcclassstr;

            if (funcStr == null || funcStr == "")
            {
                throw new Exception(
                          string.Format("服务类型{0}对应的医疗单配置串为空,请从检查医疗单维护节点检查配置信息", srvType));
            }

            r = this.GetEmsFactoryFromFuncStr(funcStr);

            return(r);
        }
Esempio n. 2
0
        /// <summary>
        /// 基于代表医疗单的的字符串反射创建对应的医疗单控件对象
        /// </summary>
        /// <param name="Funcclassstr"></param>
        /// <returns></returns>
        public CiorderBaseControl GetCiorderBaseControl(String funcstr)
        {
            if (String.IsNullOrEmpty(funcstr))
            {
                new Exception("没有匹配到医疗单");
            }
            EmsFunclassKVDTO funclassDTO = EmsMatchTool.GetEmsFunclassKVDTO(funcstr);
            string           dllAssembly = funclassDTO.Classpath_dll;
            string           libName     = funclassDTO.Dll;

            //String[] str = Funcclassstr.Split(',');
            //string dllAssembly = str[0];
            //string libName = str[1];
            try {
                //Assembly assembly = Assembly.LoadFrom(Application.StartupPath + "\\CiSheetPlus\\" + libName);
                Assembly           assembly = Assembly.LoadFrom(Application.StartupPath + "\\" + libName);
                Type               type     = assembly.GetType(dllAssembly);
                CiorderBaseControl canvas   = (CiorderBaseControl)Activator.CreateInstance(type);

                return(canvas);
            }
            catch //(Exception e)
            {
                throw new Exception("没有匹配到医疗单");
            }
        }
Esempio n. 3
0
        public BaseEmsDriver DriverWith(String id_srv, String sd_srvtp, BaseFormBizView context, Ent4BannerDTO bannerDto)
        {
            BaseEmsDriver emsFactory = null;

            if (context.Context == null)
            {
                context.SetStatusMsg("Context 上下文信息为空,不能创建医疗单");
                return(null);
            }

            if (context.Context.PsnInfo == null)
            {
                context.SetStatusMsg("Context 上下文登录用户信息为空,不能创建医疗单");
                return(null);
            }

            //读取医疗单匹配信息
            SrvMatchEmsParamDTO dto         = EmsMatchTool.GetSrvMatchEmsParamDTO(context.Context.Org.Id_org, context.Context.Group.Id_grp, context.Context.Dept.Id_dep, context.Context.PsnInfo.Id_psndoc, bannerDto.Code_entp, sd_srvtp, id_srv, EmsAppModeEnum.SVEMSAPPMODE);
            SrvMatchEmsRstDTO   matchResult = this.GetSrvMatchEmsParamDTO(dto);

            if (matchResult == null)
            {
                context.SetStatusMsg(
                    string.Format("服务类型{0}没有匹配到合适的医疗单,请在【医疗单维护】节点中维护相关数据!", sd_srvtp));
                return(null);
            }

            string funcStr = matchResult.Funcclassstr;

            if (String.IsNullOrEmpty(funcStr))
            {
                context.SetStatusMsg(
                    string.Format("服务类型{0}对应的医疗单配置串为空,请从医疗单维护节点检查配置信息,先使用治疗医疗单!", sd_srvtp));
                return(null);
            }

            emsFactory = this.GetEmsFactoryFromFuncStr(funcStr);
            emsFactory.Initialize(context, bannerDto, matchResult);

            return(emsFactory);
        }
Esempio n. 4
0
        /// <summary>
        /// 基于代表医疗单的的字符串反射创建对应的医疗单控件对象
        /// </summary>
        /// <param name="funcStr"></param>
        /// <returns></returns>
        private EmsFactoryBase GetEmsFactoryFromFuncStr(String funcStr)
        {
            EmsFunclassKVDTO funclassDTO = EmsMatchTool.GetEmsFunclassKVDTO(funcStr);
            string           clazzStr    = funclassDTO.Classpath_dll;
            string           dllStr      = funclassDTO.Dll;

            //String[] str = funcStr.Split(',');
            //string clazzStr = str[0];
            //string dllStr = str[1];
            try {
                //Assembly assembly = Assembly.LoadFrom(Application.StartupPath + "\\CiSheetPlus\\" + libName);
                Assembly       assembly = Assembly.LoadFrom(Application.StartupPath + "\\" + dllStr);
                Type           type     = assembly.GetType(clazzStr);
                EmsFactoryBase r        = (EmsFactoryBase)Activator.CreateInstance(type);
                return(r);
            }
            catch //(Exception e)
            {
                throw new Exception(string.Format("反射{0}时出现异常", funcStr));
            }
        }