Package com.ibm.fhir.term.util
Class ValueSetSupport
- java.lang.Object
-
- com.ibm.fhir.term.util.ValueSetSupport
-
public final class ValueSetSupport extends Object
A utility class for expanding FHIR value sets
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ValueSet
expand(ValueSet valueSet)
Expand the given value set per the algorithm here: http://hl7.org/fhir/valueset.html#expansionstatic Set<ValueSet.Expansion.Contains>
getContains(ValueSet.Expansion expansion)
Get a set containingValueSet.Expansion.Contains
instances where all structural hierarchies have been flattened.static ValueSet
getValueSet(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)
-
-
-
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
-
isExpanded
public static boolean isExpanded(ValueSet valueSet)
-
isExpandable
public static boolean isExpandable(ValueSet valueSet)
-
getContains
public static Set<ValueSet.Expansion.Contains> getContains(ValueSet.Expansion expansion)
Get a set 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 set of Contains instances for the given expansion
-
getValueSet
public static ValueSet getValueSet(String url)
Get the value set associated with the given url from the FHIR registry.- Parameters:
url
- the url of the value set- Returns:
- the value set associated with the given input parameter, or null if no such value set exists
-
-