Skip to content

Make $merge Feature Optional in JPA Server (Avoid Mandatory Patient DAO Requirement) #7380

@patrick-werner

Description

@patrick-werner

Summary

The $merge feature in the HAPI FHIR JPA Server is currently initialized unconditionally. As a result, several merge-related services (MergeValidationService, ResourceMergeService, MergeProvenanceSvc, and merge providers) require the existence of certain DAOs — most notably the Patient DAO.

When a deployment intentionally limits supported_resource_types (e.g., to only Organization or HealthcareService), these DAOs do not exist in the DaoRegistry. This causes the server to fail during startup with errors such as:

`No DAO exists for resource type class org.hl7.fhir.r4.model.Patient``

This makes it impossible to run a minimal or restricted JPA Server instance without implicitly supporting Patient, even when $merge is not needed.

Expected Behavior

  • $merge should be fully optional at the JPA-layer.
  • If a server disables resource merge:
  • No merge-related beans should be constructed.
  • No DAOs for specific resource types (such as Patient) should be required.
  • No $merge operations should be exposed via REST.
  • The default behavior must remain fully backward-compatible.

Environment
• HAPI FHIR version: 8.4
• Module: JPA Server (core), R4/R5 configs
• Relevant area: Merge Services and $merge provider registration

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