diff --git a/hapi-fhir-testpage-overlay/src/main/webapp/WEB-INF/templates/resource.html b/hapi-fhir-testpage-overlay/src/main/webapp/WEB-INF/templates/resource.html
index 462bfa67d11..289d21d23d7 100644
--- a/hapi-fhir-testpage-overlay/src/main/webapp/WEB-INF/templates/resource.html
+++ b/hapi-fhir-testpage-overlay/src/main/webapp/WEB-INF/templates/resource.html
@@ -137,6 +137,32 @@
+
+
Sort Results
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Other Options
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 c82838d16a5..f0f93ee42c2 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
@@ -13,6 +13,7 @@ import ca.uhn.fhir.model.dstu.composite.*;
import ca.uhn.fhir.model.dstu.resource.*;
import ca.uhn.fhir.rest.annotation.*;
import ca.uhn.fhir.rest.param.*;
+import ca.uhn.fhir.rest.api.SortSpec;
public class ${className}ResourceProvider extends JpaResourceProvider<${className}> {
@@ -69,7 +70,10 @@ public class ${className}ResourceProvider extends JpaResourceProvider<${classNam
#end
#{if}($searchParamsReference.empty == false), #{end}"*"
})
- Set theIncludes
+ Set theIncludes,
+
+ @Sort
+ SortSpec theSort
) {
startRequest(theServletRequest);
try {
@@ -81,8 +85,7 @@ public class ${className}ResourceProvider extends JpaResourceProvider<${classNam
#end
paramMap.setIncludes(theIncludes);
-
-
+ paramMap.setSort(theSort);
ca.uhn.fhir.rest.server.IBundleProvider retVal = getDao().search(paramMap);
return retVal;