<?xml version="1.0" encoding="utf-8"?>
<html>
Template:Menu LexEVS 6.0 CTS2
LexEVS CTS2 Load API provides capability to load complete or incremental updates of Code System, Value Sets and Association contents. It also provides capability to activate and deactivate loaded contents.
There are three major load interfaces proved, each for loading specific content:
Each of these interfaces can be accessed using:
<source>
org.lexevs.cts2.admin.load.CodeSystemLoadOperation csLoadOp = new org.lexevs.cts2.LexEvsCTS2Impl().getAdminOperation().getCodeSystemLoadOperation();
org.lexevs.cts2.admin.load.ValueSetLoadOperation vsLoadOp = new org.lexevs.cts2.LexEvsCTS2Impl().getAdminOperation().getValueSetLoadOperation();
org.lexevs.cts2.admin.load.AssociationLoadOperation assnLoadOp = new org.lexevs.cts2.LexEvsCTS2Impl().getAdminOperation().getAssociationLoadOperation();
</source>
org.lexevs.cts2.admin.load.CodeSystemLoadOperation is the main interface which can be used to load, activate and deactivate Code System. This interface can be accessed using main LexEVSCTS2 interface, like:
<source>
org.lexevs.cts2.admin.load.CodeSystemLoadOperation csLoadOp = new org.lexevs.cts2.LexEvsCTS2Impl().getAdminOperation().getCodeSystemLoadOperation();
</source>
There are two different methods available to load Code System :
This function provides the capability to load Code System found in the file using the loader specified.
<u>load(URI source, URI metadata, URI manifest, String loaderName, Boolean stopOnErrors, Boolean async, Boolean overwriteMetadata, String versionTag, Boolean activate)</u>
*Description: * |
Loads Code System found in source file using the loader specified. |
*Input: * |
java.net.URI source - (Mandatory) URI corresponding to the code system file. |
If true, the load will occur in a separate asynchronous process.
If false, this method blocks until the load operation completes or fails. Regardless of setting, the getStatus and getLog calls are used to fetch results.
boolean overwriteMetadata - (Optional) If true, existing meta data for the code system will be erased. If false, new meta data will be appended to existing meta data. |
*Output: * |
Array of edu.mayo.informatics.lexgrid.convert.utility.URNVersionPair - URN and Version of the loaded code system | |
*Exception: * |
org.LexGrid.LexBIG.Exceptions.LBException | |
*Sample Call: * |
Step 1: Instantiate CodeSystemLoadOperation if it is not done yet :
org.lexevs.cts2.admin.load.CodeSystemLoadOperation csLoadOp = new org.lexevs.cts2.LexEvsCTS2Impl().getAdminOperation().getCodeSystemLoadOperation(); |
Step 2: Call load method by passing the inputfile location and other parameter values:
URNVersionPair[] csloaded = csLoad.load(new File("resources/testData/fungal_anatomy.obo").toURI(), null, null, "OBOLoader", true, true, true, "DEV", true); | |
This function provides the capability to load supplied Code System object.
<u>load(CodingScheme codeSystem, URI metadata, Boolean stopOnErrors, Boolean async, Boolean overwriteMetadata, String versionTag, Boolean activate)</u>
*Description: * |
Loads supplied Code System Object. |
*Input: * |
org.LexGrid.codingSchemes.CodingScheme codeSystem - (Mandatory) Code System Object to be loaded into the terminology service. |
If true, the load will occur in a separate asynchronous process.
If false, this method blocks until the load operation completes or fails. Regardless of setting, the getStatus and getLog calls are used to fetch results.
boolean overwriteMetadata - (Optional) If true, existing meta data for the code system will be erased. If false, new meta data will be appended to existing meta data. |
*Output: * |
Array of edu.mayo.informatics.lexgrid.convert.utility.URNVersionPair - URN and Version of the loaded code system | |
*Exception: * |
org.LexGrid.LexBIG.Exceptions.LBException | |
*Sample Call: * |
Step 1: Instantiate CodeSystemLoadOperation if it is not done yet :
org.lexevs.cts2.admin.load.CodeSystemLoadOperation csLoadOp = new org.lexevs.cts2.LexEvsCTS2Impl().getAdminOperation().getCodeSystemLoadOperation(); |
Step 2: Populate Code System Object:
org.LexGrid.codingSchemes.CodingScheme cs = new org.LexGrid.codingSchemes.CodingScheme(); |
org.LexGrid.naming.SupportedAssociation saHasSubType = edu.mayo.informatics.lexgrid.convert.exporters.xml.lgxml.factory.SupportedAssociationFactory.createSupportedAssociationHasSubType();
cs.getMappings().addSupportedAssociation(saHasSubType); org.LexGrid.relations.Relations rels = new org.LexGrid.relations.Relations(); org.LexGrid.relations.AssociationPredicate ap = new org.LexGrid.relations.AssociationPredicate(); |
ap = new org.LexGrid.relations.AssociationPredicate();
ap.setAssociationName("uses"); rels.addAssociationPredicate(ap); cs.addRelations(rels); |
Step 3: Call load method by passing the Code System Object and other parameter values:
URNVersionPair[] csloaded = csLoad.load(cs, null, true, false, true, "DEV", true); | |
Value Set is stored in repository in terms of definitions, in LexEVS, it is known as 'Value Set Definition'. As name indicates, it is a definition of a value set contents, NOT the expanded value set contents that will be loaded. During the runtime, these definitions are resolved against the supplied Code System Version to return expanded Value Set contents. Visit LexEVS 6.0 Value Set and Pick List Definition Guide for detailed information about LexEVS Value Set Definition.
org.lexevs.cts2.admin.load.ValueSetLoadOperation is the main interface which can be used to load Value Set Definition. This interface can be accessed using main LexEVSCTS2 interface, like:
<source>
org.lexevs.cts2.admin.load.ValueSetLoadOperation vsLoadOp = new org.lexevs.cts2.LexEvsCTS2Impl().getAdminOperation().getValueSetLoadOperation();
</source>
Similar to Code System, there are two different methods available to load Value Sets :
This function provides the capability to load Value Set Definition(s) found in the file using the loader specified.
<u>load(URI source, URI releaseURI, String loaderName, Boolean stopOnErrors)</u>
*Description: * |
Loads Value Set Definition(s) found in source file using the loader specified. |
*Input: * |
java.net.URI source - (Mandatory) URI corresponding to the Value Set Definition(s) file. |
*Output: * |
Array of edu.mayo.informatics.lexgrid.convert.utility.URNVersionPair - URI and Version of the loaded Value Set Definition | |
*Exception: * |
org.LexGrid.LexBIG.Exceptions.LBException | |
*Sample Call: * |
Step 1: Instantiate ValueSetLoadOperation if it is not done yet :
org.lexevs.cts2.admin.load.ValueSetLoadOperation vsLoadOp = new org.lexevs.cts2.LexEvsCTS2Impl().getAdminOperation().getValueSetLoadOperation(); |
Step 2: Call load method by passing the inputfile location and other parameter values:
URNVersionPair[] vsloaded = vsLoad.load(new File("resources/testData/vsTestData.xml").toURI(), null, "LexGrid_Loader", true); | |
This function provides the capability to load supplied Value Set Definition object.
<u>load(ValueSetDefinition valueSetDefinition, URI releaseURI, Boolean stopOnErrors)</u>
*Description: * |
Loads supplied Value Set Definition Object. |
*Input: * |
org.LexGrid.valueSets.ValueSetDefinition valueSetDefinition - (Mandatory) Value Set Definition Object to be loaded into the terminology service. |
*Output: * |
java.lang.String - URI of Value Set Definition loaded | |
*Exception: * |
org.LexGrid.LexBIG.Exceptions.LBException | |
*Sample Call: * |
Step 1: Instantiate ValueSetLoadOperation if it is not done yet :
org.lexevs.cts2.admin.load.ValueSetLoadOperation vsLoadOp = new org.lexevs.cts2.LexEvsCTS2Impl().getAdminOperation().getValueSetLoadOperation(); |
Step 2: Populate Code System Object:
org.LexGrid.valueSets.ValueSetDefinition vsd = new org.LexGrid.valueSets.ValueSetDefinition(); |
org.LexGrid.valueSets.DefinitionEntry de = new org.LexGrid.valueSets.DefinitionEntry(); |
vsd.addDefinitionEntry(de);
Step 3: Call load method by passing the Value Set Definition Object and other parameter values:
String vsdURI = vsLoadOp.load(vsd, null, true);; | |
org.lexevs.cts2.admin.load.AssociationLoadOperation is the main interface which can be used to load Associations with in a Code System. This interface can be accessed using main LexEVSCTS2 interface, like:
<source>
org.lexevs.cts2.admin.load.AssociationLoadOperation assnLoadOp = new org.lexevs.cts2.LexEvsCTS2Impl().getAdminOperation().getAssociationLoadOperation();
</source>
There are two different methods available to load Associations :
This function provides the capability to load Associations found in the file using the loader specified.
<u>importAssociationVersion(URI source, URI metadata, URI manifest, String loaderName, Boolean stopOnErrors, Boolean async, Boolean overwriteMetadata, String versionTag, Boolean activate)</u>
*Description: * |
Loads Associations found in source file using the loader specified. |
*Input: * |
java.net.URI source - (Mandatory) URI corresponding to the file that contains Associations. |
If true, the load will occur in a separate asynchronous process.
If false, this method blocks until the load operation completes or fails. Regardless of setting, the getStatus and getLog calls are used to fetch results.
boolean overwriteMetadata - (Optional) If true, existing meta data for the code system will be erased. If false, new meta data will be appended to existing meta data. |
*Output: * |
None | |
*Exception: * |
org.LexGrid.LexBIG.Exceptions.LBException | |
*Sample Call: * |
Step 1: Instantiate AssociationLoadOperation if it is not done yet :
org.lexevs.cts2.admin.load.AssociationLoadOperation assnLoadOp = new org.lexevs.cts2.LexEvsCTS2Impl().getAdminOperation().getAssociationLoadOperation(); |
Step 2: Call load method by passing the inputfile location and other parameter values:
assnLoad.importAssociationVersion(new File("resources/testData/fungal_anatomy.obo").toURI(), null, null, "OBOLoader", true, true, true, "DEV", true); | |
This function provides the capability to load Associations supplied with in a Code System object.
<u>importAssociationVersion(CodingScheme codeSystem, URI metadata, Boolean stopOnErrors, Boolean async, Boolean overwriteMetadata, String versionTag, Boolean activate)</u>
*Description: * |
Loads Associations supplied with in Code System Object. |
*Input: * |
org.LexGrid.codingSchemes.CodingScheme codeSystem - (Mandatory) Code System Object that contains Associations to be loaded into the terminology service. |
If true, the load will occur in a separate asynchronous process.
If false, this method blocks until the load operation completes or fails. Regardless of setting, the getStatus and getLog calls are used to fetch results.
boolean overwriteMetadata - (Optional) If true, existing meta data for the code system will be erased. If false, new meta data will be appended to existing meta data. |
*Output: * |
None | |
*Exception: * |
org.LexGrid.LexBIG.Exceptions.LBException | |
*Sample Call: * |
Step 1: Instantiate AssociationLoadOperation if it is not done yet :
org.lexevs.cts2.admin.load.AssociationLoadOperation assnLoadOp = new org.lexevs.cts2.LexEvsCTS2Impl().getAdminOperation().getAssociationLoadOperation(); |
Step 2: Populate Code System Object:
org.LexGrid.codingSchemes.CodingScheme cs = new org.LexGrid.codingSchemes.CodingScheme(); |
org.LexGrid.naming.SupportedAssociation saHasSubType = edu.mayo.informatics.lexgrid.convert.exporters.xml.lgxml.factory.SupportedAssociationFactory.createSupportedAssociationHasSubType();
cs.getMappings().addSupportedAssociation(saHasSubType); org.LexGrid.relations.Relations rels = new org.LexGrid.relations.Relations(); org.LexGrid.relations.AssociationPredicate ap = new org.LexGrid.relations.AssociationPredicate(); |
ap = new org.LexGrid.relations.AssociationPredicate();
ap.setAssociationName("uses"); rels.addAssociationPredicate(ap); cs.addRelations(rels); |
Step 3: Call load method by passing the Code System Object and other parameter values:
assnLoad.importAssociationVersion(cs, null, true, false, true, "DEV", true); | |
</html>