<?xml version="1.0" encoding="utf-8"?>
<html>
Template:Menu LexEVS 6.0 CTS2
LexEVS CTS2 Value Set Authoring API provides capability to author Value Set Definition, its Properties, Definition Entries (rule set) and its Versionable attributes.
Here are the authoring functions that can be performed on Value Set:
*Create - This function provides capability to create: |
*Edit - This function provides capability to update: |
*Remove - This function provides capability to remove: |
*Versionable Change - This function provides capability to modify versionable attributes of Usage Context like Status, Effective Date, Expiration Date, isActive and Owner: |
org.lexevs.cts2.author.ValueSetAuthoringOperation is the main interface for all the authoring operations against Value Set. This interface can be accessed using main LexEVSCTS2 interface, like:
<source>
org.lexevs.cts2.author.ValueSetAuthoringOperation vsAuthOp = new org.lexevs.cts2.LexEvsCTS2Impl().getAuthoringOperation().getValueSetAuthoringOperation();
</source>
All the authoring functions described here requires information about the author and revision/version id to be assigned to entities for each of these operations. These is done passing object org.lexevs.cts2.core.update.RevisionInfo. RevisionInfo object has following attributes:
java.lang.String changeAgent - (Optional) The source that participated in this particular change. |
Following sections contains detailed functions provided by ValueSetAuthoringOperation interface.
Create Operation provides capability to create Value Set, Definition Entry and Properties. For every entry that gets created, a unique revision(version) identifier will be assigned to that entry. This helps in retrieving snapshots of an entry based on its revision(version) identifier. This unique id can be passed in using the RevisionInfo object described above.
This function creates a new Value Set. The new Value Set is defined by the set of meta-data properties that describe it.
*Description: * |
Creates a new value set definition and loads into repository. |
*Input: * |
java.net.URI valueSetURI - (Mandatory) URI of value set definition. |
*Output: * |
java.net.URI - value set definition URI if created successfully | |
*Exception: * |
org.LexGrid.LexBIG.Exceptions.LBException | |
*Sample Call: * |
Step 1: Instantiate ValueSetAuthoringOperation if it is not done yet :
org.lexevs.cts2.author.ValueSetAuthoringOperation vsAuthorOp = LexEvsCTS2Impl.defaultInstance().getAuthoringOperation().getValueSetAuthoringOperation(); |
Step 2: Populate RevisionInfo object:
RevisionInfo revInfo = new RevisionInfo(); |
Step 3: Populate a properties to be added:
Property prop = new Property(); |
Properties props = new Properties();
props.addProperty(prop); |
Step 4: call create Value Set method:
''URI vsdURI = vsAuthOp.createValueSet(new URI("VSD:AUTHORING:JUNIT:TEST1"), |
"Authoring create vsd junit test1",
"Automobiles", "Autos", null, null,
props, null, null, revInfo);'' |
This function is similar to above except this allows users to create Value Set by passing well defined value set definition object. The new Value Set is defined by the set of meta-data properties that describe it.
*Description: * |
Creates a new value set definition and loads into repository. |
*Input: * |
org.LexGrid.valuesets.ValueSetDefinition valueSetDefininition - (Mandatory) Value Set Definition object to be loaded into repository. |
*Output: * |
java.net.URI - value set definition URI if created successfully | |
*Exception: * |
org.LexGrid.LexBIG.Exceptions.LBException | |
*Sample Call: * |
Step 1: Instantiate ValueSetAuthoringOperation if it is not done yet :
org.lexevs.cts2.author.ValueSetAuthoringOperation vsAuthorOp = LexEvsCTS2Impl.defaultInstance().getAuthoringOperation().getValueSetAuthoringOperation(); |
Step 2: Populate RevisionInfo object:
RevisionInfo revInfo = new RevisionInfo(); |
Step 3: Populate a Value Set Definition to be added:
ValueSetDefinition vsd = new ValueSetDefinition(); |
Step 4: call create Value Set method:
URI vsdURI = vsAuthOp.createValueSet(vsd, revInfo); | |
This function provides capability to add new Definition Entry (Rule Set) to Value Set Definition.
*Description: * |
Add new definition entry (rule set) to a value set definition. |
*Input: * |
java.net.URI valueSetURI - (Mandatory) URI of value set definition. |
*Output: * |
boolean - True if update was successful | |
*Exception: * |
org.LexGrid.LexBIG.Exceptions.LBException | |
*Sample Call: * |
Step 1: Instantiate ValueSetAuthoringOperation if it is not done yet :
org.lexevs.cts2.author.ValueSetAuthoringOperation vsAuthorOp = LexEvsCTS2Impl.defaultInstance().getAuthoringOperation().getValueSetAuthoringOperation(); |
Step 2: Populate RevisionInfo object:
RevisionInfo revInfo = new RevisionInfo(); |
Step 3: Populate a Definition Entry object to be added:
DefinitionEntry newDefEntry = new DefinitionEntry(); |
org.LexGrid.valuesets.EntityReference er = new org.LexGrid.valuesets.EntityReference(); |
newDefEntry.setEntityReference(er); |
Step 4: call create definition entry method by passing Value Set URI and Definition Entry object:
boolean created = vsAuthOp.addDefinitionEntry(new URI("VSD:AUTHORING:JUNIT:TEST2"), newDefEntry, revInfo); | |
This function provides capability to add a new property to a Value Set.
*Description: * |
Add new Property to existing value set definition. |
*Input: * |
java.net.URI valueSetURI - (Mandatory) URI of value set definition this new property will be added. |
*Output: * |
boolean - True; if addition of new property was success | |
*Exception: * |
org.LexGrid.LexBIG.Exceptions.LBException | |
*Sample Call: * |
Step 1: Instantiate ValueSetAuthoringOperation if it is not done yet :
org.lexevs.cts2.author.ValueSetAuthoringOperation vsAuthorOp = LexEvsCTS2Impl.defaultInstance().getAuthoringOperation().getValueSetAuthoringOperation(); |
Step 2: Populate RevisionInfo object:
RevisionInfo revInfo = new RevisionInfo(); |
Step 3: Populate a property to be added:
Property prop = new Property(); |
Step 4: call add property method by passing the Value Set information and a new property:
''boolean added = vsAuthOp.addValueSetProperty(new URI("VSD:AUTHORING:JUNIT:TEST1"), |
prop, revInfo));'' |
The edit operation provides the capability to modify Value Set meta-data, it's definition entires (rule sets) and its properties. For every entry that gets modified, a unique revision(version) identifier will be assigned to that entry. This helps in retrieving snapshots of an entry based on its revision(version) identifier. This unique id can be passed in using the RevisionInfo object described above.
This function provides capability to modify existing meta-data of a value set definition.
*Description: * |
Updates value set definition meta data. |
*Input: * |
java.net.URI valueSetURI - (Mandatory) URI of value set definition that will be modified. |
*Output: * |
boolean - True; if update was success | |
*Exception: * |
org.LexGrid.LexBIG.Exceptions.LBException | |
*Sample Call: * |
Step 1: Instantiate ValueSetAuthoringOperation if it is not done yet :
org.lexevs.cts2.author.ValueSetAuthoringOperation vsAuthorOp = LexEvsCTS2Impl.defaultInstance().getAuthoringOperation().getValueSetAuthoringOperation(); |
Step 2: Populate RevisionInfo object:
RevisionInfo revInfo = new RevisionInfo(); |
Step 3: Populate a modified meta-data. Here, just modifying source and usage context:
List<org.LexGrid.commonTypes.Source> srcList = new ArrayList<org.LexGrid.commonTypes.Source>(); |
List<String> contextList = new ArrayList<String>(); |
Step 4: call update meta-data method by passing the value set information and the modified meta-data:
''boolean updated = vsAuthOp.updateValueSetMetaData(new URI("VSD:AUTHORING:JUNIT:TEST2"), |
"VSD after metatdate update vsdR250",
null, "Autos CD update vsdR250", srcList, contextList,
revInfo);'' |
This function provides capability to modify existing Definition Entry of a Value Set Definition.
*Description: * |
Update existing definition entry (rule set) of a value set definition. |
*Input: * |
java.net.URI valueSetURI - (Mandatory) URI of value set definition that contains the definition entry. |
*Output: * |
boolean - True; if update was success | |
*Exception: * |
org.LexGrid.LexBIG.Exceptions.LBException | |
*Sample Call: * |
Step 1: Instantiate ValueSetAuthoringOperation if it is not done yet :
org.lexevs.cts2.author.ValueSetAuthoringOperation vsAuthorOp = LexEvsCTS2Impl.defaultInstance().getAuthoringOperation().getValueSetAuthoringOperation(); |
Step 2: Populate RevisionInfo object:
RevisionInfo revInfo = new RevisionInfo(); |
Step 3: Populate a modified Definition Entry object:
DefinitionEntry changedDefinitionEntry = new DefinitionEntry(); |
Step 4: call update definition entry method by passing the value set information and the modified definition entry object:
boolean updated = vsAuthOp.updateDefinitionEntry(new URI("VSD:AUTHORING:JUNIT:TEST2"), changedDefinitionEntry, revInfo); | |
This function provides capability to modify existing property of a Value Set Definition.
*Description: * |
Updates existing property of a value set definition. |
*Input: * |
java.net.URI valueSetURI - (Mandatory) URI of value set definition that contains the property. |
*Output: * |
boolean - True; if update was success | |
*Exception: * |
org.LexGrid.LexBIG.Exceptions.LBException | |
*Sample Call: * |
Step 1: Instantiate ValueSetAuthoringOperation if it is not done yet :
org.lexevs.cts2.author.ValueSetAuthoringOperation vsAuthorOp = LexEvsCTS2Impl.defaultInstance().getAuthoringOperation().getValueSetAuthoringOperation(); |
Step 2: Populate RevisionInfo object:
RevisionInfo revInfo = new RevisionInfo(); |
Step 3: Populate a modified property. Just modified isActive to 'true' and language to 'eng' in property 'propertyId1':
Property prop = new Property(); |
Step 4: call update property method by passing the value set information and the modified property:
boolean updated = vsAuthOp.updateValueSetProperty(new URI("VSD:AUTHORING:JUNIT:TEST1"), prop, revInfo); | |
Remove operation provides capability to remove Value Set, its definition entry and its property.
This function provides capability to remove a Value Set. This operation is permanent removal of value set definition.
*Description: * |
Removes value set definition from the system. This operation is permanent removal of value set definition. |
*Input: * |
java.net.URI valueSetURI - (Mandatory) URI of value set definition to be removed. |
*Output: * |
boolean - True; if remove was success | |
*Exception: * |
org.LexGrid.LexBIG.Exceptions.LBException | |
*Sample Call: * |
Step 1: Instantiate ValueSetAuthoringOperation if it is not done yet :
org.lexevs.cts2.author.ValueSetAuthoringOperation vsAuthorOp = LexEvsCTS2Impl.defaultInstance().getAuthoringOperation().getValueSetAuthoringOperation(); |
Step 2: Populate RevisionInfo object:
RevisionInfo revInfo = new RevisionInfo(); |
Step 3: call remove Value Set method by passing the value set information:
boolean removed = vsAuthOp.removeValueSet(new URI("VSD:AUTHORING:JUNIT:TEST1"), revInfo); | |
This function provides capability to remove Definition Entry (rule set) of a Value Set.
*Description: * |
Removes definition entry (rule set) of a value set definition. |
*Input: * |
java.net.URI valueSetURI - (Mandatory) URI of value set definition that contains the definition entry to be removed. |
*Output: * |
boolean - True; if remove was success | |
*Exception: * |
org.LexGrid.LexBIG.Exceptions.LBException | |
*Sample Call: * |
Step 1: Instantiate ValueSetAuthoringOperation if it is not done yet :
org.lexevs.cts2.author.ValueSetAuthoringOperation vsAuthorOp = LexEvsCTS2Impl.defaultInstance().getAuthoringOperation().getValueSetAuthoringOperation(); |
Step 2: Populate RevisionInfo object:
RevisionInfo revInfo = new RevisionInfo(); |
Step 3: call remove definition entry method by passing the value set and rule order id information:
boolean removed = vsAuthOp.removeDefinitionEntry(new URI("VSD:AUTHORING:JUNIT:TEST2"), 1L, revInfo); | |
This function provides capability to remove property of a Value Set.
*Description: * |
Removes a property of a Value Set Definition. |
*Input: * |
java.net.URI valueSetURI - (Mandatory) URI of value set definition that contains the property to be removed. |
*Output: * |
boolean - True; if remove was success | |
*Exception: * |
org.LexGrid.LexBIG.Exceptions.LBException | |
*Sample Call: * |
Step 1: Instantiate ValueSetAuthoringOperation if it is not done yet :
org.lexevs.cts2.author.ValueSetAuthoringOperation vsAuthorOp = LexEvsCTS2Impl.defaultInstance().getAuthoringOperation().getValueSetAuthoringOperation(); |
Step 2: Populate RevisionInfo object:
RevisionInfo revInfo = new RevisionInfo(); |
Step 3: Call remove property method by passing the value set and property information:
boolean removed = vsAuthOp.removeValueSetProperty(new URI("VSD:AUTHORING:JUNIT:TEST1"), "propertyId1", revInfo)); | |
Versionable Change operation provides capability to modify versionable attributes of Value Set like Status, Effective Date, Expiration Date, isActive and Owner.
This function modifies the status of a Value Set.
*Description: * |
Modifies the status of a Value Set. |
*Input: * |
java.net.URI valueSetURI - (Mandatory) URI of value set definition. |
*Output: * |
boolean - True; if update was success | |
*Exception: * |
org.LexGrid.LexBIG.Exceptions.LBException | |
*Sample Call: * |
Step 1: Instantiate ValueSetAuthoringOperation if it is not done yet :
org.lexevs.cts2.author.ValueSetAuthoringOperation vsAuthorOp = LexEvsCTS2Impl.defaultInstance().getAuthoringOperation().getValueSetAuthoringOperation(); |
Step 2: Populate RevisionInfo object:
RevisionInfo revInfo = new RevisionInfo(); |
Step 3: Call status change method by passing the value set and status information:
boolean changed = vsAuthOp.updateValueSetStatus(new URI("VSD:AUTHORING:JUNIT:TEST2"), "pending", revInfo));; | |
This function provides capability to modify Value Set versionable attributes like effective date, expiration date, owner, status etc.
*Description: * |
Update Value Set versionable attributes like effective date, expiration date, owner, status etc. |
*Input: * |
java.net.URI valueSetURI - (Mandatory) URI of value set definition. |
*Output: * |
boolean - True; if update was success | |
*Exception: * |
org.LexGrid.LexBIG.Exceptions.LBException | |
*Sample Call: * |
Step 1: Instantiate ValueSetAuthoringOperation if it is not done yet :
org.lexevs.cts2.author.ValueSetAuthoringOperation vsAuthorOp = LexEvsCTS2Impl.defaultInstance().getAuthoringOperation().getValueSetAuthoringOperation(); |
Step 2: Populate RevisionInfo object:
RevisionInfo revInfo = new RevisionInfo(); |
Step 3: Populate versionable changes:
Versionable changedVersionable = new Versionable(); |
Step 4: Call change versionable method by passing the value set and changed versionable information:
boolean changed = vsAuthOp.updateValueSetVersionable(new URI("VSD:AUTHORING:JUNIT:TEST2"), changedVersionable, revInfo); | |
</html>