Class FHIRTermService


  • public class FHIRTermService
    extends java.lang.Object
    • Method Detail

      • closure

        public java.util.Set<CodeSystem.Concept> closure​(CodeSystem codeSystem,
                                                         Code code)
        Get a set containing CodeSystem.Concept instances where all structural hierarchies have been flattened.
        Parameters:
        codeSystem - the code system
        code - the root of the hierarchy containing the Concept instances to be flattened
        Returns:
        flattened set of Concept instances for the given tree
      • closure

        public java.util.Set<CodeSystem.Concept> closure​(Coding coding)
        Generate the transitive closure for the code system concept represented by the given coding
        Parameters:
        coding - the coding
        Returns:
        a set containing the transitive closure for the code system concept represented by the given coding
      • closure

        public java.util.Map<Coding,​java.util.Set<CodeSystem.Concept>> closure​(java.util.Set<Coding> codings)
        Generate a map containing the transitive closures for the code system concepts represented by the given codings
        Parameters:
        codings - the codings
        Returns:
        a map of sets containing the transitive closures for the code system concepts represented by the given codings
      • closure

        public java.util.Map<Code,​java.util.Set<CodeSystem.Concept>> closure​(CodeSystem codeSystem,
                                                                                   java.util.Set<Code> codes)
        Get a map of sets containing CodeSystem.Concept instances where all structural hierarchies have been flattened
        Parameters:
        codeSystem - the code system
        codes - the set of roots of hierarchies containing the Concept instances to be flattened
        Returns:
        a map containing flattened sets of Concept instances for the given trees
      • expand

        public ValueSet expand​(ValueSet valueSet)
        Expand the given value set
        Parameters:
        valueSet - the value set to expand
        Returns:
        the expanded value set, or the original value set if already expanded or unable to expand
      • expand

        public ValueSet expand​(ValueSet valueSet,
                               ExpansionParameters parameters)
        Expand the given value set and expansion parameters
        Parameters:
        valueSet - the value set to expand
        parameters - the expansion parameters
        Returns:
        the expanded value set, or the original value set if already expanded or unable to expand
      • getConcept

        public CodeSystem.Concept getConcept​(CodeSystem codeSystem,
                                             Code code)
        Get the concept in the provided code system with the specified code.
        Parameters:
        codeSystem - the code system to search
        code - the code to match
        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)
        Get a set containing CodeSystem.Concept instances where all structural hierarchies have been flattened.
        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)
        Get a set containing FHIRTermService 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 flattened
        function - the function to apply to each element of the result set
        Returns:
        flattened set of FHIRTermService 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)
        Get a set containing CodeSystem.Concept instances where all structural hierarchies have been flattened and filtered by the given set of value set include filters.
        Parameters:
        codeSystem - the code system
        filters - the value set include filters
        Returns:
        flattened / filtered list 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)
        Get a set containing FHIRTermService 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 / filtered
        filters - the value set include filters
        function - the function to apply to each element of the result set
        Returns:
        flattened / filtered set of FHIRTermService instances mapped from concepts for the given code system
      • hasConcept

        public boolean hasConcept​(CodeSystem codeSystem,
                                  Code code)
        Indicates whether the given code system contains a concept with the specified code.
        Parameters:
        codeSystem - the code system
        code - the code
        Returns:
        true if the given code system contains a concept with the specified code, false otherwise
      • hasConcepts

        public boolean hasConcepts​(CodeSystem codeSystem,
                                   java.util.Set<Code> codes)
        Indicates whether the given code system contains a concept for each of the specified codes.
        Parameters:
        codeSystem - the code system
        codes - the codes
        Returns:
        true if the given code system contains a concept for each of the specified codes, false otherwise
      • isExpandable

        public boolean isExpandable​(ValueSet valueSet)
        Indicates whether the given value set is expandable
        Parameters:
        valueSet - the value set
        Returns:
        true if the given value set is expandable, false otherwise
      • isSupported

        public boolean isSupported​(CodeSystem codeSystem)
        Indicates whether the given code system is supported.
        Parameters:
        codeSystem - the code system
        Returns:
        true if the given code system is supported, false otherwise
      • lookup

        public LookupOutcome lookup​(Coding coding)
        Lookup the code system concept for the given coding
        Parameters:
        coding - the coding to lookup
        Returns:
        the outcome of the lookup; null if a CodeSystem was not found for the system and version in the coding
      • lookup

        public LookupOutcome lookup​(Coding coding,
                                    LookupParameters parameters)
        Lookup the code system concept for the given coding and lookup parameters
        Parameters:
        coding - the coding to lookup
        parameters - the lookup parameters
        Returns:
        the outcome of the lookup; null if a CodeSystem was not found for the system and version in the coding
      • lookup

        public LookupOutcome lookup​(CodeSystem codeSystem,
                                    Coding coding,
                                    LookupParameters parameters)
        Lookup the code system concept for the given coding within the passed CodeSystem
        Parameters:
        codeSystem - the code system to look in
        coding - the coding to lookup
        parameters - the lookup parameters
        Returns:
        the outcome of the lookup; null if the passed CodeSystem is not applicable to the system and version of the coding
      • lookup

        public LookupOutcome lookup​(Uri system,
                                    String version,
                                    Code code)
        Lookup the code system concept for the given system, version, and code
        Parameters:
        system - the system
        version - the version
        code - the code
        Returns:
        the outcome of the lookup
      • lookup

        public LookupOutcome lookup​(Uri system,
                                    String version,
                                    Code code,
                                    LookupParameters parameters)
        Lookup the code system concept for the given system, version, code and lookup parameters
        Parameters:
        system - the system
        version - the version
        code - the code
        parameters - the lookup parameters
        Returns:
        the outcome of the lookup
      • subsumes

        public boolean subsumes​(CodeSystem codeSystem,
                                Code codeA,
                                Code codeB)
        Find the concept in tree rooted by the provided concept that matches the specified code.
        Parameters:
        codeSystem - the code system
        codeA - the code "A"
        codeB - the code "B"
        Returns:
        true if the concept represented by code "A" subsumes the concept represented by code "B", false otherwise
      • subsumes

        public ConceptSubsumptionOutcome subsumes​(Coding codingA,
                                                  Coding codingB)
        Perform a subsumption test to determine if the code system concept represented by the given coding "A" subsumes the code system concept represented by the given coding "B"
        Parameters:
        codingA - the coding "A"
        codingB - the coding "B"
        Returns:
        the outcome of the subsumption test, or null if the relationship could not be tested
      • translate

        public TranslationOutcome translate​(ConceptMap conceptMap,
                                            CodeableConcept codeableConcept)
        Translate the given coding using the provided concept map
        Parameters:
        conceptMap - the concept map
        codeable - concept the codeable concept
        Returns:
        the outcome of translation
      • translate

        public TranslationOutcome translate​(ConceptMap conceptMap,
                                            CodeableConcept codeableConcept,
                                            TranslationParameters parameters)
        Translate the given codeable concept using the provided concept map and translation parameters
        Parameters:
        conceptMap - the concept map
        codeableConcept - the codeable concept
        parameters - the translation parameters
        Returns:
        the outcome of translation
      • translate

        public TranslationOutcome translate​(ConceptMap conceptMap,
                                            Coding coding)
        Translate the given coding using the provided concept map
        Parameters:
        conceptMap - the concept map
        coding - the coding
        Returns:
        the outcome of translation
      • translate

        public TranslationOutcome translate​(ConceptMap conceptMap,
                                            Coding coding,
                                            TranslationParameters parameters)
        Translate the given coding using the provided concept map and translation parameters
        Parameters:
        conceptMap - the concept map
        coding - the coding
        parameters - the translation parameters
        Returns:
        the outcome of translation
      • translate

        public TranslationOutcome translate​(ConceptMap conceptMap,
                                            Uri system,
                                            String version,
                                            Code code)
        Translate the given system, version and code using the provided concept map
        Parameters:
        conceptMap - the concept map
        system - the system
        version - the version
        code - the code
        Returns:
        the outcome of translation
      • translate

        public TranslationOutcome translate​(ConceptMap conceptMap,
                                            Uri system,
                                            String version,
                                            Code code,
                                            TranslationParameters parameters)
        Translate the given system, version and code using the provided concept map and translation parameters
        Parameters:
        conceptMap - the concept map
        system - the system
        version - the version
        code - the code
        parameters - the translation parameters
        Returns:
        the outcome of translation
      • validateCode

        public ValidationOutcome validateCode​(CodeSystem codeSystem,
                                              CodeableConcept codeableConcept)
        Validate a codeable concept using the provided code system
        Parameters:
        codeableConcept - the codeable concept
        Returns:
        the outcome of validation
      • validateCode

        public ValidationOutcome validateCode​(CodeSystem codeSystem,
                                              CodeableConcept codeableConcept,
                                              ValidationParameters parameters)
        Validate a codeable concept using the provided code system and validation parameters
        Parameters:
        codeSystem - the code system
        codeableConcept - the codeable concept
        parameters - the validation parameters
        Returns:
        the outcome of validation
      • validateCode

        public ValidationOutcome validateCode​(CodeSystem codeSystem,
                                              Coding coding)
        Validate a coding using the provided code system
        Parameters:
        codeSystem - the codeSystem
        coding - the coding
        Returns:
        the outcome of validation
      • validateCode

        public ValidationOutcome validateCode​(CodeSystem codeSystem,
                                              Coding coding,
                                              ValidationParameters parameters)
        Validate a coding using the provided code system and validation parameters
        Parameters:
        codeSystem - the code system
        coding - the coding
        parameters - the validation parameters
        Returns:
        the outcome of validation
      • validateCode

        public ValidationOutcome validateCode​(CodeSystem codeSystem,
                                              Code code,
                                              String display)
        Validate a code and display using the provided code system
        Parameters:
        code - system the code system
        code - the code
        display - the display
        Returns:
        the outcome of validation
      • validateCode

        public ValidationOutcome validateCode​(CodeSystem codeSystem,
                                              Code code,
                                              String display,
                                              ValidationParameters parameters)
        Validate a code and display using the provided code system and validation parameters
        Parameters:
        codeSystem - the code system
        code - the code
        display - the display
        parameters - the validation parameters
        Returns:
        the outcome of validation
      • validateCode

        public ValidationOutcome validateCode​(ValueSet valueSet,
                                              Code code)
        Validate a code using the provided value set
        Parameters:
        valueSet - the value set
        code - the code
        Returns:
        the outcome of validation
      • validateCode

        public ValidationOutcome validateCode​(ValueSet valueSet,
                                              Code code,
                                              ValidationParameters parameters)
        Validate a code using the provided value set and validation parameters
        Parameters:
        valueSet - the value set
        code - the code
        parameters - the validation parameters
        Returns:
        the outcome of validation
      • validateCode

        public ValidationOutcome validateCode​(ValueSet valueSet,
                                              CodeableConcept codeableConcept)
        Validate a codeable concept using the provided value set
        Parameters:
        valueSet - the value set
        codeable - concept the codeable concept
        Returns:
        the outcome of validation
      • validateCode

        public ValidationOutcome validateCode​(ValueSet valueSet,
                                              CodeableConcept codeableConcept,
                                              ValidationParameters parameters)
        Validate a codeable concept using the provided value set using the provided validation parameters
        Parameters:
        valueSet - the value set
        codeable - concept the codeable concept
        parameters - the validation parameters
        Returns:
        the outcome of validation
      • validateCode

        public ValidationOutcome validateCode​(ValueSet valueSet,
                                              Coding coding)
        Validate a coding using the provided value set using the provided validation parameters
        Parameters:
        valueSet - the value set
        coding - the coding
        parameters - the validation parameters
        Returns:
        the outcome of validation
      • validateCode

        public ValidationOutcome validateCode​(ValueSet valueSet,
                                              Coding coding,
                                              ValidationParameters parameters)
        Validate a coding using the provided value set using the provided validation parameters
        Parameters:
        valueSet - the value set
        coding - the coding
        parameters - the validation parameters
        Returns:
        the outcome of validation
      • validateCode

        public ValidationOutcome validateCode​(ValueSet valueSet,
                                              Uri system,
                                              String version,
                                              Code code,
                                              String display)
        Validate a code and display using the provided value set
        Parameters:
        valueSet - the value set
        system - the system
        version - the version
        code - the code
        display - the display
        Returns:
        the outcome of validation
      • validateCode

        public ValidationOutcome validateCode​(ValueSet valueSet,
                                              Uri system,
                                              String version,
                                              Code code,
                                              String display,
                                              ValidationParameters parameters)
        Validate a code and display using the provided value set and validation parameters
        Parameters:
        valueSet - the value set
        system - the system
        version - the version
        code - the code
        display - the display
        parameters - the validation parameters
        Returns:
        the outcome of validation