com.ibm.fhir.cql.engine.rest.retrieve.RestFHIRRetrieveProvider Maven / Gradle / Ivy
/*
* (C) Copyright IBM Corp. 2021
*
* SPDX-License-Identifier: Apache-2.0
*/
package com.ibm.fhir.cql.engine.rest.retrieve;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.Response;
import com.ibm.fhir.client.FHIRClient;
import com.ibm.fhir.client.FHIRParameters;
import com.ibm.fhir.client.FHIRResponse;
import com.ibm.fhir.cql.engine.retrieve.SearchParameterFHIRRetrieveProvider;
import com.ibm.fhir.cql.engine.retrieve.SearchParameterMap;
import com.ibm.fhir.cql.engine.searchparam.IQueryParameter;
import com.ibm.fhir.cql.engine.searchparam.SearchParameterResolver;
import com.ibm.fhir.cql.engine.util.FHIRClientUtil;
import com.ibm.fhir.cql.helpers.FHIRBundleCursor;
import com.ibm.fhir.model.resource.Bundle;
import com.ibm.fhir.model.resource.Resource;
import com.ibm.fhir.model.util.ModelSupport;
/**
* This is an implementation of a retrieve provider for the CQL Engine that uses
* the IBM FHIR Server REST Client to access data.
*/
public class RestFHIRRetrieveProvider extends SearchParameterFHIRRetrieveProvider {
private FHIRClient fhirClient;
public RestFHIRRetrieveProvider(SearchParameterResolver searchParameterResolver, FHIRClient fhirClient) {
super(searchParameterResolver);
this.fhirClient = fhirClient;
}
@Override
protected Iterable