Class RegistryTermServiceProvider
- java.lang.Object
-
- org.linuxforhealth.fhir.term.spi.AbstractTermServiceProvider
-
- org.linuxforhealth.fhir.term.service.provider.RegistryTermServiceProvider
-
- All Implemented Interfaces:
FHIRTermServiceProvider
public class RegistryTermServiceProvider extends AbstractTermServiceProvider
Registry-based implementation of theFHIRTermServiceProvider
interface usingCodeSystemSupport
-
-
Constructor Summary
Constructors Constructor Description RegistryTermServiceProvider()
-
Method Summary
All Methods Instance Methods Concrete 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.CodeSystem.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.<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.<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.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.-
Methods inherited from class org.linuxforhealth.fhir.term.spi.AbstractTermServiceProvider
checkArgument, checkArguments, checkArguments, checkArguments, checkArguments, checkArguments
-
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, hasConcepts
-
-
-
-
Method Detail
-
closure
public 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
- Specified by:
closure
in classAbstractTermServiceProvider
- 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 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
- Specified by:
getConcept
in classAbstractTermServiceProvider
- 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 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
- Specified by:
getConcepts
in classAbstractTermServiceProvider
- 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 <R> java.util.Set<R> getConcepts(CodeSystem codeSystem, java.util.function.Function<CodeSystem.Concept,? extends R> function)
Description copied from interface:FHIRTermServiceProvider
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
public 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
- Specified by:
getConcepts
in classAbstractTermServiceProvider
- 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
public <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)
Description copied from interface:FHIRTermServiceProvider
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
public 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
- Specified by:
hasConcept
in classAbstractTermServiceProvider
- 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 boolean isSupported(CodeSystem codeSystem)
Description copied from interface:FHIRTermServiceProvider
Indicates whether the given code system is supported.- Specified by:
isSupported
in interfaceFHIRTermServiceProvider
- Specified by:
isSupported
in classAbstractTermServiceProvider
- Parameters:
codeSystem
- the code system- Returns:
- true if the given code system is supported, false otherwise
-
subsumes
public 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
- Specified by:
subsumes
in classAbstractTermServiceProvider
- 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
-
-