Class OperationHelper
- java.lang.Object
-
- org.linuxforhealth.fhir.operation.cqf.OperationHelper
-
public class OperationHelper extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description OperationHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.opencds.cqf.cql.engine.execution.LibraryLoader
createLibraryLoader(java.util.List<Library> libraries)
Create a library loader that will server up the CQL library content of the provided list of FHIR Library resources.static java.util.List<org.cqframework.cql.elm.execution.Library>
loadCqlLibraries(java.util.List<Library> libraries)
Load the CQL Library content for each of the provided FHIR Library resources with translation as needed for Libraries with CQL attachments and no corresponding ELM attachment.static Library
loadLibraryById(FHIRResourceHelpers resourceHelper, java.lang.String resourceId)
Load a Library resource by ID.static Library
loadLibraryByReference(FHIRResourceHelpers resourceHelper, java.lang.String reference)
Load a Library resource by reference.static Measure
loadMeasureById(FHIRResourceHelpers resourceHelper, java.lang.String resourceId)
Load a Measure resource by ID.static Measure
loadMeasureByReference(FHIRResourceHelpers resourceHelper, java.lang.String reference)
Load a Measure resource by reference.static <T extends Resource>
TloadResourceById(FHIRResourceHelpers resourceHelper, ResourceType resourceType, java.lang.String resourceId)
Load a resource by ID.static <T extends Resource>
TloadResourceByReference(FHIRResourceHelpers resourceHelper, ResourceType resourceType, java.lang.Class<T> resourceClass, java.lang.String reference)
Load a resource by reference.
-
-
-
Method Detail
-
createLibraryLoader
public static org.opencds.cqf.cql.engine.execution.LibraryLoader createLibraryLoader(java.util.List<Library> libraries)
Create a library loader that will server up the CQL library content of the provided list of FHIR Library resources.- Parameters:
libraries
- FHIR library resources- Returns:
- LibraryLoader that will serve the CQL Libraries for the provided FHIR resources
-
loadCqlLibraries
public static java.util.List<org.cqframework.cql.elm.execution.Library> loadCqlLibraries(java.util.List<Library> libraries)
Load the CQL Library content for each of the provided FHIR Library resources with translation as needed for Libraries with CQL attachments and no corresponding ELM attachment.- Parameters:
libraries
- FHIR Libraries- Returns:
- CQL Libraries
-
loadMeasureByReference
public static Measure loadMeasureByReference(FHIRResourceHelpers resourceHelper, java.lang.String reference) throws FHIROperationException
Load a Measure resource by reference.- Parameters:
resourceHelper
- FHIRResourceHelpers for resource readsreference
- Resource reference either in ResourceType/ID or canonical URL format- Returns:
- loaded resource
- Throws:
FHIROperationException
- when resource is not found- See Also:
<T>loadResourceByReference(org.linuxforhealth.fhir.server.spi.operation.FHIRResourceHelpers,org.linuxforhealth.fhir.core.ResourceType,java.lang.Class<T>,java.lang.String)
-
loadMeasureById
public static Measure loadMeasureById(FHIRResourceHelpers resourceHelper, java.lang.String resourceId) throws FHIROperationException
Load a Measure resource by ID.- Parameters:
resourceHelper
- FHIRResourceHelpers for resource readsresourceId
- Resource ID- Returns:
- loaded resource
- Throws:
FHIROperationException
- when resource is not found- See Also:
<T>loadResourceById(org.linuxforhealth.fhir.server.spi.operation.FHIRResourceHelpers,org.linuxforhealth.fhir.core.ResourceType,java.lang.String)
-
loadLibraryByReference
public static Library loadLibraryByReference(FHIRResourceHelpers resourceHelper, java.lang.String reference) throws FHIROperationException
Load a Library resource by reference.- Parameters:
resourceHelper
- FHIRResourceHelpers for resource readsreference
- Resource reference either in ResourceType/ID or canonical URL format- Returns:
- loaded resource
- Throws:
FHIROperationException
- when resource is not found- See Also:
<T>loadResourceByReference(org.linuxforhealth.fhir.server.spi.operation.FHIRResourceHelpers,org.linuxforhealth.fhir.core.ResourceType,java.lang.Class<T>,java.lang.String)
-
loadLibraryById
public static Library loadLibraryById(FHIRResourceHelpers resourceHelper, java.lang.String resourceId) throws FHIROperationException
Load a Library resource by ID.- Parameters:
resourceHelper
- FHIRResourceHelpers for resource readsresourceId
- Resource ID- Returns:
- loaded resource
- Throws:
FHIROperationException
- when resource is not found- See Also:
<T>loadResourceById(org.linuxforhealth.fhir.server.spi.operation.FHIRResourceHelpers,org.linuxforhealth.fhir.core.ResourceType,java.lang.String)
-
loadResourceByReference
public static <T extends Resource> T loadResourceByReference(FHIRResourceHelpers resourceHelper, ResourceType resourceType, java.lang.Class<T> resourceClass, java.lang.String reference) throws FHIROperationException
Load a resource by reference. If the reference is of the format, ResourceType/ID or does not contain any forward slash characters, it will be loaded directly. Otherwise, the reference will be treated as a canonical URL and resolved from the FHIR registry.- Parameters:
resourceHelper
- FHIRResourceHelpers for resource readsreference
- Resource reference either in ResourceType/ID or canonical URL format- Returns:
- loaded resource
- Throws:
FHIROperationException
- when resource is not found
-
loadResourceById
public static <T extends Resource> T loadResourceById(FHIRResourceHelpers resourceHelper, ResourceType resourceType, java.lang.String resourceId) throws FHIROperationException
Load a resource by ID. ID values are expected to already be separated from the ResourceType in a reference.- Type Parameters:
T
- Resource class to load- Parameters:
resourceHelper
- FHIRResourceHelpers for resource readsresourceType
- ResourceType of the resource to loadresourceId
- ID- Returns:
- Throws:
FHIROperationException
-
-