Package org.linuxforhealth.fhir.term.spi
Class AbstractTermServiceProvider
- java.lang.Object
-
- org.linuxforhealth.fhir.term.spi.AbstractTermServiceProvider
-
- All Implemented Interfaces:
FHIRTermServiceProvider
- Direct Known Subclasses:
GraphTermServiceProvider
,RegistryTermServiceProvider
,RemoteTermServiceProvider
public abstract class AbstractTermServiceProvider extends java.lang.Object implements FHIRTermServiceProvider
-
-
Constructor Summary
Constructors Constructor Description AbstractTermServiceProvider()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
checkArgument(CodeSystem codeSystem)
protected <R> void
checkArguments(CodeSystem codeSystem, java.util.function.Function<CodeSystem.Concept,? extends R> function)
protected void
checkArguments(CodeSystem codeSystem, java.util.List<ValueSet.Compose.Include.Filter> filters)
protected <R> void
checkArguments(CodeSystem codeSystem, java.util.List<ValueSet.Compose.Include.Filter> filters, java.util.function.Function<CodeSystem.Concept,? extends R> function)
protected void
checkArguments(CodeSystem codeSystem, Code code)
protected void
checkArguments(CodeSystem codeSystem, Code codeA, Code codeB)
abstract java.util.Set<CodeSystem.Concept>
closure(CodeSystem codeSystem, Code code)
Get a set containingCodeSystem.Concept
instances where all structural hierarchies have been flattened.abstract CodeSystem.Concept
getConcept(CodeSystem codeSystem, Code code)
Get the concept in the provided code system with the specified code.abstract java.util.Set<CodeSystem.Concept>
getConcepts(CodeSystem codeSystem)
Get a set containingCodeSystem.Concept
instances where all structural hierarchies have been flattened.abstract java.util.Set<CodeSystem.Concept>
getConcepts(CodeSystem codeSystem, java.util.List<ValueSet.Compose.Include.Filter> filters)
Get a set containingCodeSystem.Concept
instances where all structural hierarchies have been flattened and filtered by the given set of value set include filters.abstract boolean
hasConcept(CodeSystem codeSystem, Code code)
Indicates whether the given code system contains a concept with the specified code.abstract boolean
isSupported(CodeSystem codeSystem)
Indicates whether the given code system is supported.abstract boolean
subsumes(CodeSystem codeSystem, Code codeA, Code codeB)
Indicates whether the concept forCodeA
subsumes the concept forcodeB
in the passed CodeSystem.-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.linuxforhealth.fhir.term.spi.FHIRTermServiceProvider
closure, getConcepts, getConcepts, hasConcepts
-
-
-
-
Method Detail
-
closure
public abstract java.util.Set<CodeSystem.Concept> closure(CodeSystem codeSystem, Code code)
Description copied from interface:FHIRTermServiceProvider
Get a set containingCodeSystem.Concept
instances where all structural hierarchies have been flattened.- Specified by:
closure
in interfaceFHIRTermServiceProvider
- Parameters:
codeSystem
- the code systemcode
- the root of the hierarchy containing the Concept instances to be flattened- Returns:
- flattened set of Concept instances for the given tree
-
getConcept
public abstract CodeSystem.Concept getConcept(CodeSystem codeSystem, Code code)
Description copied from interface:FHIRTermServiceProvider
Get the concept in the provided code system with the specified code. Consumers should not expect the returned Concept to contain child concepts, even where such concepts exist in the underlying CodeSystem.- Specified by:
getConcept
in interfaceFHIRTermServiceProvider
- Parameters:
codeSystem
- the code systemcode
- the code- Returns:
- the code system concept with the specified code, or null if no such concept exists
-
getConcepts
public abstract java.util.Set<CodeSystem.Concept> getConcepts(CodeSystem codeSystem)
Description copied from interface:FHIRTermServiceProvider
Get a set containingCodeSystem.Concept
instances where all structural hierarchies have been flattened.- Specified by:
getConcepts
in interfaceFHIRTermServiceProvider
- Parameters:
codeSystem
- the code system containing the set of Concept instances to be flattened- Returns:
- flattened set of Concept instances for the given code system
-
getConcepts
public abstract java.util.Set<CodeSystem.Concept> getConcepts(CodeSystem codeSystem, java.util.List<ValueSet.Compose.Include.Filter> filters)
Description copied from interface:FHIRTermServiceProvider
Get a set containingCodeSystem.Concept
instances where all structural hierarchies have been flattened and filtered by the given set of value set include filters.- Specified by:
getConcepts
in interfaceFHIRTermServiceProvider
- Parameters:
codeSystem
- the code system containing the set of Concept instances to be flattened / filteredfilters
- the value set include filters- Returns:
- flattened / filtered set of Concept instances for the given code system
-
hasConcept
public abstract boolean hasConcept(CodeSystem codeSystem, Code code)
Description copied from interface:FHIRTermServiceProvider
Indicates whether the given code system contains a concept with the specified code.- Specified by:
hasConcept
in interfaceFHIRTermServiceProvider
- Parameters:
codeSystem
- the code systemcode
- the code- Returns:
- true if the given code system contains a concept with the specified code, false otherwise
-
isSupported
public abstract boolean isSupported(CodeSystem codeSystem)
Description copied from interface:FHIRTermServiceProvider
Indicates whether the given code system is supported.- Specified by:
isSupported
in interfaceFHIRTermServiceProvider
- Parameters:
codeSystem
- the code system- Returns:
- true if the given code system is supported, false otherwise
-
subsumes
public abstract boolean subsumes(CodeSystem codeSystem, Code codeA, Code codeB)
Description copied from interface:FHIRTermServiceProvider
Indicates whether the concept forCodeA
subsumes the concept forcodeB
in the passed CodeSystem.- Specified by:
subsumes
in interfaceFHIRTermServiceProvider
- Parameters:
codeSystem
- the code systemcodeA
- the root of the hierarchy to searchcodeB
- the code to match- Returns:
- true if the code system concept for
codeB
exists in the tree rooted by the concept forCodeA
, false otherwise
-
checkArgument
protected void checkArgument(CodeSystem codeSystem)
-
checkArguments
protected void checkArguments(CodeSystem codeSystem, Code code)
-
checkArguments
protected void checkArguments(CodeSystem codeSystem, Code codeA, Code codeB)
-
checkArguments
protected <R> void checkArguments(CodeSystem codeSystem, java.util.function.Function<CodeSystem.Concept,? extends R> function)
-
checkArguments
protected void checkArguments(CodeSystem codeSystem, java.util.List<ValueSet.Compose.Include.Filter> filters)
-
checkArguments
protected <R> void checkArguments(CodeSystem codeSystem, java.util.List<ValueSet.Compose.Include.Filter> filters, java.util.function.Function<CodeSystem.Concept,? extends R> function)
-
-