Rip out pagingprovider requirement

This commit is contained in:
Tadgh 2021-06-30 18:41:18 -04:00
parent 950096d42f
commit 1eb82d633d
4 changed files with 8 additions and 16 deletions

View File

@ -31,8 +31,6 @@ public abstract class BaseProviderR4Test extends BaseMdmR4Test {
private IMdmSubmitSvc myMdmSubmitSvc;
@Autowired
private MdmSettings myMdmSettings;
@Autowired
private IPagingProvider myPagingProvider;
private String defaultScript;
@ -46,7 +44,7 @@ public abstract class BaseProviderR4Test extends BaseMdmR4Test {
@BeforeEach
public void before() {
myMdmProvider = new MdmProviderDstu3Plus(myFhirContext, myMdmControllerSvc, myMdmMatchFinderSvc, myMdmExpungeSvc, myMdmSubmitSvc, myPagingProvider);
myMdmProvider = new MdmProviderDstu3Plus(myFhirContext, myMdmControllerSvc, myMdmMatchFinderSvc, myMdmExpungeSvc, myMdmSubmitSvc);
defaultScript = myMdmSettings.getScriptText();
}
@AfterEach

View File

@ -28,7 +28,6 @@ import ca.uhn.fhir.mdm.api.paging.MdmPageLinkTuple;
import ca.uhn.fhir.mdm.api.paging.MdmPageRequest;
import ca.uhn.fhir.mdm.model.MdmTransactionContext;
import ca.uhn.fhir.rest.api.server.RequestDetails;
import ca.uhn.fhir.rest.server.RestfulServerUtils;
import ca.uhn.fhir.rest.server.TransactionLogMessages;
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
import ca.uhn.fhir.rest.server.provider.ProviderConstants;
@ -39,10 +38,6 @@ import org.hl7.fhir.instance.model.api.IBaseParameters;
import org.hl7.fhir.instance.model.api.IPrimitiveType;
import org.springframework.data.domain.Page;
import java.util.Arrays;
import static ca.uhn.fhir.rest.api.Constants.PARAM_COUNT;
import static ca.uhn.fhir.rest.api.Constants.PARAM_OFFSET;
public abstract class BaseMdmProvider {

View File

@ -76,7 +76,9 @@ public class MdmProviderDstu3Plus extends BaseMdmProvider {
private final IMdmMatchFinderSvc myMdmMatchFinderSvc;
private final IMdmExpungeSvc myMdmExpungeSvc;
private final IMdmSubmitSvc myMdmSubmitSvc;
private final IPagingProvider myPagingProvider;
public static final int DEFAULT_PAGE_SIZE = 20;
public static final int MAX_PAGE_SIZE = 100;
/**
* Constructor
@ -84,13 +86,12 @@ public class MdmProviderDstu3Plus extends BaseMdmProvider {
* Note that this is not a spring bean. Any necessary injections should
* happen in the constructor
*/
public MdmProviderDstu3Plus(FhirContext theFhirContext, IMdmControllerSvc theMdmControllerSvc, IMdmMatchFinderSvc theMdmMatchFinderSvc, IMdmExpungeSvc theMdmExpungeSvc, IMdmSubmitSvc theMdmSubmitSvc, IPagingProvider thePagingProvider) {
public MdmProviderDstu3Plus(FhirContext theFhirContext, IMdmControllerSvc theMdmControllerSvc, IMdmMatchFinderSvc theMdmMatchFinderSvc, IMdmExpungeSvc theMdmExpungeSvc, IMdmSubmitSvc theMdmSubmitSvc) {
super(theFhirContext);
myMdmControllerSvc = theMdmControllerSvc;
myMdmMatchFinderSvc = theMdmMatchFinderSvc;
myMdmExpungeSvc = theMdmExpungeSvc;
myMdmSubmitSvc = theMdmSubmitSvc;
myPagingProvider = thePagingProvider;
}
@Operation(name = ProviderConstants.EMPI_MATCH, typeName = "Patient")
@ -213,7 +214,7 @@ public class MdmProviderDstu3Plus extends BaseMdmProvider {
UnsignedIntType theCount,
ServletRequestDetails theRequestDetails) {
MdmPageRequest mdmPageRequest = new MdmPageRequest(theOffset, theCount, myPagingProvider.getDefaultPageSize(), myPagingProvider.getMaximumPageSize());
MdmPageRequest mdmPageRequest = new MdmPageRequest(theOffset, theCount, DEFAULT_PAGE_SIZE, MAX_PAGE_SIZE);
Page<MdmLinkJson> mdmLinkJson = myMdmControllerSvc.queryLinks(extractStringOrNull(theGoldenResourceId),
extractStringOrNull(theResourceId), extractStringOrNull(theMatchResult), extractStringOrNull(theLinkSource),
createMdmContext(theRequestDetails, MdmTransactionContext.OperationType.QUERY_LINKS,
@ -233,7 +234,7 @@ public class MdmProviderDstu3Plus extends BaseMdmProvider {
UnsignedIntType theCount,
ServletRequestDetails theRequestDetails) {
MdmPageRequest mdmPageRequest = new MdmPageRequest(theOffset, theCount, myPagingProvider.getDefaultPageSize(), myPagingProvider.getMaximumPageSize());
MdmPageRequest mdmPageRequest = new MdmPageRequest(theOffset, theCount, DEFAULT_PAGE_SIZE, MAX_PAGE_SIZE);
Page<MdmLinkJson> possibleDuplicates = myMdmControllerSvc.getDuplicateGoldenResources(createMdmContext(theRequestDetails, MdmTransactionContext.OperationType.DUPLICATE_GOLDEN_RESOURCES, (String) null), mdmPageRequest);

View File

@ -49,8 +49,6 @@ public class MdmProviderLoader {
private IMdmExpungeSvc myMdmExpungeSvc;
@Autowired
private IMdmSubmitSvc myMdmSubmitSvc;
@Autowired
private IPagingProvider myPagingProvider;
private BaseMdmProvider myMdmProvider;
@ -59,7 +57,7 @@ public class MdmProviderLoader {
case DSTU3:
case R4:
myResourceProviderFactory.addSupplier(() -> {
myMdmProvider = new MdmProviderDstu3Plus(myFhirContext, myMdmControllerSvc, myMdmMatchFinderSvc, myMdmExpungeSvc, myMdmSubmitSvc, myPagingProvider);
myMdmProvider = new MdmProviderDstu3Plus(myFhirContext, myMdmControllerSvc, myMdmMatchFinderSvc, myMdmExpungeSvc, myMdmSubmitSvc);
return myMdmProvider;
});
break;