diff --git a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/api/paging/MdmPageLinkBuilder.java b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/api/paging/MdmPageLinkBuilder.java index aac24db86d9..6d63aa0df48 100644 --- a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/api/paging/MdmPageLinkBuilder.java +++ b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/api/paging/MdmPageLinkBuilder.java @@ -49,6 +49,7 @@ public final class MdmPageLinkBuilder { builder.append("?"); } builder.append(PARAM_OFFSET).append("=").append(theOffset); + builder.append("&"); builder.append(PARAM_COUNT).append("=").append(theCount); return builder.toString(); } diff --git a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/api/paging/MdmPageRequest.java b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/api/paging/MdmPageRequest.java index 6e401a58b0e..91eb5db3f3d 100644 --- a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/api/paging/MdmPageRequest.java +++ b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/api/paging/MdmPageRequest.java @@ -4,6 +4,7 @@ import ca.uhn.fhir.rest.server.IPagingProvider; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import org.apache.commons.lang3.StringUtils; import org.hl7.fhir.dstu3.model.UnsignedIntType; +import org.hl7.fhir.instance.model.api.IPrimitiveType; import org.slf4j.Logger; import org.springframework.data.domain.PageRequest; @@ -24,7 +25,7 @@ public class MdmPageRequest { private final int myOffset; private final int myCount; - public MdmPageRequest(@Nullable UnsignedIntType theOffset, @Nullable UnsignedIntType theCount, int theDefaultPageSize, int theMaximumPageSize) { + public MdmPageRequest(@Nullable IPrimitiveType theOffset, @Nullable IPrimitiveType theCount, int theDefaultPageSize, int theMaximumPageSize) { myOffset = theOffset == null ? 0 : theOffset.getValue(); myCount = theCount == null ? theDefaultPageSize : Math.min(theCount.getValue(), theMaximumPageSize); validatePagingParameters(myOffset, myCount); diff --git a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/provider/MdmProviderDstu3Plus.java b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/provider/MdmProviderDstu3Plus.java index 7ea63838fb5..28aa52c69b5 100644 --- a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/provider/MdmProviderDstu3Plus.java +++ b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/provider/MdmProviderDstu3Plus.java @@ -31,20 +31,18 @@ import ca.uhn.fhir.mdm.api.MdmLinkJson; import ca.uhn.fhir.mdm.api.paging.MdmPageRequest; import ca.uhn.fhir.mdm.model.MdmTransactionContext; import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.primitive.IntegerDt; import ca.uhn.fhir.rest.annotation.IdParam; import ca.uhn.fhir.rest.annotation.Operation; import ca.uhn.fhir.rest.annotation.OperationParam; import ca.uhn.fhir.rest.api.Constants; import ca.uhn.fhir.rest.api.server.RequestDetails; -import ca.uhn.fhir.rest.server.IPagingProvider; -import ca.uhn.fhir.rest.server.IRestfulServerDefaults; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.rest.server.provider.ProviderConstants; import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails; import ca.uhn.fhir.util.BundleBuilder; import ca.uhn.fhir.util.ParametersUtil; import org.apache.commons.lang3.StringUtils; -import org.hl7.fhir.dstu3.model.UnsignedIntType; import org.hl7.fhir.instance.model.api.IAnyResource; import org.hl7.fhir.instance.model.api.IBase; import org.hl7.fhir.instance.model.api.IBaseBackboneElement; @@ -207,11 +205,11 @@ public class MdmProviderDstu3Plus extends BaseMdmProvider { IPrimitiveType theLinkSource, @Description(formalDefinition="Results from this method are returned across multiple pages. This parameter controls the offset when fetching a page.") - @OperationParam(name = PARAM_OFFSET, min = 0, max = 1) - UnsignedIntType theOffset, + @OperationParam(name = PARAM_OFFSET, min = 0, max = 1, typeName = "integer") + IPrimitiveType theOffset, @Description(formalDefinition = "Results from this method are returned across multiple pages. This parameter controls the size of those pages.") - @OperationParam(name = Constants.PARAM_COUNT, min = 0, max = 1) - UnsignedIntType theCount, + @OperationParam(name = Constants.PARAM_COUNT, min = 0, max = 1, typeName = "integer") + IPrimitiveType theCount, ServletRequestDetails theRequestDetails) { MdmPageRequest mdmPageRequest = new MdmPageRequest(theOffset, theCount, DEFAULT_PAGE_SIZE, MAX_PAGE_SIZE); @@ -223,15 +221,14 @@ public class MdmProviderDstu3Plus extends BaseMdmProvider { return parametersFromMdmLinks(mdmLinkJson, true, theRequestDetails, mdmPageRequest); } - @Operation(name = ProviderConstants.MDM_DUPLICATE_GOLDEN_RESOURCES, idempotent = true) public IBaseParameters getDuplicateGoldenResources( @Description(formalDefinition="Results from this method are returned across multiple pages. This parameter controls the offset when fetching a page.") - @OperationParam(name = PARAM_OFFSET, min = 0, max = 1) - UnsignedIntType theOffset, + @OperationParam(name = PARAM_OFFSET, min = 0, max = 1, typeName = "integer") + IPrimitiveType theOffset, @Description(formalDefinition = "Results from this method are returned across multiple pages. This parameter controls the size of those pages.") - @OperationParam(name = Constants.PARAM_COUNT, min = 0, max = 1) - UnsignedIntType theCount, + @OperationParam(name = Constants.PARAM_COUNT, min = 0, max = 1, typeName = "integer") + IPrimitiveType theCount, ServletRequestDetails theRequestDetails) { MdmPageRequest mdmPageRequest = new MdmPageRequest(theOffset, theCount, DEFAULT_PAGE_SIZE, MAX_PAGE_SIZE);