Skip to content
Advanced Topics

Advanced Topics

This section covers advanced features of the FHIRPath Go library that help you build production-ready applications. Each topic builds on the core API introduced in the Getting Started guide.

What You Will Find Here

  • Expression Caching – Avoid redundant parsing with the built-in LRU expression cache. Learn how to use the global DefaultCache, create custom caches, monitor hit rates, and pre-warm caches at startup.

  • Evaluation Options – Control evaluation behavior with timeouts, recursion limits, collection size caps, and custom variables via the functional options API.

  • FHIR Version-Specific Models – Use the Model interface to provide FHIR version-specific type metadata for precise polymorphic resolution, type hierarchy checking, and path-based inference. Compatible with gofhir/models for R4, R4B, and R5.

  • Custom Reference Resolvers – Implement the ReferenceResolver interface to let the resolve() function fetch referenced FHIR® resources from HTTP endpoints, in-memory bundles, or any other data source.

  • Terminology Services – Connect the memberOf() and conformsTo() functions to external terminology servers and profile validators by implementing the TerminologyService and ProfileValidator interfaces.

  • Performance Guide – Practical patterns for high-throughput evaluation: compile-once, expression caching, resource pre-serialization, early filtering, and avoiding unnecessary type conversions.

  • Thread Safety – Understand the concurrency model: which objects are safe to share across goroutines and which must remain per-evaluation. Includes HTTP handler and worker pool examples.

Last updated on