Class SearchService

  • All Implemented Interfaces:
    java.io.Serializable

    public class SearchService
    extends java.lang.Object
    implements java.io.Serializable
    Provides the basic methods to query the SNOMED CT repository for finding suggestions and searching Concepts.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      SearchService()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<java.util.List<java.lang.String>> getLangRefset()
      This method used for retrieving language refset values from LangRefsetEnum
      java.util.Set<java.lang.String> getSuggestions​(java.lang.String matchTerm, int returnLimit, java.lang.String refsetId, java.util.List<java.lang.String> parentIdList, boolean excludeConcept)
      Returns limited best matching suggestions for given term/text in SNOMED CT repository.
      java.util.Set<java.lang.String> getSuggestions​(java.lang.String matchTerm, EnumState enumState, int returnLimit, java.lang.String refsetId, java.util.List<java.lang.String> parentIdList, boolean excludeConcept)
      Returns most matching suggestions for term/text in the SNOMED CT repository based on provided component state (active, inactive, both).
      java.util.Set<java.lang.String> getSuggestions​(java.lang.String matchTerm, EnumState enumState, java.util.List<java.lang.String> semanticTagList, int returnLimit, java.lang.String refsetId, java.util.List<java.lang.String> parentIdList, boolean excludeConcept)
      Returns most matching suggestions for given term/text or concept id in the SNOMED CT repository based on provided component state, semantic tag.
      java.util.Set<java.lang.String> getSuggestions​(java.lang.String matchTerm, EnumState enumState, java.util.List<java.lang.String> semanticTagList, EnumAcceptability enumAcceptability, int returnLimit, java.lang.String refsetId, java.util.List<java.lang.String> parentIdList, boolean excludeConcept)
      Returns most matching suggestions for given term/text or concept id in the SNOMED CT repository based on provided component state, semantic tag, acceptability.
      java.util.Set<java.lang.String> getSuggestions​(java.lang.String matchTerm, java.lang.String refsetId, java.util.List<java.lang.String> parentIdList, boolean excludeConcept)
      Returns most matching suggestions for given term/text in SNOMED CT repository.
      Concept search​(java.lang.String conceptId)
      Searches given conceptId in the SNOMED CT repository
      java.util.Set<CompositeDescription> search​(java.lang.String matchTerm, boolean groupByConcept, java.lang.String refsetId, java.util.List<java.lang.String> parentIdList, boolean excludeConcept)
      Searches given term/text or concept id in SNOMED CT repository.
      java.util.Set<CompositeDescription> search​(java.lang.String matchTerm, int returnLimit, boolean groupByConcept, java.lang.String refsetId, java.util.List<java.lang.String> parentIdList, boolean excludeConcept)
      Searches limited best matching terms for given term/text or concept iD in SNOMED CT repository.
      java.util.Set<CompositeDescription> search​(java.lang.String matchTerm, EnumState enumState, int returnLimit, boolean groupByConcept, java.lang.String refsetId, java.util.List<java.lang.String> parentIdList, boolean excludeConcept)
      Searches given term/text or concept id in the SNOMED CT repository based on provided component state (active, inactive, both).
      java.util.Set<CompositeDescription> search​(java.lang.String matchTerm, EnumState enumState, java.util.List<java.lang.String> semanticTagList, int returnLimit, boolean groupByConcept, java.lang.String refsetId, java.util.List<java.lang.String> parentIdList, boolean excludeConcept)
      Searches given term/text or concept id in the SNOMED CT repository based on provided component state, semantic tag.
      java.util.Set<CompositeDescription> search​(java.lang.String matchTerm, EnumState enumState, java.util.List<java.lang.String> semanticTagList, int returnLimit, boolean groupByConcept, java.lang.String refsetId, java.util.List<java.lang.String> parentIdList, boolean fullConcept, boolean excludeConcept)  
      java.util.Set<CompositeDescription> search​(java.lang.String matchTerm, EnumState enumState, java.util.List<java.lang.String> semanticTagList, EnumAcceptability enumAcceptability, int returnLimit, boolean groupByConcept, java.lang.String refsetId, java.util.List<java.lang.String> parentIdList, boolean excludeConcept)
      Searches given term/text or concept id in the SNOMED CT repository based on provided component state, semantic tag, acceptability.
      java.util.Set<CompositeDescription> search​(java.lang.String matchTerm, EnumState enumState, java.util.List<java.lang.String> semanticTagList, EnumAcceptability enumAcceptability, int returnLimit, boolean groupByConcept, java.lang.String refsetId, java.util.List<java.lang.String> parentIdList, boolean fullConcept, boolean excludeConcept)  
      java.util.List<Identifier> searchAlternateIdentifiers​(java.lang.String id, java.lang.String moduleId)
      Searches for alternate identifiers of a SNOMED concept.
      Identifier searchLOINC​(java.lang.String id)
      Searches the LOINC / SNOMEDCT code of code provided .
      SimpleMapRefsetResult searchSimpleMap​(java.lang.String refsetComponentId)
      Searches the simpleMapTarget of refsetComponentId provided .
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SearchService

        public SearchService()
    • Method Detail

      • search

        public Concept search​(java.lang.String conceptId)
        Searches given conceptId in the SNOMED CT repository
        Parameters:
        conceptId - String it will search on the basis of given conceptId and also use for checking the entered conceptId is valid or not
        Returns:
        Object of Concept respected to given conceptId
      • search

        public java.util.Set<CompositeDescription> search​(java.lang.String matchTerm,
                                                          boolean groupByConcept,
                                                          java.lang.String refsetId,
                                                          java.util.List<java.lang.String> parentIdList,
                                                          boolean excludeConcept)
        Searches given term/text or concept id in SNOMED CT repository. Result includes active as well as inactive terms.
        Parameters:
        matchTerm - String term/text or Concept ID to be searched.
        groupByConcept - boolean value, if true, then method will return set of CompositeDescription which will contain one description from one concept.
        refsetId - Identifier of Refset if search is to be done from a specific Refset and null if search is to be done from whole SNOMED CT Terminology.
        parentIdList - List of Identifier of Concepts if search is to be done from it's descendants only and null if search is to be done from whole SNOMED CT Terminology.
        Returns:
        Set of CompositeDescription matching the given term/text or Concept ID.
      • search

        public java.util.Set<CompositeDescription> search​(java.lang.String matchTerm,
                                                          int returnLimit,
                                                          boolean groupByConcept,
                                                          java.lang.String refsetId,
                                                          java.util.List<java.lang.String> parentIdList,
                                                          boolean excludeConcept)
        Searches limited best matching terms for given term/text or concept iD in SNOMED CT repository.
        Parameters:
        matchTerm - String term/text or Concept ID to be searched in SNOMED CT repository.
        returnLimit - Maximum number of matching terms to be fetched. *
        groupByConcept - boolean value, if true, then method will return set of CompositeDescription which will contain one description from one concept.
        refsetId - Identifier of Refset if search is to be done from a specific Refset and null if search is to be done from whole SNOMED CT Terminology.
        parentIdList - List of Identifier of Concepts if search is to be done from it's descendants only and null if search is to be done from whole SNOMED CT Terminology.
        Returns:
        Set of CompositeDescription matching the given term/text or Concept ID.
      • search

        public java.util.Set<CompositeDescription> search​(java.lang.String matchTerm,
                                                          EnumState enumState,
                                                          int returnLimit,
                                                          boolean groupByConcept,
                                                          java.lang.String refsetId,
                                                          java.util.List<java.lang.String> parentIdList,
                                                          boolean excludeConcept)
        Searches given term/text or concept id in the SNOMED CT repository based on provided component state (active, inactive, both). by the user.
        Parameters:
        matchTerm - String term/text or Concept ID to be searched in SNOMED CT repository.
        enumState - EnumState State of a component.
        If enumState is,
        active - It will return only active Components.
        inactive - It will return only inactive Components.
        both - It will return both active and inactive Components.
        returnLimit - Maximum number of matching terms to be fetched.
        groupByConcept - boolean value, if true, then method will return set of CompositeDescription which will contain one description from one concept.
        refsetId - Identifier of Refset if search is to be done from a specific Refset and null if search is to be done from whole SNOMED CT Terminology.
        parentIdList - List of Identifier of Concepts if search is to be done from it's descendants only and null if search is to be done from whole SNOMED CT Terminology.
        Returns:
        Set of CompositeDescription matching the given term/text or Concept ID.
      • search

        public java.util.Set<CompositeDescription> search​(java.lang.String matchTerm,
                                                          EnumState enumState,
                                                          java.util.List<java.lang.String> semanticTagList,
                                                          int returnLimit,
                                                          boolean groupByConcept,
                                                          java.lang.String refsetId,
                                                          java.util.List<java.lang.String> parentIdList,
                                                          boolean excludeConcept)
        Searches given term/text or concept id in the SNOMED CT repository based on provided component state, semantic tag.
        Parameters:
        matchTerm - String term/text or Concept ID to be searched in SNOMED CT repository.
        enumState - EnumState State of a component.
        If enumState is,
        active - It will return only active Components.
        inactive - It will return only inactive Components.
        both - It will return both active and inactive Components.
        enumSemanticTagList - EnumSemanticTag Refers to the List of Semantic Tags in which SNOMED CT term/text or concept id will be searched.
        If enumSemanticTag is,
        all - It will search SNOMED CT term in all the Semantic Tags.
        For other possible values please refer EnumSemanticTag.
        A list of EnumSemanticTag can also be provide in which search/suggest is to be perform.
        returnLimit - Maximum number of matching terms to be fetched.
        groupByConcept - boolean value, if true, then method will return set of CompositeDescription which will contain one description from one concept.
        refsetId - Identifier of Refset if search is to be done from a specific Refset and null if search is to be done from whole SNOMED CT Terminology.
        parentIdList - List of Identifier of Concepts if search is to be done from it's descendants only and null if search is to be done from whole SNOMED CT Terminology.
        Returns:
        Set of CompositeDescription matching the given term/text or Concept ID.
      • search

        public java.util.Set<CompositeDescription> search​(java.lang.String matchTerm,
                                                          EnumState enumState,
                                                          java.util.List<java.lang.String> semanticTagList,
                                                          int returnLimit,
                                                          boolean groupByConcept,
                                                          java.lang.String refsetId,
                                                          java.util.List<java.lang.String> parentIdList,
                                                          boolean fullConcept,
                                                          boolean excludeConcept)
      • search

        public java.util.Set<CompositeDescription> search​(java.lang.String matchTerm,
                                                          EnumState enumState,
                                                          java.util.List<java.lang.String> semanticTagList,
                                                          EnumAcceptability enumAcceptability,
                                                          int returnLimit,
                                                          boolean groupByConcept,
                                                          java.lang.String refsetId,
                                                          java.util.List<java.lang.String> parentIdList,
                                                          boolean excludeConcept)
        Searches given term/text or concept id in the SNOMED CT repository based on provided component state, semantic tag, acceptability.
        Parameters:
        matchTerm - String term/text or Concept ID to be searched in SNOMED CT repository.
        enumState - EnumState State of a component.
        If enumState is,
        active - It will return only active Components.
        inactive - It will return only inactive Components.
        both - It will return both active and inactive Components.
        enumSemanticTagList - EnumSemanticTag Refers to the Semantic Tag in which SNOMED CT term/text or concept id will be searched.
        If enumSemanticTag is,
        all - It will search SNOMED CT term in all the Semantic Tags.
        For other possible values please refer EnumSemanticTag.
        A list of EnumSemanticTag can also be provide in which search/suggest is to be perform.
        enumAcceptability - EnumAcceptability Represents the type of description i.e. whether the search results contains preferred terms or preferred terms other than FSN, only acceptable terms or synonyms.
        If enumAcceptability is,
        preferred - refers to all preferred description for a concept (including FSN).
        preferredexcludingfsn - refers to SNOMEDCT description for preferred terms excluding FSN.
        synonyms - refers to all description for a concept (excluding FSN).
        acceptable- refers to all description for a concept excluding preferred.
        all - refers to all description for a concept (both preferred and acceptable).
        returnLimit - Maximum number of matching terms to be fetched.
        groupByConcept - boolean value, if true, then method will return set of CompositeDescription which will contain one description from one concept.
        refsetId - Identifier of Refset if search is to be done from a specific Refset and null if search is to be done from whole SNOMED CT Terminology.
        parentIdList - List of Identifier of Concepts if search is to be done from it's descendants only and null if search is to be done from whole SNOMED CT Terminology.
        Returns:
        Set of CompositeDescription matching the given term/text or Concept ID.
      • search

        public java.util.Set<CompositeDescription> search​(java.lang.String matchTerm,
                                                          EnumState enumState,
                                                          java.util.List<java.lang.String> semanticTagList,
                                                          EnumAcceptability enumAcceptability,
                                                          int returnLimit,
                                                          boolean groupByConcept,
                                                          java.lang.String refsetId,
                                                          java.util.List<java.lang.String> parentIdList,
                                                          boolean fullConcept,
                                                          boolean excludeConcept)
      • getSuggestions

        public java.util.Set<java.lang.String> getSuggestions​(java.lang.String matchTerm,
                                                              java.lang.String refsetId,
                                                              java.util.List<java.lang.String> parentIdList,
                                                              boolean excludeConcept)
        Returns most matching suggestions for given term/text in SNOMED CT repository.
        Parameters:
        matchTerm - String term/text to be searched.
        refsetId - Identifier of Refset if search is to be done from a specific Refset and null if search is to be done from whole SNOMED CT Terminology.
        parentIdList - List of Identifier of Concepts if search is to be done from it's descendants only and null if search is to be done from whole SNOMED CT Terminology.
        Returns:
        Set of String suggestions matching the given term/text.
      • getSuggestions

        public java.util.Set<java.lang.String> getSuggestions​(java.lang.String matchTerm,
                                                              int returnLimit,
                                                              java.lang.String refsetId,
                                                              java.util.List<java.lang.String> parentIdList,
                                                              boolean excludeConcept)
        Returns limited best matching suggestions for given term/text in SNOMED CT repository.
        Parameters:
        matchTerm - String term/text to be searched in SNOMED CT repository.
        returnLimit - Maximum number of matching terms to be fetched.
        refsetId - Identifier of Refset if search is to be done from a specific Refset and null if search is to be done from whole SNOMED CT Terminology.
        parentIdList - List of Identifier of Concepts if search is to be done from it's descendants only and null if search is to be done from whole SNOMED CT Terminology.
        Returns:
        Set of String matching the given term/text.
      • getSuggestions

        public java.util.Set<java.lang.String> getSuggestions​(java.lang.String matchTerm,
                                                              EnumState enumState,
                                                              int returnLimit,
                                                              java.lang.String refsetId,
                                                              java.util.List<java.lang.String> parentIdList,
                                                              boolean excludeConcept)
        Returns most matching suggestions for term/text in the SNOMED CT repository based on provided component state (active, inactive, both). by the user.
        Parameters:
        matchTerm - String term/text to be searched in SNOMED CT repository.
        enumState - EnumState State of a component.
        If enumState is,
        active - It will return only active Components.
        inactive - It will return only inactive Components.
        both - It will return both active and inactive Components.
        returnLimit - Maximum number of matching terms to be fetched.
        refsetId - Identifier of Refset if search is to be done from a specific Refset and null if search is to be done from whole SNOMED CT Terminology.
        parentIdList - List of Identifier of Concepts if search is to be done from it's descendants only and null if search is to be done from whole SNOMED CT Terminology.
        Returns:
        Set of String matching the given term/text.
      • getSuggestions

        public java.util.Set<java.lang.String> getSuggestions​(java.lang.String matchTerm,
                                                              EnumState enumState,
                                                              java.util.List<java.lang.String> semanticTagList,
                                                              int returnLimit,
                                                              java.lang.String refsetId,
                                                              java.util.List<java.lang.String> parentIdList,
                                                              boolean excludeConcept)
        Returns most matching suggestions for given term/text or concept id in the SNOMED CT repository based on provided component state, semantic tag.
        Parameters:
        matchTerm - String term/text or Concept ID to be searched in SNOMED CT repository.
        enumState - EnumState State of a component.
        If enumState is,
        active - It will return only active Components.
        inactive - It will return only inactive Components.
        both - It will return both active and inactive Components.
        enumSemanticTagList - EnumSemanticTag Refers to the Semantic Tag in which SNOMED CT term/text or concept id will be searched.
        If enumSemanticTag is,
        all - It will search SNOMED CT term in all the Semantic Tags.
        For other possible values please refer EnumSemanticTag.
        A list of EnumSemanticTag can also be provide in which search/suggest is to be perform.
        returnLimit - Maximum number of matching terms to be fetched.
        refsetId - Identifier of Refset if search is to be done from a specific Refset and null if search is to be done from whole SNOMED CT Terminology.
        parentIdList - List of Identifier of Concepts if search is to be done from it's descendants only and null if search is to be done from whole SNOMED CT Terminology.
        Returns:
        Set of String matching the given term/text or Concept ID.
      • getSuggestions

        public java.util.Set<java.lang.String> getSuggestions​(java.lang.String matchTerm,
                                                              EnumState enumState,
                                                              java.util.List<java.lang.String> semanticTagList,
                                                              EnumAcceptability enumAcceptability,
                                                              int returnLimit,
                                                              java.lang.String refsetId,
                                                              java.util.List<java.lang.String> parentIdList,
                                                              boolean excludeConcept)
        Returns most matching suggestions for given term/text or concept id in the SNOMED CT repository based on provided component state, semantic tag, acceptability.
        Parameters:
        matchTerm - String term/text or Concept ID to be searched in SNOMED CT repository.
        enumState - EnumState State of a component.
        If enumState is,
        active - It will return only active Components.
        inactive - It will return only inactive Components.
        both - It will return both active and inactive Components.
        enumSemanticTagList - EnumSemanticTag Refers to the Semantic Tag in which SNOMED CT term/text or concept id will be searched.
        If enumSemanticTag is,
        all - It will search SNOMED CT term in all the Semantic Tags.
        For other possible values please refer EnumSemanticTag.
        A list of EnumSemanticTag can also be provide in which search/suggest is to be perform.
        enumAcceptability - EnumAcceptability Represents the type of description i.e. whether the search results contains preferred terms or preferred terms other than FSN or only acceptable terms and so on.
        If enumAcceptability is,
        preferred - refers to all preferred description for a concept (including FSN).
        preferredexcludingfsn - refers to SNOMEDCT description for preferred terms excluding FSN.
        synonyms - refers to all description for a concept (excluding FSN).
        acceptable- refers to all description for a concept excluding preferred.
        all - refers to all description for a concept (both preferred and acceptable).
        returnLimit - Maximum number of matching terms to be fetched.
        refsetId - Identifier of Refset if search is to be done from a specific Refset and null if search is to be done from whole SNOMED CT Terminology.
        parentIdList - List of Identifier of Concepts if search is to be done from it's descendants only and null if search is to be done from whole SNOMED CT Terminology.
        Returns:
        Set of String matching the given term/text or Concept ID.
      • getLangRefset

        public java.util.List<java.util.List<java.lang.String>> getLangRefset()
        This method used for retrieving language refset values from LangRefsetEnum
        Returns:
        List of List String containing language refset values in it
      • searchSimpleMap

        public SimpleMapRefsetResult searchSimpleMap​(java.lang.String refsetComponentId)
        Searches the simpleMapTarget of refsetComponentId provided .
        Parameters:
        queryParams -
        Returns:
        SimpleMapRefsetResult mapped to the given Refset Component ID.
        Throws:
        java.io.IOException
        java.text.ParseException
        org.apache.lucene.queryparser.classic.ParseException
      • searchLOINC

        public Identifier searchLOINC​(java.lang.String id)
        Searches the LOINC / SNOMEDCT code of code provided .
        Parameters:
        queryParams -
        Returns:
        Identifier mapped to the given Refset Component ID.
        Throws:
        java.io.IOException
        java.text.ParseException
        org.apache.lucene.queryparser.classic.ParseException
      • searchAlternateIdentifiers

        public java.util.List<Identifier> searchAlternateIdentifiers​(java.lang.String id,
                                                                     java.lang.String moduleId)
        Searches for alternate identifiers of a SNOMED concept.
        Parameters:
        queryParams -
        Returns:
        Identifier mapped to the given Refset Component ID.
        Throws:
        java.io.IOException
        java.text.ParseException
        org.apache.lucene.queryparser.classic.ParseException