Package ca.uhn.fhir.mdm.svc
Class MdmSurvivorshipSvcImpl
java.lang.Object
ca.uhn.fhir.mdm.svc.MdmSurvivorshipSvcImpl
- All Implemented Interfaces:
IMdmSurvivorshipService
-
Field Summary
-
Constructor Summary
ConstructorDescriptionMdmSurvivorshipSvcImpl
(ca.uhn.fhir.context.FhirContext theFhirContext, GoldenResourceHelper theResourceHelper, DaoRegistry theDaoRegistry, IMdmLinkQuerySvc theLinkQuerySvc, IIdHelperService<?> theIIdHelperService, HapiTransactionService theHapiTransactionService) -
Method Summary
Modifier and TypeMethodDescription<T extends org.hl7.fhir.instance.model.api.IBase>
voidapplySurvivorshipRulesToGoldenResource
(T theTargetResource, T theGoldenResource, MdmTransactionContext theMdmTransactionContext) Merges two golden resources by overwriting all field values on theGoldenResource param for CREATE_RESOURCE, UPDATE_RESOURCE, SUBMIT_RESOURCE_TO_MDM, UPDATE_LINK (when setting to MATCH) and MANUAL_MERGE_GOLDEN_RESOURCES.<T extends org.hl7.fhir.instance.model.api.IBase>
TrebuildGoldenResourceWithSurvivorshipRules
(T theGoldenResourceBase, MdmTransactionContext theMdmTransactionContext) GoldenResources can have non-empty field data created from changes to the various resources that are matched to it (using some pre-defined survivorship rules).
-
Field Details
-
myFhirContext
-
-
Constructor Details
-
MdmSurvivorshipSvcImpl
public MdmSurvivorshipSvcImpl(ca.uhn.fhir.context.FhirContext theFhirContext, GoldenResourceHelper theResourceHelper, DaoRegistry theDaoRegistry, IMdmLinkQuerySvc theLinkQuerySvc, IIdHelperService<?> theIIdHelperService, HapiTransactionService theHapiTransactionService)
-
-
Method Details
-
applySurvivorshipRulesToGoldenResource
public <T extends org.hl7.fhir.instance.model.api.IBase> void applySurvivorshipRulesToGoldenResource(T theTargetResource, T theGoldenResource, MdmTransactionContext theMdmTransactionContext) Description copied from interface:IMdmSurvivorshipService
Merges two golden resources by overwriting all field values on theGoldenResource param for CREATE_RESOURCE, UPDATE_RESOURCE, SUBMIT_RESOURCE_TO_MDM, UPDATE_LINK (when setting to MATCH) and MANUAL_MERGE_GOLDEN_RESOURCES. PID, identifiers and meta values are not affected by this operation. Applies survivorship rules to merge fields from the specified target resource to the golden resource. Survivorship rules may include, but not limited to the following data consolidation methods:- Length of field - apply the field value containing most or least number of characters - e.g. longest name
- Date time - all the field value from the oldest or the newest recrod - e.g. use the most recent phone number
- Frequency - use the most or least frequent number of occurrence - e.g. most common phone number
- Integer - number functions (largest, sum, avg) - e.g. number of patient encounters
- Quality of data - best quality data - e.g. data coming from a certain system is considered trusted and overrides all other values
- A hybrid approach combining all methods listed above as best fits
- Specified by:
applySurvivorshipRulesToGoldenResource
in interfaceIMdmSurvivorshipService
- Type Parameters:
T
- Resource type to apply the survivorship rules to- Parameters:
theTargetResource
- Target resource to merge fields fromtheGoldenResource
- Golden resource to merge fields intotheMdmTransactionContext
- Current transaction context
-
rebuildGoldenResourceWithSurvivorshipRules
public <T extends org.hl7.fhir.instance.model.api.IBase> T rebuildGoldenResourceWithSurvivorshipRules(T theGoldenResourceBase, MdmTransactionContext theMdmTransactionContext) Description copied from interface:IMdmSurvivorshipService
GoldenResources can have non-empty field data created from changes to the various resources that are matched to it (using some pre-defined survivorship rules). If a match link between a source and golden resource is broken, this method will rebuild/repopulate the GoldenResource based on the current links and current survivorship rules.- Specified by:
rebuildGoldenResourceWithSurvivorshipRules
in interfaceIMdmSurvivorshipService
- Type Parameters:
T
- - Resource type to apply the survivorship rules to- Parameters:
theGoldenResourceBase
- - the golden resource to rebuildtheMdmTransactionContext
- - the transaction context
-