Create() public static method

public static Create ( Hl7.Fhir.Model type, bool fuzzy = false ) : Argument
type Hl7.Fhir.Model
fuzzy bool
return Argument
コード例 #1
0
        public static Definition CreateDefinition(ModelInfo.SearchParamDefinition paramdef)
        {
            Definition definition = new Definition();

            definition.Argument    = ArgumentFactory.Create(paramdef.Type);
            definition.Resource    = paramdef.Resource;
            definition.ParamName   = paramdef.Name;
            definition.Query       = new ElementQuery(paramdef.Path);
            definition.ParamType   = paramdef.Type;
            definition.Description = paramdef.Description;
            return(definition);
        }
コード例 #2
0
ファイル: DefinitionsFactory.cs プロジェクト: jjrdk/spark
        public static Definition CreateDefinition(ModelInfo.SearchParamDefinition paramdef)
        {
            var definition = new Definition
            {
                Argument    = ArgumentFactory.Create(paramdef.Type),
                Resource    = paramdef.Resource,
                ParamName   = paramdef.Name,
                Query       = new ElementQuery(paramdef.Path),
                ParamType   = paramdef.Type,
                Description = paramdef.Description?.Value
            };

            return(definition);
        }
コード例 #3
0
ファイル: Definitions.cs プロジェクト: ztfuqingvip/spark
        public Argument GuessArgument(string field)
        {
            var query =
                from d in definitions
                where (d.ParamName == field)
                group d by d.ParamType into pgroup
                let count = pgroup.Count()
                            orderby count descending
                            select new { ParamType = pgroup.Key, Count = count };

            //for testing:
            var pg = query.ToList();

            Argument argument = (pg.Any()) ? ArgumentFactory.Create(pg.First().ParamType) : null;

            return(argument);
        }