Skip to content

Exceptions

All public exceptions raised by Fhircraft, organized by component.

DefinitionNotFoundError

Path: fhircraft.exceptions.DefinitionNotFoundError

DefinitionNotFoundError(message: str, component: str = 'registry')

Bases: FhircraftException, FileNotFoundError

Raised when a required structure definition cannot be resolved.

Source code in fhircraft/exceptions.py
def __init__(self, message: str, component: str = "registry"):
    super().__init__(message, component=component)

FactoryAssemblerError

Path: fhircraft.exceptions.FactoryAssemblerError

FactoryAssemblerError(message: str, component: str = 'factory')

Bases: FactoryException, LookupError

Raised when the assembler encounters an error.

Source code in fhircraft/exceptions.py
def __init__(self, message: str, component: str = "factory"):
    super().__init__(message, component=component)

FactoryBuilderError

Path: fhircraft.exceptions.FactoryBuilderError

FactoryBuilderError(message: str, component: str = 'factory')

Bases: FactoryException

Raised when a Builder operation fails.

Source code in fhircraft/exceptions.py
def __init__(self, message: str, component: str = "factory"):
    super().__init__(message, component=component)

FactoryDefinitionIndexError

Path: fhircraft.exceptions.FactoryDefinitionIndexError

FactoryDefinitionIndexError(message: str, component: str = 'factory')

Bases: FactoryException

Raised when a DefinitionIndex navigation or construction operation fails.

Source code in fhircraft/exceptions.py
def __init__(self, message: str, component: str = "factory"):
    super().__init__(message, component=component)

FactoryDefinitionResolutionError

Path: fhircraft.exceptions.FactoryDefinitionResolutionError

FactoryDefinitionResolutionError(message: str, component: str = 'factory')

Bases: FactoryException

Raised when a SnapshotResolver or DefinitionIndex operation fails.

Source code in fhircraft/exceptions.py
def __init__(self, message: str, component: str = "factory"):
    super().__init__(message, component=component)

FactoryException

Path: fhircraft.exceptions.FactoryException

FactoryException(message: str, component: str = 'factory')

Bases: FhircraftException

Base exception for all Factory component errors.

Source code in fhircraft/exceptions.py
def __init__(self, message: str, component: str = "factory"):
    super().__init__(message, component=component)

FactoryTypeResolutionError

Path: fhircraft.exceptions.FactoryTypeResolutionError

FactoryTypeResolutionError(message: str, component: str = 'factory')

Bases: FactoryException, LookupError

Raised when resolving a FHIR type fails.

Source code in fhircraft/exceptions.py
def __init__(self, message: str, component: str = "factory"):
    super().__init__(message, component=component)

FactoryWarning

Path: fhircraft.exceptions.FactoryWarning

Bases: FhircraftWarning

Warning raised for non-critical issues encountered during factory operations.

FhirPathException

Path: fhircraft.exceptions.FhirPathException

FhirPathException(message: str, component: str = 'fhirpath')

Bases: FhircraftException

Base exception for all FHIRPath errors.

Source code in fhircraft/exceptions.py
def __init__(self, message: str, component: str = "fhirpath"):
    super().__init__(message, component=component)

FhirPathLexingError

Path: fhircraft.exceptions.FhirPathLexingError

FhirPathLexingError(message: str, component: str = 'fhirpath')

Bases: FhirPathException

Exception raised for errors encountered during the lexical analysis of FHIRPath expressions.

This error is typically thrown when the FHIRPath lexer encounters invalid tokens or cannot interpret a given FHIRPath expression.

Source code in fhircraft/exceptions.py
def __init__(self, message: str, component: str = "fhirpath"):
    super().__init__(message, component=component)

FhirPathOperationError

Path: fhircraft.exceptions.FhirPathOperationError

FhirPathOperationError(message: str, component: str = 'fhirpath')

Bases: FhirPathException

Exception raised when an unsupported or invalid operation is encountered during FHIRPath evaluation.

This can occur when trying to call functions that don't exist or with incompatible arguments.

Source code in fhircraft/exceptions.py
def __init__(self, message: str, component: str = "fhirpath"):
    super().__init__(message, component=component)

FhirPathParsingError

Path: fhircraft.exceptions.FhirPathParsingError

FhirPathParsingError(message: str, component: str = 'fhirpath')

Bases: FhirPathException

Exception raised for errors encountered during the parsing of FHIRPath expressions.

This error is typically thrown when the FHIRPath parser encounters invalid syntax or cannot interpret a given FHIRPath expression.

Source code in fhircraft/exceptions.py
def __init__(self, message: str, component: str = "fhirpath"):
    super().__init__(message, component=component)

FhirPathRuntimeError

Path: fhircraft.exceptions.FhirPathRuntimeError

FhirPathRuntimeError(message: str, component: str = 'fhirpath')

Bases: FhirPathException, RuntimeError

Exception raised for errors that occur during the runtime evaluation of FHIRPath expressions.

This exception is intended to signal issues encountered while processing or executing FHIRPath logic, such as invalid operations, type mismatches, or other runtime-specific problems.

Source code in fhircraft/exceptions.py
def __init__(self, message: str, component: str = "fhirpath"):
    super().__init__(message, component=component)

FhirPathTypeError

Path: fhircraft.exceptions.FhirPathTypeError

FhirPathTypeError(message: str, component: str = 'fhirpath')

Bases: FhirPathException

Exception raised when there are type mismatches during FHIRPath expression evaluation.

This typically occurs when attempting incompatible operations on values of different types.

Source code in fhircraft/exceptions.py
def __init__(self, message: str, component: str = "fhirpath"):
    super().__init__(message, component=component)

FhirPathWarning

Path: fhircraft.exceptions.FhirPathWarning

Bases: FhircraftWarning

Warning raised for non-critical issues encountered during FHIRPath expression processing.

This warning can be used to alert users to potential problems or unexpected behavior that do not necessarily prevent the execution of FHIRPath operations.

FhirTypeError

Path: fhircraft.exceptions.FhirTypeError

FhirTypeError(message: str, component: str = 'type')

Bases: FhircraftException

Raised when type checking or conversion fails.

Source code in fhircraft/exceptions.py
def __init__(self, message: str, component: str = "type"):
    super().__init__(message, component=component)

FhirValidationWarning

Path: fhircraft.exceptions.FhirValidationWarning

Bases: FhircraftWarning

Warning raised for non-critical issues encountered during FHIR resource validation.

FhircraftException

Path: fhircraft.exceptions.FhircraftException

FhircraftException(message: str, component: Optional[str] = None)

Bases: Exception

Base exception for all fhircraft errors.

All exceptions in fhircraft inherit from this class, allowing users to catch any fhircraft-related error with a single except clause.

Attributes:

Name Type Description
message

Human-readable error message

component

Optional component identifier (e.g., 'mapper', 'path', 'factory')

Parameters:

Name Type Description Default
message str

Detailed error message describing what went wrong

required
component Optional[str]

Optional identifier for which component raised the error

None
Source code in fhircraft/exceptions.py
def __init__(self, message: str, component: Optional[str] = None):
    """
    Initialize a fhircraft exception.

    Args:
        message: Detailed error message describing what went wrong
        component: Optional identifier for which component raised the error
    """
    self.message = message
    self.component = component
    super().__init__(self._format_message())

FhircraftWarning

Path: fhircraft.exceptions.FhircraftWarning

Bases: Warning

Base warning for all fhircraft warnings.

This can be used to signal non-critical issues or potential problems without raising an exception.

MapperDigestionError

Path: fhircraft.exceptions.MapperDigestionError

MapperDigestionError(message: str, component: str = 'mapper')

Bases: MapperException

Raised during the digestion of StructureMap definitions.

Source code in fhircraft/exceptions.py
def __init__(self, message: str, component: str = "mapper"):
    super().__init__(message, component=component)

MapperException

Path: fhircraft.exceptions.MapperException

MapperException(message: str, component: str = 'mapper')

Bases: FhircraftException

Base exception for all FHIR Mapper errors.

Source code in fhircraft/exceptions.py
def __init__(self, message: str, component: str = "mapper"):
    super().__init__(message, component=component)

MapperExecutionError

Path: fhircraft.exceptions.MapperExecutionError

MapperExecutionError(message: str, component: str = 'mapper')

Bases: MapperException

Raised when mapping execution fails.

Source code in fhircraft/exceptions.py
def __init__(self, message: str, component: str = "mapper"):
    super().__init__(message, component=component)

MapperGroupProcessingError

Path: fhircraft.exceptions.MapperGroupProcessingError

MapperGroupProcessingError(message: str, component: str = 'mapper')

Bases: MapperException

Raised when group processing fails.

Source code in fhircraft/exceptions.py
def __init__(self, message: str, component: str = "mapper"):
    super().__init__(message, component=component)

MapperParsingError

Path: fhircraft.exceptions.MapperParsingError

MapperParsingError(message: str, component: str = 'mapper')

Bases: MapperException

Raised when FHIR Mapping Language syntax or parsing fails.

Source code in fhircraft/exceptions.py
def __init__(self, message: str, component: str = "mapper"):
    super().__init__(message, component=component)

MapperRegistryNotFoundError

Path: fhircraft.exceptions.MapperRegistryNotFoundError

MapperRegistryNotFoundError(message: str, component: str = 'mapper')

Bases: MapperException, FileNotFoundError

Raised when a required StructureMap cannot be resolved.

Source code in fhircraft/exceptions.py
def __init__(self, message: str, component: str = "mapper"):
    super().__init__(message, component=component)

MapperRuleProcessingError

Path: fhircraft.exceptions.MapperRuleProcessingError

MapperRuleProcessingError(message: str, component: str = 'mapper')

Bases: MapperException

Raised when rule processing fails.

Source code in fhircraft/exceptions.py
def __init__(self, message: str, component: str = "mapper"):
    super().__init__(message, component=component)

MapperScopeError

Path: fhircraft.exceptions.MapperScopeError

MapperScopeError(message: str, component: str = 'mapper')

Bases: MapperException

Raised when something accessing or modifying the mapping scope fails.

Source code in fhircraft/exceptions.py
def __init__(self, message: str, component: str = "mapper"):
    super().__init__(message, component=component)

MapperSourceProcessingError

Path: fhircraft.exceptions.MapperSourceProcessingError

MapperSourceProcessingError(message: str, component: str = 'mapper')

Bases: MapperException

Raised when source/input processing fails.

Source code in fhircraft/exceptions.py
def __init__(self, message: str, component: str = "mapper"):
    super().__init__(message, component=component)

MapperTargetProcessingError

Path: fhircraft.exceptions.MapperTargetProcessingError

MapperTargetProcessingError(message: str, component: str = 'mapper')

Bases: MapperException

Raised when target/output processing fails.

Source code in fhircraft/exceptions.py
def __init__(self, message: str, component: str = "mapper"):
    super().__init__(message, component=component)

MapperValidationError

Path: fhircraft.exceptions.MapperValidationError

MapperValidationError(message: str, component: str = 'mapper')

Bases: MapperException

Raised when input data validation fails.

Source code in fhircraft/exceptions.py
def __init__(self, message: str, component: str = "mapper"):
    super().__init__(message, component=component)

PackageException

Path: fhircraft.exceptions.PackageException

PackageException(message: str, component: str = 'packages')

Bases: FhircraftException

Base exception for all Package Registry errors.

Source code in fhircraft/exceptions.py
def __init__(self, message: str, component: str = "packages"):
    super().__init__(message, component=component)

PackageNotFoundError

Path: fhircraft.exceptions.PackageNotFoundError

PackageNotFoundError(message: str, component: str = 'packages')

Bases: PackageException

Raised when a package is not found in the registry.

Source code in fhircraft/exceptions.py
def __init__(self, message: str, component: str = "packages"):
    super().__init__(message, component=component)

PackageResolutionError

Path: fhircraft.exceptions.PackageResolutionError

PackageResolutionError(message: str, component: str = 'packages')

Bases: PackageException

Raised when package resolution or loading fails.

Source code in fhircraft/exceptions.py
def __init__(self, message: str, component: str = "packages"):
    super().__init__(message, component=component)

PackageValidationError

Path: fhircraft.exceptions.PackageValidationError

PackageValidationError(message: str, component: str = 'packages')

Bases: PackageException

Raised when package validation fails.

Source code in fhircraft/exceptions.py
def __init__(self, message: str, component: str = "packages"):
    super().__init__(message, component=component)