예제 #1
0
        public Maybe <IValueSet> GetValueSet(string valueSetUniqueId, IEnumerable <string> codeSystemCodes)
        {
            var codeSystemCDs = codeSystemCodes as string[] ?? codeSystemCodes.ToArray();
            var cached        = this.Cache.GetCachedValueSetWithAllCodes(valueSetUniqueId, codeSystemCDs);

            if (cached != null)
            {
                return(Maybe.From(cached));
            }

            var dto = this.DbSet.Where(GetBaseExpression()).FirstOrDefault(vs => vs.ValueSetUniqueID == valueSetUniqueId);

            if (dto == null)
            {
                return(Maybe <IValueSet> .Not);
            }

            var mapper = new ValueSetFullCodeListMapper(
                this.isCustomValue,
                this.Cache,
                this.valueSetCodeRepository.GetValueSetCodes,
                codeSystemCDs);

            return(Maybe.From(mapper.Map(dto)));
        }
예제 #2
0
        internal Maybe <IValueSet> GetCustomValueSet(string valueSetUniqueId)
        {
            var dto = this.ClientTermContext.ValueSetDescriptions.AsNoTracking().SingleOrDefault(x => x.ValueSetUniqueID == valueSetUniqueId);

            if (dto == null)
            {
                return(Maybe <IValueSet> .Not);
            }

            var mapper = new ValueSetFullCodeListMapper(
                this.isCustomValue,
                this.Cache,
                ((SqlValueSetCodeRepository)this.valueSetCodeRepository).GetCustomValueSetCodes,
                Enumerable.Empty <string>());

            return(Maybe.From(mapper.Map(dto)));
        }