当前位置: 首页>>代码示例>>Java>>正文


Java LanguageCode类代码示例

本文整理汇总了Java中org.ihtsdo.otf.tcc.api.lang.LanguageCode的典型用法代码示例。如果您正苦于以下问题:Java LanguageCode类的具体用法?Java LanguageCode怎么用?Java LanguageCode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


LanguageCode类属于org.ihtsdo.otf.tcc.api.lang包,在下文中一共展示了LanguageCode类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createNewConcept

import org.ihtsdo.otf.tcc.api.lang.LanguageCode; //导入依赖的package包/类
public ConceptChronicleBI createNewConcept() throws ValidationException, IOException, InvalidCAB, ContradictionException {
		String fsn = getConceptFSN();
		String prefTerm = getConceptPT();

		LOG.debug("Creating concept {}", fsn);
		
		UUID isA = Snomed.IS_A.getUuids()[0];
		UUID parentCons[] = new UUID[parents.size()];
		for (int i = 0; i < parents.size(); i++) {
			parentCons[i] = parents.get(i).getPrimordialUuid();
		}

		IdDirective idDir = IdDirective.GENERATE_HASH;

		LanguageCode lc = LanguageCode.EN_US;
		UUID module = Snomed.CORE_MODULE.getLenient().getPrimordialUuid();
		
		ConceptCB newConCB = new ConceptCB(fsn, prefTerm, lc, isA, idDir, module, parentCons);
										
		newConCB.setDefined(!isPrimitive);
		
		ConceptChronicleBI newCon = OTFUtility.getBuilder().construct(newConCB);
//		OTFUtility.addUncommitted(newCon);

		return newCon;
	}
 
开发者ID:Apelon-VA,项目名称:ISAAC,代码行数:27,代码来源:WizardController.java

示例2: createNewRefsetConcept

import org.ihtsdo.otf.tcc.api.lang.LanguageCode; //导入依赖的package包/类
private ConceptChronicleBI createNewRefsetConcept(ConceptVersionBI parent, String fsn, String prefTerm, boolean isAnnotated) throws IOException, InvalidCAB, ContradictionException {
	LanguageCode lc = LanguageCode.EN_US;
	UUID isA = Snomed.IS_A.getUuids()[0];
	IdDirective idDir = IdDirective.GENERATE_HASH;
       UUID module = Snomed.CORE_MODULE.getLenient().getPrimordialUuid();
       UUID parents[] = new UUID[1];
       parents[0] = parent.getPrimordialUuid();

	ConceptCB newConCB = new ConceptCB(fsn, prefTerm, lc, isA, idDir, module, parents);
									
	ConceptChronicleBI newCon = appDb.getBuilder().construct(newConCB);

	newCon.setAnnotationStyleRefex(isAnnotated);
	
	appDb.getDB().addUncommitted(newCon);

	return newCon;
}
 
开发者ID:IHTSDO,项目名称:example-OTF-code,代码行数:19,代码来源:RefsetCreation.java

示例3: createNewConcept

import org.ihtsdo.otf.tcc.api.lang.LanguageCode; //导入依赖的package包/类
private ConceptChronicleBI createNewConcept(ConceptVersionBI con) throws IOException, InvalidCAB, ContradictionException {
	String fsn = "New Test Concept (observable entity)";
	String prefTerm = "New Test Concept PT";
	LanguageCode lc = LanguageCode.EN_US;
	UUID isA = Snomed.IS_A.getUuids()[0];
	IdDirective idDir = IdDirective.GENERATE_HASH;
       UUID module = Snomed.CORE_MODULE.getLenient().getPrimordialUuid();
       UUID parents[] = new UUID[1];
       parents[0] = con.getPrimordialUuid();

	ConceptCB newConCB = new ConceptCB(fsn, prefTerm, lc, isA, idDir, module, parents);
									
	ConceptChronicleBI newCon = appDb.getBuilder().construct(newConCB);
	appDb.getDB().addUncommitted(newCon);

	return newCon;

}
 
开发者ID:IHTSDO,项目名称:example-OTF-code,代码行数:19,代码来源:ComponentCreation.java

示例4: createNewConceptBlueprint

import org.ihtsdo.otf.tcc.api.lang.LanguageCode; //导入依赖的package包/类
/**
 * Creates the new concept blueprint
 *
 * @param parent the parent
 * @param fsn the fsn
 * @param prefTerm the pref term
 * @return the concept cb
 * @throws ValidationException the validation exception
 * @throws IOException Signals that an I/O exception has occurred.
 * @throws InvalidCAB the invalid cab
 * @throws ContradictionException the contradiction exception
 */
private ConceptCB createNewConceptBlueprint(ConceptChronicleBI parent,
  String fsn, String prefTerm) throws ValidationException, IOException,
  InvalidCAB, ContradictionException {
  if (parent == null) {
    throw new IOException("Parent is unexpectedly null");
  }
  if (fsn == null) {
    throw new IOException("FN is unexpectedly null");
  }
  if (prefTerm == null) {
    throw new IOException("PT is unexpectedly null");
  }
  // Assume language US English
  LanguageCode lc = LanguageCode.EN_US;
  // Assume hierarchy is represented as IS_A rel
  UUID isA = Snomed.IS_A.getUuids()[0];
  // Compute UUIDs in standard way
  IdDirective idDir = IdDirective.GENERATE_HASH;
  // Assume module should be SNOMED core module (this may be something to
  // change)
  UUID module = Snomed.CORE_MODULE.getLenient().getPrimordialUuid();
  // Create single parent
  UUID parentUUIDs[] = new UUID[1];
  parentUUIDs[0] = parent.getPrimordialUuid();
  return new ConceptCB(fsn, prefTerm, lc, isA, idDir, module, parentUUIDs);
}
 
开发者ID:Apelon-VA,项目名称:ISAAC,代码行数:39,代码来源:BdbInformationModelService.java

示例5: createNewConceptBlueprint

import org.ihtsdo.otf.tcc.api.lang.LanguageCode; //导入依赖的package包/类
public static ConceptCB createNewConceptBlueprint(ConceptChronicleBI parent, String fsn, String prefTerm) throws ValidationException, IOException, InvalidCAB, ContradictionException {
	LanguageCode lc = LanguageCode.EN_US;
	UUID isA = Snomed.IS_A.getUuids()[0];
	IdDirective idDir = IdDirective.GENERATE_HASH;
	UUID module = Snomed.CORE_MODULE.getLenient().getPrimordialUuid();
	UUID parentUUIDs[] = new UUID[1];
	parentUUIDs[0] = parent.getPrimordialUuid();
	return new ConceptCB(fsn, prefTerm, lc, isA, idDir, module, parentUUIDs);
}
 
开发者ID:Apelon-VA,项目名称:ISAAC,代码行数:10,代码来源:OTFUtility.java

示例6: createLangCode

import org.ihtsdo.otf.tcc.api.lang.LanguageCode; //导入依赖的package包/类
private void createLangCode() {
	createTitleLabel("Language Code");
	
	Set<String> noDialectCodes = new HashSet<>();
	for (LanguageCode val : LanguageCode.values()) {
		noDialectCodes.add(val.getFormatedLanguageNoDialectCode());
	}
	if (desc == null) {
		languageCodeCb.getItems().add(SELECT_VALUE);
	}

	languageCodeCb.getItems().addAll(noDialectCodes);
	languageCodeCb.valueProperty().addListener(new ChangeListener<String>() {
		@Override
		public void changed(ObservableValue<? extends String> ov, String oldVal, String newVal) {
			if (desc != null) {
				if (!desc.getLang().equals(newVal.toString())) { 
					modificationMade.set(true);
				} else {
					modificationMade.set(false);
					reasonSaveDisabled_.set("Cannot save unless original content changed");
				}
			} else if (!newVal.equals(SELECT_VALUE)) {
				langCodeNewSelected.set(true);
			} else {
				langCodeNewSelected.set(false);
			}
		}
	});
	gp_.add(languageCodeCb, 2, row);

	row++;
}
 
开发者ID:Apelon-VA,项目名称:ISAAC,代码行数:34,代码来源:DescriptionModelingPopup.java

示例7: addNewVersion

import org.ihtsdo.otf.tcc.api.lang.LanguageCode; //导入依赖的package包/类
@Override 
protected void addNewVersion()
{	
	try
	{
		int type = getSelectedType(); 
		String langCode = languageCodeCb.getSelectionModel().getSelectedItem();
		
		String term = termTf.getText(); 
		boolean isInitCap = (isCapCb.getSelectionModel().getSelectedItem().equalsIgnoreCase("True")); 

		if (desc == null) {
			OTFUtility.createNewDescription((desc != null) ? desc.getConceptNid() : conceptNid, type, LanguageCode.getLangCode(langCode), term, isInitCap);
		} else {
			if (desc.isUncommitted()) {
				ExtendedAppContext.getDataStore().forget(desc);
			}
			DescriptionCAB dcab = new DescriptionCAB((desc != null) ? desc.getConceptNid() : conceptNid, type, LanguageCode.getLangCode(langCode), term, isInitCap, desc, OTFUtility.getViewCoordinate(), IdDirective.PRESERVE, RefexDirective.EXCLUDE);

			DescriptionChronicleBI dcbi = OTFUtility.getBuilder().constructIfNotCurrent(dcab);
			OTFUtility.addUncommitted(dcbi.getEnclosingConcept());
		}
	}
	catch (Exception e)
	{
		logger_.error("Error saving description", e);
		AppContext.getCommonDialogs().showErrorDialog("Unexpected error", "There was an error saving the Description", e.getMessage(), this);
	}
}
 
开发者ID:Apelon-VA,项目名称:ISAAC,代码行数:30,代码来源:DescriptionModelingPopup.java

示例8: createNewDescription

import org.ihtsdo.otf.tcc.api.lang.LanguageCode; //导入依赖的package包/类
public void createNewDescription(ConceptChronicleBI con, int i) throws IOException, InvalidCAB, ContradictionException {
		DescriptionCAB newDesc = new DescriptionCAB(con.getConceptNid(), 
													getTypeNid(i), 
													LanguageCode.EN_US, 
													syns.get(i).getTerm(), 
													syns.get(i).isInitialCaseSig(), 
													IdDirective.GENERATE_HASH);
		
		OTFUtility.getBuilder().construct(newDesc);
//		OTFUtility.addUncommitted(con);
	}
 
开发者ID:Apelon-VA,项目名称:ISAAC,代码行数:12,代码来源:WizardController.java

示例9: modifyDescAttributes

import org.ihtsdo.otf.tcc.api.lang.LanguageCode; //导入依赖的package包/类
private void modifyDescAttributes(DescriptionChronicleBI fullDesc) throws PropertyVetoException, IOException, ContradictionException, InvalidCAB
{
	DescriptionVersionBI desc = fullDesc.getVersion(vc);
	DescriptionCAB dcab = new DescriptionCAB(desc.getConceptNid(), SnomedMetadataRfx.getDES_SYNONYM_NID(), LanguageCode.DA_DK, "New Text attempt", true, desc, vc, IdDirective.PRESERVE, RefexDirective.EXCLUDE);
	DescriptionChronicleBI dcbi = appDb.getBuilder().constructIfNotCurrent(dcab);
	
	appDb.getDB().addUncommitted(dcbi.getEnclosingConcept());
}
 
开发者ID:IHTSDO,项目名称:example-OTF-code,代码行数:9,代码来源:ComponentModify.java

示例10: Rf2Export

import org.ihtsdo.otf.tcc.api.lang.LanguageCode; //导入依赖的package包/类
/**
 * Instantiates a new rf2 export.
 *
 * @param directory specifying where to write the files
 * @param releaseType the <code>ReleaseType</code> representing the type of
 *          release
 * @param language the <code>LanguageCode</code> representing the language of
 *          the release
 * @param country the <code>COUNTRY_CODE</code> representing the country
 *          associated with the release
 * @param namespace the String representing the namespace associated with the
 *          released content
 * @param effectiveDate specifying the official release date
 * @param pathNid the path nid
 * @param viewCoordinate specifying which versions of the concepts to include
 *          in this release. Should not include all status values.
 * @param taxonomyParentNids an integer representing the parent of taxonomy to
 *          release
 * @throws IOException signals that an I/O exception has occurred
 * @throws ContradictionException the contradiction exception
 */
public Rf2Export(File directory, ReleaseType releaseType,
    LanguageCode language, COUNTRY_CODE country, String namespace,
    Date effectiveDate, int pathNid, ViewCoordinate viewCoordinate,
    Collection<Integer> taxonomyParentNids) throws IOException,
    ContradictionException {
  this.directory = directory;
  this.releaseType = releaseType;
  this.language = language;
  this.country = country;
  this.namespace = namespace;
  this.pathNid = pathNid;
  this.viewCoordinate = viewCoordinate;
  this.effectiveDateString =
      TimeHelper.getShortFileDateFormat().format(effectiveDate);
  this.taxonomyParentNids = taxonomyParentNids;
  setup();
}
 
开发者ID:Apelon-VA,项目名称:ISAAC,代码行数:39,代码来源:Rf2Export.java

示例11: createUserConcept

import org.ihtsdo.otf.tcc.api.lang.LanguageCode; //导入依赖的package包/类
/**
 * Create a concept in the DB, for the specified user.  Only call this if {@link #alreadyExists(User)) return false
 */
public static void createUserConcept(User user) throws IOException, InvalidCAB, ContradictionException
{
	logger.info("Creating user " + toString(user) + " in DB");
	AppContext.getRuntimeGlobals().disableAllCommitListeners();
	try
	{
		BdbTerminologyStore ts = ExtendedAppContext.getDataStore();
		String fsn = user.getUniqueFullName();
		String preferredName = user.getFullName();
		String logonName = user.getUniqueLogonName();
		UUID userUUID = UUID.fromString(user.getUUID());

		LanguageCode lc = LanguageCode.EN_US;
		UUID isA = Snomed.IS_A.getUuids()[0];
		IdDirective idDir = IdDirective.PRESERVE_CONCEPT_REST_HASH;
		UUID module = TermAux.TERM_AUX_MODULE.getUuids()[0];
		UUID parents[] = new UUID[] { TermAux.USER.getUuids()[0] };

		ConceptCB cab = new ConceptCB(fsn, preferredName, lc, isA, idDir, module, userUUID, parents);

		DescriptionCAB dCab = new DescriptionCAB(cab.getComponentUuid(), Snomed.SYNONYM_DESCRIPTION_TYPE.getUuids()[0], lc, logonName, true,
				IdDirective.GENERATE_HASH);
		dCab.getProperties().put(ComponentProperty.MODULE_ID, module);

		//Mark it as acceptable
		RefexCAB rCabAcceptable = new RefexCAB(RefexType.CID, dCab.getComponentUuid(), Snomed.US_LANGUAGE_REFEX.getUuids()[0], IdDirective.GENERATE_HASH,
				RefexDirective.EXCLUDE);
		rCabAcceptable.put(ComponentProperty.COMPONENT_EXTENSION_1_ID, SnomedMetadataRf2.ACCEPTABLE_RF2.getUuids()[0]);
		rCabAcceptable.getProperties().put(ComponentProperty.MODULE_ID, module);
		dCab.addAnnotationBlueprint(rCabAcceptable);

		cab.addDescriptionCAB(dCab);
		
		//TODO store roles on the concept

		//Build this on the lowest level path, otherwise, other code that references this will fail (as it doesn't know about custom paths)
		ConceptChronicleBI newCon = ts.getTerminologyBuilder(
				new EditCoordinate(TermAux.USER.getLenient().getConceptNid(), TermAux.TERM_AUX_MODULE.getLenient().getNid(), TermAux.WB_AUX_PATH.getLenient()
						.getConceptNid()), StandardViewCoordinates.getWbAuxiliary()).construct(cab);
		ts.addUncommitted(newCon);
		ts.commit(newCon);
	}
	finally
	{
		AppContext.getRuntimeGlobals().enableAllCommitListeners();
	}
}
 
开发者ID:Apelon-VA,项目名称:ISAAC,代码行数:51,代码来源:GenerateUsers.java

示例12: createNewDescription

import org.ihtsdo.otf.tcc.api.lang.LanguageCode; //导入依赖的package包/类
public static void createNewDescription(int conNid, int typeNid, LanguageCode lang, String term, boolean isInitial) throws IOException, InvalidCAB, ContradictionException {
	DescriptionCAB newDesc = new DescriptionCAB(conNid, typeNid, lang, term, isInitial, IdDirective.GENERATE_HASH); 

	getBuilder().construct(newDesc);
	addUncommitted(conNid);
}
 
开发者ID:Apelon-VA,项目名称:ISAAC,代码行数:7,代码来源:OTFUtility.java

示例13: getLanguage

import org.ihtsdo.otf.tcc.api.lang.LanguageCode; //导入依赖的package包/类
public String getLanguage(int i) {
	return LanguageCode.EN_US.getFormatedLanguageCode();
}
 
开发者ID:Apelon-VA,项目名称:ISAAC,代码行数:4,代码来源:WizardController.java

示例14: createNewDescription

import org.ihtsdo.otf.tcc.api.lang.LanguageCode; //导入依赖的package包/类
private void createNewDescription(ConceptVersionBI con) throws IOException, InvalidCAB, ContradictionException {
	DescriptionCAB newDesc = new DescriptionCAB(con.getConceptNid(), SnomedMetadataRfx.getDES_SYNONYM_NID(), LanguageCode.EN_US, 
												"Test Description #1", true, IdDirective.GENERATE_HASH);
	appDb.getBuilder().construct(newDesc);
	appDb.getDB().addUncommitted(con);
}
 
开发者ID:IHTSDO,项目名称:example-OTF-code,代码行数:7,代码来源:ComponentCreation.java


注:本文中的org.ihtsdo.otf.tcc.api.lang.LanguageCode类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。