Skip to content

Exceptions

All public exceptions raised by Fhircraft, organized by component.

exceptions

Fhircraft Exceptions Module

This module provides a unified public API for all exceptions in fhircraft. All exceptions inherit from FhircraftException and are organized by component.

Classes:

Name Description
FhircraftException

Base exception for all fhircraft errors.

FhircraftWarning

Base warning for all fhircraft warnings.

MapperException

Base exception for all FHIR Mapper errors.

MapperWarning

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

MapperLexingError

Raised when FHIR Mapping Language parsing fails.

MapperParsingError

Raised when FHIR Mapping Language syntax or parsing fails.

MapperValidationError

Raised when input data validation fails.

MapperScopeError

Raised when something accessing or modifying the mapping scope fails.

MapperDigestionError

Raised during the digestion of StructureMap definitions.

MapperGroupProcessingError

Raised when group processing fails.

MapperRuleProcessingError

Raised when rule processing fails.

MapperSourceProcessingError

Raised when source/input processing fails.

MapperTargetProcessingError

Raised when target/output processing fails.

MapperExecutionError

Raised when mapping execution fails.

MapperRegistryNotFoundError

Raised when a required StructureMap cannot be resolved.

FHIRPathException

Base exception for all FHIRPath errors.

FHIRPathParsingError

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

FHIRPathLexingError

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

FHIRPathRuntimeError

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

FHIRPathTypeError

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

FHIRPathOperationError

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

FHIRPathWarning

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

FhirValidationWarning

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

FhirTypeError

Raised when type checking or conversion fails.

DefinitionNotFoundError

Raised when a required structure definition cannot be resolved.

FactoryException

Base exception for all Factory component errors.

FactoryDefinitionIndexError

Raised when a DefinitionIndex navigation or construction operation fails.

FactoryDefinitionResolutionError

Raised when a SnapshotResolver or DefinitionIndex operation fails.

FactoryBuilderError

Raised when a Builder operation fails.

FactoryTypeResolutionError

Raised when resolving a FHIR type fails.

FactoryAssemblerError

Raised when the assembler encounters an error.

FactoryWarning

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

PackageException

Base exception for all Package Registry errors.

PackageNotFoundError

Raised when a package is not found in the registry.

PackageResolutionError

Raised when package resolution or loading fails.

PackageValidationError

Raised when package validation fails.

PackageValidationWarning

Warning raised for non-critical issues encountered during package 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

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.

MapperException

Path: fhircraft.exceptions.MapperException

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

Bases: FhircraftException

Base exception for all FHIR Mapper errors.

MapperWarning

Path: fhircraft.exceptions.MapperWarning

Bases: FhircraftWarning

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

MapperLexingError

Path: fhircraft.exceptions.MapperLexingError

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

Bases: MapperException

Raised when FHIR Mapping Language parsing fails.

MapperParsingError

Path: fhircraft.exceptions.MapperParsingError

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

Bases: MapperException

Raised when FHIR Mapping Language syntax or parsing fails.

MapperValidationError

Path: fhircraft.exceptions.MapperValidationError

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

Bases: MapperException

Raised when input data validation fails.

MapperScopeError

Path: fhircraft.exceptions.MapperScopeError

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

Bases: MapperException

Raised when something accessing or modifying the mapping scope fails.

MapperDigestionError

Path: fhircraft.exceptions.MapperDigestionError

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

Bases: MapperException

Raised during the digestion of StructureMap definitions.

MapperGroupProcessingError

Path: fhircraft.exceptions.MapperGroupProcessingError

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

Bases: MapperException

Raised when group processing fails.

MapperRuleProcessingError

Path: fhircraft.exceptions.MapperRuleProcessingError

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

Bases: MapperException

Raised when rule processing fails.

MapperSourceProcessingError

Path: fhircraft.exceptions.MapperSourceProcessingError

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

Bases: MapperException

Raised when source/input processing fails.

MapperTargetProcessingError

Path: fhircraft.exceptions.MapperTargetProcessingError

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

Bases: MapperException

Raised when target/output processing fails.

MapperExecutionError

Path: fhircraft.exceptions.MapperExecutionError

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

Bases: MapperException

Raised when mapping execution fails.

MapperRegistryNotFoundError

Path: fhircraft.exceptions.MapperRegistryNotFoundError

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

Bases: MapperException, FileNotFoundError

Raised when a required StructureMap cannot be resolved.

FHIRPathException

Path: fhircraft.exceptions.FHIRPathException

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

Bases: FhircraftException

Base exception for all FHIRPath errors.

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.

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.

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.

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.

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.

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.

FhirValidationWarning

Path: fhircraft.exceptions.FhirValidationWarning

Bases: FhircraftWarning

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

FhirTypeError

Path: fhircraft.exceptions.FhirTypeError

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

Bases: FhircraftException

Raised when type checking or conversion fails.

DefinitionNotFoundError

Path: fhircraft.exceptions.DefinitionNotFoundError

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

Bases: FhircraftException, FileNotFoundError

Raised when a required structure definition cannot be resolved.

FactoryException

Path: fhircraft.exceptions.FactoryException

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

Bases: FhircraftException

Base exception for all Factory component errors.

FactoryDefinitionIndexError

Path: fhircraft.exceptions.FactoryDefinitionIndexError

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

Bases: FactoryException

Raised when a DefinitionIndex navigation or construction operation fails.

FactoryDefinitionResolutionError

Path: fhircraft.exceptions.FactoryDefinitionResolutionError

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

Bases: FactoryException

Raised when a SnapshotResolver or DefinitionIndex operation fails.

FactoryBuilderError

Path: fhircraft.exceptions.FactoryBuilderError

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

Bases: FactoryException

Raised when a Builder operation fails.

FactoryTypeResolutionError

Path: fhircraft.exceptions.FactoryTypeResolutionError

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

Bases: FactoryException, LookupError

Raised when resolving a FHIR type fails.

FactoryAssemblerError

Path: fhircraft.exceptions.FactoryAssemblerError

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

Bases: FactoryException, LookupError

Raised when the assembler encounters an error.

FactoryWarning

Path: fhircraft.exceptions.FactoryWarning

Bases: FhircraftWarning

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

PackageException

Path: fhircraft.exceptions.PackageException

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

Bases: FhircraftException

Base exception for all Package Registry errors.

PackageNotFoundError

Path: fhircraft.exceptions.PackageNotFoundError

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

Bases: PackageException

Raised when a package is not found in the registry.

PackageResolutionError

Path: fhircraft.exceptions.PackageResolutionError

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

Bases: PackageException

Raised when package resolution or loading fails.

PackageValidationError

Path: fhircraft.exceptions.PackageValidationError

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

Bases: PackageException

Raised when package validation fails.

PackageValidationWarning

Path: fhircraft.exceptions.PackageValidationWarning

Bases: FhircraftWarning

Warning raised for non-critical issues encountered during package validation.