All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ibm.fhir.persistence.jdbc.util.WholeSystemDataExtension Maven / Gradle / Ivy

There is a newer version: 4.11.1
Show newest version
/*
 * (C) Copyright IBM Corp. 2021
 *
 * SPDX-License-Identifier: Apache-2.0
 */

package com.ibm.fhir.persistence.jdbc.util;

import java.util.List;

import com.ibm.fhir.persistence.exception.FHIRPersistenceException;
import com.ibm.fhir.persistence.jdbc.domain.SearchExtension;
import com.ibm.fhir.persistence.jdbc.domain.SearchQueryVisitor;

/**
 * A SearchExtension used to add whole-system data search filters to the
 * whole-system data query.
 */
public class WholeSystemDataExtension implements SearchExtension {
    // The resource type being processed
    private final String resourceType;

    // The list of LOGICAL_RESOURCE_ID values to filter the query
    private final List logicalResourceIds;

    /**
     * Public constructor
     * @param resourceType
     * @param logicalResourcesIds
     */
    public WholeSystemDataExtension(String resourceType, List logicalResourceIds) {
        this.resourceType = resourceType;
        this.logicalResourceIds = logicalResourceIds;
    }

    @Override
    public  T visit(T query, SearchQueryVisitor visitor) throws FHIRPersistenceException {
        return visitor.addWholeSystemDataFilter(query, resourceType, logicalResourceIds);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy