@@ -444,9 +444,13 @@ public static SearchParameter getSearchParameter(String resourceType, String cod
444
444
// If we found it within the built-in search parameters, apply our filtering rules.
445
445
if (result != null ) {
446
446
447
+ // Check if this search parameter applies to the base Resource type
447
448
ResourceType rt = result .getBase ().get (0 ).as (ResourceType .class );
449
+ if (SearchConstants .RESOURCE_RESOURCE .equals (rt .getValue ())) {
450
+ resourceType = rt .getValue ();
451
+ }
448
452
Collection <SearchParameter > filteredResult =
449
- filterSearchParameters (getFilterRules (), rt . getValue () , Collections .singleton (result ));
453
+ filterSearchParameters (getFilterRules (), resourceType , Collections .singleton (result ));
450
454
451
455
// If our filtered result is non-empty, then just return the first (and only) item.
452
456
result = (filteredResult .isEmpty () ? null : filteredResult .iterator ().next ());
@@ -509,9 +513,14 @@ public static SearchParameter getSearchParameter(String resourceType, Canonical
509
513
510
514
// If we found it within the built-in search parameters, apply our filtering rules.
511
515
if (result != null ) {
512
- ResourceType rt = result .getBase ().get (0 );
516
+
517
+ // Check if this search parameter applies to the base Resource type
518
+ ResourceType rt = result .getBase ().get (0 ).as (ResourceType .class );
519
+ if (SearchConstants .RESOURCE_RESOURCE .equals (rt .getValue ())) {
520
+ resourceType = rt .getValue ();
521
+ }
513
522
Collection <SearchParameter > filteredResult =
514
- filterSearchParameters (getFilterRules (), rt . getValue () , Collections .singleton (result ));
523
+ filterSearchParameters (getFilterRules (), resourceType , Collections .singleton (result ));
515
524
516
525
// If our filtered result is non-empty, then just return the first (and only) item.
517
526
result = (filteredResult .isEmpty () ? null : filteredResult .iterator ().next ());
0 commit comments