org.LexGrid.LexBIG.Impl
Class CodedNodeSetImpl

java.lang.Object
  extended by org.LexGrid.LexBIG.Impl.CodedNodeSetImpl
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, CodedNodeSet
Direct Known Subclasses:
AbstractMultiSingleLuceneIndexCodedNodeSet, SingleLuceneIndexCodedNodeSet

public class CodedNodeSetImpl
extends java.lang.Object
implements CodedNodeSet, java.lang.Cloneable

Implementation of the CodedNodeSet Interface.

Version:
subversion $Revision: $ checked in on $Date: $
Author:
Dan Armbrust, Konrad Rokicki, Jesse Erdmann, Deepak Sharma
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.LexGrid.LexBIG.LexBIGService.CodedNodeSet
CodedNodeSet.ActiveOption, CodedNodeSet.AnonymousOption, CodedNodeSet.PropertyType, CodedNodeSet.SearchDesignationOption
 
Field Summary
protected  CodeHolderFactory codeHolderFactory
           
protected  CodeHolder codesToInclude_
           
protected  java.util.ArrayList<Operation> pendingOperations_
           
 
Constructor Summary
CodedNodeSetImpl()
          This constructor is only here for Apache Axis to work correctly.
CodedNodeSetImpl(CodeHolder codes)
           
CodedNodeSetImpl(CodeHolder codes, java.lang.String internalCodingSchemeName, java.lang.String internalVersionString)
          This is used when I converter a CodedNodeGraph to a CodedNodeSet.
CodedNodeSetImpl(java.lang.String codingScheme, CodingSchemeVersionOrTag tagOrVersion, java.lang.Boolean activeOnly, LocalNameList entityTypes)
           
 
Method Summary
protected  void clearToNodeListCodes()
           
 CodedNodeSetImpl clone()
           
 CodedNodeSet difference(CodedNodeSet codesToRemove)
          Return a coded node set that represents the set of nodes in this set that are not included by the given set.
protected  void doDifference(java.lang.String internalCodeSystemName, java.lang.String internalVersionString, Difference difference)
           
protected  void doIntersect(java.lang.String internalCodeSystemName, java.lang.String internalVersionString, Intersect intersect)
           
protected  void doUnion(java.lang.String internalCodeSystemName, java.lang.String internalVersionString, Union union)
           
 CodeHolder getCodeHolder()
           
 CodeHolderFactory getCodeHolderFactory()
           
 java.util.Set<CodingSchemeReference> getCodingSchemeReferences()
           
 java.util.List<org.apache.lucene.search.Filter> getFilters()
           
protected  java.lang.String getInternalCodeSystemName()
           
protected  java.lang.String getInternalVersionString()
           
protected  LgLoggerIF getLogger()
           
 java.util.List<org.apache.lucene.search.Query> getQueries()
           
protected  ResolvedConceptReferencesIterator getResolvedConceptReferencesIterator(CodeHolder codesToInclude, LocalNameList restrictToProperties, CodedNodeSet.PropertyType[] restrictToPropertyTypes, Filter[] filters, boolean resolveObjects)
           
protected
<T> ResultComparator<T>
getResultComparator(SortOptionList sortOptionList, SortContext sortContext, java.lang.Class<T> clazz)
           
 CodeHolder getToNodeListCodes()
           
 CodedNodeSet intersect(CodedNodeSet codes)
          Return a coded node set that represents the set of nodes this set and the provided node set have in common.
 java.lang.Boolean isCodeInSet(ConceptReference code)
          Return true if the supplied code reference is contained within this coded node set.
 boolean isShouldCodingSchemeSpecificRestriction()
           
protected  void optimizePendingOpsOrder()
           
 ResolvedConceptReferencesIterator resolve(SortOptionList sortOptions, LocalNameList restrictToProperties, CodedNodeSet.PropertyType[] restrictToPropertyTypes)
          Resolve an iterator over nodes matching the given criteria.
 ResolvedConceptReferencesIterator resolve(SortOptionList sortByProperty, LocalNameList filterOptions, LocalNameList restrictToProperties, CodedNodeSet.PropertyType[] restrictToPropertyTypes)
          Resolve an iterator over nodes matching the given criteria, allowing for additional filters to be applied against the returned items.
 ResolvedConceptReferencesIterator resolve(SortOptionList sortByProperty, LocalNameList filterOptions, LocalNameList restrictToProperties, CodedNodeSet.PropertyType[] restrictToPropertyTypes, boolean resolveObjects)
          Resolve an iterator over nodes matching the given criteria, allowing for additional filters and optionally populating full objects (e.g. concept or instance) for each returned reference.
 ResolvedConceptReferenceList resolveToList(SortOptionList sortOptions, LocalNameList restrictToProperties, CodedNodeSet.PropertyType[] restrictToPropertyTypes, int maxToReturn)
          Resolve the set to a list of nodes sorted by the supplied parameters, resolving all of the properties named in the list.
 ResolvedConceptReferenceList resolveToList(SortOptionList sortByProperty, LocalNameList filterOptions, LocalNameList restrictToProperties, CodedNodeSet.PropertyType[] restrictToPropertyTypes, boolean resolveObjects, int maxToReturn)
          Resolve the set to a list of nodes sorted by the supplied parameters, resolving all of the properties named in the list, and allowing for additional filters to be applied against the returned items.
 ResolvedConceptReferenceList resolveToList(SortOptionList sortByProperty, LocalNameList filterOptions, LocalNameList restrictToProperties, CodedNodeSet.PropertyType[] restrictToPropertyTypes, int maxToReturn)
          Resolve the set to a list of nodes sorted by the supplied parameters, resolving all of the properties named in the list, and allowing for additional filters to be applied against the returned items.
 CodedNodeSet restrictToAnonymous(CodedNodeSet.AnonymousOption anonymousOption)
          Restrict the set to anonymous (or non-anonymous) nodes.
 CodedNodeSet restrictToCodes(ConceptReferenceList codeList)
          Restrict the set to the list of codes in the supplied reference list
protected  CodedNodeSet restrictToEntityTypes(LocalNameList typeList)
           
 CodedNodeSet restrictToMatchingDesignations(java.lang.String matchText, boolean preferredOnly, java.lang.String matchAlgorithm, java.lang.String language)
          Deprecated.  
 CodedNodeSet restrictToMatchingDesignations(java.lang.String matchText, CodedNodeSet.SearchDesignationOption option, java.lang.String matchAlgorithm, java.lang.String language)
          Restrict the list to the set of nodes with designations matching the supplied text, interpreted using the supplied matching algorithm and language.
 CodedNodeSet restrictToMatchingProperties(LocalNameList propertyList, CodedNodeSet.PropertyType[] propertyTypes, LocalNameList sourceList, LocalNameList contextList, NameAndValueList qualifierList, java.lang.String matchText, java.lang.String matchAlgorithm, java.lang.String language)
          Remove all elements from the set that do not have one or more properties that match the given criteria.
 CodedNodeSet restrictToMatchingProperties(LocalNameList propertyList, CodedNodeSet.PropertyType[] propertyTypes, java.lang.String matchText, java.lang.String matchAlgorithm, java.lang.String language)
          Remove all elements from the set that do not have one or more properties that match the supplied property names, type, and text.
 CodedNodeSet restrictToProperties(LocalNameList propertyList, CodedNodeSet.PropertyType[] propertyTypes)
          Remove all elements from the set that do not have one or more properties that match the supplied property list.
 CodedNodeSet restrictToProperties(LocalNameList propertyList, CodedNodeSet.PropertyType[] propertyTypes, LocalNameList sourceList, LocalNameList contextList, NameAndValueList qualifierList)
          Remove all elements from the set that do not have one or more properties that match the given criteria.
 CodedNodeSet restrictToStatus(CodedNodeSet.ActiveOption activeOption, java.lang.String[] conceptStatus)
          Restrict the set to nodes matching the given status criteria.
 void runPendingOps()
           
 void setCodeHolderFactory(CodeHolderFactory codeHolderFactory)
           
 void setFilters(java.util.List<org.apache.lucene.search.Filter> filters)
           
 void setQueries(java.util.List<org.apache.lucene.search.Query> queries)
           
 void setShouldCodingSchemeSpecificRestriction(boolean shouldCodingSchemeSpecificRestriction)
           
 void setToNodeListCodes(CodeHolder toNodeListCodes)
           
protected  void toBruteForceMode(java.lang.String internalCodeSystemName, java.lang.String internalVersionString)
           
 CodedNodeSet union(CodedNodeSet codes)
          Return the set union of all of the codes in the containing or the referenced set
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pendingOperations_

protected java.util.ArrayList<Operation> pendingOperations_

codesToInclude_

protected CodeHolder codesToInclude_

codeHolderFactory

protected CodeHolderFactory codeHolderFactory
Constructor Detail

CodedNodeSetImpl

public CodedNodeSetImpl()
This constructor is only here for Apache Axis to work correctly. It should not be used by anyone.


CodedNodeSetImpl

public CodedNodeSetImpl(java.lang.String codingScheme,
                        CodingSchemeVersionOrTag tagOrVersion,
                        java.lang.Boolean activeOnly,
                        LocalNameList entityTypes)
                 throws LBInvocationException,
                        LBParameterException,
                        LBResourceUnavailableException
Throws:
LBResourceUnavailableException
LBInvocationException
LBParameterException

CodedNodeSetImpl

public CodedNodeSetImpl(CodeHolder codes,
                        java.lang.String internalCodingSchemeName,
                        java.lang.String internalVersionString)
                 throws LBInvocationException
This is used when I converter a CodedNodeGraph to a CodedNodeSet.

Parameters:
codes -
tagOrVersion -
Throws:
LBInvocationException
LBParameterException

CodedNodeSetImpl

public CodedNodeSetImpl(CodeHolder codes)
                 throws LBInvocationException
Throws:
LBInvocationException
Method Detail

getLogger

protected LgLoggerIF getLogger()

intersect

public CodedNodeSet intersect(CodedNodeSet codes)
                       throws LBInvocationException,
                              LBParameterException
Description copied from interface: CodedNodeSet
Return a coded node set that represents the set of nodes this set and the provided node set have in common.

Specified by:
intersect in interface CodedNodeSet
Parameters:
codes - Set of codes to intersect.
Returns:
A new CodedNodeSet representing the intersection result.
Throws:
LBInvocationException
LBParameterException
See Also:
CodedNodeSet.intersect(org.LexGrid.LexBIG.LexBIGService.CodedNodeSet)

union

public CodedNodeSet union(CodedNodeSet codes)
                   throws LBInvocationException,
                          LBParameterException
Description copied from interface: CodedNodeSet
Return the set union of all of the codes in the containing or the referenced set

Specified by:
union in interface CodedNodeSet
Parameters:
codes - Codes to add to the union
Returns:
A new CodedNodeSet representing the merged result.
Throws:
LBInvocationException
LBParameterException
See Also:
CodedNodeSet.union(org.LexGrid.LexBIG.LexBIGService.CodedNodeSet)

difference

public CodedNodeSet difference(CodedNodeSet codesToRemove)
                        throws LBInvocationException,
                               LBParameterException
Description copied from interface: CodedNodeSet
Return a coded node set that represents the set of nodes in this set that are not included by the given set.

Specified by:
difference in interface CodedNodeSet
Parameters:
codesToRemove - List of codes to remove from the surrounding set.
Returns:
A new CodedNodeSet representing the difference.
Throws:
LBInvocationException
LBParameterException
See Also:
CodedNodeSet.difference(org.LexGrid.LexBIG.LexBIGService.CodedNodeSet)

isCodeInSet

public java.lang.Boolean isCodeInSet(ConceptReference code)
                              throws LBInvocationException,
                                     LBParameterException
Description copied from interface: CodedNodeSet
Return true if the supplied code reference is contained within this coded node set.

Specified by:
isCodeInSet in interface CodedNodeSet
Parameters:
code - Coding scheme and code to test.
Throws:
LBInvocationException
LBParameterException
See Also:
CodedNodeSet.isCodeInSet(org.LexGrid.LexBIG.DataModel.Core.ConceptReference)

restrictToMatchingDesignations

@Deprecated
public CodedNodeSet restrictToMatchingDesignations(java.lang.String matchText,
                                                              boolean preferredOnly,
                                                              java.lang.String matchAlgorithm,
                                                              java.lang.String language)
                                            throws LBInvocationException,
                                                   LBParameterException
Deprecated. 

Description copied from interface: CodedNodeSet
Restrict the list to the set of nodes with designations matching the supplied text, interpreted using the supplied matching algorithm and language.

Specified by:
restrictToMatchingDesignations in interface CodedNodeSet
Parameters:
matchText - Filter String - syntax is determined by the match algorithm
preferredOnly - True means only use preferred designations, false means all.
matchAlgorithm - Local name of the match algorithm - possible algorithms are returned in LexBigService.getMatchAlgorithms().
language - Language of search string. If missing, use the default language specified in the context.
Returns:
A new CodedNodeSet representing the filtered result.
Throws:
LBInvocationException
LBParameterException
See Also:
CodedNodeSet.restrictToMatchingDesignations(String, boolean, String, String)

restrictToMatchingDesignations

public CodedNodeSet restrictToMatchingDesignations(java.lang.String matchText,
                                                   CodedNodeSet.SearchDesignationOption option,
                                                   java.lang.String matchAlgorithm,
                                                   java.lang.String language)
                                            throws LBInvocationException,
                                                   LBParameterException
Description copied from interface: CodedNodeSet
Restrict the list to the set of nodes with designations matching the supplied text, interpreted using the supplied matching algorithm and language.

Specified by:
restrictToMatchingDesignations in interface CodedNodeSet
Parameters:
matchText - Filter String - syntax is determined by the match algorithm
option - Indicates the designations to search (one of the enumerated type SearchDesignationOption).
matchAlgorithm - Local name of the match algorithm - possible algorithms are returned in LexBigService.getMatchAlgorithms().
language - Language of search string. If missing, use the default language specified in the context.
Returns:
A new CodedNodeSet representing the filtered result.
Throws:
LBInvocationException
LBParameterException

restrictToProperties

public CodedNodeSet restrictToProperties(LocalNameList propertyList,
                                         CodedNodeSet.PropertyType[] propertyTypes,
                                         LocalNameList sourceList,
                                         LocalNameList contextList,
                                         NameAndValueList qualifierList)
                                  throws LBInvocationException,
                                         LBParameterException
Description copied from interface: CodedNodeSet
Remove all elements from the set that do not have one or more properties that match the given criteria.

Note that while property name and type can be the same, the API allows for them to differ. While property name can vary from source to source, all properties are mapped to normalized property types or categories as established by the LexGrid model ('Presentations', 'Definitions', 'Comments', and 'Generic' properties). As an example, a Presentation property may be named 'displayText').

This method allows for query based on property name, type, or both. However, at least one name or type must be specified.

Specified by:
restrictToProperties in interface CodedNodeSet
Parameters:
propertyList - Local names of properties to use in restriction; each must be defined in the supported properties for the coding scheme.
propertyTypes - Indicates whether to match specific property categories, regardless of the assigned name. Any of the enumerated PropertyType values can be specified. If empty or null, properties of all types are evaluated.
sourceList - Local names of sources to match; each must be defined in the supported sources for the coding scheme. Returned values must match at least one of the specified values. A null or empty value indicates to match against all available sources.
contextList - Local names of usage contexts to match; each must be defined in the supported contexts for the coding scheme. Returned values must match at least one of the specified values. A null or empty value indicates to match against all available contexts.
qualifierList - Name/value pairings of property qualifiers to match. Each name must be defined in the supported property qualifiers for the coding scheme. Returned values must match at least one of the name/value combinations. A null or empty value indicates to match against all property qualifiers.
Returns:
A new CodedNodeSet representing the filtered result.
Throws:
LBInvocationException
LBParameterException
See Also:
org.LexGrid.LexBIG.LexBIGService.CodedNodeSet#restrictToProperties(org.LexGrid.LexBIG.DataModel.Collections.PropertyDetailList)

restrictToProperties

public CodedNodeSet restrictToProperties(LocalNameList propertyList,
                                         CodedNodeSet.PropertyType[] propertyTypes)
                                  throws LBInvocationException,
                                         LBParameterException
Description copied from interface: CodedNodeSet
Remove all elements from the set that do not have one or more properties that match the supplied property list.

Note that while property name and type can be the same, the API allows for them to differ. While property name can vary from source to source, all properties are mapped to normalized property types or categories as established by the LexGrid model ('Presentations', 'Definitions', 'Comments', and 'Generic' properties). As an example, a Presentation property may be named 'displayText').

This method allows for query based on property name, type, or both. However, at least one name or type must be specified.

Specified by:
restrictToProperties in interface CodedNodeSet
Parameters:
propertyList - Local names of properties to use in restriction; each must be defined in the supported properties for the coding scheme.
propertyTypes - Indicates whether to match specific property categories, regardless of the assigned name. Any of the enumerated PropertyType values can be specified. If empty or null, properties of all types are evaluated.
Returns:
A new CodedNodeSet representing the filtered result.
Throws:
LBInvocationException
LBParameterException
See Also:
org.LexGrid.LexBIG.LexBIGService.CodedNodeSet#restrictToProperties(org.LexGrid.LexBIG.DataModel.Collections.LocalNameList)

restrictToCodes

public CodedNodeSet restrictToCodes(ConceptReferenceList codeList)
                             throws LBInvocationException,
                                    LBParameterException
Description copied from interface: CodedNodeSet
Restrict the set to the list of codes in the supplied reference list

Specified by:
restrictToCodes in interface CodedNodeSet
Parameters:
codeList - The list of codes to filter on.
Returns:
A new CodedNodeSet representing the filtered result.
Throws:
LBInvocationException
LBParameterException

restrictToEntityTypes

protected CodedNodeSet restrictToEntityTypes(LocalNameList typeList)
                                      throws LBInvocationException,
                                             LBParameterException
Throws:
LBInvocationException
LBParameterException

restrictToMatchingProperties

public CodedNodeSet restrictToMatchingProperties(LocalNameList propertyList,
                                                 CodedNodeSet.PropertyType[] propertyTypes,
                                                 LocalNameList sourceList,
                                                 LocalNameList contextList,
                                                 NameAndValueList qualifierList,
                                                 java.lang.String matchText,
                                                 java.lang.String matchAlgorithm,
                                                 java.lang.String language)
                                          throws LBInvocationException,
                                                 LBParameterException
Description copied from interface: CodedNodeSet
Remove all elements from the set that do not have one or more properties that match the given criteria.

Note that while property name and type can be the same, the API allows for them to differ. While property name can vary from source to source, all properties are mapped to normalized property types or categories as established by the LexGrid model ('Presentations', 'Definitions', 'Comments', and 'Generic' properties). As an example, a Presentation property may be named 'displayText').

This method allows for query based on property name, type, or both. However, at least one name or type must be specified.

Specified by:
restrictToMatchingProperties in interface CodedNodeSet
Parameters:
propertyList - Indicates the local names of properties to match. To be recognized, each provided name must be defined in the coding scheme metadata as part of the registered supported properties. If empty or null, all names are evaluated for the specified property types.

Note that the meta-property 'conceptCode' can be specified in addition to specific named properties defined by the code system.

If 'conceptCode' is specified, the matchAlgorithms 'exactMatch', 'contains' and 'luceneQuery' and 'RegExp' are allowed. Any other request results in 'luceneQuery' being used.

propertyTypes - Indicates whether to match specific property categories, regardless of the assigned name. Any of the enumerated PropertyType values can be specified. If empty or null, properties of all types are evaluated.
sourceList - Local names of sources to match; each must be defined in the supported sources for the coding scheme. Returned values must match at least one of the specified values. A null or empty value indicates to match against all available sources.
contextList - Local names of usage contexts to match; each must be defined in the supported contexts for the coding scheme. Returned values must match at least one of the specified values. A null or empty value indicates to match against all available contexts.
qualifierList - Name/value pairings of property qualifiers to match. Each name must be defined in the supported property qualifiers for the coding scheme. Returned values must match at least one of the name/value combinations. A null or empty value indicates to match against all property qualifiers.
matchText - Property text to match - syntax is determined by the algorithm.
matchAlgorithm - Local name of the match algorithm - possible algorithms are returned in LexBigService.getMatchAlgorithms().
language - Language of search string. If missing, use the default language specified in the context.
Returns:
A new CodedNodeSet representing the filtered result.
Throws:
LBInvocationException
LBParameterException

restrictToMatchingProperties

public CodedNodeSet restrictToMatchingProperties(LocalNameList propertyList,
                                                 CodedNodeSet.PropertyType[] propertyTypes,
                                                 java.lang.String matchText,
                                                 java.lang.String matchAlgorithm,
                                                 java.lang.String language)
                                          throws LBInvocationException,
                                                 LBParameterException
Description copied from interface: CodedNodeSet
Remove all elements from the set that do not have one or more properties that match the supplied property names, type, and text. Text values are compared using the provided matching algorithm and language.

Note that while property name and type can be the same, the API allows for them to differ. While property name can vary from source to source, all properties are mapped to normalized property types or categories as established by the LexGrid model ('Presentations', 'Definitions', 'Comments', and 'Generic' properties). As an example, a Presentation property may be named 'displayText').

This method allows for query based on property name, type, or both. However, at least one name or type must be specified.

Specified by:
restrictToMatchingProperties in interface CodedNodeSet
Parameters:
propertyList - Indicates the local names of properties to match. To be recognized, each provided name must be defined in the coding scheme metadata as part of the registered supported properties. If empty or null, all names are evaluated for the specified property types.

Note that the meta-property 'conceptCode' can be specified in addition to specific named properties defined by the code system.

If 'conceptCode' is specified, the matchAlgorithms 'exactMatch', 'contains' and 'luceneQuery' are allowed. Any other request results in 'luceneQuery' being used.

propertyTypes - Indicates whether to match specific property categories, regardless of the assigned name. Any of the enumerated PropertyType values can be specified. If empty or null, properties of all types are evaluated.
matchText - Property text to match - syntax is determined by the algorithm.
matchAlgorithm - Local name of the match algorithm - possible algorithms are returned in LexBigService.getMatchAlgorithms().
language - Language of search string. If missing, use the default language specified in the context.
Returns:
A new CodedNodeSet representing the filtered result.
Throws:
LBInvocationException
LBParameterException
See Also:
org.LexGrid.LexBIG.LexBIGService.CodedNodeSet#restrictToMatchingProperties(org.LexGrid.LexBIG.DataModel.Collections.LocalNameList, String, String, String)

resolveToList

public ResolvedConceptReferenceList resolveToList(SortOptionList sortOptions,
                                                  LocalNameList restrictToProperties,
                                                  CodedNodeSet.PropertyType[] restrictToPropertyTypes,
                                                  int maxToReturn)
                                           throws LBInvocationException,
                                                  LBParameterException
Description copied from interface: CodedNodeSet
Resolve the set to a list of nodes sorted by the supplied parameters, resolving all of the properties named in the list.

Specified by:
resolveToList in interface CodedNodeSet
Parameters:
sortOptions - List of sort options to apply during resolution. If supplied, the sort algorithms will be applied in the order provided. Any algorithms not valid to be applied in context of node set iteration, as specified in the sort extension description, will result in a parameter exception. Available algorithms can be retrieved through the LexBIGService getSortExtensions() method after being defined to the LexBIGServiceManager extension registry.
restrictToProperties - Local names of properties to resolve. If not empty and not null, only properties matching the given names are included for resolved nodes.
restrictToPropertyTypes - Indicates whether to resolve only specific property categories, regardless of the assigned name. Any of the enumerated PropertyType values can be specified. If not empty and not null, only properties matching the given types are included for resolved nodes.
maxToReturn - Maximum number of entries to return.
Returns:
A list of node references, up to the maximum number specified. Note that in the event that a maximum number 'n' is specified and exactly 'n' items are resolved, there is currently no flag or notification provided to indicate the requested list is fully resolved.

Note that while the class of the returned value appears to imply concepts only, each contained reference inherits from the more general CodedNodeReference and is capable of representing any type of node contained by the set.

Throws:
LBInvocationException
LBParameterException
See Also:
org.LexGrid.LexBIG.LexBIGService.CodedNodeSet#resolveToList(org.LexGrid.LexBIG.DataModel.Collections.SortOptionList, org.LexGrid.LexBIG.DataModel.Collections.LocalNameList, int)

resolveToList

public ResolvedConceptReferenceList resolveToList(SortOptionList sortByProperty,
                                                  LocalNameList filterOptions,
                                                  LocalNameList restrictToProperties,
                                                  CodedNodeSet.PropertyType[] restrictToPropertyTypes,
                                                  int maxToReturn)
                                           throws LBInvocationException,
                                                  LBParameterException
Description copied from interface: CodedNodeSet
Resolve the set to a list of nodes sorted by the supplied parameters, resolving all of the properties named in the list, and allowing for additional filters to be applied against the returned items.

Specified by:
resolveToList in interface CodedNodeSet
Parameters:
sortByProperty - List of sort options to apply during resolution. If supplied, the sort algorithms will be applied in the order provided. Any algorithms not valid to be applied in context of node set iteration, as specified in the sort extension description, will result in a parameter exception. Available algorithms can be retrieved through the LexBIGService getSortExtensions() method after being defined to the LexBIGServiceManager extension registry.
filterOptions - List of Filter extensions to apply during resolution. If supplied, filters are applied in the order provided. Each name in the list must correspond to the name of a Filter description as registered to the associated service. Available Filter descriptions can be retrieved through the LexBIGService getFilterExtensions() method after being defined to the LexBIGServiceManager extension registry.
restrictToProperties - Local names of properties to resolve. If not empty and not null, only properties matching the given names are included for resolved nodes.
restrictToPropertyTypes - Indicates whether to resolve only specific property categories, regardless of the assigned name. Any of the enumerated PropertyType values can be specified. If not empty and not null, only properties matching the given types are included for resolved nodes.
maxToReturn - Maximum number of entries to return.
Returns:
A list of node references, up to the maximum number specified. Note that in the event that a maximum number 'n' is specified and exactly 'n' items are resolved, there is currently no flag or notification provided to indicate the requested list is fully resolved.

Note that while the class of the returned value appears to imply concepts only, each contained reference inherits from the more general CodedNodeReference and is capable of representing any type of node contained by the set.

Throws:
LBInvocationException
LBParameterException
See Also:
org.LexGrid.LexBIG.LexBIGService.CodedNodeSet#resolveToList(org.LexGrid.LexBIG.DataModel.Collections.SortOptionList, org.LexGrid.LexBIG.DataModel.Collections.LocalNameList, org.LexGrid.LexBIG.DataModel.Collections.LocalNameList, int)

resolveToList

public ResolvedConceptReferenceList resolveToList(SortOptionList sortByProperty,
                                                  LocalNameList filterOptions,
                                                  LocalNameList restrictToProperties,
                                                  CodedNodeSet.PropertyType[] restrictToPropertyTypes,
                                                  boolean resolveObjects,
                                                  int maxToReturn)
                                           throws LBInvocationException,
                                                  LBParameterException
Description copied from interface: CodedNodeSet
Resolve the set to a list of nodes sorted by the supplied parameters, resolving all of the properties named in the list, and allowing for additional filters to be applied against the returned items.

Specified by:
resolveToList in interface CodedNodeSet
Parameters:
sortByProperty - List of sort options to apply during resolution. If supplied, the sort algorithms will be applied in the order provided. Any algorithms not valid to be applied in context of node set iteration, as specified in the sort extension description, will result in a parameter exception. Available algorithms can be retrieved through the LexBIGService getSortExtensions() method after being defined to the LexBIGServiceManager extension registry.
filterOptions - List of Filter extensions to apply during resolution. If supplied, filters are applied in the order provided. Each name in the list must correspond to the name of a Filter description as registered to the associated service. Available Filter descriptions can be retrieved through the LexBIGService getFilterExtensions() method after being defined to the LexBIGServiceManager extension registry.
restrictToProperties - Local names of properties to resolve. If not empty and not null, only properties matching the given names are included for resolved nodes.
restrictToPropertyTypes - Indicates whether to resolve only specific property categories, regardless of the assigned name. Any of the enumerated PropertyType values can be specified. If not empty and not null, only properties matching the given types are included for resolved nodes.
resolveObjects - True to build and embed a full object (e.g. concept) for each referenced node in the returned results; false to return only basic identifying information (e.g. code, coding scheme, and description). If false, additional properties for referenced entries can be resolved on an item-by-item basis as controlled by the application.
maxToReturn - Maximum number of entries to return.
Returns:
A list of node references, up to the maximum number specified. Note that in the event that a maximum number 'n' is specified and exactly 'n' items are resolved, there is currently no flag or notification provided to indicate the requested list is fully resolved.

Note that while the class of the returned value appears to imply concepts only, each contained reference inherits from the more general CodedNodeReference and is capable of representing any type of node contained by the set.

Throws:
LBInvocationException
LBParameterException

getResultComparator

protected <T> ResultComparator<T> getResultComparator(SortOptionList sortOptionList,
                                                      SortContext sortContext,
                                                      java.lang.Class<T> clazz)
                                           throws LBParameterException
Throws:
LBParameterException

getInternalCodeSystemName

protected java.lang.String getInternalCodeSystemName()

getInternalVersionString

protected java.lang.String getInternalVersionString()

resolve

public ResolvedConceptReferencesIterator resolve(SortOptionList sortOptions,
                                                 LocalNameList restrictToProperties,
                                                 CodedNodeSet.PropertyType[] restrictToPropertyTypes)
                                          throws LBInvocationException,
                                                 LBParameterException
Description copied from interface: CodedNodeSet
Resolve an iterator over nodes matching the given criteria.

Specified by:
resolve in interface CodedNodeSet
Parameters:
sortOptions - List of sort options to apply during resolution. If supplied, the sort algorithms will be applied in the order provided. Any algorithms not valid to be applied in context of node set iteration, as specified in the sort extension description, will result in a parameter exception. Available algorithms can be retrieved through the LexBIGService getSortExtensions() method after being defined to the LexBIGServiceManager extension registry.
restrictToProperties - Local names of properties to resolve. If not empty and not null, only properties matching the given names are included for resolved nodes.
restrictToPropertyTypes - Indicates whether to resolve only specific property categories, regardless of the assigned name. Any of the enumerated PropertyType values can be specified. If not empty and not null, only properties matching the given types are included for resolved nodes.
Returns:
An iterator over matching entries. Each entry will include basic information for the node along with an embedded object (e.g. concept) populated with requested properties.

Note that while the class of the returned value appears to imply concepts only, each contained reference inherits from the more general CodedNodeReference and is capable of representing any type of node contained by the set.

Throws:
LBInvocationException
LBParameterException
See Also:
org.LexGrid.LexBIG.LexBIGService.CodedNodeSet#resolve(org.LexGrid.LexBIG.DataModel.Collections.LocalNameList, org.LexGrid.LexBIG.DataModel.Collections.LocalNameList)

resolve

public ResolvedConceptReferencesIterator resolve(SortOptionList sortByProperty,
                                                 LocalNameList filterOptions,
                                                 LocalNameList restrictToProperties,
                                                 CodedNodeSet.PropertyType[] restrictToPropertyTypes)
                                          throws LBInvocationException,
                                                 LBParameterException
Description copied from interface: CodedNodeSet
Resolve an iterator over nodes matching the given criteria, allowing for additional filters to be applied against the returned items.

Specified by:
resolve in interface CodedNodeSet
Parameters:
sortByProperty - List of sort options to apply during resolution. If supplied, the sort algorithms will be applied in the order provided. Any algorithms not valid to be applied in context of node set iteration, as specified in the sort extension description, will result in a parameter exception. Available algorithms can be retrieved through the LexBIGService getSortExtensions() method after being defined to the LexBIGServiceManager extension registry.
filterOptions - List of Filter extensions to apply during resolution. If supplied, filters are applied in the order provided. Each name in the list must correspond to the name of a Filter description as registered to the associated service. Available Filter descriptions can be retrieved through the LexBIGService getFilterExtensions() method after being defined to the LexBIGServiceManager extension registry.
restrictToProperties - Local names of properties to resolve. If not empty and not null, only properties matching the given names are included for resolved nodes.
restrictToPropertyTypes - Indicates whether to resolve only specific property categories, regardless of the assigned name. Any of the enumerated PropertyType values can be specified. If not empty and not null, only properties matching the given types are included for resolved nodes.
Returns:
An iterator over matching entries. Each entry will include basic information for the node along with an embedded object (e.g. concept) populated with requested properties.

Note that while the class of the returned value appears to imply concepts only, each contained reference inherits from the more general CodedNodeReference and is capable of representing any type of node contained by the set.

Throws:
LBInvocationException
LBParameterException
See Also:
org.LexGrid.LexBIG.LexBIGService.CodedNodeSet#resolve(org.LexGrid.LexBIG.DataModel.Collections.SortOptionList, org.LexGrid.LexBIG.DataModel.Collections.LocalNameList, org.LexGrid.LexBIG.DataModel.Collections.LocalNameList)

resolve

public ResolvedConceptReferencesIterator resolve(SortOptionList sortByProperty,
                                                 LocalNameList filterOptions,
                                                 LocalNameList restrictToProperties,
                                                 CodedNodeSet.PropertyType[] restrictToPropertyTypes,
                                                 boolean resolveObjects)
                                          throws LBInvocationException,
                                                 LBParameterException
Description copied from interface: CodedNodeSet
Resolve an iterator over nodes matching the given criteria, allowing for additional filters and optionally populating full objects (e.g. concept or instance) for each returned reference.

Specified by:
resolve in interface CodedNodeSet
Parameters:
sortByProperty - List of sort options to apply during resolution. If supplied, the sort algorithms will be applied in the order provided. Any algorithms not valid to be applied in context of node set iteration, as specified in the sort extension description, will result in a parameter exception. Available algorithms can be retrieved through the LexBIGService getSortExtensions() method after being defined to the LexBIGServiceManager extension registry.
filterOptions - List of Filter extensions to apply during resolution. If supplied, filters are applied in the order provided. Each name in the list must correspond to the name of a Filter description as registered to the associated service. Available Filter descriptions can be retrieved through the LexBIGService getFilterExtensions() method after being defined to the LexBIGServiceManager extension registry.
restrictToProperties - Local names of properties to resolve. If not empty and not null, only properties matching the given names are included for resolved nodes.
restrictToPropertyTypes - Indicates whether to resolve only specific property categories, regardless of the assigned name. Any of the enumerated PropertyType values can be specified. If not empty and not null, only properties matching the given types are included for resolved nodes.
resolveObjects - True to build and embed a full object (e.g. concept) for each referenced node in the returned results; false to return only basic identifying information (e.g. code, coding scheme, and description). If false, additional properties for referenced entries can be resolved on an item-by-item basis as controlled by the application.
Returns:
An iterator over matching entries. Each entry will include basic information for the node, such as code and coding scheme. An embedded object (e.g. concept) will optionally be populated for each item, based on the resolveObjects setting.

Note that while the class of the returned value appears to imply concepts only, each contained reference inherits from the more general CodedNodeReference and is capable of representing any type of node contained by the set.

Throws:
LBInvocationException
LBParameterException
See Also:
org.LexGrid.LexBIG.LexBIGService.CodedNodeSet#resolve(org.LexGrid.LexBIG.DataModel.Collections.SortOptionList, org.LexGrid.LexBIG.DataModel.Collections.LocalNameList, org.LexGrid.LexBIG.DataModel.Collections.LocalNameList)

restrictToStatus

public CodedNodeSet restrictToStatus(CodedNodeSet.ActiveOption activeOption,
                                     java.lang.String[] conceptStatus)
                              throws LBInvocationException,
                                     LBParameterException
Description copied from interface: CodedNodeSet
Restrict the set to nodes matching the given status criteria.

Specified by:
restrictToStatus in interface CodedNodeSet
Parameters:
activeOption - Indicates whether to include active codes, inactive codes, or both in the resolved result set (one of the enumerated type ActiveOption). This is matched against the 'isActive' field for CodedEntry instances in the code system.
conceptStatus - Indicates zero or more status values to match. Provided values are compared using an exact match algorithm against the 'status' field for matching entities. If null or empty, the restriction is evaluated based only on the specified activeOption.
Returns:
A new CodedNodeSet representing the filtered result.
Throws:
LBInvocationException
LBParameterException
See Also:
CodedNodeSet.restrictToStatus(org.LexGrid.LexBIG.LexBIGService.CodedNodeSet.ActiveOption, java.lang.String[])

restrictToAnonymous

public CodedNodeSet restrictToAnonymous(CodedNodeSet.AnonymousOption anonymousOption)
                                 throws LBInvocationException,
                                        LBParameterException
Description copied from interface: CodedNodeSet
Restrict the set to anonymous (or non-anonymous) nodes.

Specified by:
restrictToAnonymous in interface CodedNodeSet
Parameters:
anonymousOption - AnonymousOption.ANONYMOUS_ONLY : Only Anonymous nodes AnonymousOption.NON_ANONYMOUS_ONLY : Only nodes that are either not anonymous, or unspecified AnonymousOption.ALL : All nodes
Returns:
A new CodedNodeSet representing the filtered result.
Throws:
LBInvocationException - the LB invocation exception
LBParameterException - the LB parameter exception

runPendingOps

public void runPendingOps()
                   throws LBInvocationException,
                          LBParameterException
Throws:
LBInvocationException
LBParameterException

getResolvedConceptReferencesIterator

protected ResolvedConceptReferencesIterator getResolvedConceptReferencesIterator(CodeHolder codesToInclude,
                                                                                 LocalNameList restrictToProperties,
                                                                                 CodedNodeSet.PropertyType[] restrictToPropertyTypes,
                                                                                 Filter[] filters,
                                                                                 boolean resolveObjects)

doUnion

protected void doUnion(java.lang.String internalCodeSystemName,
                       java.lang.String internalVersionString,
                       Union union)
                throws LBException
Throws:
LBException

doIntersect

protected void doIntersect(java.lang.String internalCodeSystemName,
                           java.lang.String internalVersionString,
                           Intersect intersect)
                    throws LBException
Throws:
LBException

doDifference

protected void doDifference(java.lang.String internalCodeSystemName,
                            java.lang.String internalVersionString,
                            Difference difference)
                     throws LBException
Throws:
LBException

getCodeHolder

public CodeHolder getCodeHolder()
                         throws LBInvocationException,
                                LBParameterException
Throws:
LBInvocationException
LBParameterException

clearToNodeListCodes

protected void clearToNodeListCodes()

toBruteForceMode

protected void toBruteForceMode(java.lang.String internalCodeSystemName,
                                java.lang.String internalVersionString)
                         throws LBInvocationException,
                                LBParameterException
Throws:
LBInvocationException
LBParameterException

optimizePendingOpsOrder

protected void optimizePendingOpsOrder()

clone

public CodedNodeSetImpl clone()
                       throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

getCodingSchemeReferences

public java.util.Set<CodingSchemeReference> getCodingSchemeReferences()

getQueries

public java.util.List<org.apache.lucene.search.Query> getQueries()

setQueries

public void setQueries(java.util.List<org.apache.lucene.search.Query> queries)

getFilters

public java.util.List<org.apache.lucene.search.Filter> getFilters()

setFilters

public void setFilters(java.util.List<org.apache.lucene.search.Filter> filters)

getCodeHolderFactory

public CodeHolderFactory getCodeHolderFactory()

setCodeHolderFactory

public void setCodeHolderFactory(CodeHolderFactory codeHolderFactory)

setToNodeListCodes

public void setToNodeListCodes(CodeHolder toNodeListCodes)

getToNodeListCodes

public CodeHolder getToNodeListCodes()

setShouldCodingSchemeSpecificRestriction

public void setShouldCodingSchemeSpecificRestriction(boolean shouldCodingSchemeSpecificRestriction)

isShouldCodingSchemeSpecificRestriction

public boolean isShouldCodingSchemeSpecificRestriction()

Copyright: (c) 2004-2006 Mayo Foundation for Medical Education and Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the triple-shield Mayo logo are trademarks and service marks of MFMER.