public class VSDServiceHelper
extends java.lang.Object
Constructor and Description |
---|
VSDServiceHelper(boolean failOnAllErrors,
LgMessageDirectorIF messages)
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected CodedNodeSet |
conceptReferenceListToCodedNodeSet(ConceptReferenceList crl,
ValueSetDefinition vdd,
java.util.HashMap<java.lang.String,java.lang.String> refVersions,
java.lang.String versionTag)
Convert a concept reference list into a coded node set in the context of
a particular value set definition
|
protected java.lang.String |
constructKey(ConceptReference cr)
Construct a (hopefully) unique key from a concept reference
|
protected ValueSetDefinitionCompiler |
doCreateValueSetDefinitionCompiler() |
protected boolean |
equalReferences(ConceptReference r1,
ConceptReference r2)
Determine whether two concept references refer to the same thing in
the context of a single coding scheme!
|
java.io.InputStream |
exportValueSetResolutionDataToWriter(ValueSetDefinition vsd,
ResolvedValueSetCodedNodeSet rvscns,
LgMessageDirectorIF messager)
Generate LexGrid Coding Scheme object for the Value Set Resolution
|
AbsoluteCodingSchemeVersionReferenceList |
getAbsoluteCodingSchemeVersionReference(java.lang.String codingSchemeNameOrURI)
Return a list of all the versions of the supplied coding scheme URI or
local identifier that are supported by the service
|
java.lang.String |
getCodingSchemeNameForNamespaceName(Mappings maps,
java.lang.String namespaceName)
Return the local identifier of the coding scheme name associated with the
supplied namespace name in the context of the supplied mapping.
|
static java.lang.String |
getCodingSchemeURIForEntityCodeNamespace(Mappings maps,
java.lang.String entityCodeNamespace)
Return the coding scheme URI that corresponds to the supplied
entityCodeNamespace.
|
java.util.HashSet<java.lang.String> |
getCodingSchemeURIs(ValueSetDefinition vdDef)
Return a string representation the URI's of all of the coding schemes
used in the supplied value domain
|
LexBIGService |
getLexBIGService()
Return a persistent link to the LexBIG service
|
int |
getMaxLeafCacheSize()
Return the maximum cache size for traversing graphs looking for leaf
nodes
|
protected CodedNodeSet |
getNodeSetForCodingScheme(ValueSetDefinition vdd,
java.lang.String csName,
java.util.HashMap<java.lang.String,java.lang.String> refVersions,
java.lang.String versionTag)
Return the coded node set that represents all of the concept codes in the
referenced coding scheme
|
ResolvedValueSetCodedNodeSet |
getResolvedCodedNodeSetForValueSet(ValueSetDefinition vdd,
AbsoluteCodingSchemeVersionReferenceList csVersionsToUse,
java.lang.String versionTag,
java.util.HashMap<java.lang.String,ValueSetDefinition> referencedVSDs)
Resolve a value domain definition.
|
java.lang.String |
getURIForAssociationName(Mappings maps,
java.lang.String associationName)
Return the URI that corresponds to the supplied association name.
|
static java.lang.String |
getURIForCodingSchemeName(Mappings maps,
java.lang.String codingSchemeName)
Return the URI that corresponds to the supplied coding scheme name.
|
ValueSetDefinitionCompiler |
getValueSetDefinitionCompiler() |
protected boolean |
isCodingSchemeVersionLoaded(java.lang.String codingSchemeName,
java.lang.String version)
Checks if the supplied codingScheme and version is loaded.
|
java.util.HashMap<java.lang.String,java.lang.String> |
pruneVersionList(AbsoluteCodingSchemeVersionReferenceList suppliedCsVersions)
Go over the supplied coding scheme version reference list and remove any
entries that aren't supported by the service.
|
AbsoluteCodingSchemeVersionReference |
resolveCSVersion(java.lang.String csName,
Mappings maps,
java.lang.String versionTag,
java.util.HashMap<java.lang.String,java.lang.String> refVersions)
Return the absolute reference for the supplied csName.
|
void |
setLexBIGService(LexBIGService lbs)
Record a persistent link to the LexBIG service for use by this and other
classes
|
void |
setMaxLeafCacheSize(int newSize)
Set the maximum cache size to be used when traversing graphs looking for
leaf nodes.
|
public VSDServiceHelper(boolean failOnAllErrors, LgMessageDirectorIF messages) throws LBParameterException, LBInvocationException
sqlServer
- - SQL Server URIsqlDriver
- - SQL driver namesqlUsername
- - logon user namesqlPassword
- - logon passwordtablePrefix
- - prefix to use (?)failOnAllErrors
- - true means fail on any load, false means trymessages
- - message directorLBParameterException
LBInvocationException
public java.lang.String getCodingSchemeNameForNamespaceName(Mappings maps, java.lang.String namespaceName)
maps
- Mappings to use for transformationnamespaceName
- name to mappublic static java.lang.String getURIForCodingSchemeName(Mappings maps, java.lang.String codingSchemeName)
maps
- - Mappings that contain the name to URI mapscodingSchemeName
- - local identifier of the coding schemepublic static java.lang.String getCodingSchemeURIForEntityCodeNamespace(Mappings maps, java.lang.String entityCodeNamespace)
maps
- - Mappings that contain the name to URI mapsentityCodeNamespace
- - local identifier of the entityCodeNamespacepublic java.lang.String getURIForAssociationName(Mappings maps, java.lang.String associationName)
maps
- - Mappings that contain the name to URI mapsassociationName
- - local identifier of the coding schemepublic java.util.HashSet<java.lang.String> getCodingSchemeURIs(ValueSetDefinition vdDef) throws LBException
vdDef
- supplied value domainLBException
java.net.URISyntaxException
public AbsoluteCodingSchemeVersionReferenceList getAbsoluteCodingSchemeVersionReference(java.lang.String codingSchemeNameOrURI) throws LBException
codingSchemeNameOrURI
- - URI to return versions for or return all URI's if nullLBException
protected boolean isCodingSchemeVersionLoaded(java.lang.String codingSchemeName, java.lang.String version) throws LBException
codingSchemeName
- version
- LBException
public ResolvedValueSetCodedNodeSet getResolvedCodedNodeSetForValueSet(ValueSetDefinition vdd, AbsoluteCodingSchemeVersionReferenceList csVersionsToUse, java.lang.String versionTag, java.util.HashMap<java.lang.String,ValueSetDefinition> referencedVSDs) throws LBException
vdd
- - the value domain definition to be resolvedacsvl
- - a list of coding scheme URI's and versions to be used in the
resolution.versionTag
- - a tag (e.g. "production", "test", etc. used to any coding
schemes not in asvl If a coding scheme does not appear in the
asvl list the resolution will be as follows: 1) If the service
supports a single active version of the coding scheme it will
be used. 2) If there is more than one version the one that
uses the supplied versionTag will be used 3) If the versionTag
isn't supplied, or if none of the versions matches it, then
the one marked "production" will be used 4) If there isn't one
marked production, then the "latest" will be usedreferencedVSDs
- - List of ValueSetDefinitions referenced by vsDef. If
provided, these ValueSetDefinitions will be used to resolve
vsDef.LBException
public java.util.HashMap<java.lang.String,java.lang.String> pruneVersionList(AbsoluteCodingSchemeVersionReferenceList suppliedCsVersions) throws LBException
suppliedVersions
- - a list of "suggested" versions to useLBException
public void setMaxLeafCacheSize(int newSize)
newSize
- New max sizepublic int getMaxLeafCacheSize()
public void setLexBIGService(LexBIGService lbs)
lbs
- public LexBIGService getLexBIGService()
public AbsoluteCodingSchemeVersionReference resolveCSVersion(java.lang.String csName, Mappings maps, java.lang.String versionTag, java.util.HashMap<java.lang.String,java.lang.String> refVersions) throws LBException
csName
- - the local identifier of the coding scheme to be resolvedmaps
- - mappings that contain local ids to URIsversionTag
- - the version tag to use if there is more than one version in
the servicerefVersions
- - a list of URI/version pairs that are already resolvedLBException
protected java.lang.String constructKey(ConceptReference cr)
cr
- concept referenceprotected boolean equalReferences(ConceptReference r1, ConceptReference r2)
r1
- - first concept referencer2
- - second concept referenceprotected CodedNodeSet conceptReferenceListToCodedNodeSet(ConceptReferenceList crl, ValueSetDefinition vdd, java.util.HashMap<java.lang.String,java.lang.String> refVersions, java.lang.String versionTag) throws LBException
crl
- - list to convertvdd
- - context to do the conversion inrefVersions
- - set of already resolved versions (may have new versions
added)versionTag
- - the versionTag to use if more than one version of the coding
scheme existsLBException
protected CodedNodeSet getNodeSetForCodingScheme(ValueSetDefinition vdd, java.lang.String csName, java.util.HashMap<java.lang.String,java.lang.String> refVersions, java.lang.String versionTag) throws LBException
vdd
- - containing value set definitioncsName
- - local name of coding scheme within the value domainrefVersions
- - map from coding scheme URI to versions. A new node will be
added to this list if the coding scheme isn't already thereversionTag
- - default version or tagLBException
public ValueSetDefinitionCompiler getValueSetDefinitionCompiler()
protected ValueSetDefinitionCompiler doCreateValueSetDefinitionCompiler()
public java.io.InputStream exportValueSetResolutionDataToWriter(ValueSetDefinition vsd, ResolvedValueSetCodedNodeSet rvscns, LgMessageDirectorIF messager) throws LBException
vsd
- Value Set Definitionrvscns
- ResolvedValueSetCodedNodeSet for the VSDLBException