fix empilinks
This commit is contained in:
parent
93da042d19
commit
1d9641a736
|
@ -25,7 +25,6 @@ import org.hl7.fhir.r4.model.Patient;
|
|||
import org.junit.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.batch.core.BatchStatus;
|
||||
import org.springframework.batch.core.Job;
|
||||
import org.springframework.batch.core.JobExecution;
|
||||
import org.springframework.batch.core.JobInstance;
|
||||
|
@ -341,9 +340,9 @@ public class BulkDataExportSvcImplR4Test extends BaseJpaR4Test {
|
|||
//create one itself, which means that its jobUUID isnt known until it starts. to get around this, we move
|
||||
public void awaitJobCompletion(JobExecution theJobExecution) throws InterruptedException {
|
||||
await().until(() -> {
|
||||
return theJobExecution.getStatus() == BatchStatus.COMPLETED;
|
||||
//String jobUUID = theJobExecution.getExecutionContext().getString("jobUUID");
|
||||
//return myBulkDataExportSvc.getJobInfoOrThrowResourceNotFound(jobUUID).getStatus() == BulkJobStatusEnum.COMPLETE;
|
||||
//return theJobExecution.getStatus() == BatchStatus.COMPLETED;
|
||||
String jobUUID = theJobExecution.getExecutionContext().getString("jobUUID");
|
||||
return myBulkDataExportSvc.getJobInfoOrThrowResourceNotFound(jobUUID).getStatus() == BulkJobStatusEnum.COMPLETE;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ public class EmpiPersonMergerSvcTest extends BaseEmpiR4Test {
|
|||
@Test
|
||||
public void mergeRemovesPossibleDuplicatesLink() {
|
||||
EmpiLink empiLink = new EmpiLink().setPersonPid(myToPersonPid).setTargetPid(myFromPersonPid).setMatchResult(EmpiMatchResultEnum.POSSIBLE_DUPLICATE).setLinkSource(EmpiLinkSourceEnum.AUTO);
|
||||
myEmpiLinkDaoSvc.save(empiLink);
|
||||
saveLink(empiLink);
|
||||
assertEquals(1, myEmpiLinkDao.count());
|
||||
mergePersons();
|
||||
assertEquals(0, myEmpiLinkDao.count());
|
||||
|
@ -179,7 +179,8 @@ public class EmpiPersonMergerSvcTest extends BaseEmpiR4Test {
|
|||
EmpiLink fromLink = createEmpiLink(myFromPerson, myTargetPatient1);
|
||||
fromLink.setLinkSource(EmpiLinkSourceEnum.MANUAL);
|
||||
fromLink.setMatchResult(EmpiMatchResultEnum.NO_MATCH);
|
||||
myEmpiLinkDaoSvc.save(fromLink);
|
||||
|
||||
saveLink(fromLink);
|
||||
|
||||
createEmpiLink(myToPerson, myTargetPatient1);
|
||||
|
||||
|
@ -196,7 +197,7 @@ public class EmpiPersonMergerSvcTest extends BaseEmpiR4Test {
|
|||
EmpiLink toLink = createEmpiLink(myToPerson, myTargetPatient1);
|
||||
toLink.setLinkSource(EmpiLinkSourceEnum.MANUAL);
|
||||
toLink.setMatchResult(EmpiMatchResultEnum.NO_MATCH);
|
||||
myEmpiLinkDaoSvc.save(toLink);
|
||||
saveLink(toLink);
|
||||
|
||||
mergePersons();
|
||||
List<EmpiLink> links = myEmpiLinkDaoSvc.findEmpiLinksByPersonId(myToPerson);
|
||||
|
@ -209,7 +210,7 @@ public class EmpiPersonMergerSvcTest extends BaseEmpiR4Test {
|
|||
EmpiLink fromLink = createEmpiLink(myFromPerson, myTargetPatient1);
|
||||
fromLink.setLinkSource(EmpiLinkSourceEnum.MANUAL);
|
||||
fromLink.setMatchResult(EmpiMatchResultEnum.NO_MATCH);
|
||||
myEmpiLinkDaoSvc.save(fromLink);
|
||||
saveLink(fromLink);
|
||||
|
||||
EmpiLink toLink = createEmpiLink(myToPerson, myTargetPatient1);
|
||||
toLink.setLinkSource(EmpiLinkSourceEnum.MANUAL);
|
||||
|
@ -229,12 +230,12 @@ public class EmpiPersonMergerSvcTest extends BaseEmpiR4Test {
|
|||
EmpiLink fromLink = createEmpiLink(myFromPerson, myTargetPatient1);
|
||||
fromLink.setLinkSource(EmpiLinkSourceEnum.MANUAL);
|
||||
fromLink.setMatchResult(EmpiMatchResultEnum.MATCH);
|
||||
myEmpiLinkDaoSvc.save(fromLink);
|
||||
saveLink(fromLink);
|
||||
|
||||
EmpiLink toLink = createEmpiLink(myToPerson, myTargetPatient1);
|
||||
toLink.setLinkSource(EmpiLinkSourceEnum.MANUAL);
|
||||
toLink.setMatchResult(EmpiMatchResultEnum.NO_MATCH);
|
||||
myEmpiLinkDaoSvc.save(toLink);
|
||||
saveLink(toLink);
|
||||
|
||||
try {
|
||||
mergePersons();
|
||||
|
@ -249,12 +250,12 @@ public class EmpiPersonMergerSvcTest extends BaseEmpiR4Test {
|
|||
EmpiLink fromLink = createEmpiLink(myFromPerson, myTargetPatient1);
|
||||
fromLink.setLinkSource(EmpiLinkSourceEnum.MANUAL);
|
||||
fromLink.setMatchResult(EmpiMatchResultEnum.NO_MATCH);
|
||||
myEmpiLinkDaoSvc.save(fromLink);
|
||||
saveLink(fromLink);
|
||||
|
||||
EmpiLink toLink = createEmpiLink(myToPerson, myTargetPatient2);
|
||||
toLink.setLinkSource(EmpiLinkSourceEnum.MANUAL);
|
||||
toLink.setMatchResult(EmpiMatchResultEnum.MATCH);
|
||||
myEmpiLinkDaoSvc.save(toLink);
|
||||
saveLink(toLink);
|
||||
|
||||
mergePersons();
|
||||
assertEquals(1, myToPerson.getLink().size());
|
||||
|
|
|
@ -45,7 +45,7 @@ public class TestJpaConfig {
|
|||
|
||||
@Bean
|
||||
@Primary
|
||||
public JpaTransactionManager hapiTransactionManager(EntityManagerFactory entityManagerFactory) {
|
||||
public JpaTransactionManager hapiransactionManager(EntityManagerFactory entityManagerFactory) {
|
||||
JpaTransactionManager retVal = new JpaTransactionManager();
|
||||
retVal.setEntityManagerFactory(entityManagerFactory);
|
||||
return retVal;
|
||||
|
|
Loading…
Reference in New Issue