public SubscriptionMatchResult match ( String theCriteria , IBaseResource theResource , ResourceIndexedSearchParams theSearchParams ) { RuntimeResourceDefinition resourceDefinition ; if ( theResource == null ) { resourceDefinition = UrlUtil . parseUrlResourceType ( myFhirContext , theCriteria ) ; } else { resourceDefinition = myFhirContext . getResourceDefinition ( theResource ) ; } SearchParameterMap searchParameterMap ; try { searchParameterMap = myMatchUrlService . translateMatchUrl ( theCriteria , resourceDefinition ) ; } catch ( UnsupportedOperationException e ) { return SubscriptionMatchResult . unsupportedFromReason ( SubscriptionMatchResult . PARSE_FAIL ) ; } searchParameterMap . clean ( ) ; if ( searchParameterMap . getLastUpdated ( ) != null ) { return SubscriptionMatchResult . unsupportedFromParameterAndReason ( Constants . PARAM_LASTUPDATED , SubscriptionMatchResult . STANDARD_PARAMETER ) ; } for ( Map . Entry < String , List < List < IQueryParameterType > > > entry : searchParameterMap . entrySet ( ) ) { String theParamName = entry . getKey ( ) ; List < List < IQueryParameterType > > theAndOrParams = entry . getValue ( ) ; SubscriptionMatchResult result = matchIdsWithAndOr ( theParamName , theAndOrParams , resourceDefinition , theResource , theSearchParams ) ; if ( ! result . matched ( ) ) { return result ; } } return SubscriptionMatchResult . successfulMatch ( ) ; }
This method is called in two different scenarios . With a null theResource it determines whether database matching might be required . Otherwise it tries to perform the match in - memory returning UNSUPPORTED if it s not possible .