Class GoldenResourceHelper

    • Constructor Detail

      • GoldenResourceHelper

        @Autowired
        public GoldenResourceHelper​(ca.uhn.fhir.context.FhirContext theFhirContext)
    • Method Detail

      • createGoldenResourceFromMdmSourceResource

        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 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)
      • 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 from
        theResourceToCloneInto - Resource to set the EID on
        theEid - EID to be set