Added correction to generated resource providers (#5743)

* Added correction to generated resource providers

* add changelog and fix issue that was adding languange SP to version that does not have language as a SP

* actually fix the test

* fix changelog wrong issue number

---------

Co-authored-by: Jens Kristian Villadsen <jenskristianvilladsen@gmail.com>
Co-authored-by: Long Ma <long@smilecdr.com>
This commit is contained in:
longma1 2024-02-27 15:12:23 -07:00 committed by GitHub
parent 28b8662637
commit f5cc015ff3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 0 deletions

View File

@ -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!

View File

@ -73,6 +73,12 @@ public class ${className}ResourceProvider extends
@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,
@ -154,6 +160,9 @@ public class ${className}ResourceProvider extends
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});