diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_2_0/5742-new-language-searchparam-not-passed-to-generated-resource-provider.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_2_0/5742-new-language-searchparam-not-passed-to-generated-resource-provider.yaml new file mode 100644 index 00000000000..4c99e4c14e7 --- /dev/null +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_2_0/5742-new-language-searchparam-not-passed-to-generated-resource-provider.yaml @@ -0,0 +1,4 @@ +--- +type: fix +issue: 5742 +title: Fixed behaviour of the _language query parameter. Now it is picked up as search parameter in the resource provider and filters accordingly. Thanks to Jens Villadsen (@jkiddo) for the contribution! diff --git a/hapi-tinder-plugin/src/main/resources/vm/jpa_resource_provider.vm b/hapi-tinder-plugin/src/main/resources/vm/jpa_resource_provider.vm index 469f943a495..807fe45c5b0 100644 --- a/hapi-tinder-plugin/src/main/resources/vm/jpa_resource_provider.vm +++ b/hapi-tinder-plugin/src/main/resources/vm/jpa_resource_provider.vm @@ -69,6 +69,16 @@ public class ${className}ResourceProvider extends @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE) UriAndListParam theSearchForProfile, + @Description(shortDefinition="Search the contents of the resource's data using a list") + @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_LIST) + StringAndListParam theList, + +#if ( $version == 'R5' ) + @Description(shortDefinition="The language of the resource") + @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_LANGUAGE) + TokenAndListParam theResourceLanguage, +#end + @Description(shortDefinition="Search for resources which have the given source value (Resource.meta.source)") @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_SOURCE) UriAndListParam theSearchForSource, @@ -149,6 +159,10 @@ public class ${className}ResourceProvider extends paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY, theSearchForSecurity); paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE, theSearchForProfile); paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_SOURCE, theSearchForSource); + paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_LIST, theList); +#if ( $version == 'R5' ) + paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_LANGUAGE, theResourceLanguage); +#end paramMap.add("_has", theHas); #foreach ( $param in $searchParams ) paramMap.add("${param.name}", the${param.nameCapitalized});