Exemplo n.º 1
0
        public static IEnumerable <Base> SelectNew(this Base input, string expression, FhirEvaluationContext ctx = null)
        {
            var inputNav = input.ToTypedElement();
            var result   = inputNav.Select(expression, ctx ?? FhirEvaluationContext.CreateDefault());

            return(ToFhirValues(result));
        }
        public void ResolveOnEmptyTest()
        {
            // resolve should handle an empty collection as input
            var symbolTable = new SymbolTable();

            symbolTable.AddStandardFP();
            symbolTable.AddFhirExtensions();
            var compiler  = new FhirPathCompiler(symbolTable);
            var evaluator = compiler.Compile("{}.resolve()");

            var result = evaluator(null, FhirEvaluationContext.CreateDefault());

            Assert.IsFalse(result.Any());
        }