class AbstractBundleResourceProvider extends AbstractUntypedResourceProvider {

    @Nullable
    protected IBaseResource lookupConditionalReferenceUrl( @Nonnull FhirOperation operation )
    {
        if ( operation.getUri() == null )
        {
            return null;
        }

        final MultiValueMap<String, String> parameters = UriComponentsBuilder
            .fromUri( operation.getUri() ).build().getQueryParams();

        if ( parameters.isEmpty() )
        {
            return null;
        }

        final List<String> identifiers = parameters.get( SP_IDENTIFIER );
        final String identifier;

        if ( identifiers == null )
        {
            operation.getResult().badRequest( "Only identifiers are supported as conditional references in URLs." );

            return null;
        }

        if ( identifiers.size() > 1 )
        {
            operation.getResult().badRequest( "Conditional reference in URL must not contain more than one identifier." );

            return null;
        }

        try
        {
            identifier = URLDecoder.decode( identifiers.get( 0 ), "UTF-8" );
        }
        catch ( UnsupportedEncodingException e )
        {
            throw new IllegalStateException( e );
        }

        final FhirClientSystem fhirClientSystem = getFhirClientSystem( operation.getFhirResourceType() );
        final TokenParam identifierParam = parseTokenParam( identifier );

        if ( !fhirClientSystem.getSystem().getSystemUri().equals( identifierParam.getSystem() ) ||
            StringUtils.isBlank( identifierParam.getValue() ) )
        {
            return null;
        }

        return getDhisRepository().readByIdentifier( operation.getClientResource().getFhirClient(), operation.getFhirResourceType(), identifierParam.getValue() ).orElse( null );
    }

    public  AbstractBundleResourceProvider(
        @Nonnull FhirClientResourceRepository fhirClientResourceRepository,
        @Nonnull FhirClientSystemRepository fhirClientSystemRepository,
        @Nonnull FhirRepository fhirRepository, @Nonnull DhisRepository dhisRepository,
        @Nonnull RequestCacheService requestCacheService );

}