This commit is contained in:
leif stawnyczy 2024-08-13 13:38:29 -04:00
parent 15041d72fd
commit 5eb6648639
2 changed files with 9 additions and 16 deletions

View File

@ -419,16 +419,6 @@ class ModelScanner {
throw new ConfigurationException(Msg.code(1721) + "Search param " + searchParam.name() throw new ConfigurationException(Msg.code(1721) + "Search param " + searchParam.name()
+ " has an invalid type: " + searchParam.type()); + " 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<String> providesMembershipInCompartments; Set<String> providesMembershipInCompartments;
providesMembershipInCompartments = new HashSet<>(); providesMembershipInCompartments = new HashSet<>();

View File

@ -86,6 +86,7 @@ public class ${className}ResourceProvider extends
HasAndListParam theHas, HasAndListParam theHas,
#foreach ( $param in $searchParams ) #{if}(true) #{end} #foreach ( $param in $searchParams ) #{if}(true) #{end}
#if (${param.name} != "_lastUpdated")
@Description(shortDefinition="${param.description}") @Description(shortDefinition="${param.description}")
#if (${param.type} == 'string' ) #if (${param.type} == 'string' )
@ -97,7 +98,7 @@ public class ${className}ResourceProvider extends
#elseif (${param.type} == 'special' ) #elseif (${param.type} == 'special' )
@OptionalParam(name="${param.name}") @OptionalParam(name="${param.name}")
SpecialAndListParam the${param.nameCapitalized}, SpecialAndListParam the${param.nameCapitalized},
#elseif (${param.type} == 'date' ) #elseif (${param.type} == 'date' && ${param.name} != "_lastUpdated")
@OptionalParam(name="${param.name}") @OptionalParam(name="${param.name}")
DateRangeParam the${param.nameCapitalized}, DateRangeParam the${param.nameCapitalized},
#elseif (${param.type} == 'uri' ) #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 }) @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}, CompositeAndListParam<${param.compositeTypes[0]}Param, ${param.compositeTypes[1]}Param> the${param.nameCapitalized},
#end #end
#end
#end #end
@RawParam @RawParam
@ -162,13 +164,14 @@ public class ${className}ResourceProvider extends
paramMap.add("_has", theHas); paramMap.add("_has", theHas);
#foreach ( $param in $searchParams ) #foreach ( $param in $searchParams )
#if (${param.name} != "_lastUpdated")
paramMap.add("${param.name}", the${param.nameCapitalized}); paramMap.add("${param.name}", the${param.nameCapitalized});
#end #end
#end
#if ( $version != 'dstu' ) #if ( $version != 'dstu' )
paramMap.setRevIncludes(theRevIncludes); paramMap.setRevIncludes(theRevIncludes);
paramMap.setLastUpdated(theLastUpdated); paramMap.setLastUpdated(theLastUpdated);
// we will add this manually here because ModelScanner ignores it paramMap.add("_lastUpdated", theLastUpdated);
paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_LASTUPDATED, theLastUpdated);
#end #end
paramMap.setIncludes(theIncludes); paramMap.setIncludes(theIncludes);
paramMap.setSort(theSort); paramMap.setSort(theSort);