-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
issue #3242 - scope search-system and search-history for fhirVersion
1. introduce enums and utilities for working with resource type names and fhirVersion values ('4.0' and '4.3') 2. use those to provide a better abstraction for working with the fhir-server-config `fhirServer/resources` property group (ResourcesConfigAdapter) 3. move fhirVersion MIME-type parameter processing into a new JAX-RS RequestFilter FHIRVersionRequestFilter and update tests accordingly 4. update FHIRPersistenceUtil.parseSystemHistoryParameters to take into account the requested fhirVersion and scope the HistoryContext appropriately 5. update SearchUtil.parseQueryParameters to take into account the requested fhirVersion and scope the SearchContext appropriately Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
- Loading branch information
Showing
33 changed files
with
885 additions
and
497 deletions.
There are no files selected for viewing
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
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
52 changes: 52 additions & 0 deletions
52
fhir-core/src/main/java/com/ibm/fhir/core/FHIRVersionParam.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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* (C) Copyright IBM Corp. 2022 | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
package com.ibm.fhir.core; | ||
|
||
/** | ||
* Enum constants for the allowed values of the fhirVersion MIME-type parameter | ||
*/ | ||
public enum FHIRVersionParam { | ||
VERSION_40("4.0"), | ||
VERSION_43("4.3"); | ||
|
||
private final String value; | ||
|
||
FHIRVersionParam(String value) { | ||
this.value = value; | ||
} | ||
|
||
/** | ||
* @return | ||
* The String value of the fhirVersion parameter | ||
*/ | ||
public java.lang.String value() { | ||
return value; | ||
} | ||
|
||
/** | ||
* Factory method for creating FHIRVersionParam values from a passed string value. | ||
* | ||
* @param value | ||
* A string that matches one of the allowed FHIRVersionParam values | ||
* @return | ||
* The corresponding FHIRVersionParam or null if a null value was passed | ||
* @throws IllegalArgumentException | ||
* If the passed string is not null and cannot be parsed into an allowed FHIRVersionParam value | ||
*/ | ||
public static FHIRVersionParam from(String value) { | ||
if (value == null) { | ||
return null; | ||
} | ||
switch (value) { | ||
case "4.0": | ||
return VERSION_40; | ||
case "4.3": | ||
return VERSION_43; | ||
default: | ||
throw new IllegalArgumentException(value); | ||
} | ||
} | ||
} |
Oops, something went wrong.