Class CodeSystemSupport


  • public final class CodeSystemSupport
    extends Object
    A utility class for FHIR code systems
    • Method Detail

      • findConcept

        public static CodeSystem.Concept findConcept​(CodeSystem codeSystem,
                                                     Code code)
        Find the concept in the provided code system that matches the specified code.
        Parameters:
        codeSystem - the code system to search
        code - the code to match
        Returns:
        the code system concept that matches the specified code, or null if no such concept exists
      • findConcept

        public static CodeSystem.Concept findConcept​(CodeSystem codeSystem,
                                                     CodeSystem.Concept concept,
                                                     Code code)
        Find the concept in tree rooted by the provided concept that matches the specified code.
        Parameters:
        codeSystem - the code system
        concept - the root of the tree to search
        code - the code to match
        Returns:
        the code system concept that matches the specified code, or null if not such concept exists
      • isCaseSensitive

        public static boolean isCaseSensitive​(String url)
        Indicates whether the code system with the given url is case sensitive
        Parameters:
        url - the url
        Returns:
        true if the code system with the given is case sensitive, false otherwise
      • isCaseSensitive

        public static boolean isCaseSensitive​(CodeSystem codeSystem)
        Indicates whether the code system is case sensitive
        Parameters:
        codeSystem - the code system
        Returns:
        true if the code system is case sensitive, false otherwise
      • getCodeSystem

        public static CodeSystem getCodeSystem​(String url)
        Get the code system associated with the given url from the FHIR registry.
        Parameters:
        url - the url of the code system
        Returns:
        the code system associated with the given input parameter, or null if no such code system exists
      • getCodeSystemProperty

        public static CodeSystem.Property getCodeSystemProperty​(CodeSystem codeSystem,
                                                                Code code)
        Get the code system property that matches the specified code.
        Parameters:
        codeSystem - the code system
        code - the property code to match
        Returns:
        the code system property that matches the specified code, or null if no such property exists
      • getConceptProperty

        public static CodeSystem.Concept.Property getConceptProperty​(CodeSystem.Concept concept,
                                                                     Code code)
        Get the concept property that matches the specified code.
        Parameters:
        concept - the concept
        code - the property code to match
        Returns:
        the concept property that matches the specified code, or null if no such property exists
      • getConceptPropertyValue

        public static Element getConceptPropertyValue​(CodeSystem.Concept concept,
                                                      Code code)
        Get the value of the concept property that matches the specified code.
        Parameters:
        concept - the concept
        code - the property code to match
        Returns:
        the value of the concept property that matches the specified code, or null if no such property exists
      • getConcepts

        public static Set<CodeSystem.Concept> getConcepts​(CodeSystem codeSystem)
        Get a set containing CodeSystem.Concept instances where all structural hierarchies have been flattened.
        Parameters:
        codeSystem - the code system containing the list of of Concept instances to be flattened
        Returns:
        flattened list of Concept instances for the given code system
      • getConcepts

        public static Set<CodeSystem.Concept> getConcepts​(CodeSystem.Concept concept)
        Get a set containing CodeSystem.Concept instances where all structural hierarchies have been flattened.
        Parameters:
        concept - the root of the tree containing the Concept instances to be flattened
        Returns:
        flattened set of Concept instances for the given tree
      • hasCodeSystemProperty

        public static boolean hasCodeSystemProperty​(CodeSystem codeSystem,
                                                    Code code)
        Determine whether a code system property with the specified code exists in the provided code system.
        Parameters:
        codeSystem - the code system
        code - the property code
        Returns:
        true if the code system property exists, false otherwise
      • hasConceptProperty

        public static boolean hasConceptProperty​(CodeSystem.Concept concept,
                                                 Code code)
        Determine whether a concept property with the specified code exists on the provided concept.
        Parameters:
        concept - the concept
        code - the property code
        Returns:
        true if the concept property exists, false otherwise