本文整理汇总了Java中org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList.getResolvedConceptReference方法的典型用法代码示例。如果您正苦于以下问题:Java ResolvedConceptReferenceList.getResolvedConceptReference方法的具体用法?Java ResolvedConceptReferenceList.getResolvedConceptReference怎么用?Java ResolvedConceptReferenceList.getResolvedConceptReference使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList
的用法示例。
在下文中一共展示了ResolvedConceptReferenceList.getResolvedConceptReference方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: dumpResolvedValueSetCodingSchemes
import org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList; //导入方法依赖的package包/类
public void dumpResolvedValueSetCodingSchemes() {
int sample_size = 5;
Vector v = getResolvedValueSetCodingSchemes();
System.out.println("\nNumber of Resolved Value Set coding schemes: " + v.size());
for (int i=0; i<5; i++) {
String t = (String) v.elementAt(i);
int j = i+1;
System.out.println("\n" + " (" + j + ") " + t);
String cs_name = getValueSetCodingSchemeName(t);
String cs_version = getValueSetCodingSchemeVersion(t);
System.out.println("\t" + cs_name + " (" + cs_version + ")");
ResolvedConceptReferenceList samples = generateTestCases(cs_name, cs_version, sample_size, TestCaseGenerator.TYPE_VALUE_SET);
for (int k=0; k<samples.getResolvedConceptReferenceCount(); k++) {
ResolvedConceptReference rcr = (ResolvedConceptReference) samples.getResolvedConceptReference(k);
System.out.println("\t" + rcr.getEntityDescription().getContent() + " (" + rcr.getCode() + ")");
}
}
}
示例2: addEntities
import org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList; //导入方法依赖的package包/类
private ResolvedConceptReferenceList addEntities(
ResolvedConceptReferenceList unresolvedList,
List<CodeToReturn> codesToReturn,
LocalNameList restrictToProperties, PropertyType[] restrictToPropertyTypes) throws LBInvocationException {
Map<String,Entity> entityMap = this.buildCodedEntry(
codesToReturn,
restrictToProperties,
restrictToPropertyTypes);
for(ResolvedConceptReference ref : unresolvedList.getResolvedConceptReference()) {
if(ref == null) {continue;}
String refKey = this.getKey(ref);
ref.setEntity(entityMap.get(refKey));
}
return unresolvedList;
}
示例3: print
import org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList; //导入方法依赖的package包/类
/**
* Prints the.
*
* @param cng the cng
*/
public static void print(CodedNodeGraph cng) {
ResolvedConceptReferenceList rcrl;
try {
rcrl = cng.resolveAsList(null, false, true, 0, 0, null, null, null,
-1);
ResolvedConceptReference[] rcrArray = rcrl
.getResolvedConceptReference();
for (ResolvedConceptReference rcr : rcrArray) {
print(rcr);
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
示例4: main
import org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
args = parse(args);
LexBIGService lbs = RemoteServerUtil.createLexBIGService();
CodedNodeSet cns =
lbs.getCodingSchemeConcepts("NCI MetaThesaurus", null);
cns =
cns.restrictToMatchingDesignations("single dose",
SearchDesignationOption.ALL, "LuceneQuery", null);
CodedNodeGraph cng = lbs.getNodeGraph("NCI MetaThesaurus", null, null);
cng = cng.restrictToTargetCodes(cns);
ResolvedConceptReferenceList list =
cng.resolveAsList(null, true, false, 0, 0, null, null, null, null,
500);
for (ResolvedConceptReference ref : list.getResolvedConceptReference()) {
System.out.println("Code: " + ref.getCode());
System.out.println(" Entity Description"
+ ref.getEntityDescription().getContent());
}
}
示例5: printCode
import org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList; //导入方法依赖的package包/类
/**
* Display name and description information for the given cui.
* @param code
* @param lbSvc
* @param scheme
* @param csvt
* @return A fully resolved concept reference for the code.
* @throws LBException
*/
protected ResolvedConceptReference printCode(String cui, EVSApplicationService lbSvc, String scheme, CodingSchemeVersionOrTag csvt)
throws LBException
{
// Locate the matching concept ...
CodedNodeSet cns = lbSvc.getCodingSchemeConcepts(scheme, csvt);
cns.restrictToMatchingProperties(
ConvenienceMethods.createLocalNameList("UMLS_CUI"),
new PropertyType[] {PropertyType.GENERIC},
cui,
"exactMatch",
null);
ResolvedConceptReferenceList cnsList = cns.resolveToList(
null, // sort options
null, // property names
new PropertyType[] {PropertyType.PRESENTATION}, // property types
1);
if (cnsList.getResolvedConceptReferenceCount() == 0) {
Util.displayMessage("Unable to find code for CUI = '" + cui + "'");
return null;
}
ResolvedConceptReference rcr = cnsList.getResolvedConceptReference(0);
Util.displayMessage("Concept code: " + rcr.getConceptCode());
Util.displayMessage("Description : " + rcr.getEntityDescription().getContent());
return rcr;
}
示例6: buildResolvedConceptReference
import org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList; //导入方法依赖的package包/类
public ResolvedConceptReference buildResolvedConceptReference(CodeToReturn codeToReturn,
LocalNameList restrictToProperties, PropertyType[] restrictToPropertyTypes, Filter[] filters,
boolean resolve) throws LBInvocationException {
ResolvedConceptReferenceList returnList = this.buildResolvedConceptReference(
DaoUtility.createNonTypedList(codeToReturn), restrictToProperties, restrictToPropertyTypes, filters, resolve);
Assert.state(returnList.getResolvedConceptReferenceCount() <= 1);
if(returnList.getResolvedConceptReferenceCount() == 1) {
return returnList.getResolvedConceptReference(0);
} else {
return null;
}
}
示例7: resolveIterator
import org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList; //导入方法依赖的package包/类
/**
* Resolve the Iterator
*
* @param iterator
* @param maxToReturn
* @param code
* @return
*/
public Vector<Entity> resolveIterator(
ResolvedConceptReferencesIterator iterator, int maxToReturn,
String code) {
Vector<Entity> v = new Vector<Entity>();
if (iterator == null) {
_logger.warn("No match.");
return v;
}
try {
int iteration = 0;
while (iterator.hasNext()) {
iteration++;
iterator = iterator.scroll(maxToReturn);
ResolvedConceptReferenceList rcrl = iterator.getNext();
ResolvedConceptReference[] rcra = rcrl
.getResolvedConceptReference();
for (int i = 0; i < rcra.length; i++) {
ResolvedConceptReference rcr = rcra[i];
Entity ce = rcr.getReferencedEntry();
if (code == null) {
v.add(ce);
} else {
if (ce.getEntityCode().compareTo(code) != 0)
v.add(ce);
}
}
}
} catch (Exception e) {
_logger.warn(e.getMessage());
}
return v;
}
示例8: generateViewInHierarchyTests
import org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList; //导入方法依赖的package包/类
public void generateViewInHierarchyTests() {
String target = null;
TestCase testCase = null;
for (int i=0; i<browserHomeDisplayLabels.size(); i++) {
String label = (String) browserHomeDisplayLabels.elementAt(i);
String scheme = testUtils.getCodingSchemeName(label);
String version = testUtils.getCodingSchemeVersion(label);
boolean skip = true;
if (scheme != null && scheme.compareTo(gov.nih.nci.evs.browser.common.Constants.NCI_METATHESAURUS) != 0 &&
!Arrays.asList(gov.nih.nci.evs.browser.common.Constants.TERMINOLOGY_VALUE_SET_NAMES).contains(scheme)) {
if (metadataUtils.tree_access_allowed(scheme, version)) {
ResolvedConceptReferenceList rcrl = testUtils.generateTestCases(scheme, version, ServiceTestCase.SAMPLE_SIZE, TestCaseGenerator.TYPE_TERMINOLOGY);
int n = rvGenerator.uniform(0, rcrl.getResolvedConceptReferenceCount()-1);
ResolvedConceptReference rcr = (ResolvedConceptReference) rcrl.getResolvedConceptReference(n);
String code = rcr.getConceptCode();
String name = rcr.getEntityDescription().getContent();
// code search
test_counter++;
int testNumber = test_counter;
String browserLink = label;
String algorithm = "exactMatch";
String matchText = code;
target = "codes";
testCase = testCaseWriter.createTestCase(testNumber, TestCase.VIEW_IN_HIERARCHY,
browserLink,
scheme, version, algorithm, target, matchText);
testCaseWriter.writeTestCase(testCase);
skip = false;
}
}
if (skip) {
System.out.println("\tView In Hierarchy -- " + scheme + " " + version + " skipped.");
}
}
}
示例9: printTestTermTypeDefinitionsHelp
import org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList; //导入方法依赖的package包/类
public void printTestTermTypeDefinitionsHelp(PrintWriter out) {
String method_name = "testTermTypeDefinitionsHelp";
out.println(" @Test // (" + method_name + ")");
out.println(" public void testTermTypeDefinitionsHelp() throws Exception {");
out.println(" driver.get(baseUrl + \"/ncimbrowser/\");");
String scheme = gov.nih.nci.evs.browser.common.Constants.NCI_METATHESAURUS;
String version = NCIm_PROD_Version;
//ResolvedConceptReferenceList testCases = testUtils.generateTestCases(scheme, version, 10, TestCaseGenerator.TYPE_TERMINOLOGY);
ResolvedConceptReferenceList testCases = ncimTestCases;
int n = rvGenerator.uniform(0, testCases.getResolvedConceptReferenceCount()-1);
ResolvedConceptReference rcr = (ResolvedConceptReference) testCases.getResolvedConceptReference(n);
if (rcr == null) {
System.out.println("ResolvedConceptReference is NULL -- return ");
}
String code = rcr.getConceptCode();
out.println(" driver.findElement(By.xpath(\"//input[@name='algorithm'][@value='exactMatch']\")).click();");
out.println(" driver.findElement(By.name(\"matchText\")).clear();");
out.println(" driver.findElement(By.id(\"searchTarget1\")).click();");
out.println(" driver.findElement(By.name(\"matchText\")).sendKeys(\"" + code + "\");");
out.println(" driver.findElement(By.id(\"searchTerm:search\")).click();");
out.println(" Thread.sleep(1000);");
out.println(" driver.findElement(By.name(\"sdTab\")).click();");
out.println(" Thread.sleep(1000);");
out.println(" driver.findElement(By.cssSelector(\"img[alt=\\\"Term Type Definitions\\\"]\")).click();");
out.println(" String bodyText = null;");
out.println(" String matchedString = \"Abbreviation in any source vocabulary\";");
out.println(" Thread.sleep(4000);");
out.println(" bodyText = getPopupWindowBodyText(driver);");
out.println(" assertTrue(bodyText.contains(matchedString));");
out.println(" Thread.sleep(1000); ");
out.println(" }");
out.println("");
}
示例10: printTestSourceHelp
import org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList; //导入方法依赖的package包/类
public void printTestSourceHelp(PrintWriter out) {
String method_name = "testSourceHelp";
out.println(" @Test // (" + method_name + ")");
out.println(" public void testSourceHelp() throws Exception {");
out.println(" driver.get(baseUrl + \"/ncimbrowser/\");");
String scheme = gov.nih.nci.evs.browser.common.Constants.NCI_METATHESAURUS;
String version = NCIm_PROD_Version;
//ResolvedConceptReferenceList testCases = testUtils.generateTestCases(scheme, version, 10, TestCaseGenerator.TYPE_TERMINOLOGY);
ResolvedConceptReferenceList testCases = ncimTestCases;//testUtils.generateTestCases(scheme, version, 10, TestCaseGenerator.TYPE_TERMINOLOGY);
int n = rvGenerator.uniform(0, testCases.getResolvedConceptReferenceCount()-1);
ResolvedConceptReference rcr = (ResolvedConceptReference) testCases.getResolvedConceptReference(n);
if (rcr == null) {
System.out.println("ResolvedConceptReference is NULL -- return ");
}
String code = rcr.getConceptCode();
out.println(" driver.findElement(By.xpath(\"//input[@name='algorithm'][@value='exactMatch']\")).click();");
out.println(" driver.findElement(By.name(\"matchText\")).clear();");
out.println(" driver.findElement(By.id(\"searchTarget1\")).click();");
out.println(" driver.findElement(By.name(\"matchText\")).sendKeys(\"" + code + "\");");
out.println(" driver.findElement(By.id(\"searchTerm:search\")).click();");
out.println(" Thread.sleep(1000);");
out.println(" driver.findElement(By.name(\"sdTab\")).click();");
out.println(" Thread.sleep(1000);");
out.println(" driver.findElement(By.cssSelector(\"img[alt=\\\"Source List\\\"]\")).click();");
out.println(" String bodyText = null;");
out.println(" String matchedString = \"National Cancer Institute Thesaurus\";");
out.println(" Thread.sleep(4000);");
out.println(" bodyText = getPopupWindowBodyText(driver);");
out.println(" assertTrue(bodyText.contains(matchedString));");
out.println(" Thread.sleep(1000); ");
out.println(" }");
out.println("");
}
示例11: generateResolvedConceptReferences
import org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList; //导入方法依赖的package包/类
public ResolvedConceptReferenceList generateResolvedConceptReferences(String codingScheme, String version, int number) {
if (version == null) {
version = codingSchemeDataUtils.getVocabularyVersionByTag(codingScheme, gov.nih.nci.evs.browser.common.Constants.PRODUCTION);
}
CodingSchemeVersionOrTag csvt = new CodingSchemeVersionOrTag();
if (version != null) {
csvt.setVersion(version);
}
ResolvedConceptReferenceList rcrl = new ResolvedConceptReferenceList();
try {
LocalNameList entityTypes = new LocalNameList();
entityTypes.addEntry("concept");
CodedNodeSet cns = lbSvc.getNodeSet(codingScheme, csvt, entityTypes);
SortOptionList sortOptions = null;
LocalNameList filterOptions = null;
LocalNameList propertyNames = null;
CodedNodeSet.PropertyType[] propertyTypes = null;
boolean resolveObjects = false;
int maxToReturn = number;
ResolvedConceptReferenceList rvrlist = cns.resolveToList(sortOptions, filterOptions, propertyNames, propertyTypes, resolveObjects, maxToReturn);
for (int i=0; i<rvrlist.getResolvedConceptReferenceCount(); i++) {
ResolvedConceptReference rcr = rvrlist.getResolvedConceptReference(i);
rcrl.addResolvedConceptReference(rcr);
}
} catch (Exception ex) {
ex.printStackTrace();
}
return rcrl;
}
示例12: resolveOneHit
import org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList; //导入方法依赖的package包/类
protected List<? extends ResolvedConceptReference> resolveOneHit(ResolvedConceptReference hit) throws LBException{
List<ResolvedConceptReference> returnList = new ArrayList<ResolvedConceptReference>();
CodingSchemeVersionOrTag tagOrVersion = new CodingSchemeVersionOrTag();
if (hit.getCodingSchemeVersion() != null) tagOrVersion.setVersion(hit.getCodingSchemeVersion());
CodedNodeGraph cng = null;
if (lbSvc == null) {
return null;
}
cng = lbSvc.getNodeGraph(
hit.getCodingSchemeName(),
tagOrVersion,
null);
Boolean restrictToAnonymous = Boolean.FALSE;
cng = cng.restrictToAnonymous(restrictToAnonymous);
LocalNameList localNameList = new LocalNameList();
localNameList.addEntry("concept");
cng = cng.restrictToEntityTypes(localNameList);
if (_associationNameAndValueList != null) {
cng =
cng.restrictToAssociations(
_associationNameAndValueList,
_associationQualifierNameAndValueList);
}
else {
String scheme = hit.getCodingSchemeName();
SimpleDataUtils simpleDataUtils = new SimpleDataUtils(lbSvc);
boolean isMapping = simpleDataUtils.isMapping(scheme, null);
if (isMapping) {
NameAndValueList navl = simpleDataUtils.getMappingAssociationNames(scheme, null);
if (navl != null) {
cng = cng.restrictToAssociations(navl, null);
}
}
}
ConceptReference focus = new ConceptReference();
focus.setCode(hit.getCode());
focus.setCodingSchemeName(hit.getCodingSchemeName());
focus.setCodeNamespace(hit.getCodeNamespace());
LocalNameList propertyNames = new LocalNameList();
CodedNodeSet.PropertyType[] propertyTypes = null;
SortOptionList sortCriteria = null;
ResolvedConceptReferenceList list =
cng.resolveAsList(focus,
_resolveForward, _resolveBackward, 0,
_resolveAssociationDepth, propertyNames, propertyTypes, sortCriteria,
_maxToReturn);
for(ResolvedConceptReference ref : list.getResolvedConceptReference()){
if (ref.getSourceOf() != null && this.getAssociations(ref.getSourceOf()).size() > 0) {
returnList.addAll(this.getAssociations(ref.getSourceOf()));
}
//if(ref.getSourceOf() != null){
// returnList.addAll(this.getAssociations(ref.getSourceOf()));
//}
if (ref.getTargetOf() != null && this.getAssociations(ref.getTargetOf()).size() > 0) {
returnList.addAll(this.getAssociations(ref.getTargetOf()));
}
//if(ref.getTargetOf() != null){
//returnList.addAll(this.getAssociations(ref.getTargetOf()));
//}
}
return returnList;
}
示例13: resolveIterator
import org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList; //导入方法依赖的package包/类
public static Vector resolveIterator(ResolvedConceptReferencesIterator iterator, int maxToReturn, String code)
{
Vector v = new Vector();
if (iterator == null)
{
_logger.debug("No match.");
return v;
}
try {
int iteration = 0;
Util.StopWatch stopWatch = new Util.StopWatch();
while (iterator.hasNext())
{
iteration++;
iterator = iterator.scroll(maxToReturn);
ResolvedConceptReferenceList rcrl = iterator.getNext();
ResolvedConceptReference[] rcra = rcrl.getResolvedConceptReference();
for (int i=0; i<rcra.length; i++)
{
ResolvedConceptReference rcr = rcra[i];
//org.LexGrid.concepts.Concept ce = rcr.getReferencedEntry();
org.LexGrid.concepts.Concept ce = new org.LexGrid.concepts.Concept();
ce.setId(rcr.getConceptCode());
ce.setEntityDescription(rcr.getEntityDescription());
if (code == null)
{
v.add(ce);
}
else
{
if (ce.getId().compareTo(code) != 0) v.add(ce);
}
}
}
long duration = stopWatch.duration();
_debugBuffer.append("DBG: " + stopWatch.getResult(duration) + " * resolveIterator\n");
_excelBuffer.append(stopWatch.getSecondsString(duration) + "\t");
} catch (Exception e) {
e.printStackTrace();
}
return v;
}
示例14: testViewInHierarchy
import org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList; //导入方法依赖的package包/类
@Test
public void testViewInHierarchy() throws Exception {
int m = 0;
csVec = codingSchemeDataUtils.getCodingSchemes(true); // excludeMappings
RandomVariateGenerator rvGenerator = new RandomVariateGenerator();
System.out.println("Number of coding schemes: " + csVec.size());
int lcv = 0;
for (int i = 0; i < csVec.size(); i++) {
String t = (String) csVec.get(i);
System.out.println(t);
Vector u = StringUtils.parseData(t);
String scheme = (String) u.elementAt(0);
if (scheme != null && scheme.compareTo(gov.nih.nci.evs.browser.common.Constants.NCI_METATHESAURUS) != 0 &&
!Arrays.asList(gov.nih.nci.evs.browser.common.Constants.TERMINOLOGY_VALUE_SET_NAMES).contains(scheme)) {
String version = (String) u.elementAt(1);
if (metadataUtils.tree_access_allowed(scheme, version)) {
lcv++;
System.out.println("(" + lcv + ") " + scheme + " (" + version + ")");
long ms = System.currentTimeMillis();
ResolvedConceptReferenceList rcrl = testCaseGenerator.generateTestCases(scheme, version, ServiceTestCase.SAMPLE_SIZE,
TestCaseGenerator.TYPE_TERMINOLOGY);
if (rcrl == null || rcrl.getResolvedConceptReferenceCount() == 0) {
m++;
System.out.println("\tERROR: generateTestCases failed.");
} else {
int sel_case = rvGenerator.uniform(0, rcrl.getResolvedConceptReferenceCount()-1);
ResolvedConceptReference rcr = rcrl.getResolvedConceptReference(sel_case);
String name = rcr.getEntityDescription().getContent();
String code = rcr.getCode();
String namespace = rcr.getCodeNamespace();
System.out.println("code: " + code);
System.out.println("namespace: " + namespace);
try {
String jsonstring = getJsonString(scheme, version, code, namespace);
System.out.println("\t" + jsonstring);
} catch (Exception ex) {
ex.printStackTrace();
System.out.println("\tERROR: Unable to create View in Hierarchy JSON string.");
m++;
}
}
System.out.println("Total run time (ms): " + (System.currentTimeMillis() - ms));
}
System.out.println("\n");
} else {
System.out.println("(*) " + scheme + " -- Tree not available.");
}
}
assertTrue(m == 0);
}
示例15: matchSubquery
import org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList; //导入方法依赖的package包/类
/**
* Attempt to approximate compositional or sub-query match (e.g., "peptic ulcer"
* will match the two separate concepts for "peptic" and "ulcer", in case the
* ontology does not contain any concept matching the full text "peptic ulcer").
* @param s The test string.
* @param lbSvc
* @param scheme
* @param csvt
* @throws LBException
*/
protected void matchSubquery(String s, EVSApplicationService lbSvc, String scheme, CodingSchemeVersionOrTag csvt)
throws LBException
{
Util.displayMessage("\n*** Subquery match (incorporates partial normalization/stemming).");
// Similar to synonym match, only allow match on any single non-stop word
// and only print presentations matching the query.
//
// On resolve, we sort by lucene score ('matchToQuery' sort algorithm).
StringBuffer searchPhrase = new StringBuffer();
String[] words = toWords(s, true);
for (int i = 0; i < words.length; i++) {
if (i > 0)
searchPhrase.append(" OR ");
searchPhrase.append(words[i]);
}
// Define the code set and add restrictions ...
CodedNodeSet nodes = lbSvc.getCodingSchemeConcepts(scheme, csvt);
nodes.restrictToMatchingDesignations(
searchPhrase.toString(), SearchDesignationOption.ALL, "StemmedLuceneQuery", null);
SortOptionList sortCriteria =
Constructors.createSortOptionList(new String[]{"matchToQuery"});
PropertyType[] fetchTypes =
new PropertyType[] {PropertyType.PRESENTATION};
// Resolve and analyze the result ...
ResolvedConceptReferenceList matches =
nodes.resolveToList(sortCriteria, null, fetchTypes, -1);
// Found a match? If so, print each associated presentation containing at least
// one word from the query expression (exclude non-matching synonyms).
if (matches.getResolvedConceptReferenceCount() > 0) {
for (int i = 0; i < matches.getResolvedConceptReferenceCount(); i++) {
ResolvedConceptReference ref = matches.getResolvedConceptReference(i);
printText(ref, words, 1);
}
} else {
Util.displayMessage("\tNo match found.");
}
}