Class ValueSetSupport
- java.lang.Object
-
- org.linuxforhealth.fhir.term.util.ValueSetSupport
-
public final class ValueSetSupport extends java.lang.Object
A utility class for expanding FHIR value sets
-
-
Field Summary
Fields Modifier and Type Field Description static CacheManager.Configuration
CODE_SET_MAP_CACHE_CONFIG
static java.lang.String
CODE_SET_MAP_CACHE_NAME
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
clearCache(ValueSet valueSet)
Clear the code set map cache for the given value set.static ValueSet
expand(ValueSet valueSet)
Expand the given value set per the algorithm here: http://hl7.org/fhir/valueset.html#expansionstatic java.util.Map<java.lang.String,java.util.Set<java.lang.String>>
getCodeSetMap(ValueSet valueSet)
Get the code set map for the given value set.static java.util.List<ValueSet.Expansion.Contains>
getContains(ValueSet.Expansion expansion)
Get a list containingValueSet.Expansion.Contains
instances where all structural hierarchies have been flattened.static ValueSet
getValueSet(java.lang.String url)
Get the value set associated with the given url from the FHIR registry.static boolean
isExpandable(ValueSet valueSet)
static boolean
isExpanded(ValueSet valueSet)
static boolean
validateCode(ValueSet valueSet, Code code)
static boolean
validateCode(ValueSet valueSet, Coding coding)
-
-
-
Field Detail
-
CODE_SET_MAP_CACHE_NAME
public static final java.lang.String CODE_SET_MAP_CACHE_NAME
- See Also:
- Constant Field Values
-
CODE_SET_MAP_CACHE_CONFIG
public static final CacheManager.Configuration CODE_SET_MAP_CACHE_CONFIG
-
-
Method Detail
-
expand
public static ValueSet expand(ValueSet valueSet)
Expand the given value set per the algorithm here: http://hl7.org/fhir/valueset.html#expansion- Parameters:
valueSet
- the value set to be expanded- Returns:
- the expanded value set, or the original value set if already expanded or unable to expand
-
getCodeSetMap
public static java.util.Map<java.lang.String,java.util.Set<java.lang.String>> getCodeSetMap(ValueSet valueSet)
Get the code set map for the given value set.- Parameters:
valueSet
- the value set- Returns:
- the code set map for the given value set, or an empty map if no such code set map exists
-
clearCache
public static void clearCache(ValueSet valueSet)
Clear the code set map cache for the given value set.- Parameters:
valueSet
- the value set
-
getContains
public static java.util.List<ValueSet.Expansion.Contains> getContains(ValueSet.Expansion expansion)
Get a list containingValueSet.Expansion.Contains
instances where all structural hierarchies have been flattened.- Parameters:
expansion
- the expansion containing the list of Contains instances to flatten- Returns:
- flattened list of Contains instances for the given expansion
-
getValueSet
public static ValueSet getValueSet(java.lang.String url)
Get the value set associated with the given url from the FHIR registry.- Parameters:
url
- the url of the value set (with optional version postfix and optional fragment id for contained resources)- Returns:
- the value set associated with the given input parameter, or null if no such value set exists
-
isExpandable
public static boolean isExpandable(ValueSet valueSet)
-
isExpanded
public static boolean isExpanded(ValueSet valueSet)
-
-