
Package ca.uhn.fhir.mdm.util
Class GoldenResourceHelper
java.lang.Object
ca.uhn.fhir.mdm.util.GoldenResourceHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
cloneEidIntoResource
(ca.uhn.fhir.context.FhirContext theFhirContext, org.hl7.fhir.instance.model.api.IBaseResource theResourceToCloneInto, CanonicalEID theEid) Clones the specified canonical EID into the identifier field on the resource<T extends org.hl7.fhir.instance.model.api.IAnyResource>
TcreateGoldenResourceFromMdmSourceResource
(T theIncomingResource, MdmTransactionContext theMdmTransactionContext) Creates a copy of the specified resource.void
handleExternalEidAddition
(org.hl7.fhir.instance.model.api.IAnyResource theGoldenResource, org.hl7.fhir.instance.model.api.IAnyResource theSourceResource, MdmTransactionContext theMdmTransactionContext) boolean
hasIdentifier
(org.hl7.fhir.instance.model.api.IBaseResource theResource) boolean
isPotentialDuplicate
(org.hl7.fhir.instance.model.api.IAnyResource theExistingGoldenResource, org.hl7.fhir.instance.model.api.IAnyResource theComparingGoldenResource) An incoming resource is a potential duplicate if it matches a source that has a golden resource with an official EID, but the incoming resource also has an EID that does not match.void
mergeIndentifierFields
(org.hl7.fhir.instance.model.api.IBaseResource theFromGoldenResource, org.hl7.fhir.instance.model.api.IBaseResource theToGoldenResource, MdmTransactionContext theMdmTransactionContext) void
mergeNonIdentiferFields
(org.hl7.fhir.instance.model.api.IBaseResource theFromGoldenResource, org.hl7.fhir.instance.model.api.IBaseResource theToGoldenResource, MdmTransactionContext theMdmTransactionContext) org.hl7.fhir.instance.model.api.IBaseResource
overwriteExternalEids
(org.hl7.fhir.instance.model.api.IBaseResource theGoldenResource, List<CanonicalEID> theNewEid) org.hl7.fhir.instance.model.api.IAnyResource
updateGoldenResourceExternalEidFromSourceResource
(org.hl7.fhir.instance.model.api.IAnyResource theGoldenResource, org.hl7.fhir.instance.model.api.IAnyResource theSourceResource, MdmTransactionContext theMdmTransactionContext) Updates EID on Golden Resource, based on the incoming source resource.
-
Constructor Details
-
GoldenResourceHelper
-
-
Method Details
-
createGoldenResourceFromMdmSourceResource
@Nonnull public <T extends org.hl7.fhir.instance.model.api.IAnyResource> T createGoldenResourceFromMdmSourceResource(T theIncomingResource, MdmTransactionContext theMdmTransactionContext) Creates a copy of the specified resource. This method will carry over resource EID if it exists. If it does not exist, a randomly generated UUID EID will be created.- Type Parameters:
T
- Supported MDM resource type (e.g. Patient, Practitioner)- Parameters:
theIncomingResource
- The resource that will be used as the starting point for the MDM linking.theMdmTransactionContext
-
-
updateGoldenResourceExternalEidFromSourceResource
public org.hl7.fhir.instance.model.api.IAnyResource updateGoldenResourceExternalEidFromSourceResource(org.hl7.fhir.instance.model.api.IAnyResource theGoldenResource, org.hl7.fhir.instance.model.api.IAnyResource theSourceResource, MdmTransactionContext theMdmTransactionContext) Updates EID on Golden Resource, based on the incoming source resource. If the incoming resource has an external EID, it is applied to the Golden Resource, unless that golden resource already has an external EID which does not match, in which case throwIllegalArgumentException
If running in multiple EID mode, then incoming EIDs are simply added to the Golden Resource without checking for matches.
- Parameters:
theGoldenResource
- The golden resource to update the external EID on.theSourceResource
- The source we will retrieve the external EID from.- Returns:
- the modified
IBaseResource
representing the Golden Resource.
-
overwriteExternalEids
public org.hl7.fhir.instance.model.api.IBaseResource overwriteExternalEids(org.hl7.fhir.instance.model.api.IBaseResource theGoldenResource, List<CanonicalEID> theNewEid) -
hasIdentifier
-
mergeIndentifierFields
public void mergeIndentifierFields(org.hl7.fhir.instance.model.api.IBaseResource theFromGoldenResource, org.hl7.fhir.instance.model.api.IBaseResource theToGoldenResource, MdmTransactionContext theMdmTransactionContext) -
mergeNonIdentiferFields
public void mergeNonIdentiferFields(org.hl7.fhir.instance.model.api.IBaseResource theFromGoldenResource, org.hl7.fhir.instance.model.api.IBaseResource theToGoldenResource, MdmTransactionContext theMdmTransactionContext) -
isPotentialDuplicate
public boolean isPotentialDuplicate(org.hl7.fhir.instance.model.api.IAnyResource theExistingGoldenResource, org.hl7.fhir.instance.model.api.IAnyResource theComparingGoldenResource) An incoming resource is a potential duplicate if it matches a source that has a golden resource with an official EID, but the incoming resource also has an EID that does not match. -
handleExternalEidAddition
public void handleExternalEidAddition(org.hl7.fhir.instance.model.api.IAnyResource theGoldenResource, org.hl7.fhir.instance.model.api.IAnyResource theSourceResource, MdmTransactionContext theMdmTransactionContext) -
cloneEidIntoResource
public void cloneEidIntoResource(ca.uhn.fhir.context.FhirContext theFhirContext, org.hl7.fhir.instance.model.api.IBaseResource theResourceToCloneInto, CanonicalEID theEid) Clones the specified canonical EID into the identifier field on the resource- Parameters:
theFhirContext
- Context to pull resource definitions fromtheResourceToCloneInto
- Resource to set the EID ontheEid
- EID to be set
-