-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
issue #1052 - ignore non-return parameter "general parameters" in search
move "general parameter" parameter names to FHIRConstants in `fhir-core` and update SearchUtil Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
- Loading branch information
Showing
7 changed files
with
241 additions
and
105 deletions.
There are no files selected for viewing
23 changes: 22 additions & 1 deletion
23
fhir-core/src/main/java/com/ibm/fhir/core/FHIRConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,36 @@ | ||
/* | ||
* (C) Copyright IBM Corp. 2016,2019 | ||
* (C) Copyright IBM Corp. 2016, 2020 | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package com.ibm.fhir.core; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
/** | ||
* This class contains constants that are used through the fhir-* projects. | ||
*/ | ||
public class FHIRConstants { | ||
public static final String FHIR_LOGGING_GROUP = "FHIRServer"; | ||
|
||
public static final int FHIR_CONDITIONAL_DELETE_MAX_NUMBER_DEFAULT = 10; | ||
|
||
public static final String FORMAT = "_format"; | ||
|
||
public static final String PRETTY = "_pretty"; | ||
|
||
public static final String SUMMARY = "_summary"; | ||
|
||
public static final String ELEMENTS = "_elements"; | ||
|
||
/** | ||
* General parameter names that can be used with any FHIR interaction. | ||
* | ||
* @see <a href="https://www.hl7.org/fhir/r4/http.html#parameters">https://www.hl7.org/fhir/r4/http.html#parameters</a> | ||
*/ | ||
public static final List<String> GENERAL_PARAMETER_NAMES = | ||
Collections.unmodifiableList(Arrays.asList(FORMAT, PRETTY, SUMMARY, ELEMENTS)); | ||
} |
57 changes: 56 additions & 1 deletion
57
fhir-core/src/main/java/com/ibm/fhir/core/context/FHIRPagingContext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,75 @@ | ||
/* | ||
* (C) Copyright IBM Corp. 2016,2019 | ||
* (C) Copyright IBM Corp. 2016, 2020 | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package com.ibm.fhir.core.context; | ||
|
||
/** | ||
* The paging context for given request | ||
*/ | ||
public interface FHIRPagingContext { | ||
/** | ||
* @return the last page number | ||
*/ | ||
int getLastPageNumber(); | ||
|
||
/** | ||
* @return the current page number | ||
*/ | ||
int getPageNumber(); | ||
|
||
/** | ||
* @return the number of resources in a single page | ||
* @see <a href="https://www.hl7.org/fhir/r4/search.html#count">https://www.hl7.org/fhir/r4/search.html#count</a> | ||
* @implSpec this number only applies to resources with {@code entry.search.mode = search} | ||
* and does not include included resources or operation outcomes | ||
*/ | ||
int getPageSize(); | ||
|
||
/** | ||
* @return the total number of matching resources for the corresponding query | ||
* @see <a href="https://www.hl7.org/fhir/r4/search.html#count">https://www.hl7.org/fhir/r4/search.html#count</a> | ||
* @implSpec this number only includes the total number of matching resources; it does not count extra resources | ||
* such as OperationOutcome or included resources that may also be returned | ||
*/ | ||
int getTotalCount(); | ||
|
||
/** | ||
* @param lastPageNumber the last page of results that can be requested for the corresponding query | ||
*/ | ||
void setLastPageNumber(int lastPageNumber); | ||
|
||
/** | ||
* @param pageNumber the current page number | ||
*/ | ||
void setPageNumber(int pageNumber); | ||
|
||
/** | ||
* @param pageSize the number of resources to include in a single page | ||
* @see <a href="https://www.hl7.org/fhir/r4/search.html#count">https://www.hl7.org/fhir/r4/search.html#count</a> | ||
* @implSpec this number only applies to resources with {@code entry.search.mode = search} | ||
* and does not include included resources or operation outcomes | ||
* | ||
*/ | ||
void setPageSize(int pageSize); | ||
|
||
/** | ||
* @param totalCount the total number of matching resources for the corresponding query | ||
* @see <a href="https://www.hl7.org/fhir/r4/search.html#count">https://www.hl7.org/fhir/r4/search.html#count</a> | ||
* @implSpec this number only includes the total number of matching resources; it does not count extra resources | ||
* such as OperationOutcome or included resources that may also be returned | ||
*/ | ||
void setTotalCount(int totalCount); | ||
|
||
/** | ||
* @return whether the request should be handled with leniency | ||
*/ | ||
boolean isLenient(); | ||
|
||
/** | ||
* @param lenient whether the request should be handled with leniency | ||
*/ | ||
void setLenient(boolean lenient); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.