Skip to content

Make $merge Feature Optional / Disable Merge Services When Not Needed #890

@patrick-werner

Description

@patrick-werner

Summary

When configuring supported_resource_types in the HAPI FHIR JPA Starter to include only a subset of resources (e.g., Organization, HealthcareService), the application fails to start due to the $merge feature being initialized unconditionally. The merge services assume the existence of a Patient DAO, which is not present when the user explicitly limits supported resources.

This results in startup failures such as:
No DAO exists for resource type class org.hl7.fhir.r4.model.Patient

This makes it impossible to run a minimal JPA server without implicitly supporting Patient or other resources that $merge depends on.

Expected Behavior

  • It should be possible to disable all $merge-related services (MergeValidationService, ResourceMergeService, MergeProvenanceSvc, and merge providers).
  • When disabled, no merge-related beans should be constructed and the server should start even if Patient is not available in the DaoRegistry.
  • Configuration should remain fully backward-compatible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions