Пример #1
0
        private T CreateCode <T>(Type type, CdaCodeResolver.CodedValue value) where T : Code
        {
            ICollection <Type> implementedTypes = new HashSet <Type>();

            implementedTypes.Add(type);
            Dictionary <string, string> displayTextMap = new Dictionary <string, string>();

            displayTextMap["en"] = value.GetDisplayName();
            return(type.Cast <T>(this.codeFactory.Create(type, implementedTypes, value.GetValue(), value.GetCodeSystemOid(),
                                                         value.GetCodeSystemName(), displayTextMap, 1, true, true)));
        }
Пример #2
0
 public virtual T Lookup <T>(Type type, string code, bool ignoreCase) where T : Code
 {
     CdaCodeResolver.ValueSet valueSet = valueSetsByTypeName.SafeGet(type.Name);
     if (valueSet != null)
     {
         CdaCodeResolver.CodedValue codedValue = valueSet.GetCode(code, ignoreCase);
         if (codedValue != null)
         {
             return(CreateCode <T>(type, codedValue));
         }
     }
     return(default(T));
 }
Пример #3
0
 public virtual void AddCode(CdaCodeResolver.CodedValue code)
 {
     if (code != null && code.GetValue() != null)
     {
         IList <CdaCodeResolver.CodedValue> list = this.codes.SafeGet(code.GetValue());
         if (list == null)
         {
             list = new List <CdaCodeResolver.CodedValue>();
             this.codes[code.GetValue()] = list;
             this.codesByLowerCase[code.GetValue().ToLower()] = list;
         }
         list.Add(code);
     }
 }