class R4BundleResourceProvider extends AbstractBundleResourceProvider<Bundle> {

    @Nonnull
    @Override
    protected FhirBatchRequest createBatchRequest( @Nonnull Bundle bundle )
    {
        if ( bundle.getType() != Bundle.BundleType.BATCH )
        {
            throw new InvalidRequestException( "Only batch bundles are supported currently." );
        }

        final List<FhirOperation> operations = new ArrayList<>();

        bundle.getEntry().forEach( entry -> {
            final FhirOperation operation = createOperation( entry.getFullUrl(), entry.getResource(),
                entry.getRequest().getMethodElement().getValueAsString(), entry.getRequest().getUrl() );

            if ( !operation.isProcessed() && ( entry.getRequest().hasIfMatch() || entry.getRequest().hasIfModifiedSince() || entry.getRequest().hasIfNoneExist() || entry.getRequest().hasIfNoneMatch() ) )
            {
                operation.getResult().badRequest( "If conditions on request are not supported." );
            }

            operations.add( operation );
        } );

        return new FhirBatchRequest( operations, false );
    }

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

}