You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I would like the fhir path evaluation to resolve elements from a database / http call.
This is currently possible with: FhirEvaluationContext.ElementResolver
However the caveat is that I would have to introduce blocking in to my application, as the delegate can not be async.
Describe the solution you'd like
new property AsyncElementResolver on FhirEvaluationContext of type Func<string,Task<ITypedElement>>
new method Compile(string fhirPath, bool async) that evaluates to CompiledAsyncExpression
new delegate type public delegate Task<IEnumerable<ITypedElement>> CompiledAsyncExpression(ITypedElement root, EvaluationContext ctx);
so in the end I can do the following:
varexpression=compiler.Compile("entry.resource.ofType(MedicationRequest).medication.resolve().id",true);varresult=awaitexpression(bundle,newFhirEvaluationContext{AsyncElementResolver=async(id)=>{// call to db or httpreturn ...}});
Describe alternatives you've considered
it's possible with blocking via .GetAwaiter().GetResult()
Additional context
this was discovered during connectathon cds hooks testing.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I would like the fhir path evaluation to resolve elements from a database / http call.
This is currently possible with:
FhirEvaluationContext.ElementResolver
However the caveat is that I would have to introduce blocking in to my application, as the delegate can not be async.
Describe the solution you'd like
AsyncElementResolver
onFhirEvaluationContext
of typeFunc<string,Task<ITypedElement>>
Compile(string fhirPath, bool async)
that evaluates toCompiledAsyncExpression
public delegate Task<IEnumerable<ITypedElement>> CompiledAsyncExpression(ITypedElement root, EvaluationContext ctx);
so in the end I can do the following:
Describe alternatives you've considered
it's possible with blocking via
.GetAwaiter().GetResult()
Additional context
this was discovered during connectathon cds hooks testing.
The text was updated successfully, but these errors were encountered: