Added tests
This commit is contained in:
parent
24204f4425
commit
e6f484cefd
|
@ -106,8 +106,6 @@ public class MdmGoldenResourceMergerSvcTest extends BaseMdmR4Test {
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO NG - add a test with a manually merged golden patient
|
|
||||||
|
|
||||||
private int redirectLinkCount() {
|
private int redirectLinkCount() {
|
||||||
MdmLink mdmLink = new MdmLink().setMatchResult(MdmMatchResultEnum.REDIRECT);
|
MdmLink mdmLink = new MdmLink().setMatchResult(MdmMatchResultEnum.REDIRECT);
|
||||||
Example<MdmLink> example = Example.of(mdmLink);
|
Example<MdmLink> example = Example.of(mdmLink);
|
||||||
|
@ -173,6 +171,24 @@ public class MdmGoldenResourceMergerSvcTest extends BaseMdmR4Test {
|
||||||
assertEquals(POSTAL_CODE, mergedSourcePatient.getAddressFirstRep().getPostalCode());
|
assertEquals(POSTAL_CODE, mergedSourcePatient.getAddressFirstRep().getPostalCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testManualOverride() {
|
||||||
|
Patient manuallyMergedPatient = new Patient();
|
||||||
|
populatePatient(manuallyMergedPatient);
|
||||||
|
manuallyMergedPatient.getNameFirstRep().setFamily("TestFamily");
|
||||||
|
manuallyMergedPatient.getNameFirstRep().getGiven().clear();
|
||||||
|
manuallyMergedPatient.getNameFirstRep().addGiven("TestGiven");
|
||||||
|
|
||||||
|
MdmTransactionContext ctx = createMdmContext();
|
||||||
|
ctx.setRestOperation(MdmTransactionContext.OperationType.MANUAL_MERGE_GOLDEN_RESOURCES);
|
||||||
|
Patient mergedSourcePatient = (Patient) myGoldenResourceMergerSvc
|
||||||
|
.mergeGoldenResources(myFromGoldenPatient, manuallyMergedPatient, myToGoldenPatient, ctx);
|
||||||
|
|
||||||
|
HumanName returnedName = mergedSourcePatient.getNameFirstRep();
|
||||||
|
assertEquals("TestGiven TestFamily", returnedName.getNameAsSingleString());
|
||||||
|
assertEquals(POSTAL_CODE, mergedSourcePatient.getAddressFirstRep().getPostalCode());
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void fromLinkToNoLink() {
|
public void fromLinkToNoLink() {
|
||||||
createMdmLink(myFromGoldenPatient, myTargetPatient1);
|
createMdmLink(myFromGoldenPatient, myTargetPatient1);
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
package ca.uhn.fhir.jpa.mdm.svc;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
|
class MdmSurvivorshipSvcImplTest {
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue