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
The trace() function adds a string representation of the input collection to a diagnostic log using the name argument, then returns the input collection unchanged. An optional projection argument allows logging the result of a sub-expression instead of the full input.
Implement the trace() function in the FHIRPath engine (first argument only). During evaluation, each trace() call logs to SLF4J at TRACE level and collects trace entries (name + string representation of the collection) into a list. Add trace entries to SingleInstanceEvaluationResult alongside the existing results and expectedReturnType fields.
library-api module
Thread trace entries through PathlingContext.evaluateFhirPath() so they are available in the result returned to callers.
Python library
Update PathlingContext.evaluate_fhirpath() to extract trace entries from the Java result and include them in the returned dict (e.g. a trace key containing a list of {name, value} dicts).
Spec link: https://hl7.org/fhirpath/#trace-name-string-projection-expression-collection
The
trace()function adds a string representation of the input collection to a diagnostic log using thenameargument, then returns the input collection unchanged. An optionalprojectionargument allows logging the result of a sub-expression instead of the full input.Split from #2395, which now covers only
type()reflection.Scope
Only the first argument (
name : String) will be implemented. The optionalprojectionargument is out of scope.Limitations
nameargument must be a string literal. Dynamic expressions (e.g.,trace(someField)) are not supported and will raise an error.projectionargument is not supported.Trace sinks
Two sinks will be implemented for trace output:
TRACElevel via SLF4J during expression evaluation. This covers standalone library usage and the server.Changes required
fhirpath module
Implement the
trace()function in the FHIRPath engine (first argument only). During evaluation, eachtrace()call logs to SLF4J at TRACE level and collects trace entries (name + string representation of the collection) into a list. Add trace entries toSingleInstanceEvaluationResultalongside the existingresultsandexpectedReturnTypefields.library-api module
Thread trace entries through
PathlingContext.evaluateFhirPath()so they are available in the result returned to callers.Python library
Update
PathlingContext.evaluate_fhirpath()to extract trace entries from the Java result and include them in the returned dict (e.g. atracekey containing a list of{name, value}dicts).