
Package ca.uhn.fhir.jpa.patch
Class FhirPatch
java.lang.Object
ca.uhn.fhir.jpa.patch.FhirPatch
FhirPatch handler.
Patch is defined by the spec: https://hl7.org/fhir/fhirpatch.html
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addIgnorePath
(String theIgnorePath) Adds a path element that will not be included in generated diffs.void
apply
(org.hl7.fhir.instance.model.api.IBaseResource theResource, org.hl7.fhir.instance.model.api.IBaseResource thePatch) Apply the patch against the given resource.org.hl7.fhir.instance.model.api.IBaseParameters
diff
(org.hl7.fhir.instance.model.api.IBaseResource theOldValue, org.hl7.fhir.instance.model.api.IBaseResource theNewValue) void
setIncludePreviousValueInDiff
(boolean theIncludePreviousValueInDiff) validate
(org.hl7.fhir.instance.model.api.IBaseResource thePatch) Validates a FHIRPatch Parameters document and throws anInvalidRequestException
if it is not valid.
-
Field Details
-
OPERATION_ADD
- See Also:
-
OPERATION_DELETE
- See Also:
-
OPERATION_INSERT
- See Also:
-
OPERATION_MOVE
- See Also:
-
OPERATION_REPLACE
- See Also:
-
PARAMETER_DESTINATION
- See Also:
-
PARAMETER_INDEX
- See Also:
-
PARAMETER_NAME
- See Also:
-
PARAMETER_OPERATION
- See Also:
-
PARAMETER_PATH
- See Also:
-
PARAMETER_SOURCE
- See Also:
-
PARAMETER_TYPE
- See Also:
-
PARAMETER_VALUE
- See Also:
-
PARAMETER_ALLOW_MULTIPLE_MATCHES
- See Also:
-
-
Constructor Details
-
FhirPatch
-
-
Method Details
-
addIgnorePath
Adds a path element that will not be included in generated diffs. Values can take the formResourceName.fieldName.fieldName
and wildcards are supported, such as*.meta
. -
setIncludePreviousValueInDiff
-
apply
public void apply(org.hl7.fhir.instance.model.api.IBaseResource theResource, org.hl7.fhir.instance.model.api.IBaseResource thePatch) Apply the patch against the given resource.- Parameters:
theResource
- The resourece to patch. This object will be modified in-place.thePatch
- The patch document.
-
diff
public org.hl7.fhir.instance.model.api.IBaseParameters diff(@Nullable org.hl7.fhir.instance.model.api.IBaseResource theOldValue, @Nonnull org.hl7.fhir.instance.model.api.IBaseResource theNewValue) -
validate
Validates a FHIRPatch Parameters document and throws anInvalidRequestException
if it is not valid. Note, in previous versions of HAPI FHIR this method threw an exception but the full error list is now returned instead.- Parameters:
thePatch
- The Parameters resource to validate as a FHIRPatch document- Returns:
- Returns a
FhirPatch.PatchOutcome
containing any errors - Since:
- 8.4.0
-