Survivorship 7
This commit is contained in:
parent
57662eedb3
commit
a2e1bb57fa
|
@ -73,6 +73,8 @@ public class GoldenResourceMergerSvcImpl implements IGoldenResourceMergerSvc {
|
|||
|
||||
//Merge the links from the FROM to the TO resource. Clean up dangling links.
|
||||
mergeGoldenResourceLinks(theFromGoldenResource, theToGoldenResource, toGoldenResourcePid, theMdmTransactionContext);
|
||||
//Save changes to the golden resource
|
||||
myMdmResourceDaoSvc.upsertGoldenResource(theToGoldenResource, resourceType);
|
||||
|
||||
//Create the new REDIRECT link
|
||||
addMergeLink(toGoldenResourcePid, fromGoldenResourcePid, resourceType);
|
||||
|
|
|
@ -51,13 +51,12 @@ public class MdmProviderMergeGoldenResourcesR4Test extends BaseProviderR4Test {
|
|||
|
||||
assertEquals(myFromGoldenPatient.getName().size(), mergedSourcePatient.getName().size());
|
||||
assertEquals(myFromGoldenPatient.getName().get(0).getNameAsSingleString(), mergedSourcePatient.getName().get(0).getNameAsSingleString());
|
||||
|
||||
assertEquals(myFromGoldenPatient.getCommunication().size(), mergedSourcePatient.getCommunication().size());
|
||||
assertEquals(myFromGoldenPatient.getExtension().size(), mergedSourcePatient.getExtension().size());
|
||||
|
||||
Patient fromSourcePatient = myPatientDao.read(myFromGoldenPatient.getIdElement().toUnqualifiedVersionless());
|
||||
assertEquals(fromSourcePatient.getName().size(), mergedSourcePatient.getName().size());
|
||||
assertEquals(fromSourcePatient.getName().get(0).getNameAsSingleString(), mergedSourcePatient.getName().get(0).getNameAsSingleString());
|
||||
Patient toGoldenPatient = myPatientDao.read(myToGoldenPatient.getIdElement().toUnqualifiedVersionless());
|
||||
assertEquals(toGoldenPatient.getName().size(), mergedSourcePatient.getName().size());
|
||||
assertEquals(toGoldenPatient.getName().get(0).getNameAsSingleString(), mergedSourcePatient.getName().get(0).getNameAsSingleString());
|
||||
}
|
||||
|
||||
|
||||
|
@ -99,6 +98,7 @@ public class MdmProviderMergeGoldenResourcesR4Test extends BaseProviderR4Test {
|
|||
Patient mergedSourcePatient = (Patient) myMdmProvider.mergeGoldenResources(myFromGoldenPatientId,
|
||||
myToGoldenPatientId, myFromGoldenPatient, myRequestDetails);
|
||||
|
||||
myFromGoldenPatient = (Patient) myPatientDao.read(myFromGoldenPatient.getIdElement().toUnqualifiedVersionless());
|
||||
assertTrue(!MdmResourceUtil.isGoldenRecord(myFromGoldenPatient));
|
||||
assertTrue(MdmResourceUtil.isGoldenRecordRedirected(myFromGoldenPatient));
|
||||
|
||||
|
|
|
@ -346,7 +346,7 @@ public class MdmMatchLinkSvcTest extends BaseMdmR4Test {
|
|||
|
||||
//In a normal situation, janePatient2 would just match to jane patient, but here we need to hack it so they are their
|
||||
//own individual GoldenResource for the purpose of this test.
|
||||
IAnyResource goldenResource = myGoldenResourceHelper.createGoldenResourceFromMdmSourceResource(janePatient2, new MdmTransactionContext());
|
||||
IAnyResource goldenResource = myGoldenResourceHelper.createGoldenResourceFromMdmSourceResource(janePatient2, new MdmTransactionContext(MdmTransactionContext.OperationType.CREATE_RESOURCE));
|
||||
myMdmLinkSvc.updateLink(goldenResource, janePatient2, MdmMatchOutcome.NEW_GOLDEN_RESOURCE_MATCH, MdmLinkSourceEnum.AUTO, createContextForCreate("Patient"));
|
||||
assertThat(janePatient, is(not(sameGoldenResourceAs(janePatient2))));
|
||||
|
||||
|
@ -437,7 +437,7 @@ public class MdmMatchLinkSvcTest extends BaseMdmR4Test {
|
|||
public void testCreateGoldenResourceFromMdmTarget() {
|
||||
// Create Use Case #2 - adding patient with no EID
|
||||
Patient janePatient = buildJanePatient();
|
||||
Patient janeGoldenResourcePatient = myGoldenResourceHelper.createGoldenResourceFromMdmSourceResource(janePatient, new MdmTransactionContext());
|
||||
Patient janeGoldenResourcePatient = myGoldenResourceHelper.createGoldenResourceFromMdmSourceResource(janePatient, new MdmTransactionContext(MdmTransactionContext.OperationType.CREATE_RESOURCE));
|
||||
|
||||
// golden record now contains HAPI-generated EID and HAPI tag
|
||||
assertTrue(MdmResourceUtil.isMdmManaged(janeGoldenResourcePatient));
|
||||
|
|
|
@ -52,11 +52,15 @@ public class MdmTransactionContext {
|
|||
public MdmTransactionContext() {
|
||||
}
|
||||
|
||||
public MdmTransactionContext(TransactionLogMessages theTransactionLogMessages, OperationType theRestOperation) {
|
||||
myTransactionLogMessages = theTransactionLogMessages;
|
||||
public MdmTransactionContext(OperationType theRestOperation) {
|
||||
myRestOperation = theRestOperation;
|
||||
}
|
||||
|
||||
public MdmTransactionContext(TransactionLogMessages theTransactionLogMessages, OperationType theRestOperation) {
|
||||
this(theRestOperation);
|
||||
myTransactionLogMessages = theTransactionLogMessages;
|
||||
}
|
||||
|
||||
public MdmTransactionContext(TransactionLogMessages theTransactionLogMessages, OperationType theRestOperation, String theResourceType) {
|
||||
this(theTransactionLogMessages, theRestOperation);
|
||||
setResourceType(theResourceType);
|
||||
|
|
Loading…
Reference in New Issue