Skip to content

Configure FHIR Versions Through Configs #120

@jenniferjiangkells

Description

@jenniferjiangkells

Description

The system currently lacks a standardized way to specify and handle different FHIR versions (R4, R5, etc.), leading to potential compatibility issues when integrating with external systems. fhir.resource has different subpackages for older FHIR versions. Someone correct me if I'm wrong but should be able to do something like

import importlib

def get_fhir_resource(resource_name, version=None):
    """
    Dynamically import a FHIR resource class based on version
    
    Args:
        resource_name: Name of the resource (e.g., "Patient")
        version: FHIR version (None for default/R5, "R4B", "STU3")
        
    Returns:
        The FHIR resource class
    """
    if version:
        module_path = f"fhir.resources.{version}.{resource_name.lower()}"
    else:
        module_path = f"fhir.resources.{resource_name.lower()}"
    
    module = importlib.import_module(module_path)
    return getattr(module, resource_name)

# Usage examples
Patient_R5 = get_fhir_resource("Patient")             # Default/R5
Patient_R4B = get_fhir_resource("Patient", "R4B")     # R4B version
Patient_STU3 = get_fhir_resource("Patient", "STU3")   # STU3 version

Tasks

  • Design a configuration schema that allows specifying FHIR versions
  • Implement conversion utilities between different FHIR versions when needed

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: GatewayIssue/PR that handles connections, API gateways

    Type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions