A StructureMap is a canonical FHIR resource that houses a FHIR Mapping Language script, providing a computable, step-by-step blueprint for converting source data into target FHIR resources. It acts as a deterministic transformation engine, explicitly defining how to map, translate, and restructure data elements from a legacy format like HL7 v2 or CDA into a conformant FHIR Bundle.
Glossary
StructureMap

What is StructureMap?
A FHIR resource that defines a detailed, executable transformation from one set of FHIR resources or a legacy format to another, mapping element by element.
Unlike a ConceptMap, which only provides semantic translations between code systems, a StructureMap handles the full structural transformation of an entire document. It is executed by a FHIR mapping engine to automate the conversion process, ensuring consistent and repeatable data migration or normalization, and is often published within a FHIR Implementation Guide to standardize interoperability.
Key Features of StructureMap
A FHIR resource that defines a detailed, executable transformation from one set of FHIR resources or a legacy format to another, mapping element by element.
Declarative Mapping Rules
StructureMap defines transformations using a declarative syntax, not procedural code. Each rule specifies a source context, a target context, and a transform expression. This allows the engine to optimize execution order and enables static analysis of the map for correctness. Rules can be conditional, using FHIRPath expressions to gate execution based on source data values. The declarative model separates the what from the how, making maps auditable by clinical informaticists without requiring deep programming knowledge.
Group-Based Structural Organization
Maps are organized into groups, which are logical containers for related rules. Each group has:
- Input: One or more source resource types or data structures
- Output: The target resource or element being constructed
- Rule set: The transformations to execute
Groups can be nested and invoked like functions, enabling reuse. A group that maps a Patient resource can be called from multiple parent groups, ensuring consistent transformation logic across an entire implementation guide.
FHIRPath Expression Integration
StructureMap uses FHIRPath as its expression language for all value computation and conditional logic. This provides:
- Source extraction:
source.name.givento pull a patient's first name - Conditional execution:
source.birthDate < today() - 18 yearsto gate rules - String manipulation:
source.name.family & ', ' & source.name.givenfor formatting - Type checking:
source.value is Quantityto branch logic
Because FHIRPath is a standardized, implementation-independent language, maps remain portable across different FHIR server implementations.
Variable Management and Scoping
StructureMap supports typed variables that hold intermediate results during transformation. Variables are scoped to their defining group and can store:
- Primitive values: Strings, integers, booleans
- FHIR resources: Fully constructed resources for later reference
- Lists: Collections of elements for iteration
This enables complex multi-step transformations where a value extracted early in the map can be referenced in multiple target elements later, avoiding redundant extraction logic and ensuring consistency.
Dependency and Invocation Model
Maps can declare dependencies on other StructureMaps, enabling modular composition. A high-level map for converting a CDA document to a FHIR Bundle might invoke:
- A
CDAtoPatientmap for the subject - A
CDAtoMedicationRequestmap for prescribed medications - A
CDAtoObservationmap for vital signs
Each dependency is resolved at execution time. This promotes a library of reusable, tested transformation components rather than monolithic, single-use maps. Circular dependencies are detected and rejected during parsing.
Target Transformation Directives
StructureMap provides explicit directives for how targets should be constructed:
- create: Instantiate a new resource or element
- copy: Duplicate a source element to the target
- truncate: Copy but limit to a specified length
- escape: Apply FHIR escaping rules to the value
- cast: Convert between compatible data types
- append: Add to an existing list rather than replacing
- translate: Apply a ConceptMap to convert codes
These directives give precise control over data shaping, ensuring the output conforms exactly to the target FHIR profile's constraints.
Frequently Asked Questions
Clear, technical answers to the most common questions about the FHIR StructureMap resource, its role in healthcare data transformation, and its relationship to the FHIR Mapping Language.
A FHIR StructureMap is a canonical resource that defines a detailed, executable transformation from a source data structure to a target data structure, mapping element by element. It serves as the blueprint for converting one set of FHIR resources or a legacy format like HL7 v2 or CDA into another. The StructureMap works by declaring a series of group elements, each containing input definitions and a set of rule statements. Each rule specifies a source context, a target context, and a transform operation (e.g., copy, append, reference, evaluate). The FHIR Mapping Language is the textual syntax used to author these rules, which is then compiled into the formal StructureMap resource. At runtime, a transformation engine like the FHIR Validator or a dedicated mapper executes the StructureMap against an input bundle, producing a new output bundle. This declarative approach ensures that complex healthcare data migrations are repeatable, testable, and standards-compliant, eliminating brittle, hand-coded point-to-point interfaces.
StructureMap vs. ConceptMap vs. FHIR Mapping Language
A comparison of the three primary FHIR-based mechanisms for defining data transformations and semantic equivalences.
| Feature | StructureMap | ConceptMap | FHIR Mapping Language |
|---|---|---|---|
Primary Purpose | Executable data transformation between resources or formats | Semantic mapping between code system concepts | Authoring syntax for defining mapping rules |
Defines Executable Logic | |||
Handles Terminology Translation | |||
Target Output | A modified or new FHIR resource instance | A relationship between two codes | A StructureMap instance |
Input Scope | Any set of source data (FHIR, v2, CDA, JSON) | A source code system and concept | A source data structure definition |
Human-Readable Syntax | |||
Machine-Processable Format | |||
Supports Conditional Logic |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
StructureMap is the executable engine of FHIR transformation. Master these related concepts to build a complete, standards-compliant data mapping pipeline.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us