Package com.ibm.fhir.term.spi
Interface FHIRTermServiceProvider
-
- All Known Implementing Classes:
AbstractTermServiceProvider
,GraphTermServiceProvider
,RegistryTermServiceProvider
,RemoteTermServiceProvider
public interface FHIRTermServiceProvider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.Set<CodeSystem.Concept>
closure(CodeSystem codeSystem, Code code)
Get a set containingCodeSystem.Concept
instances where all structural hierarchies have been flattened.default java.util.Map<Code,java.util.Set<CodeSystem.Concept>>
closure(CodeSystem codeSystem, java.util.Set<Code> codes)
Get a map of sets containingCodeSystem.Concept
instances where all structural hierarchies have been flattenedCodeSystem.Concept
getConcept(CodeSystem codeSystem, Code code)
Get the concept in the provided code system with the specified code.java.util.Set<CodeSystem.Concept>
getConcepts(CodeSystem codeSystem)
Get a set containingCodeSystem.Concept
instances where all structural hierarchies have been flattened.default <R> java.util.Set<R>
getConcepts(CodeSystem codeSystem, java.util.function.Function<CodeSystem.Concept,? extends R> function)
Get a set containingFHIRTermServiceProvider
instances mapped from concepts where all structural hierarchies have been flattened.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.default <R> java.util.Set<R>
getConcepts(CodeSystem codeSystem, java.util.List<ValueSet.Compose.Include.Filter> filters, java.util.function.Function<CodeSystem.Concept,? extends R> function)
Get a set containingFHIRTermServiceProvider
instances mapped from concepts where all structural hierarchies have been flattened and filtered by the given set of value set include filters.boolean
hasConcept(CodeSystem codeSystem, Code code)
Indicates whether the given code system contains a concept with the specified code.default boolean
hasConcepts(CodeSystem codeSystem, java.util.Set<Code> codes)
Indicates whether the given code system contains a concept for each of the specified codes.boolean
isSupported(CodeSystem codeSystem)
Indicates whether the given code system is supported.boolean
subsumes(CodeSystem codeSystem, Code codeA, Code codeB)
Indicates whether the concept forCodeA
subsumes the concept forcodeB
in the passed CodeSystem.
-
-
-
Method Detail
-
closure
java.util.Set<CodeSystem.Concept> closure(CodeSystem codeSystem, Code code)
Get a set containingCodeSystem.Concept
instances where all structural hierarchies have been flattened.- 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
-
closure
default java.util.Map<Code,java.util.Set<CodeSystem.Concept>> closure(CodeSystem codeSystem, java.util.Set<Code> codes)
Get a map of sets containingCodeSystem.Concept
instances where all structural hierarchies have been flattened- Parameters:
codeSystem
- the code systemcodes
- the set of roots of hierarchies containing the Concept instances to be flattened- Returns:
- a map containing flattened sets of Concept instances for the given trees
-
getConcept
CodeSystem.Concept getConcept(CodeSystem codeSystem, Code code)
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.- Parameters:
codeSystem
- the code systemcode
- the code- Returns:
- the code system concept with the specified code, or null if no such concept exists
-
getConcepts
java.util.Set<CodeSystem.Concept> getConcepts(CodeSystem codeSystem)
Get a set containingCodeSystem.Concept
instances where all structural hierarchies have been flattened.- 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
default <R> java.util.Set<R> getConcepts(CodeSystem codeSystem, java.util.function.Function<CodeSystem.Concept,? extends R> function)
Get a set containingFHIRTermServiceProvider
instances mapped from concepts where all structural hierarchies have been flattened.- Type Parameters:
R
- the element type of the result set- Parameters:
codeSystem
- the code system containing the set of Concept instances to be flattenedfunction
- the function to apply to each element of the result set- Returns:
- flattened set of
FHIRTermServiceProvider
instances mapped from concepts for the given code system
-
getConcepts
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.- 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
-
getConcepts
default <R> java.util.Set<R> getConcepts(CodeSystem codeSystem, java.util.List<ValueSet.Compose.Include.Filter> filters, java.util.function.Function<CodeSystem.Concept,? extends R> function)
Get a set containingFHIRTermServiceProvider
instances mapped from concepts where all structural hierarchies have been flattened and filtered by the given set of value set include filters.- Type Parameters:
R
- the element type of the result set- Parameters:
codeSystem
- the code system containing the set of Concept instances to be flattened / filteredfilters
- the value set include filtersfunction
- the function to apply to each element of the result set- Returns:
- flattened / filtered set of
FHIRTermServiceProvider
instances mapped from concepts for the given code system
-
hasConcept
boolean hasConcept(CodeSystem codeSystem, Code code)
Indicates whether the given code system contains a concept with the specified code.- Parameters:
codeSystem
- the code systemcode
- the code- Returns:
- true if the given code system contains a concept with the specified code, false otherwise
-
hasConcepts
default boolean hasConcepts(CodeSystem codeSystem, java.util.Set<Code> codes)
Indicates whether the given code system contains a concept for each of the specified codes.- Parameters:
codeSystem
- the code systemcodes
- the codes- Returns:
- true if the given code system contains a concept for each of the specified codes, false otherwise
-
isSupported
boolean isSupported(CodeSystem codeSystem)
Indicates whether the given code system is supported.- Parameters:
codeSystem
- the code system- Returns:
- true if the given code system is supported, false otherwise
-
subsumes
boolean subsumes(CodeSystem codeSystem, Code codeA, Code codeB)
Indicates whether the concept forCodeA
subsumes the concept forcodeB
in the passed CodeSystem.- 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
-
-