org.cqframework.fhir.api.r4.FhirDal Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cqf-fhir Show documentation
Show all versions of cqf-fhir Show documentation
The cqf-fhir library for the Clinical Quality Language Java reference implementation
The newest version!
package org.cqframework.fhir.api.r4;
import ca.uhn.fhir.model.api.IQueryParameterType;
import java.util.List;
import java.util.Map;
import org.hl7.fhir.instance.model.api.IIdType;
import org.hl7.fhir.r4.model.Bundle;
import org.hl7.fhir.r4.model.Resource;
/**
* This interface is a minimal Fhir CRUD API. It's based on the
* FHIR HTTP API, but constrained to provide only the
* operations necessary for the cql-evaluator modules to function.
* @see https://www.hl7.org/fhir/http.html
*/
public interface FhirDal extends org.cqframework.fhir.api.FhirDal {
/**
* Fetches an {@code Resource} by {@code id}. The {@code IIdType} must have the resourceType defined.
*
* Returns null if no resource is found.
* @param id the id of the resource
* @return the resource
*/
Resource read(IIdType id);
/**
* Creates the {@code IBaseResource}.
*
* Default behavior is to overwrite the resource if it already exists.
* @param resource the resource
*/
void create(Resource resource);
/**
* Updates the {@code IBaseResource}.
*
* Default behavior is to create the resource if it does not exist.
* @param resource the resource
*/
void update(Resource resource);
/**
* Deletes an {@code IBaseResource} by {@code id}. The {@code IIdType} must have the resourceType defined.
*
* Default behavior is no-op if the resource does not exist.
* @param id the id of the resource
*/
void delete(IIdType id);
/**
* Returns an {@code Iterable} of all the resources of type {@code resourceType}.
*
* Default behavior is to return null if no resources are found.
* @param resourceType the type of resources to return.
* @return the resources
*/
Bundle search(String resourceType, Map>> searchParameters);
}