Start getting sorting into fhirtest

This commit is contained in:
jamesagnew 2014-08-12 08:00:24 -04:00
parent e2b9b3318d
commit 9ef670aae9
2 changed files with 32 additions and 3 deletions

View File

@ -137,6 +137,32 @@
</span>
</div>
<div class="row-fluid">
<h4>Sort Results</h4>
</div>
<div class="row-fluid">
<div class='col-sm-3'>
<div class="btn-group">
<button type="button" class="btn btn-info">Action</button>
<button type="button" class="btn btn-info dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
<span class="sr-only">Default Sort</span>
</button>
<ul class="dropdown-menu" role="menu">
<li><a href="#">Default Sort</a></li>
<li class="divider"></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li><a href="#">Separated link</a></li>
</ul>
</div>
</div>
</div>
<br clear="all"/>
<div class="row-fluid">
<h4>Other Options</h4>
</div>

View File

@ -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<Include> theIncludes
Set<Include> 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;