/// <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); }
/// <summary> /// /// </summary> /// <param name="dto"></param> /// <returns></returns> private SrvMatchEmsRstDTO GetSrvMatchEmsParamDTO(SrvMatchEmsParamDTO dto) { //EmsMatchRstDTO r = bdSrvService.getmedSrvMatchEms(dto); IEmsManagementService service = XapServiceMgr.find <IEmsManagementService>(); FMap map = service.medSrvMatchEms(new SrvMatchEmsParamDTO[] { dto }); SrvMatchEmsRstDTO r = null; if (map != null) { r = (SrvMatchEmsRstDTO)map[dto.Id_srv]; } return(r); }
/// <summary> /// /// </summary> /// <param name="paramDto"></param> /// <returns></returns> public SrvMatchEmsRstDTO getSrvMatchEmsParamDTO(SrvMatchEmsParamDTO paramDto) { //EmsMatchRstDTO emsMatchRstDTO = sheetModel.getmedSrvMatchEms(paramDto); IEmsManagementService service = XapServiceMgr.find <IEmsManagementService>(); FMap map = service.medSrvMatchEms(new SrvMatchEmsParamDTO[] { paramDto }); SrvMatchEmsRstDTO r = null; if (map != null) { r = (SrvMatchEmsRstDTO)map[paramDto.Id_srv]; } return(r); }
public static SrvMatchEmsParamDTO GetSrvMatchEmsParamDTO(String id_org, String id_grp, String id_dept, String id_emp, String code_entp, String sd_srvtp, String id_srv, EmsAppModeEnum emsAppMode) { SrvMatchEmsParamDTO dto = new SrvMatchEmsParamDTO(); dto.Id_org = id_org; dto.Id_grp = id_grp; dto.Id_dept = id_dept; dto.Id_emp = id_emp; dto.Code_entp = code_entp; dto.Sd_srvtp = sd_srvtp; dto.Id_srv = id_srv; dto.Dt_or = logic.GetServerDataTime(); dto.Emsappmode = (int)emsAppMode; return(dto); }
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); }