Page History
Scrollbar | ||
---|---|---|
|
...
Page info | ||||
---|---|---|---|---|
|
Section | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Retrieving Services
LexEVS provides a number of services which are retrievable through the LexBIGService interface and the LexEvsServiceLocator interface. We list here a small sample including the more commonly used interfaces.
LexBIGService
Multiexcerpt include | ||||||
---|---|---|---|---|---|---|
|
HistoryService
Multiexcerpt include | ||||||
---|---|---|---|---|---|---|
|
Code Block |
---|
LexBIGService lbsv = LexBIGServiceImpl.defaultInstance(); try { HistoryService historSvc = lbsv.getHistoryService(codingScheme:title} {section} {column} {panel:title=Contents of this Page} {toc:minLevel=2} {panel} {column} {column} {align:right}{include:Menu LexEVS 6.0 Administration to Include}{align}{column} {section} h2. Retrieving Services LexEVS provides a number of services which are retrievable through the LexBIGService interface and the LexEvsServiceLocator interface. We list here a small sample including the more commonly used interfaces. h3. [LexBIGService|http://informatics.mayo.edu/LexGrid/downloads/LexEVS_60_JavaDocs/runtime_javadoc/org/LexGrid/LexBIG/Impl/LexBIGServiceImpl.html] h4. [HistoryService|http://informatics.mayo.edu/LexGrid/downloads/LexEVS_60_JavaDocs/runtime_javadoc/org/LexGrid/LexBIG/Impl/LexBIGServiceImpl.html#getHistoryService%28java.lang.String%29] <source lang = java> {code} LexBIGService lbsv = LexBIGServiceImpl.defaultInstance(); try { HistoryService historSvc = lbsv.getHistoryService(codingScheme);< } catch (LBException e) { e.printStackTrace(); } {code} </source> h4. [LexBIGServiceManager|http://informatics.mayo.edu/LexGrid/downloads/LexEVS_60_JavaDocs/runtime_javadoc/org/LexGrid/LexBIG/Impl/LexBIGServiceImpl.html#getServiceManager%28java.lang.Object%29] <source lang = java> {code} |
LexBIGServiceManager
Multiexcerpt include | ||||||
---|---|---|---|---|---|---|
|
Code Block |
---|
//LexBIG Service Manager can accept credentials validation to
//preserve service security.
LexBIGService lbsv = LexBIGServiceImpl.defaultInstance();
try {
LexBIGServiceManager svcManager = lbsv.getServiceManager(credentials);
} catch (LBException e) {
e.printStackTrace();
}
{code}
</source>
h4 |
LexEVSServiceMetaData
Multiexcerpt include | ||||||
---|---|---|---|---|---|---|
|
Code Block |
---|
. [LexEVSServiceMetaData|http://informatics.mayo.edu/LexGrid/downloads/LexEVS_60_JavaDocs/runtime_javadoc/org/LexGrid/LexBIG/Impl/LexBIGServiceImpl.html#getServiceMetadata%28%29] <source lang = java> {code} // User safe service meta data query interface. LexBIGService lbsv = LexBIGServiceImpl.defaultInstance(); try { LexBIGServiceMetadata svcMetaData = lbsv.getServiceMetadata(); } catch (LBException e) { e.printStackTrace(); } {code} </source> h3 |
LexEvsServiceLocator
Multiexcerpt include | ||||||
---|---|---|---|---|---|---|
|
SystemResourceService
Multiexcerpt include | ||||||
---|---|---|---|---|---|---|
|
Code Block |
---|
// The system resource service is commonly wrapped in LexBIGServiceManager calls // and as such it prevents unauthorized users from removing coding schemes from the service. SystemResourceService systemResourceService = LexEvsServiceLocator.getInstance().getSystemResourceService(); // must be marked as inactive or pending before delete. systemResourceService.removeCodingSchemeResourceFromSystem( codingSchemeVersionReference.getCodingSchemeURN(), . [LexEvsServiceLocator|http://informatics.mayo.edu/LexGrid/downloads/LexEVS_60_JavaDocs/runtime_javadoc/org/lexevs/locator/LexEvsServiceLocator.html] h4. [SystemResourceService|http://informatics.mayo.edu/LexGrid/downloads/LexEVS_60_JavaDocs/runtime_javadoc/org/lexevs/locator/LexEvsServiceLocator.html#getSystemResourceService%28%29] <source lang = java> {code} // The system resource service is commonly wrapped in LexBIGServiceManager calls // and as such it prevents unauthorized users from removing coding schemes from the service. SystemResourceService systemResourceService = LexEvsServiceLocator.getInstance().getSystemResourceService(); // must be marked as inactive or pending before delete. systemResourceService.removeCodingSchemeResourceFromSystem( codingSchemeVersionReference.getCodingSchemeURN(), codingSchemeVersionReference.getCodingSchemeVersion()); {code} </source> |
LexEvsIndexOperations
Multiexcerpt include | ||||||
---|---|---|---|---|---|---|
|
Some index operations can be accomplished using the interface returned from the LexEvsServiceLocator.
Code Block |
---|
boolean isSingleIndex = h4. [LexEvsIndexOperations|http://informatics.mayo.edu/LexGrid/downloads/LexEVS_60_JavaDocs/runtime_javadoc/org/lexevs/locator/LexEvsServiceLocator.html#getLexEvsIndexOperations%28%29] Some index operations can be accomplished using the interface returned from the LexEvsServiceLocator. <source lang = java> {code} boolean isSingleIndex = LexEvsServiceLocator.getInstance().getSystemResourceService().getSystemVariables().getIsSingleIndex(); if(! isSingleIndex) { throw new RuntimeException("Lucene Clean Up can only be executed in Single Index Mode."); } try { List<AbsoluteCodingSchemeVersionReference> expectedList = new ArrayList<AbsoluteCodingSchemeVersionReference>(); for(RegistryEntry entry : LexEvsServiceLocator.getInstance().getRegistry().getAllRegistryEntriesOfType(ResourceType.CODING_SCHEME)) { AbsoluteCodingSchemeVersionReference ref = new AbsoluteCodingSchemeVersionReference(); ref.setCodingSchemeURN(entry.getResourceUri()); ref.setCodingSchemeVersion(entry.getResourceVersion()); expectedList.add(ref); } LexEvsServiceLocator.getInstance().getLexEvsIndexOperations().cleanUp(expectedList, reindexMissing); } catch (Exception e) { throw new RuntimeException(e); } |
EntityIndexService
Multiexcerpt include | ||||||
---|---|---|---|---|---|---|
|
Others operations require using the IndexServiceManager to retrieve a more specific index service
Code Block |
---|
AbsoluteCodingSchemeVersionReference acsvr = new AbsoluteCodingSchemeVersionReference(); {code} </source> h4. [EntityIndexService|http://informatics.mayo.edu/LexGrid/downloads/LexEVS_60_JavaDocs/runtime_javadoc/org/lexevs/dao/index/service/entity/EntityIndexService.html] Others operations require using the IndexServiceManager to retrieve a more specific index service <source lang = java> {code} AbsoluteCodingSchemeVersionReference acsvr = new AbsoluteCodingSchemeVersionReference()acsvr.setCodingSchemeURN(css.getCodingSchemeURI()); acsvr.setCodingSchemeURN(css.getCodingSchemeURI()); acsvr.setCodingSchemeVersion(css.getRepresentsVersion()); LexEvsServiceLocator.getInstance(). getIndexServiceManager(). getEntityIndexService().dropIndex(acsvr); {code} </source> h2. LexBIGService Administration Methods |
LexBIGService Administration Methods
We've
...
shown
...
how
...
the
...
LexBIGService
...
interface
...
can
...
retrieve
...
other
...
services,
...
but
...
it
...
also
...
provides
...
some
...
user
...
safe
...
administrative
...
functions.
...
These
...
functions
...
provide
...
users
...
with
...
information
...
about
...
the
...
service
...
and
...
overlap
...
general
...
user
...
API
...
functions,
...
since
...
they
...
give
...
users
...
information
...
about
...
how
...
to
...
use
...
the
...
service.
Getting Filter Extensions
Multiexcerpt include | ||||||
---|---|---|---|---|---|---|
|
Code Block |
---|
h3. [Getting Filter Extensions|http://informatics.mayo.edu/LexGrid/downloads/LexEVS_60_JavaDocs/runtime_javadoc/org/LexGrid/LexBIG/Impl/LexBIGServiceImpl.html#getFilterExtensions%28%29]: <source lang=java> {code} // LexEVS has no built-in filter extensions. This method call // will only return filters users have created themselves. LexBIGService lbsv = LexBIGServiceImpl.defaultInstance(); Enumeration<? extends ExtensionDescription> extDesc = lbsv.getFilterExtensions().enumerateExtensionDescription(); while(extDesc.hasMoreElements()){ System.out.println(extDesc.nextElement().getName()); } {code} </source> h3. [Getting Sort Algorithms:|http://informatics.mayo.edu/LexGrid/downloads/LexEVS_60_JavaDocs/runtime_javadoc/org/LexGrid/LexBIG/Impl/LexBIGServiceImpl.html#getSortAlgorithms%28org.LexGrid.LexBIG.DataModel.InterfaceElements.types.SortContext%29] <source lang=java> {code} LexBIGService lbsv = LexBIGServiceImpl.defaultInstance(); Enumeration<? extends SortDescription> sortDesc = lbsv.getSortAlgorithms(null).enumerateSortDescription(); |
Getting Sort Algorithms
Multiexcerpt include | ||||||
---|---|---|---|---|---|---|
|
Code Block |
---|
LexBIGService lbsv = LexBIGServiceImpl.defaultInstance(); Enumeration<? extends SortDescription> sortDesc = lbsv.getSortAlgorithms(null).enumerateSortDescription(); while(sortDesc.hasMoreElements()){ System.out.println(sortDesc.nextElement().getName()); } {code} </source> h3. [Getting Match Algorithms|http://informatics.mayo.edu/LexGrid/downloads/LexEVS_60_JavaDocs/runtime_javadoc/org |
Getting Match Algorithms
Multiexcerpt include | ||||||
---|---|---|---|---|---|---|
|
Code Block |
---|
/LexGrid/LexBIG/Impl/LexBIGServiceImpl.html#getMatchAlgorithms%28%29]:
<source lang=java>
{code}
LexBIGService lbsv = LexBIGServiceImpl.defaultInstance();
Enumeration<? extends ModuleDescription> modDesc = lbsv.getMatchAlgorithms().enumerateModuleDescription();
while(modDesc.hasMoreElements()){
System.out.println(modDesc.nextElement().getName());
}
|
Sample Output
Code Block |
---|
{code} </source> Sample Output: {code} SpellingErrorTolerantSubStringSearch StemmedLuceneQuery literalContains startsWith nonLeadingWildcardLiteralSubString literal WeightedDoubleMetaphoneLuceneQuery literalSubString DoubleMetaphoneLuceneQuery RegExp {code} h3. [Getting Generic Extensions|http://informatics.mayo.edu/LexGrid/downloads/LexEVS_60_JavaDocs/runtime_javadoc/org/LexGrid/LexBIG/Impl/LexBIGServiceImpl.html#getGenericExtensions%28%29]: <source lang=java> {code} LexBIGService lbsv = LexBIGServiceImpl.defaultInstance(); Enumeration<? extends ExtensionDescription> extDesc = lbsv.getGenericExtensions().enumerateExtensionDescription() |
Getting Generic Extensions
Multiexcerpt include | ||||||
---|---|---|---|---|---|---|
|
Code Block |
---|
LexBIGService lbsv = LexBIGServiceImpl.defaultInstance();
Enumeration<? extends ExtensionDescription> extDesc = lbsv.getGenericExtensions().enumerateExtensionDescription();
while(extDesc.hasMoreElements()){
System.out.println(extDesc.nextElement().getName());
}
|
Sample Output
Code Block |
---|
SupplementExtension {code} </source> Sample Output: {code} SupplementExtension LexBIGServiceConvenienceMethods ApproxNumOfConceptsPostProcessor MappingExtension SupportedAttributePostProcessor OntologyFormatAddingPostProcessor {code} h3. [Getting Service Information on all Schemes|http://informatics.mayo.edu/LexGrid/downloads/LexEVS_60_JavaDocs |
Getting Service Information on all Schemes
Multiexcerpt include | ||||||
---|---|---|---|---|---|---|
|
Code Block |
---|
LexBIGService lbsv = LexBIGServiceImpl.defaultInstance(); try { CodingSchemeRenderingList schemes = lbsv.getSupportedCodingSchemes(); for (CodingSchemeRendering csr : schemes.getCodingSchemeRendering()) { /runtime_javadoc/org/LexGrid/LexBIG/Impl/LexBIGServiceImpl.html#getSupportedCodingSchemes%28%29]: <source lang=java> {code} LexBIGService lbsv = LexBIGServiceImpl.defaultInstance(); try { CodingSchemeRenderingList schemes = lbsv.getSupportedCodingSchemes(); for (CodingSchemeRendering csr : schemes.getCodingSchemeRendering()) { // Separator ... System.out.println("============================="); CodingSchemeSummary css = csr.getCodingSchemeSummary(); CodingScheme cs = lbsv.resolveCodingScheme(css.getCodingSchemeURI(), Constructors .createCodingSchemeVersionOrTagFromVersion(css.getRepresentsVersion())); System.out.println(ObjectToString.toString(cs, "", 80));} } catch (LBException e) { // TODO Auto-generated catch block e.printStackTrace(); } |
Sample Output Excerpt
Code Block |
---|
{code} </source> Sample Output Excerpt {code} CodingScheme Name: MDR12_1_TO_CST95 Formal Name: MDR12_1_TO_CST95 URI: urn:oid:CL413321.MDR.CST Approximate Number of Concepts: 0 Default Language: null Represents Version: 200909 Local Names: Array of 1 items: MDR12_1_TO_CST95 Mappings: MappingsSupportedAssociations: Array of 1 items: SupportedAssociation Local ID: mapped_to Content: mapped_to AssociationEntity CodingScheme: null AssociationEntity EntityCodeNamespace: null AssociationEntity EntityCode: null SupportedCodingSchemes: ................................................... {code} h3. [Getting Single Coding Scheme Information|http://informatics.mayo.edu/LexGrid/downloads/LexEVS_60_JavaDocs/runtime_javadoc/org/LexGrid/LexBIG/Impl/LexBIGServiceImpl.html#resolveCodingScheme%28java.lang.String,%20org |
Getting Single Coding Scheme Information
Multiexcerpt include | ||||||
---|---|---|---|---|---|---|
|
Code Block |
---|
.LexGrid.LexBIG.DataModel.Core.CodingSchemeVersionOrTag%29]: <source lang=java> {code} public void run(){ String codingScheme = "amino-acid.owl"; CodingSchemeVersionOrTag versionOrTag = new CodingSchemeVersionOrTag(); versionOrTag.setVersion("1.2"); LexBIGService lbsv = LexBIGServiceImpl.defaultInstance(); try { CodingScheme cs = lbsv.resolveCodingScheme(codingScheme, versionOrTag ); System.out.println(ObjectToString.toString(cs, "", 80)); } catch (LBException e) { // TODO Auto-generated catch block e.printStackTrace(); } {code} </source> Output same as above but for designated coding scheme only. h3. [Getting a Coding Scheme's Copyright Content|http://informatics.mayo.edu/LexGrid/downloads/LexEVS_60_JavaDocs/runtime_javadoc/org/LexGrid/LexBIG/Impl/LexBIGServiceImpl.html#resolveCodingSchemeCopyright%28java.lang.String,%20org.LexGrid.LexBIG.DataModel.Core.CodingSchemeVersionOrTag%29]: <source lang=java> {code} String codingScheme = "amino-acid.owl"; CodingSchemeVersionOrTag versionOrTag = new CodingSchemeVersionOrTag(); versionOrTag.setVersion("1.2"); block e.printStackTrace(); } |
Output same as preceding but for designated coding scheme only.
Getting a Coding Scheme's Copyright Content
Multiexcerpt include | ||||||
---|---|---|---|---|---|---|
|
Code Block |
---|
String codingScheme = "amino-acid.owl";
CodingSchemeVersionOrTag versionOrTag = new CodingSchemeVersionOrTag();
versionOrTag.setVersion("1.2");
LexBIGService lbsv = LexBIGServiceImpl.defaultInstance();
try {
String cpywrt = lbsv.resolveCodingSchemeCopyright(codingScheme, versionOrTag);
System.out.println(cpywrt);
} catch (LBException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
|
Output is unformatted text
LexBIGService Manager Methods
Multiexcerpt include | ||||||
---|---|---|---|---|---|---|
|
These methods are generally not end user safe or access information in the system that is administrator specific in context. In general it should not be exposed to the end user.
Setting Coding Scheme Version Tag
Setting the Coding Scheme tag allows the system administrator to provide status tags or designate a preferred version of a given coding scheme for this terminology service.
Code Block |
---|
AbsoluteCodingSchemeVersionReference codingSchemeVersion = new AbsoluteCodingSchemeVersionReference(); codingSchemeVersion.setCodingSchemeURN("http://www.co-ode.org/ontologies/amino-acid/2005/10/11 /amino-acid.owl"); codingSchemeVersion.setCodingSchemeVersion("1.0"); LexBIGService lbsv = LexBIGServiceImpl.defaultInstance(); try { StringLexBIGServiceManager cpywrtlbsvm = lbsv.resolveCodingSchemeCopyright(codingScheme,getServiceManager(null); // PRODUCTION tagged vocabularies are interpreted by LexEVS // to be the preferred version of the vocabulary. lbsvm.setVersionTag(codingSchemeVersion, "PRODUCTION"); } catch (LBException e) { // TODO Auto-generated catch block e.printStackTrace(); } |
Activate Coding Scheme
The active designation for a coding scheme is required to enable query functionality for the contained entities and their relationships and properties.
Code Block |
---|
versionOrTag); System.out.println(cpywrt); } catch (LBException e) { // TODO Auto-generated catch block e.printStackTrace(); } {code} </source> Output is unformatted text h2. [LexBIGService Manager Methods|http://informatics.mayo.edu/LexGrid/downloads/LexEVS_60_JavaDocs/runtime_javadoc/org/LexGrid/LexBIG/LexBIGService/LexBIGServiceManager.html] These methods are generally not end user safe or access information in the system that is administrator specific in context. In general it should not be exposed to the end user. h3. Setting Coding Scheme Version Tag Setting the Coding Scheme tag allows the system administrator to provide status tags or designate a preferred version of a given coding scheme for this terminology service. <source lang=java> {code} AbsoluteCodingSchemeVersionReference codingSchemeVersion = new AbsoluteCodingSchemeVersionReference(); codingSchemeVersion.setCodingSchemeURN("http://www.co-ode.org/ontologies/amino-acid/2005/10/11 1/amino-acid.owl"); codingSchemeVersion.setCodingSchemeVersion("1.0"); LexBIGService lbsv = LexBIGServiceImpl.defaultInstance(); try { LexBIGServiceManager lbsvm = lbsv.getServiceManager(null= lbsv.getServiceManager(null); lbsvm.activateCodingSchemeVersion(codingSchemeVersion); } catch (LBException e) { // PRODUCTIONTODO taggedAuto-generated catch block e.printStackTrace(); |
Deactivate Coding Scheme
Allows administrator to restrict access to coding scheme metadata only.
Code Block |
---|
AbsoluteCodingSchemeVersionReference codingSchemeVersion = vocabularies are interpreted by LexEVS // to be the preferred version of the vocabulary.new AbsoluteCodingSchemeVersionReference(); codingSchemeVersion.setCodingSchemeURN("http://www.co-ode.org/ontologies/amino-acid/2005/10/1/amino-acid.owl"); codingSchemeVersion.setCodingSchemeVersion("1.0"); LexBIGService lbsv = LexBIGServiceImpl.defaultInstance(); try { LexBIGServiceManager lbsvm = lbsv.getServiceManager(null); lbsvm.setVersionTagdeactivateCodingSchemeVersion(codingSchemeVersion, "PRODUCTION"null); } catch (LBException e) { // TODO Auto-generated catch block e.printStackTrace(); } {code} </source> |
Remove Coding Scheme
Removes a coding scheme and its indexes from a terminology service.
Warning | ||
---|---|---|
| ||
This is a slow, resource consuming activity when the service is configured for single table mode. |
Code Block |
---|
h3. Activate Coding Scheme The active designation for a coding scheme is required to enable query functionality for the contained entities and their relationships and properties. <source lang=java> {code} AbsoluteCodingSchemeVersionReference codingSchemeVersion = new AbsoluteCodingSchemeVersionReference(); codingSchemeVersion.setCodingSchemeURN("http://www.co-ode.org/ontologies/amino-acid/2005/10/1 /amino-acid.owl"); codingSchemeVersion.setCodingSchemeVersion("1.0"); LexBIGService lbsv = LexBIGServiceImpl.defaultInstance(); try { LexBIGServiceManager lbsvm = lbsv.getServiceManager(null); lbsvm.activateCodingSchemeVersionremoveCodingSchemeVersion(codingSchemeVersion); } catch (LBException e) { // TODO Auto-generated catch block e.printStackTrace(); {code} </source> h3. Deactivate Coding Scheme Allows administrator to restrict access to coding scheme metadata only. <source lang=java> {code} AbsoluteCodingSchemeVersionReference codingSchemeVersion = TODO Auto-generated catch block e.printStackTrace(); new AbsoluteCodingSchemeVersionReference(); codingSchemeVersion.setCodingSchemeURN("http://www.co-ode.org/ontologies/amino-acid/2005/10/1/amino-acid.owl"); codingSchemeVersion.setCodingSchemeVersion("1.0") { |
Remove History Service
Remove a history service from the terminology service.
Code Block |
---|
String codingScheme = "NCI Thesaurus"; LexBIGService lbsv = LexBIGServiceImpl.defaultInstance(); try { LexBIGServiceManager lbsvm = lbsv.getServiceManager(null); lbsvm.deactivateCodingSchemeVersion(codingSchemeVersion, nullremoveHistoryService(codingScheme); } catch (LBException e) { // TODO Auto-generated catch block e.printStackTrace(); } |
Get Load Extensions
Allows a determination of available loaders by an administrator.
Code Block |
---|
LexBIGService lbsv = LexBIGServiceImpl.defaultInstance catch block e.printStackTrace(); try {code} </source> h3. Remove Coding Scheme Removes a coding scheme and it's indexes from a terminology service. {warning:title=Warning}This is a slow, resource consuming activity when the service is configured for single table mode.{warning} <source lang=java> {code} AbsoluteCodingSchemeVersionReference codingSchemeVersion = new AbsoluteCodingSchemeVersionReference(); codingSchemeVersion.setCodingSchemeURN("http://www.co-ode.org/ontologies/amino-acid/2005/10/1 /amino-acid.owl"); codingSchemeVersion.setCodingSchemeVersion("1.0"); LexBIGService lbsv = LexBIGServiceImpl.defaultInstance(); try { LexBIGServiceManager lbsvm = lbsv.getServiceManager(null); lbsvm.removeCodingSchemeVersion(codingSchemeVersion); LexBIGServiceManager lbsvm = lbsv.getServiceManager(null); Enumeration<? extends ExtensionDescription> extDesc = lbsvm.getLoadExtensions().enumerateExtensionDescription(); while(extDesc.hasMoreElements()){ System.out.println(extDesc.nextElement().getName()); } } catch (LBException e) { // TODO Auto-generated catch block e.printStackTrace(); } |
Sample Output
Code Block |
---|
NCIMetaHistoryLoader OBOLoader HL7Loader ClaMLLoader SemNetLoader MrMap_Loader MetaDataLoader RadLexFramesLoader TextLoader NCIThesaurusHistoryLoader OWLLoader LexGrid_Loader |
Get Specific Loader
Returns a specific loader instance for use in loading the relevant source file.
Code Block |
---|
LexBIGService lbs { {code} </source> h3. Remove History Service Remove a history service from the terminology service. <source lang=java> {code} String codingScheme = "NCI Thesaurus"; LexBIGService lbsv = LexBIGServiceImpl.defaultInstance(); try { LexBIGServiceManager lbsvm = lbsv= LexBIGServiceImpl.defaultInstance(); LexBIGServiceManager lbsm = lbs.getServiceManager(null); lbsvm.removeHistoryService(codingScheme); } catch (LBException e) { // TODO Auto-generated catch block e.printStackTrace(); } {code} </source> h3. Get Load Extensions Allows a determination of available loaders by an administrator. <source lang=java> {code} LexBIGService lbsv = LexBIGServiceImpl.defaultInstance(); try { LexBIGServiceManager lbsvm = lbsv.getServiceManager(null); Enumeration<? extends ExtensionDescription> extDesc = LexGrid_Loader loader = (LexGrid_Loader) lbsm .getLoader(org.LexGrid.LexBIG.Impl.loaders.LexGridMultiLoaderImpl.name); loader.setCodingSchemeManifestURI(manifest); lbsvm.getLoadExtensions().enumerateExtensionDescription(); while(extDesc.hasMoreElements()){ System.out.println(extDesc.nextElement().getName()); } } catch (LBException e) { // TODO Auto-generated catch block e.printStackTrace(); } {code} </source> Sample Output: {code} NCIMetaHistoryLoader OBOLoader HL7Loader ClaMLLoader SemNetLoader MrMap_Loader MetaDataLoader RadLexFramesLoader TextLoader NCIThesaurusHistoryLoader OWLLoader LexGrid_Loader {code} h3. Get Specific Loader Returns a specific loader instance for use in loading the relevant source file. <source lang=java> {code} LexBIGService lbs loader.load(source, false, true); |
Get Extension Registry
Returns an extension registry service for all externally registered plugins to LexEVS. This provides similar functionality to the other registry retrieval, display and use and we won't repeat method examples here.
Code Block |
---|
LexBIGServiceManager lbsvm = lbsv.getServiceManager(null);
ExtensionRegistry registry = lbsvm.getExtensionRegistry();
|
Get Export Extensions
Returns a list of Export extensions available as administrative functions to allow administrators to export a terminology to a specifically formatted output file.
Code Block |
---|
LexBIGService lbsv = LexBIGServiceImpl.defaultInstance(); LexBIGServiceManager lbsm try { LexBIGServiceManager lbsvm = lbslbsv.getServiceManager(null); Enumeration<? extends ExtensionDescription> LexGrid_Loader loader = (LexGrid_Loader) lbsm extDesc = lbsvm.getLoadergetExportExtensions().enumerateExtensionDescription(); while(extDesc.hasMoreElements()){ System.out.println(extDesc.nextElement().getName()); } } catch (LBException e) { // TODO Auto-generated catch block e.printStackTrace(); } |
Sample Output
Code Block |
---|
LexGridExport
OwlRdfExporter
OBOExport
|
Get Exporter
Returns an exporter for a specific output format.
Code Block |
---|
LexBIGService lbs = LexBIGServiceImpl.defaultInstance(); LexBIGServiceManager lbsm = lbs.getServiceManager(null); // Find the registered extension handling this type of export ... OwlRdfExporterImpl exporter = (OwlRdfExporterImpl) lbsm.getExporter(OwlRdfExporterImpl.name); // Perform the requested action ... org.LexGrid.LexBIG.Impl.loaders.LexGridMultiLoaderImpl.name); loader.setCodingSchemeManifestURI(manifest); loader.load(source, false, true); {code} </source> {code} h3. Get Extension Registry Returns an extension registry service for all externally registered plugins to LexEVS. This provides similar functionality to the other registry retrieval, display and use and we won't repeat method examples here. <source lang=java> {code} LexBIGServiceManager lbsvm = lbsv.getServiceManager(null); ExtensionRegistry registry = lbsvm.getExtensionRegistry(); {code} </source> h3. Get Export Extensions Returns a list of Export extensions available as administrative functions to allow administrators to export a terminology to a specifically formatted output file. <source lang=java> {code} LexBIGService lbsv = LexBIGServiceImpl.defaultInstance(); try { LexBIGServiceManager lbsvm = lbsv.getServiceManager(null); Enumeration<? extends ExtensionDescription> extDesc = CnsCngPair cngCngPair = lbsvmFilterParser.getExportExtensions().enumerateExtensionDescriptionparse(lbs, css.getCodingSchemeURI(); while(extDesc.hasMoreElements()){ System.out.println(extDesc.nextElement().getName()); } } catch (LBException e) { // TODO Auto-generated catch block e.printStackTrace(); } {code} </source> Sample Output {code} LexGridExport OwlRdfExporter OBOExport {code} h3. Get Exporter Returns an exporter for a specific output format. <source lang=java> {code} , css.getRepresentsVersion(), cl); exporter.setCng(cngCngPair.getCng()); exporter.setCns(cngCngPair.getCns()); LexBIGService lbs = LexBIGServiceImpl.defaultInstance();exporter.export(Constructors.createAbsoluteCodingSchemeVersionReference(css), destination,overwrite,false, true); |
Remove Metadata
Remove external coding scheme metadata.
Code Block |
---|
LexBIGServiceManager lbsm = lbs.getServiceManager(null); // Find the registered extensionString handlingurn this type of export ... = "urn:oid:11.00.11.1"; OwlRdfExporterImplString exporterver = (OwlRdfExporterImpl) lbsm.getExporter(OwlRdfExporterImpl.name); "1.1"; //Enumeration<? Performextends theCodingSchemeRendering> requestedschemes action= lbs...getSupportedCodingSchemes() CnsCngPair cngCngPair = FilterParser.parse(lbs, css.getCodingSchemeURI(), .enumerateCodingSchemeRendering(); css.getRepresentsVersion(), cl);while (schemes.hasMoreElements() && css == null) { exporter.setCng(cngCngPair.getCng()); CodingSchemeSummary summary = exporterschemes.setCnsnextElement(cngCngPair).getCnsgetCodingSchemeSummary()); exporter.export(Constructors.createAbsoluteCodingSchemeVersionReference(css), destination,overwrite,false, true); {code} </source> h3. Remove Metadata Remove external coding scheme metadata <source lang=java> {code} if (urn.equalsIgnoreCase(summary.getCodingSchemeURI()) String urn = "urn:oid:11.00.11.1"; && ver.equalsIgnoreCase(summary.getRepresentsVersion())) String vercss = "1.1"summary; } Enumeration<? extends CodingSchemeRendering> schemes = lbs.getSupportedCodingSchemes() } lbs.enumerateCodingSchemeRenderinggetServiceManager(null); .removeCodingSchemeVersionMetaData( while (schemesConstructors.hasMoreElementscreateAbsoluteCodingSchemeVersionReference(css) && css =); |
Register Coding Scheme Supplement
Register a coding scheme as a supplement to another coding scheme.
Code Block |
---|
try { LexBIGServiceManager lbsvm = lbsv.getServiceManager(null); AbsoluteCodingSchemeVersionReference parentCodingScheme = new= null) { CodingSchemeSummary summary = schemes.nextElementAbsoluteCodingSchemeVersionReference().getCodingSchemeSummary(); ; AbsoluteCodingSchemeVersionReference supplementCodingScheme = new if (urn.equalsIgnoreCase(summary.getCodingSchemeURI()) AbsoluteCodingSchemeVersionReference(); String codingSchemeURN = "urn:oid:11.11.0.1.1"; String codingSchemeVersion = "1.0"; String ExtensionCodingSchemeURN = "urn:oid:11.11.0.1.1-extension"; String ExtensionCodingSchemeVersion && ver.equalsIgnoreCase(summary.getRepresentsVersion())) = "1.0-extension"; parentCodingScheme.setCodingSchemeURN(codingSchemeURN); parentCodingScheme.setCodingSchemeVersion(codingSchemeVersion); supplementCodingScheme.setCodingSchemeURN(ExtensionCodingSchemeURN); supplementCodingScheme.setCodingSchemeVersion(ExtensionCodingSchemeVersion); lbsvm.registerCodingSchemeAsSupplement(parentCodingScheme,supplementCodingScheme); } catch (LBException e) { // TODO Auto-generated catch block e.printStackTrace(); } |
Remove a coding schemes relationship with another as a supplement.
Un-Register Coding Scheme Supplement
Code Block |
---|
try { LexBIGServiceManager lbsvm = lbsv.getServiceManager(null); AbsoluteCodingSchemeVersionReference parentCodingScheme = new css = summary; } } lbs.getServiceManager(null).removeCodingSchemeVersionMetaData( AbsoluteCodingSchemeVersionReference(); AbsoluteCodingSchemeVersionReference supplementCodingScheme = new Constructors.createAbsoluteCodingSchemeVersionReferenceAbsoluteCodingSchemeVersionReference(css)); {code} </source> h3. Register Coding Scheme Supplement Register a coding scheme as a supplement to another coding scheme <source lang=java> {code} try { LexBIGServiceManager lbsvm = lbsv.getServiceManager(null); AbsoluteCodingSchemeVersionReference parentCodingScheme = new AbsoluteCodingSchemeVersionReference(); AbsoluteCodingSchemeVersionReference supplementCodingScheme = new AbsoluteCodingSchemeVersionReference(); String codingSchemeURN = "urn:oid:11.11.0.1.1"; String codingSchemeVersion = "1.0"; String ExtensionCodingSchemeURN = "urn:oid:11.11.0.1.1-extension"; String ExtensionCodingSchemeVersion = "1.0-extension"; parentCodingScheme.setCodingSchemeURN(codingSchemeURN); parentCodingScheme.setCodingSchemeVersion(codingSchemeVersion); supplementCodingScheme.setCodingSchemeURN(ExtensionCodingSchemeURN); supplementCodingScheme.setCodingSchemeVersion(ExtensionCodingSchemeVersion); lbsvm.registerCodingSchemeAsSupplement(parentCodingScheme,supplementCodingScheme); } catch (LBException e) { // TODO Auto-generated catch block e.printStackTrace(); } {code} </source> Remove a coding schemes relationship with another as a supplement. h3. Un-Register Coding Scheme Supplement <source lang=java> {code} try { LexBIGServiceManager lbsvm = lbsv.getServiceManager(null); AbsoluteCodingSchemeVersionReference parentCodingScheme = new AbsoluteCodingSchemeVersionReference(); AbsoluteCodingSchemeVersionReference supplementCodingScheme = new AbsoluteCodingSchemeVersionReference(); String codingSchemeURN = "urn:oid:11.11.0.1.1"; String codingSchemeVersion = "1.0"; String ExtensionCodingSchemeURN = "urn:oid:11.11.0.1.1-extension"; String ExtensionCodingSchemeVersion = "1.0-extension"; parentCodingScheme.setCodingSchemeURN(codingSchemeURN); parentCodingScheme.setCodingSchemeVersion(codingSchemeVersion); supplementCodingScheme.setCodingSchemeURN(ExtensionCodingSchemeURN); supplementCodingScheme.setCodingSchemeVersion(ExtensionCodingSchemeVersion); lbsvm.registerCodingSchemeAsSupplement(parentCodingScheme,supplementCodingScheme); String codingSchemeURN = "urn:oid:11.11.0.1.1"; String codingSchemeVersion = "1.0"; String ExtensionCodingSchemeURN = "urn:oid:11.11.0.1.1-extension"; String ExtensionCodingSchemeVersion = "1.0-extension"; parentCodingScheme.setCodingSchemeURN(codingSchemeURN); parentCodingScheme.setCodingSchemeVersion(codingSchemeVersion); supplementCodingScheme.setCodingSchemeURN(ExtensionCodingSchemeURN); supplementCodingScheme.setCodingSchemeVersion(ExtensionCodingSchemeVersion); lbsvm.registerCodingSchemeAsSupplement(parentCodingScheme,supplementCodingScheme); } catch (LBException e) { // TODO Auto-generated catch block e.printStackTrace(); } |
LexEVS Authoring Service Management Methods
Currently restricted to the support of Mapping Authoring only.
Create a Mapping Coding Scheme from Scratch
Code Block |
---|
LexEVSAuthoringService authoring = new LexEVSAuthoringServiceImpl(); EntryState entryState = new EntryState(); entryState.setChangeType(ChangeType.NEW); entryState.setContainingRevision("FirstVersionNCItToICD9_12_1_54"); entryState.setRelativeOrder(new Long(1)); //Minimum meta data for the mapping coding scheme should be defined here AbsoluteCodingSchemeVersionReference mappingCodingScheme = new AbsoluteCodingSchemeVersionReference(); mappingCodingScheme.setCodingSchemeURN("urn:oid:11.0011.1.1"); mappingCodingScheme.setCodingSchemeVersion("1.0"); AbsoluteCodingSchemeVersionReference sourceCodingScheme = new AbsoluteCodingSchemeVersionReference(); sourceCodingScheme.setCodingSchemeURN("http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#"); sourceCodingScheme.setCodingSchemeVersion("10.10e"); AbsoluteCodingSchemeVersionReference targetCodingScheme = new AbsoluteCodingSchemeVersionReference(); targetCodingScheme.setCodingSchemeURN("urn:oid:2.16.840.1.113883.6.2"); targetCodingScheme.setCodingSchemeVersion("200909"); AssociationSource[] associationSource = new AssociationSource[2]; String associationType = "mapped_to"; String relationsContainerName = "relations"; Date effectiveDate = new Date(); Revision revision = new Revision(); revision.setRevisionId(entryState.getContainingRevision()); boolean loadEntities = false; try { authoring.createAssociationMapping( entryState, mappingCodingScheme, sourceCodingScheme, targetCodingScheme, associationSource, associationType, relationsContainerName, effectiveDate, null, revision, false ); } catch (LBException e) { // TODO Auto-generated catch block e.printStackTrace(); } {code} </source> h2. LexEVS Authoring Service Management Methods Currently restricted to the support of Mapping Authoring only. h3. Create a Mapping Coding Scheme from Scratch <source lang=java> {code} LexEVSAuthoringService authoring = new LexEVSAuthoringServiceImpl(); EntryState entryState = new EntryState(); entryState.setChangeType(ChangeType.NEW); entryState.setContainingRevision("FirstVersionNCItToICD9_12_1_54"); entryState.setRelativeOrder(new Long(1)); //Minimum meta data for the mapping coding scheme should be defined here AbsoluteCodingSchemeVersionReference mappingCodingScheme = new AbsoluteCodingSchemeVersionReference(); mappingCodingScheme.setCodingSchemeURN("urn:oid:11.0011.1.1"); mappingCodingScheme.setCodingSchemeVersion("1.0"); AbsoluteCodingSchemeVersionReference sourceCodingScheme = new AbsoluteCodingSchemeVersionReference(); sourceCodingScheme.setCodingSchemeURN("http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#"); sourceCodingScheme.setCodingSchemeVersion("10.10e"); AbsoluteCodingSchemeVersionReference targetCodingScheme = new AbsoluteCodingSchemeVersionReference(); targetCodingScheme.setCodingSchemeURN("urn:oid:2.16.840.1.113883.6.2"); targetCodingScheme.setCodingSchemeVersion("200909"); AssociationSource[] associationSource = new AssociationSource[2]; String associationType = "mapped_to"; String relationsContainerName = "relations"; Date effectiveDate = new Date(); Revision revision = new Revision(); revision.setRevisionId(entryState.getContainingRevision()); boolean loadEntities = false; try { authoring.createAssociationMapping( entryState, mappingCodingScheme, sourceCodingScheme, targetCodingScheme, associationSource, associationType, relationsContainerName, effectiveDate, null, revision, false ); } catch (LBException e) { // TODO Auto-generated catch block e.printStackTrace(); } {code} </source> h3. Create a Mapping Coding Scheme with Default Coding Scheme Values <source lang=java> {code} authoring.createMappingWithDefaultValues(sources, "NCI Thesaurus", "10.10a", "ICD9", "200909", "mapped_to", false); AbsoluteCodingSchemeVersionReference codingSchemeVersion = new AbsoluteCodingSchemeVersionReference(); codingSchemeVersion .setCodingSchemeURN("http://default.mapping.container"); codingSchemeVersion.setCodingSchemeVersion("1.0"); lbsm.activateCodingSchemeVersion(codingSchemeVersion); {code} </source> h2. [CTS2 Management Methods|LexEVS 6.0 CTS2 API#Administration Operation] No further information provided h2. [Pick List and Value Set Managment Methods|LexEVS 6.0 Value Set Service#Administration Functions] No further information provided {scrollbar:icons=false} catch block e.printStackTrace(); } |
Create a Mapping Coding Scheme with Default Coding Scheme Values
Code Block |
---|
authoring.createMappingWithDefaultValues(sources, "NCI Thesaurus",
"10.10a", "ICD9", "200909", "mapped_to", false);
AbsoluteCodingSchemeVersionReference codingSchemeVersion = new
AbsoluteCodingSchemeVersionReference();
codingSchemeVersion
.setCodingSchemeURN("http://default.mapping.container");
codingSchemeVersion.setCodingSchemeVersion("1.0");
lbsm.activateCodingSchemeVersion(codingSchemeVersion); |
Insert Entity
Code Block |
---|
private VersionableEventEntityService service;
private AuthoringService authoringService;
CodingScheme scheme = new CodingScheme();
scheme.setApproxNumConcepts(111l);
scheme.setCodingSchemeName("testName");
scheme.setCodingSchemeURI("uri");
scheme.setRepresentsVersion("v1");
authoringService.loadRevision(scheme, null, null);
CodingScheme cs = codingSchemeservice.getCodingSchemeByUriAndVersion("uri", "v1");
System.out.println(cs);
Entity entity = new Entity();
entity.setEntityCode("c1");
entity.setEntityCodeNamespace("ns");
service.insertEntity("uri", "v1", entity); |
Updating an Existing Entity
Code Block |
---|
private VersionableEventEntityService service;
private AuthoringService authoringService;
CodingScheme scheme = new CodingScheme();
scheme.setApproxNumConcepts(111l);
scheme.setCodingSchemeName("testName");
scheme.setCodingSchemeURI("uri");
scheme.setRepresentsVersion("v1");
authoringService.loadRevision(scheme, null, null);
CodingScheme cs = codingSchemeservice.getCodingSchemeByUriAndVersion("uri", "v1");
System.out.println(cs);
// Create a new entity
Entity entity = new Entity();
entity.setEntityCode("c1");
entity.setEntityCodeNamespace("ns");
entity.setIsDefined(false);
EntryState entryState = new EntryState();
entryState.setChangeType(ChangeType.MODIFY);
entity.setEntryState(entryState);
EntityDescription ed = new EntityDescription();
ed.setContent("pre-update");
entity.setEntityDescription(ed);
// Insert the new entity
service.insertEntity("uri", "v1", entity);
// Update the entity description
entity.getEntityDescription().setContent("post-update");
try {
// Update the entity
service.updateEntity("uri", "v1", entity);
} catch (Exception e) {
}
Entity modifiedEntity = service.getEntity("uri", "v1", "c1", "ns"); |
CTS2 Management Methods
No further information provided
Pick List and Value Set Managment Methods
No further information provided
Scrollbar | ||
---|---|---|
|