Package in.cdac.medinfo.csnotk.csnolib.api

## Interface ISearchAgent

- All Superinterfaces:
    `java.io.Serializable`
  All Known Implementing Classes:
    `LuceneSearchAgent`

      public interface ISearchAgent
      extends java.io.Serializable

  Search API

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `java.util.Set<Refset>` | `getAllExtension()` | Returns a `Set` of all Extensions `Refset`s.
    `java.util.Set<Refset>` | `getAllRefset()` | Returns a `Set` of `Refset`s for given concept identifier.
    `java.util.List<Relationship>` | `getConcepts​(java.util.HashMap<java.lang.String,​java.util.List<java.lang.String>> queryParams)` | Searches the concepts of attribute name and attribute value.
    `java.util.Set<Concept>` | `getExtensionMember​(java.lang.String moduleId, int pageNumber)` | Returns a `Set` of all Extension Members `Concept`s for given concept extension identifier.
    `java.util.Set<RelationshipTC>` | `getIsARelationshipsWithCount​(java.lang.String conceptId)` | Searches for the immediate children descriptions.
    `java.util.Set<Concept>` | `getRefsetMember​(java.lang.String refsetId)` | Returns a `Set` of all Refset Members `Concept`s for given concept refset identifier.
    `java.util.List<Relationship>` | `getRelationships​(java.lang.String conceptId, java.lang.String relationshipType, EnumDirection directions)` | Searches given concept id in the SNOMED CT repository based on provided relationship type, direction.
    `java.util.List<java.lang.String>` | `getRelationType()` | It will return all relationship type based on provided SNOMED CT RF2
    `java.util.Set<java.lang.String>` | `getSemanticTags()` | It will return all semantic tags based on provided SNOMED CT RF2
    `Concept` | `search​(java.lang.String conceptId)` | Searches given conceptId in the SNOMED CT repository
    `java.util.Set<CompositeDescription>` | `search​(java.util.HashMap<java.lang.String,​java.util.List<java.lang.String>> queryParams, boolean fullConcept)` | Searches given term/text or concept id in the SNOMED CT repository based on provided component state, semantic tag, acceptability.
    `SimpleMapRefsetResult` | `searchSimpleMap​(java.lang.String refsetComponentId)` | Searches the simpleMapTarget of refsetComponentId provided .
    `java.util.Set<Concept>` | `searchTC​(java.lang.String id)` | Searches the descendent of concept id.

- - ### Method Detail

    - #### search

          java.util.Set<CompositeDescription> search​(java.util.HashMap<java.lang.String,​java.util.List<java.lang.String>> queryParams,
                                                     boolean fullConcept)

      Searches given term/text or concept id in the SNOMED CT repository based on provided component state, semantic tag, acceptability.
      Parameters:
        `queryParams` - Hashmap containing key value pair of search parameters on the basis of which search criteria will be decided. Parameters are as follows,
        SearchTerm - `String` term/text or Concept ID to be searched in SNOMED CT repository.
        State - `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.
        SemanticTag - `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`.
        Acceptability - `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,
        all - refers to all description for a concept (both preferred and acceptable).
        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.
        returnLimit/MaxRecords - 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.
      Returns:
        Set of `CompositeDescription` matching the given term/text or Concept ID.

    - #### search

          Concept search​(java.lang.String conceptId)
                  throws java.text.ParseException,
                         java.io.IOException,
                         org.apache.lucene.queryparser.classic.ParseException

      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
      Throws:
        `java.io.IOException`
        `java.text.ParseException`
        `org.apache.lucene.queryparser.classic.ParseException`

    - #### getRelationships

          java.util.List<Relationship> getRelationships​(java.lang.String conceptId,
                                                        java.lang.String relationshipType,
                                                        EnumDirection directions)

      Searches given concept id in the SNOMED CT repository based on provided relationship type, direction.
      Parameters:
        `conceptId` - - `String` Concept ID to be searched in SNOMED CT repository.
        enumRelationshipType - `EnumRelationshipType` Type of relationship.
        If enumRelationshipType is,
        is a - It will return only "is a" relation type Components.
        all - It will return only "all" relation type Components.
        finding site - It will return only "finding site" relation type Components.
        directions- `EnumDirection` Relationship direction i.e whether the specified concept Id is the source or destination Possible values for directions is,
        source - concept Id is a source
        destination - concept Id is a destination
      Returns:
        List of `Relationship` matching the given term/text or Concept ID.

    - #### searchTC

          java.util.Set<Concept> searchTC​(java.lang.String id)
                                   throws java.text.ParseException

      Searches the descendent of concept id.
      Parameters:
        `id` - concept id in the SNOMED CT
      Returns:
        Set of `Relationship` matching the given Concept ID.
      Throws:
        `java.text.ParseException`

    - #### getConcepts

          java.util.List<Relationship> getConcepts​(java.util.HashMap<java.lang.String,​java.util.List<java.lang.String>> queryParams)
                                            throws java.io.IOException,
                                                   java.text.ParseException,
                                                   org.apache.lucene.queryparser.classic.ParseException

      Searches the concepts of attribute name and attribute value.
      Parameters:
        `queryParams` -
      Returns:
        List of `Relationship` matching the given Concept ID.
      Throws:
        `java.io.IOException`
        `java.text.ParseException`
        `org.apache.lucene.queryparser.classic.ParseException`

    - #### getSemanticTags

          java.util.Set<java.lang.String> getSemanticTags()
                                                   throws java.io.IOException,
                                                          org.apache.lucene.queryparser.classic.ParseException

      It will return all semantic tags based on provided SNOMED CT RF2
      Returns:
        Set<`String`> Set of `String` containing semantic tags
      Throws:
        `java.text.ParseException`
        `java.io.IOException`
        `org.apache.lucene.queryparser.classic.ParseException`

    - #### getRelationType

          java.util.List<java.lang.String> getRelationType()
                                                    throws java.io.IOException,
                                                           org.apache.lucene.queryparser.classic.ParseException

      It will return all relationship type based on provided SNOMED CT RF2
      Returns:
        List<`String`> List of `String` containing relationship type name
      Throws:
        `java.text.ParseException`
        `java.io.IOException`
        `org.apache.lucene.queryparser.classic.ParseException`

    - #### searchSimpleMap

          SimpleMapRefsetResult searchSimpleMap​(java.lang.String refsetComponentId)
                                         throws java.text.ParseException,
                                                java.io.IOException,
                                                org.apache.lucene.queryparser.classic.ParseException

      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`

    - #### getIsARelationshipsWithCount

          java.util.Set<RelationshipTC> getIsARelationshipsWithCount​(java.lang.String conceptId)

      Searches for the immediate children descriptions.
      Parameters:
        `conceptId` - Concept Id whose immediate children to search
      Returns:
        Set of `RelationshipTC` matching the given Concept ID.
      Throws:
        `java.io.IOException` - if any error occurs while processing.
        `java.text.ParseException`

    - #### getAllRefset

          java.util.Set<Refset> getAllRefset()
                                      throws org.apache.lucene.queryparser.classic.ParseException,
                                             java.io.IOException,
                                             java.text.ParseException

      Returns a `Set` of `Refset`s for given concept identifier. *
      Returns:
        Set of `Refset`s.
      Throws:
        `org.apache.lucene.queryparser.classic.ParseException`
        `java.io.IOException`

    - #### getAllExtension

          java.util.Set<Refset> getAllExtension()
                                         throws org.apache.lucene.queryparser.classic.ParseException,
                                                java.io.IOException,
                                                java.text.ParseException

      Returns a `Set` of all Extensions `Refset`s. *
      Returns:
        Set of `Refset`s.
      Throws:
        `org.apache.lucene.queryparser.classic.ParseException`
        `java.io.IOException`

    - #### getRefsetMember

          java.util.Set<Concept> getRefsetMember​(java.lang.String refsetId)
                                          throws org.apache.lucene.queryparser.classic.ParseException,
                                                 java.io.IOException,
                                                 java.text.ParseException

      Returns a `Set` of all Refset Members `Concept`s for given concept refset identifier.
      Parameters:
        `id` - SNOMED CT concept identifier.
      Returns:
        Set of `Concept`s.
      Throws:
        `org.apache.lucene.queryparser.classic.ParseException`
        `java.io.IOException`

    - #### getExtensionMember

          java.util.Set<Concept> getExtensionMember​(java.lang.String moduleId,
                                                    int pageNumber)
                                             throws org.apache.lucene.queryparser.classic.ParseException,
                                                    java.io.IOException,
                                                    java.text.ParseException

      Returns a `Set` of all Extension Members `Concept`s for given concept extension identifier.
      Parameters:
        `id` - SNOMED CT concept identifier.
      Returns:
        Set of `Concept`s.
      Throws:
        `org.apache.lucene.queryparser.classic.ParseException`
        `java.io.IOException`