Introduction
This document is a section of the LexEVS 5.x Programmer's Guide. It is new for LexEVS v5.1.
The Value Domain services are integrated parts of the LexEVS core API. They provide the ability to:
- load Value Domaindefinitions programmatically into the LexGrid repository using the domain objects that are available via the LexGrid logical model
- apply user restrictions (ex: valueDomain URI) and dynamically resolve the definitions at run time
The LexEVS Value Domain Services expose the API particularly for the Value Domain elements of the LexGrid Logical Model. For more information on LexGrid model see http://informatics.mayo.edu/
Value Domain Class Diagram
These classes implement the LexEVS Value Domain API.
Class Name |
Description |
---|---|
VDSServices |
Class to handle list of Value Domain Definitions Object to and fro database |
VDServices |
Class to handle individual Value Domain Definition objects to and fro database. |
VDEntryServices |
Class to handle Value Domain Entry objects to and fro database. |
LexEVSValueDomainServices |
Primary interface for LexEVS Value Domain API |
LexEVSValueDomainServicesImpl |
Implementation of LexEVSValueDomainServices which is primary interface for LexEVS Value Domain API. |
LoadValueDomain |
Imports the value Domain Definitions in the source file, provided in LexGrid canonical format, to the LexBIG repository. |
ResolvedValueDomainCodedNodeSet |
Contains coding scheme version reference list that was used to resolve the value domain and the coded node set. |
ResolvedValueDomainDefinition |
A resolved Value Domain definition containing the coding scheme version reference list that was used to resolve the value domain and an iterator for resolved concepts. |
LexEVS Value Domain Service API
Administration Functions
LexEVS Value Domain Services provide administration functions to load and remove value domain definitions.
Loading Value Domain Definitions
There are three methods that could be used to load Value Domain Definitions:
- loadValueDomain(ValueDomainDefinition vddef, String systemReleaseURI)
- loadValueDomain(InputStream inputStream,boolean failOnAllErrors)
- loadValueDomain(String xmlFileLocation, boolean failOnAllErrors)
loadValueDomain(ValueDomainDefinition vddef, String systemReleaseURI)
loadValueDomain(ValueDomainDefinition vddef, String systemReleaseURI)
Description: |
Loads supplied valueDomainDefinition object. |
---|---|
Input: |
org.LexGrid.emf.valueDomains.ValueDomainDefinition |
Output: |
none |
Exception: |
LBException |
Implementation Details: |
Implementation:
|
loadValueDomain(InputStream inputStream,boolean failOnAllErrors)
loadValueDomain(InputStream inputStream,boolean failOnAllErrors)
Description: |
Loads valueDomainDefinitions Found in inputStream |
---|---|
Input: |
java.io.InputStream |
Output: |
none |
Exception: |
Exception |
Implementation Details: |
Implementation:
|
loadValueDomain(String xmlFileLocation, boolean failOnAllErrors)
loadValueDomain(String xmlFileLocation, boolean failOnAllErrors)
Description: |
Loads valueDomainDefinitions found in input xml file. |
---|---|
Input: |
java.lang.String |
Output: |
none |
Exception: |
Exception |
Implementation Details: |
Implementation:
|
Remove Value Domain Definition
Below are the functions to remove value domain definitions from the system.
removeValueDomain(URI valueDomainURI)
removeValueDomain(URI valueDomainURI)
Description: |
Removes supplied value domain definition from the system. |
---|---|
Input: |
java.net.URI |
Output: |
none |
Exception: |
org.LexGrid.LexBIG.Exceptions.LBException, |
Implementation Details: |
Implementation:
|
removeAllValueDomains()
removeAllValueDomains()
Description: |
Removes all value domain definitions from the system. |
---|---|
Input: |
none |
Output: |
none |
Exception: |
org.LexGrid.LexBIG.Exceptions.LBException, |
Implementation Details: |
Implementation:
|
Drop Value Domain Tables
Administration function to delete value domain and pick list tables. Tables will be deleted only if there are no contents in value domain and pick list tables.
dropValueDomainTables()
Description: |
Drops value domain tables only if there are no value domain and pick list entries. |
---|---|
Input: |
none |
Output: |
none |
Exception: |
org.LexGrid.LexBIG.Exceptions.LBException, |
Implementation Details: |
Implementation:
|
Validate XML Resources
Function to perform validation of source XML file without loading.
validate(URI uri, int valicationLevel)
Description: |
Performs validation of the candidate resource without loading data. |
---|---|
Input: |
java.net.URI |
Output: |
none |
Exception: |
Org.LexGrid.LexBIG.Exceptions.LBParameterException |
Implementation Details: |
Implementation:
|
Query Functions
Here are some of the query functions that can be run against value domain definitions using the LexEVS Value Domain Services.
isConceptInDomain
There are two methods to check if supplied concept code is part of supplied value domain definition.
isConceptInDomain(String entityCode, URI valueDomainURI)
isConceptInDomain(String entityCode, URI valueDomainURI)
Description: |
Determines if the supplied entity code is a valid result for the supplied value domain and, if it is, returns the particular codingSchemeVersion that was used. |
---|---|
Input: |
java.lang.String, |
Output: |
org.LexGrid.LexBIG.DataModel.Core. |
Exception: |
org.LexGrid.LexBIG.Exceptions.LBException |
Implementation Details: |
Implementation:
|
isConceptInDomain(String entityCode, URI entityCodeNamespace, CodingSchemeVersionOrTag csvt, URI valueDomainURI)
isConceptInDomain(String entityCode, URI entityCodeNamespace, CodingSchemeVersionOrTag csvt, URI valueDomainURI)
Description: |
Similar to the previous method, this method determines if the supplied entity code and entity namespace is a valid result for the supplied value domain when resolved against the supplied Coding Scheme Version or Tag. |
---|---|
Input: |
java.lang.String, |
Output: |
org.LexGrid.LexBIG.DataModel.Core. AbsoluteCodingSchemeVersionReference |
Exception: |
org.LexGrid.LexBIG.Exceptions.LBException |
Implementation Details: |
Implementation:
|
resolveValueDomain
This method resolves supplied value domain definition and returns set of valied concept codes plus the code systems and its versions that were used.
resolveValueDomain(URI valueDomainURI, AbsoluteCodingSchemeVersionReferenceList csVersionList)
Description: |
Resolves a value domain using the supplied set of coding scheme versions. |
---|---|
Input: |
java.net.URI, |
Output: |
org.lexgrid.valuedomain.dto.ResolvedValueDomainDefinition |
Exception: |
org.LexGrid.LexBIG.Exceptions.LBException |
Implementation Details: |
Implementation:
|
isSubDomain
This method checks if childValueDomain is a child of parentValueDomain.
isSubDomain(URI childValueDomainURI, URI parentValueDomainURI
Description: |
Checks whether childValueDomainURI is a child of parentValueDomainURI. |
---|---|
Input: |
java.net.URI,_java.net.URI |
Output: |
boolean |
Exception: |
org.LexGrid.LexBIG.Exceptions.LBException |
Implementation Details: |
Implementation:
|
getValueDomainDefinition
Utility method that returns value domain definition for the supplied value domain URI.
getValueDomainDefinition(URI valueDomainURI)
Description: |
Returns value domain definition for the supplied value domain URI. |
---|---|
Input: |
java.net.URI |
Output: |
org.LexGrid.emf.valueDomains.ValueDomainDefinition |
Exception: |
org.LexGrid.LexBIG.Exceptions.LBException |
Implementation Details: |
Implementation:
|
listValueDomains
Utility method that lists all the value domain(s) that matches supplied name.
listValueDomains(String valueDomainName)
Description: |
Returns the URI's for the value domain definition(s) for the supplied domain name. If the name is null, returns everything. If the name is not null, returns the value domain(s) that have the assigned name. Note Plural because there is no guarantee of valueDomain uniqueness. If the name is the empty string "", returns all unnamed valueDomains. |
---|---|
Input: |
java.lang.String |
Output: |
java.net.URI |
Exception: |
org.LexGrid.LexBIG.Exceptions.LBException |
Implementation Details: |
Implementation:
|
getAllValueDomainsWithNoNames
This method returns all the value domain definition URI's that contains no names.
getAllValueDomainsWithNoNames()
Description: |
Returns the URI's of all unnamed value domain definition(s). |
---|---|
Input: |
none |
Output: |
java.net.URI |
Exception: |
org.LexGrid.LexBIG.Exceptions.LBException |
Implementation Details: |
Implementation:
|
getValueDomainEntitiesForTerm
This method resolves the supplied value domain and returns only those concept codes that matches the supplied term.
getValueDomainEntitiesForTerm(String term, URI valueDomainURI, String matchAlgorithm)
Description: |
Resolves the value domain supplied and restricts it to the term and matchAlgorith supplied. The returned object ResolvedValueDomainCodedNodeSet contains the codingScheme URI and Version that was used to resolve and the CodedNodeSet. Note The CodedNodeSet is unresolved. |
---|---|
Input: |
java.lang.String, |
Output: |
org.lexgrid.valuedomain.dto.ResolvedValueDomainCodedNodeSet |
Exception: |
org.LexGrid.LexBIG.Exceptions.LBException |
Implementation Details: |
Implementation:
|
getCodingSchemesInValueDomain
This method returns all the coding scheme referenced by supplied value domain.
getCodingSchemesInValueDomain(URI valueDomainURI)
Description: |
Returns list of coding scheme summary that is referenced by the supplied value domain. |
---|---|
Input: |
java.net.URI |
Output: |
org.LexGrid.LexBIG.DataModel.Collections. AbsoluteCodingSchemeVersionReferenceList |
Exception: |
org.LexGrid.LexBIG.Exceptions.LBException |
Implementation Details: |
Implementation:
|
isDomain
This method checks if the supplied entityCode is of type 'valueDomain' in supplued coding scheme and version.
isDomain(String entityCode, String codingSchemeName, CodingSchemeVersionOrTag csvt)
Description: |
Determines if the supplied entity code is of type valueDomain in the supplied coding scheme and, if it is, returns true; otherwise returns false. |
---|---|
Input: |
java.lang.String, |
Output: |
boolean |
Exception: |
org.LexGrid.LexBIG.Exceptions.LBException |
Implementation Details: |
Implementation:
|
Resolved Value Domain Objects
ResolvedValueDomainCodedNodeSet
Contains Coding Scheme Version reference list that was used to resolve the Value Domain and the CodedNodeSet.
The CodedNodeSet is not resolved.
ResolvedValueDomainDefinition
A resolved Value Domain Definition containing the Coding Scheme Version reference list that was used to resolve the Value Domain and an iterator for resolved concepts.
Error Handling
LexEVS Value Domain services uses org.LexGrid.LexBIG.Impl.loaders.MessageDirector to direct all fatal, error, warning, info messages with appropriate messages to the LexBIG log files in the 'log' folder of LexEVS install directory.
Along with MessageDirector, the services will also make use of org.LexGrid.LexBIG.exception.LBException to throw any fatal and error messages to the log file as well as to console.
Load Scripts
Following are the scripts that can be used to load value domain definition that are in LexGrid XML format into the system :
- LoadValueDomain.bat for Windows environment and
- LoadValueDomain.sh for Unix environment
The above scripts can be found under 'Admin' folder of LexEVS install directory.
Both scripts take in the following parameters:
-in Input <uri> URI or path specifying location of the source file. -v Validate <int> Perform validation of the candidate resource without loading data. Supported levels of validation include: 0 = Verify document is well-formed 1 = Verify document is valid
Example:
sh LoadValueDomain.sh -in "file:///path/to/file.xml"
Sample Value Domain Definition XML File
Below is a sample XML file containing Value Domain Definitions in LexGrid format that can be loaded using LexEVS Value Domain Service.
<source> <?xml version="1.0" encoding="UTF-8"?> <systemRelease xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" {panel} xsi:schemaLocation="http://LexGrid.org/schema/2009/01/LexGrid/versions http://LexGrid.org/schema/2009/01/LexGrid/versions.xsd" xmlns="http://LexGrid.org/schema/2009/01/LexGrid/versions" xmlns:lgVer="http://LexGrid.org/schema/2009/01/LexGrid/versions" xmlns:lgCommon="http://LexGrid.org/schema/2009/01/LexGrid/commonTypes" xmlns:data="data" xmlns:lgVD="http://LexGrid.org/schema/2009/01/LexGrid/valueDomains" xmlns:lgNaming="http://LexGrid.org/schema/2009/01/LexGrid/naming" releaseURI="http://testRelease/04" releaseDate="2008-11-07T14:55:51.615-06:00"> <lgCommon:entityDescription>Sample value domains</lgCommon:entityDescription> <lgVer:valueDomains> <lgVD:mappings> <lgNaming:supportedAssociation localId="hasSubtype" uri="urn:oid:1.3.6.1.4.1.2114.108.1.8.1">hasSubtype</lgNaming:supportedAssociation> <lgNaming:supportedCodingScheme localId="Automobiles" uri="urn:oid:11.11.0.1">Automobiles</lgNaming:supportedCodingScheme> <lgNaming:supportedDataType localId="testhtml">test/html</lgNaming:supportedDataType> <lgNaming:supportedDataType localId="textplain">text/plain</lgNaming:supportedDataType> <lgNaming:supportedHierarchy localId="is_a" associationNames="hasSubtype" isForwardNavigable="true" rootCode="@">hasSubtype</lgNaming:supportedHierarchy> <lgNaming:supportedLanguage localId="en" uri="www.en.org/orsomething">en</lgNaming:supportedLanguage> <lgNaming:supportedNamespace localId="Automobiles" uri="urn:oid:11.11.0.1" equivalentCodingScheme="Automobiles">Automobiles</lgNaming:supportedNamespace> <lgNaming:supportedProperty localId="textualPresentation">textualPresentation</lgNaming:supportedProperty> <lgNaming:supportedSource localId="lexgrid.org">lexgrid.org</lgNaming:supportedSource> <lgNaming:supportedSource localId="_111101">11.11.0.1</lgNaming:supportedSource> </lgVD:mappings> <lgVD:valueDomainDefinition valueDomainURI="SRITEST:AUTO:DomesticAutoMakers" valueDomainName="Domestic Auto Makers" defaultCodingScheme="Automobiles" effectiveDate="2009-01-01T11:00:00Z" isActive="true" status="ACTIVE"> <lgVD:properties> <lgCommon:property propertyName="textualPresentation"> <lgCommon:value> Domestic Auto Makers</lgCommon:value> </lgCommon:property> </lgVD:properties> <lgVD:definitionEntry ruleOrder="1" operator="OR"> <lgVD:entityReference entityCode="005" referenceAssociation="hasSubtype" transitiveClosure="true" targetToSource="false" leafOnly="false"/> </lgVD:definitionEntry> </lgVD:valueDomainDefinition> <lgVD:valueDomainDefinition valueDomainURI="SRITEST:AUTO:AllDomesticButGM" valueDomainName="All Domestic Autos But GM" defaultCodingScheme="Automobiles" effectiveDate="2009-01-01T11:00:00Z" isActive="true" status="ACTIVE"> <lgVD:properties> <lgCommon:property propertyName="textualPresentation"> <lgCommon:value> Domestic Auto Makers</lgCommon:value> </lgCommon:property> </lgVD:properties> <lgVD:definitionEntry ruleOrder="1" operator="OR"> <lgVD:entityReference entityCode="005" referenceAssociation="hasSubtype" transitiveClosure="true" targetToSource="false" leafOnly="false"/> </lgVD:definitionEntry> <lgVD:definitionEntry ruleOrder="2" operator="SUBTRACT"> <lgVD:entityReference entityCode="GM" referenceAssociation="hasSubtype" transitiveClosure="true" targetToSource="false" leafOnly="false"/> </lgVD:definitionEntry> </lgVD:valueDomainDefinition> <lgVD:valueDomainDefinition valueDomainURI="SRITEST:AUTO:AllDomesticANDGM" valueDomainName="All Domestic Autos AND GM" defaultCodingScheme="Automobiles" effectiveDate="2009-01-01T11:00:00Z" isActive="true" status="ACTIVE"> <lgVD:properties> <lgCommon:property propertyName="textualPresentation"> <lgCommon:value> Domestic Auto Makers AND GM</lgCommon:value> </lgCommon:property> </lgVD:properties> <lgVD:definitionEntry ruleOrder="1" operator="OR"> <lgVD:entityReference entityCode="005" referenceAssociation="hasSubtype" transitiveClosure="true" targetToSource="false" leafOnly="false"/> </lgVD:definitionEntry> <lgVD:definitionEntry ruleOrder="2" operator="AND"> <lgVD:entityReference entityCode="GM" referenceAssociation="hasSubtype" transitiveClosure="true" targetToSource="false" leafOnly="false"/> </lgVD:definitionEntry> </lgVD:valueDomainDefinition> <lgVD:valueDomainDefinition valueDomainURI="SRITEST:AUTO:DomasticLeafOnly" valueDomainName="Domestic Leaf Only" defaultCodingScheme="Automobiles" effectiveDate="2009-01-01T11:00:00Z" isActive="true" status="ACTIVE"> <lgVD:properties> <lgCommon:property propertyName="textualPresentation"> <lgCommon:value>Domestic Leaf Only</lgCommon:value> </lgCommon:property> </lgVD:properties> <lgVD:definitionEntry ruleOrder="1" operator="OR"> <lgVD:entityReference entityCode="005" referenceAssociation="hasSubtype" transitiveClosure="true" targetToSource="false" leafOnly="true"/> </lgVD:definitionEntry> </lgVD:valueDomainDefinition> </lgVer:valueDomains> {panel} </systemRelease> </source>
System Testing
The System test case for the LexEVS Value Domain service is performed using the JUnit test suite:
org.LexGrid.LexBIG.Impl.testUtility.VDAllTests
This test suite will be run as part of regular LexEVS test suites AllTestsAllConfigs and AllTestsNormalConfigs.
Installation / Packaging
Value Domain Services are integrated parts of core LexEVS API and are packaged and installed with other LexEVS services.