-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add path value to _id search parameter and other missing search param… (
#6128) * Add path value to _id search parameter and other missing search parameters to IAnyResource. * Adjust tests and remove now unnecessary addition of meta parameters which are now provided by IAnyResource * Revert unneeded change * _security param is not token but uri * Add tests for new defined resource-level standard parameters * Adjust test --------- Co-authored-by: juan.marchionatto <juan.marchionatto@smilecdr.com>
- Loading branch information
1 parent
2c6b3e8
commit 2275eba
Showing
6 changed files
with
251 additions
and
18 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
6 changes: 6 additions & 0 deletions
6
...rces/ca/uhn/hapi/fhir/changelog/7_4_0/6123-search-parameters-missing-in-ianyresource.yaml
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,6 @@ | ||
--- | ||
type: fix | ||
issue: 6123 | ||
title: "`IAnyResource` `_id` search parameter was missing `path` property value, which resulted in extractor not | ||
working when standard search parameters were instantiated from defined context. This has been fixed, and also | ||
`_LastUpdated`, `_tag`, `_profile`, and `_security` parameter definitions were added to the class." |
38 changes: 38 additions & 0 deletions
38
...rc/test/java/ca/uhn/fhir/jpa/searchparam/registry/FhirContextSearchParamRegistryTest.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,38 @@ | ||
package ca.uhn.fhir.jpa.searchparam.registry; | ||
|
||
import ca.uhn.fhir.context.FhirContext; | ||
import ca.uhn.fhir.context.RuntimeSearchParam; | ||
import ca.uhn.fhir.rest.server.util.FhirContextSearchParamRegistry; | ||
import org.junit.jupiter.params.ParameterizedTest; | ||
import org.junit.jupiter.params.provider.CsvSource; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
import static org.hl7.fhir.instance.model.api.IAnyResource.SP_RES_ID; | ||
import static org.hl7.fhir.instance.model.api.IAnyResource.SP_RES_LAST_UPDATED; | ||
import static org.hl7.fhir.instance.model.api.IAnyResource.SP_RES_PROFILE; | ||
import static org.hl7.fhir.instance.model.api.IAnyResource.SP_RES_SECURITY; | ||
import static org.hl7.fhir.instance.model.api.IAnyResource.SP_RES_TAG; | ||
|
||
class FhirContextSearchParamRegistryTest { | ||
|
||
private static final FhirContext ourFhirContext = FhirContext.forR4(); | ||
|
||
FhirContextSearchParamRegistry mySearchParamRegistry = new FhirContextSearchParamRegistry(ourFhirContext); | ||
|
||
@ParameterizedTest | ||
@CsvSource({ | ||
SP_RES_ID + ", Resource.id", | ||
SP_RES_LAST_UPDATED + ", Resource.meta.lastUpdated", | ||
SP_RES_TAG + ", Resource.meta.tag", | ||
SP_RES_PROFILE + ", Resource.meta.profile", | ||
SP_RES_SECURITY + ", Resource.meta.security" | ||
}) | ||
void testResourceLevelSearchParamsAreRegistered(String theSearchParamName, String theSearchParamPath) { | ||
RuntimeSearchParam sp = mySearchParamRegistry.getActiveSearchParam("Patient", theSearchParamName); | ||
|
||
assertThat(sp) | ||
.as("path is null for search parameter: '%s'", theSearchParamName) | ||
.isNotNull().extracting("path").isEqualTo(theSearchParamPath); | ||
} | ||
|
||
} |
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.