diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/ModelScanner.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/ModelScanner.java index aa291cd52ab..81bb907a94a 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/ModelScanner.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/ModelScanner.java @@ -419,16 +419,6 @@ class ModelScanner { throw new ConfigurationException(Msg.code(1721) + "Search param " + searchParam.name() + " has an invalid type: " + searchParam.type()); } - /* - * This is a HACK! - * tinder generator jpa_resource_provider.vm already has _lastUpdated - * manually added, so we're just going to manually skip this value - * so we don't corrupt the PatientResourceProvider.java. - * - */ - if (searchParam.name().equalsIgnoreCase("_lastUpdated")) { - continue; - } Set providesMembershipInCompartments; providesMembershipInCompartments = new HashSet<>(); 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 a8470f0e940..53f9c646052 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 @@ -86,8 +86,9 @@ public class ${className}ResourceProvider extends HasAndListParam theHas, #foreach ( $param in $searchParams ) #{if}(true) #{end} + #if (${param.name} != "_lastUpdated") - @Description(shortDefinition="${param.description}") + @Description(shortDefinition="${param.description}") #if (${param.type} == 'string' ) @OptionalParam(name="${param.name}") StringAndListParam the${param.nameCapitalized}, @@ -97,7 +98,7 @@ public class ${className}ResourceProvider extends #elseif (${param.type} == 'special' ) @OptionalParam(name="${param.name}") SpecialAndListParam the${param.nameCapitalized}, -#elseif (${param.type} == 'date' ) +#elseif (${param.type} == 'date' && ${param.name} != "_lastUpdated") @OptionalParam(name="${param.name}") DateRangeParam the${param.nameCapitalized}, #elseif (${param.type} == 'uri' ) @@ -116,6 +117,7 @@ public class ${className}ResourceProvider extends @OptionalParam(name="${param.name}", compositeTypes= { ${param.compositeTypes[0]}Param.class, ${param.compositeTypes[1]}Param.class }) CompositeAndListParam<${param.compositeTypes[0]}Param, ${param.compositeTypes[1]}Param> the${param.nameCapitalized}, #end +#end #end @RawParam @@ -161,14 +163,15 @@ public class ${className}ResourceProvider extends paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_LANGUAGE, theResourceLanguage); paramMap.add("_has", theHas); -#foreach ( $param in $searchParams ) - paramMap.add("${param.name}", the${param.nameCapitalized}); +#foreach ( $param in $searchParams ) + #if (${param.name} != "_lastUpdated") + paramMap.add("${param.name}", the${param.nameCapitalized}); + #end #end #if ( $version != 'dstu' ) paramMap.setRevIncludes(theRevIncludes); paramMap.setLastUpdated(theLastUpdated); - // we will add this manually here because ModelScanner ignores it - paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_LASTUPDATED, theLastUpdated); + paramMap.add("_lastUpdated", theLastUpdated); #end paramMap.setIncludes(theIncludes); paramMap.setSort(theSort);