private bool ParseModifierType(ISearchParameterBase SearchParameter, string value)
        {
            var    SearchModifierTypeDic = FhirSearchEnum.GetSearchModifierTypeDictionary();
            string ValueCaseCorrectly    = StringSupport.ToLowerFast(value);

            if (SearchModifierTypeDic.ContainsKey(ValueCaseCorrectly))
            {
                SearchParameter.Modifier = SearchModifierTypeDic[ValueCaseCorrectly];
                return(true);
            }
            else
            {
                string TypedResourceName = value;
                if (value.Contains("."))
                {
                    char[] delimiters = { '.' };
                    TypedResourceName = value.Split(delimiters)[0].Trim();
                }

                Type ResourceType = ModelInfo.GetTypeForFhirType(TypedResourceName);
                if (ResourceType != null && ModelInfo.IsKnownResource(ResourceType))
                {
                    SearchParameter.TypeModifierResource = TypedResourceName;
                    SearchParameter.Modifier             = Hl7.Fhir.Model.SearchParameter.SearchModifierCode.Type;
                    return(true);
                }
                return(false);
            }
        }
Exemplo n.º 2
0
 public string ParsePrefix(string Value)
 {
     if (Value.Length > 2)
     {
         //Are the first two char Alpha characters
         if (Regex.IsMatch(Value.Substring(0, 2), @"^[a-zA-Z]+$"))
         {
             var SearchPrefixTypeDictionary = FhirSearchEnum.GetSearchPrefixTypeDictionary();
             if (SearchPrefixTypeDictionary.ContainsKey(Value.Substring(0, 2)))
             {
                 this.Prefix = SearchPrefixTypeDictionary[Value.Substring(0, 2)];
                 Value       = Value.Substring(2);
             }
         }
         else
         {
             this.Prefix = null;
         }
     }
     return(Value);
 }