Class GoldenResourceHelper

java.lang.Object
ca.uhn.fhir.mdm.util.GoldenResourceHelper

@Service public class GoldenResourceHelper extends Object
  • Constructor Details

  • Method Details

    • createGoldenResourceFromMdmSourceResource

      @Nonnull public <T extends org.hl7.fhir.instance.model.api.IAnyResource> T createGoldenResourceFromMdmSourceResource(T theIncomingResource, MdmTransactionContext theMdmTransactionContext, IMdmSurvivorshipService theMdmSurvivorshipService)
      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 to build the golden resource off of. Could be the source resource or another golden resource. If a golden resource, do not provide an IMdmSurvivorshipService
      theMdmTransactionContext - The mdm transaction context
      theMdmSurvivorshipService - IMdmSurvivorshipSvc. Provide only if survivorshipskills are desired to be applied. Provide null otherwise.
    • 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 throw IllegalArgumentException

      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

      public boolean hasIdentifier(org.hl7.fhir.instance.model.api.IBaseResource theResource)
    • mergeIndentifierFields

      public void mergeIndentifierFields(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 from
      theResourceToCloneInto - Resource to set the EID on
      theEid - EID to be set