Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesagnew committed Nov 15, 2024
1 parent 1f4af7e commit 2aadbec
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
package ca.uhn.fhir.jpa.mdm.config;

import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao;
import ca.uhn.fhir.jpa.entity.MdmLink;
import ca.uhn.fhir.jpa.mdm.dao.MdmLinkDaoSvc;
import ca.uhn.fhir.jpa.mdm.helper.MdmLinkHelper;
import ca.uhn.fhir.jpa.model.dao.JpaPid;
import ca.uhn.fhir.mdm.api.IMdmSettings;
import ca.uhn.fhir.mdm.dao.IMdmLinkDao;
import ca.uhn.fhir.mdm.rules.config.MdmRuleValidator;
import ca.uhn.fhir.mdm.rules.config.MdmSettings;
import com.google.common.base.Charsets;
import org.apache.commons.io.IOUtils;
import org.hl7.fhir.r4.model.Patient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand Down Expand Up @@ -45,7 +51,7 @@ IMdmSettings mdmSettings(MdmRuleValidator theMdmRuleValidator) throws IOExceptio
}

@Bean
MdmLinkHelper mdmLinkHelper() {
return new MdmLinkHelper();
MdmLinkHelper mdmLinkHelper(IMdmLinkDao<JpaPid, MdmLink> theMdmLinkRepo, IFhirResourceDao<Patient> thePatientDao, MdmLinkDaoSvc<JpaPid, MdmLink> theMdmLinkDaoSvc) {
return new MdmLinkHelper(theMdmLinkRepo, thePatientDao, theMdmLinkDaoSvc);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao;
import ca.uhn.fhir.jpa.api.model.DaoMethodOutcome;
import ca.uhn.fhir.jpa.dao.index.IdHelperService;
import ca.uhn.fhir.jpa.entity.MdmLink;
import ca.uhn.fhir.jpa.mdm.dao.MdmLinkDaoSvc;
import ca.uhn.fhir.jpa.mdm.helper.testmodels.MDMLinkResults;
Expand All @@ -21,15 +20,13 @@
import org.hl7.fhir.r4.model.Patient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import static org.apache.commons.lang3.StringUtils.isNotBlank;
import static org.assertj.core.api.Assertions.assertThat;
Expand All @@ -46,12 +43,18 @@ private enum Side {
RHS // right hand side; practically speaking, this is the SourceResource of the link
}

@Autowired
private IMdmLinkDao<JpaPid, MdmLink> myMdmLinkRepo;
@Autowired
private IFhirResourceDao<Patient> myPatientDao;
@Autowired
private MdmLinkDaoSvc<JpaPid, MdmLink> myMdmLinkDaoSvc;
private final IMdmLinkDao<JpaPid, MdmLink> myMdmLinkRepo;
private final IFhirResourceDao<Patient> myPatientDao;
private final MdmLinkDaoSvc<JpaPid, MdmLink> myMdmLinkDaoSvc;

/**
* Constructor
*/
public MdmLinkHelper(IMdmLinkDao<JpaPid, MdmLink> theMdmLinkRepo, IFhirResourceDao<Patient> thePatientDao, MdmLinkDaoSvc<JpaPid, MdmLink> theMdmLinkDaoSvc) {
myMdmLinkRepo = theMdmLinkRepo;
myPatientDao = thePatientDao;
myMdmLinkDaoSvc = theMdmLinkDaoSvc;
}

@Transactional
public void logMdmLinks() {
Expand Down

0 comments on commit 2aadbec

Please sign in to comment.