/// <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); }
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); }