
Package ca.uhn.fhir.jpa.provider.merge
Class MergeOperationParametersUtil
java.lang.Object
ca.uhn.fhir.jpa.provider.merge.MergeOperationParametersUtil
Utility class for building FHIR Parameters resources for merge operations.
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.hl7.fhir.instance.model.api.IBaseParametersbuildMergeOperationOutputParameters(ca.uhn.fhir.context.FhirContext theFhirContext, MergeOperationOutcome theMergeOutcome, org.hl7.fhir.instance.model.api.IBaseResource theInputParameters) Builds the output Parameters resource for a Patient $merge operation following the FHIR specification.static org.hl7.fhir.instance.model.api.IBaseParametersbuildMergeOperationOutputParameters(ca.uhn.fhir.context.FhirContext theFhirContext, org.hl7.fhir.instance.model.api.IBaseResource theOperationOutcome, org.hl7.fhir.instance.model.api.IBaseResource theUpdatedTargetResource, org.hl7.fhir.instance.model.api.IBaseResource theTask, org.hl7.fhir.instance.model.api.IBaseResource theInputParameters) Builds the output Parameters resource for a Patient $merge operation from individual components.inputParamsFromOperationParams(List<?> theSourcePatientIdentifier, List<?> theTargetPatientIdentifier, org.hl7.fhir.instance.model.api.IBaseReference theSourcePatient, org.hl7.fhir.instance.model.api.IBaseReference theTargetPatient, org.hl7.fhir.instance.model.api.IPrimitiveType<Boolean> thePreview, org.hl7.fhir.instance.model.api.IPrimitiveType<Boolean> theDeleteSource, org.hl7.fhir.instance.model.api.IBaseResource theResultPatient, List<ca.uhn.fhir.model.api.IProvenanceAgent> theProvenanceAgents, org.hl7.fhir.instance.model.api.IBaseResource theOriginalInputParameters, int theResourceLimit) Build MergeOperationInputParameters from REST operation parameters.inputParamsFromParameters(ca.uhn.fhir.context.FhirContext theFhirContext, org.hl7.fhir.instance.model.api.IBaseParameters theParameters, int theResourceLimit, List<ca.uhn.fhir.model.api.IProvenanceAgent> theProvenanceAgents) Build MergeOperationInputParameters from a FHIR Parameters resource.
-
Method Details
-
buildMergeOperationOutputParameters
public static org.hl7.fhir.instance.model.api.IBaseParameters buildMergeOperationOutputParameters(ca.uhn.fhir.context.FhirContext theFhirContext, MergeOperationOutcome theMergeOutcome, org.hl7.fhir.instance.model.api.IBaseResource theInputParameters) Builds the output Parameters resource for a Patient $merge operation following the FHIR specification.The output Parameters includes:
- input - The original input parameters
- outcome - OperationOutcome describing the merge result
- result - Updated target patient (optional, not included in preview mode)
- task - Task resource tracking the merge (optional)
- Parameters:
theFhirContext- FHIR context for building Parameters resourcetheMergeOutcome- Merge operation outcome containing the resulttheInputParameters- Original input parameters to include in output- Returns:
- Parameters resource with merge operation output in FHIR $merge format
-
buildMergeOperationOutputParameters
public static org.hl7.fhir.instance.model.api.IBaseParameters buildMergeOperationOutputParameters(ca.uhn.fhir.context.FhirContext theFhirContext, org.hl7.fhir.instance.model.api.IBaseResource theOperationOutcome, org.hl7.fhir.instance.model.api.IBaseResource theUpdatedTargetResource, org.hl7.fhir.instance.model.api.IBaseResource theTask, org.hl7.fhir.instance.model.api.IBaseResource theInputParameters) Builds the output Parameters resource for a Patient $merge operation from individual components.This overload is useful when you have the merge result components separately rather than wrapped in a
MergeOperationOutcomeobject.- Parameters:
theFhirContext- FHIR context for building Parameters resourcetheOperationOutcome- Operation outcome describing the merge resulttheUpdatedTargetResource- Updated target patient resource (may be null in preview mode)theTask- Task resource tracking the merge operation (may be null)theInputParameters- Original input parameters to include in output- Returns:
- Parameters resource with merge operation output in FHIR $merge format
-
inputParamsFromOperationParams
public static MergeOperationInputParameters inputParamsFromOperationParams(List<?> theSourcePatientIdentifier, List<?> theTargetPatientIdentifier, org.hl7.fhir.instance.model.api.IBaseReference theSourcePatient, org.hl7.fhir.instance.model.api.IBaseReference theTargetPatient, org.hl7.fhir.instance.model.api.IPrimitiveType<Boolean> thePreview, org.hl7.fhir.instance.model.api.IPrimitiveType<Boolean> theDeleteSource, org.hl7.fhir.instance.model.api.IBaseResource theResultPatient, List<ca.uhn.fhir.model.api.IProvenanceAgent> theProvenanceAgents, org.hl7.fhir.instance.model.api.IBaseResource theOriginalInputParameters, int theResourceLimit) Build MergeOperationInputParameters from REST operation parameters. This method is used by REST providers that receive individual operation parameters.- Parameters:
theSourcePatientIdentifier- list of source patient identifierstheTargetPatientIdentifier- list of target patient identifierstheSourcePatient- source patient referencetheTargetPatient- target patient referencethePreview- preview flagtheDeleteSource- delete source flagtheResultPatient- result patient resourcetheProvenanceAgents- provenance agents for audittheOriginalInputParameters- original input parameters for provenance- Returns:
- MergeOperationInputParameters ready for use with ResourceMergeService
-
inputParamsFromParameters
public static MergeOperationInputParameters inputParamsFromParameters(ca.uhn.fhir.context.FhirContext theFhirContext, org.hl7.fhir.instance.model.api.IBaseParameters theParameters, int theResourceLimit, List<ca.uhn.fhir.model.api.IProvenanceAgent> theProvenanceAgents) Build MergeOperationInputParameters from a FHIR Parameters resource. Extracts all merge operation parameters according to the FHIR spec.- Parameters:
theParameters- FHIR Parameters resource containing merge operation inputstheProvenanceAgents- the obtained provenance agents- Returns:
- MergeOperationInputParameters ready for use with ResourceMergeService
-