Class 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 com.ibm.fhir.model.resource.ValueSet expand​(com.ibm.fhir.model.resource.ValueSet valueSet)
      Expand the given value set per the algorithm here: http://hl7.org/fhir/valueset.html#expansion
      static Map<String,​Set<String>> getCodeSetMap​(com.ibm.fhir.model.resource.ValueSet valueSet)  
      static List<com.ibm.fhir.model.resource.ValueSet.Expansion.Contains> getContains​(com.ibm.fhir.model.resource.ValueSet.Expansion expansion)
      Get a list containing ValueSet.Expansion.Contains instances where all structural hierarchies have been flattened.
      static com.ibm.fhir.model.resource.ValueSet getValueSet​(String url)
      Get the value set associated with the given url from the FHIR registry.
      static boolean isExpandable​(com.ibm.fhir.model.resource.ValueSet valueSet)  
      static boolean isExpanded​(com.ibm.fhir.model.resource.ValueSet valueSet)  
      static boolean validateCode​(com.ibm.fhir.model.resource.ValueSet valueSet, com.ibm.fhir.model.type.Code code)  
      static boolean validateCode​(com.ibm.fhir.model.resource.ValueSet valueSet, com.ibm.fhir.model.type.Coding coding)  
    • Method Detail

      • expand

        public static com.ibm.fhir.model.resource.ValueSet expand​(com.ibm.fhir.model.resource.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
      • getContains

        public static List<com.ibm.fhir.model.resource.ValueSet.Expansion.Contains> getContains​(com.ibm.fhir.model.resource.ValueSet.Expansion expansion)
        Get a list containing ValueSet.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 com.ibm.fhir.model.resource.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
      • isExpandable

        public static boolean isExpandable​(com.ibm.fhir.model.resource.ValueSet valueSet)
      • isExpanded

        public static boolean isExpanded​(com.ibm.fhir.model.resource.ValueSet valueSet)
      • validateCode

        public static boolean validateCode​(com.ibm.fhir.model.resource.ValueSet valueSet,
                                           com.ibm.fhir.model.type.Code code)
      • validateCode

        public static boolean validateCode​(com.ibm.fhir.model.resource.ValueSet valueSet,
                                           com.ibm.fhir.model.type.Coding coding)
      • getCodeSetMap

        public static Map<String,​Set<String>> getCodeSetMap​(com.ibm.fhir.model.resource.ValueSet valueSet)