com.ibm.fhir.persistence.jdbc.util.WholeSystemDataExtension Maven / Gradle / Ivy
/*
* (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);
}
}