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


Java ValueSet类代码示例

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


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

示例1: testValueSetDaoDstu3

import org.hl7.fhir.dstu3.model.ValueSet; //导入依赖的package包/类
@Test
public void testValueSetDaoDstu3() {
	JpaResourceProviderDstu3<ValueSet> valueSetProvider = fhirTerminologyProviderService
			.getValueSetProvider();

	ValueSet vs = new ValueSet();
	vs.setId("Influenza.Test.OID");
	IIdType id = vs.getIdElement();
	vs = valueSetProvider.getDao().read(id);

	assertEquals("Influenza.Test.OID", vs.getId());
	assertEquals("1", vs.getVersion());
	assertEquals(1, vs.getExpansion().getContains().size());
	assertEquals("76077-7", vs.getExpansion().getContains().get(0)
			.getCode());
	assertEquals("http://loinc.org", vs.getExpansion().getContains().get(0)
			.getSystem());
}
 
开发者ID:Discovery-Research-Network-SCCM,项目名称:FHIR-CQL-ODM-service,代码行数:19,代码来源:FhirTerminologyProviderServiceIT.java

示例2: withDisjointValueSetsFromDirectory

import org.hl7.fhir.dstu3.model.ValueSet; //导入依赖的package包/类
/**
 * Returns all value sets that are disjoint with value sets stored in the given database and
 * adds them to our collection. The directory may be anything readable from a Spark path,
 * including local filesystems, HDFS, S3, or others.
 *
 * @param path a path from which disjoint value sets will be loaded
 * @param database the database to check value sets against
 * @return an instance of ValueSets that includes content from that directory that is disjoint
 *         with content already contained in the given database.
 */
public ValueSets withDisjointValueSetsFromDirectory(String path, String database) {

  Dataset<UrlAndVersion> currentMembers = this.spark.table(database + "." + VALUE_SETS_TABLE)
      .select("url", "version")
      .distinct()
      .as(URL_AND_VERSION_ENCODER)
      .alias("current");

  Dataset<ValueSet> valueSets = valueSetDatasetFromDirectory(path)
      .alias("new")
      .join(currentMembers, col("new.url").equalTo(col("current.url"))
          .and(col("new.version").equalTo(col("current.version"))),
          "leftanti")
      .as(VALUE_SET_ENCODER);

  return withValueSets(valueSets);
}
 
开发者ID:cerner,项目名称:bunsen,代码行数:28,代码来源:ValueSets.java

示例3: withValueSets

import org.hl7.fhir.dstu3.model.ValueSet; //导入依赖的package包/类
private ValueSets withValueSets(Dataset<ValueSet> newValueSets, Dataset<Value> newValues) {

    Dataset<UrlAndVersion> newMembers = getUrlAndVersions(newValueSets);

    // Instantiating a new composite ConceptMaps requires a new timestamp
    Timestamp timestamp = new Timestamp(System.currentTimeMillis());

    Dataset<ValueSet> newValueSetsWithTimestamp = newValueSets
        .withColumn("timestamp", lit(timestamp.toString()).cast("timestamp"))
        .as(VALUE_SET_ENCODER);

    return new ValueSets(spark,
        this.members.union(newMembers),
        this.valueSets.union(newValueSetsWithTimestamp),
        this.values.union(newValues));
  }
 
开发者ID:cerner,项目名称:bunsen,代码行数:17,代码来源:ValueSets.java

示例4: checkValueSet

import org.hl7.fhir.dstu3.model.ValueSet; //导入依赖的package包/类
private static void checkValueSet(ValueSet valueSet, String url, String version) {

    Assert.assertNotNull(
        MessageFormat.format("Could not find value set for url {0} and version {1}", url, version),
        valueSet);

    Assert.assertEquals(url, valueSet.getUrl());
    Assert.assertEquals(version, valueSet.getVersion());

    ConceptSetComponent inclusion = valueSet.getCompose().getIncludeFirstRep();

    Assert.assertEquals("urn:cerner:system", inclusion.getSystem());
    Assert.assertEquals("1", inclusion.getVersion());
    Assert.assertEquals("a", inclusion.getConceptFirstRep().getCode());

    Assert.assertEquals(1, valueSet.getCompose().getInclude().size());
  }
 
开发者ID:cerner,项目名称:bunsen,代码行数:18,代码来源:ValueSetsTest.java

示例5: testCreateSimpleValueSets

import org.hl7.fhir.dstu3.model.ValueSet; //导入依赖的package包/类
@Test
public void testCreateSimpleValueSets() {
  ValueSets valueSets = ValueSets.getEmpty(spark)
      .withValueSets(valueSet("urn:cerner:valueset:valueset1", "1"),
          valueSet("urn:cerner:valueset:valueset2", "1"));

  Dataset<Value> values = valueSets.getValues();

  Assert.assertEquals(2, values.count());

  ValueSet firstValueSet = valueSets.getValueSet("urn:cerner:valueset:valueset1", "1");
  checkValueSet(firstValueSet, "urn:cerner:valueset:valueset1", "1");

  ValueSet secondValueSet = valueSets.getValueSet("urn:cerner:valueset:valueset2", "1");
  checkValueSet(secondValueSet, "urn:cerner:valueset:valueset2", "1");
}
 
开发者ID:cerner,项目名称:bunsen,代码行数:17,代码来源:ValueSetsTest.java

示例6: testAppendValueSets

import org.hl7.fhir.dstu3.model.ValueSet; //导入依赖的package包/类
@Test
public void testAppendValueSets() {
  ValueSets original = ValueSets.getEmpty(spark)
      .withValueSets(valueSet("urn:cerner:valueset:valueset1", "1"),
          valueSet("urn:cerner:valueset:valueset2", "1"));

  ValueSets valueSets = original.withValueSets(valueSet("urn:cerner:valueset:valueset3", "1"));

  Assert.assertEquals(2, original.getValues().count());
  Assert.assertEquals(3, valueSets.getValues().count());

  ValueSet firstValueSet = valueSets.getValueSet("urn:cerner:valueset:valueset1", "1");
  checkValueSet(firstValueSet, "urn:cerner:valueset:valueset1", "1");

  ValueSet secondValueSet = valueSets.getValueSet("urn:cerner:valueset:valueset2", "1");
  checkValueSet(secondValueSet, "urn:cerner:valueset:valueset2", "1");

  ValueSet newValueSet = valueSets.getValueSet("urn:cerner:valueset:valueset3", "1");
  checkValueSet(newValueSet, "urn:cerner:valueset:valueset3", "1");
}
 
开发者ID:cerner,项目名称:bunsen,代码行数:21,代码来源:ValueSetsTest.java

示例7: testWithDisjointValueSetsFromDirectory

import org.hl7.fhir.dstu3.model.ValueSet; //导入依赖的package包/类
@Test
public void testWithDisjointValueSetsFromDirectory() {

  String database = "test_valuesets_disjoint";
  spark.sql("CREATE DATABASE " + database);

  ValueSets.getEmpty(spark)
      .withValueSetsFromDirectory("src/test/resources/valuesets")
      .writeToDatabase(database);

  ValueSets valueSets = ValueSets.getFromDatabase(spark, database)
      .withDisjointValueSetsFromDirectory("src/test/resources/valuesets", database);

  ValueSet marriedValueSet = valueSets.getValueSet(
      "urn:cerner:bunsen:valueset:married_maritalstatus",
      "0.0.1");

  Assert.assertEquals(1, valueSets.getValueSets().count());

  Assert.assertNotNull(marriedValueSet);
  Assert.assertEquals("urn:cerner:bunsen:valueset:married_maritalstatus",
      marriedValueSet.getUrl());
  Assert.assertEquals("0.0.1", marriedValueSet.getVersion());

}
 
开发者ID:cerner,项目名称:bunsen,代码行数:26,代码来源:ValueSetsTest.java

示例8: testWriteToNewTables

import org.hl7.fhir.dstu3.model.ValueSet; //导入依赖的package包/类
@Test
public void testWriteToNewTables() {

  String database = "test_valuesets_write";
  spark.sql("CREATE DATABASE " + database);

  ValueSets valueSets = ValueSets.getEmpty(spark)
      .withValueSetsFromDirectory("src/test/resources/valuesets");

  valueSets.writeToDatabase(database);

  ValueSets reloadedValueSets = ValueSets.getFromDatabase(spark, database);

  ValueSet marriedValueSet = reloadedValueSets
      .getValueSet("urn:cerner:bunsen:valueset:married_maritalstatus", "0.0.1");

  Assert.assertNotNull(marriedValueSet);
  Assert.assertEquals("urn:cerner:bunsen:valueset:married_maritalstatus",
      marriedValueSet.getUrl());
  Assert.assertEquals("0.0.1", marriedValueSet.getVersion());
  Assert.assertEquals(1, marriedValueSet.getCompose().getInclude().size());
}
 
开发者ID:cerner,项目名称:bunsen,代码行数:23,代码来源:ValueSetsTest.java

示例9: testExpandValues

import org.hl7.fhir.dstu3.model.ValueSet; //导入依赖的package包/类
@Test
public void testExpandValues() {

  ValueSet valueSet = ValueSets.getEmpty(spark)
      .withValueSets(valueSet("urn:cerner:valueset:valueset", "1"))
      .getValueSet("urn:cerner:valueset:valueset", "1");

  List<Value> values = ValueSets.expandValues(valueSet);

  Value expectedValue = new Value("urn:cerner:valueset:valueset",
      "1",
      "urn:cerner:system",
      "1",
      "a");

  Assert.assertEquals(1, values.size());
  Assert.assertEquals(expectedValue, values.get(0));
}
 
开发者ID:cerner,项目名称:bunsen,代码行数:19,代码来源:ValueSetsTest.java

示例10: expand

import org.hl7.fhir.dstu3.model.ValueSet; //导入依赖的package包/类
@Override
public Iterable<Code> expand(ValueSetInfo valueSet) throws ResourceNotFoundException {
  // TODO: Implement as ValueSet/$expand
  // http://hl7.org/fhir/2016Sep/valueset-operations.html#expand
  Parameters respParam = fhirClient
    .operation()
    .onInstance(new IdType("ValueSet", valueSet.getId()))
    .named("expand")
    .withNoParameters(Parameters.class)
    .execute();

  ValueSet expanded = (ValueSet) respParam.getParameter().get(0).getResource();
  List<Code> codes = new ArrayList<>();
  for (ValueSet.ValueSetExpansionContainsComponent codeInfo : expanded.getExpansion().getContains()) {
    Code nextCode = new Code()
      .withCode(codeInfo.getCode())
      .withSystem(codeInfo.getSystem())
      .withVersion(codeInfo.getVersion())
      .withDisplay(codeInfo.getDisplay());
    codes.add(nextCode);
  }
  return codes;
}
 
开发者ID:DBCG,项目名称:cql_engine,代码行数:24,代码来源:FhirTerminologyProvider.java

示例11: expand

import org.hl7.fhir.dstu3.model.ValueSet; //导入依赖的package包/类
@Override
public ValueSetExpansionOutcome expand(ValueSet source, ExpansionProfile profile) throws ETooCostly, IOException {
  String cacheKey = makeCacheKey(source, profile);
	if (expansions.containsKey(cacheKey))
		return expansions.get(cacheKey);
	ValueSetExpander vse = new ValueSetExpanderSimple(context, ValueSetExpansionCache.this);
	ValueSetExpansionOutcome vso = vse.expand(source, profile);
	if (vso.getError() != null) {
	  // well, we'll see if the designated server can expand it, and if it can, we'll cache it locally
		vso = context.expandVS(source, false, profile == null || !profile.getExcludeNested());
		if (cacheFolder != null) {
		FileOutputStream s = new FileOutputStream(Utilities.path(cacheFolder, makeFile(source.getUrl())));
		context.newXmlParser().setOutputStyle(OutputStyle.PRETTY).compose(s, vso.getValueset());
		s.close();
	}
	}
	if (vso.getValueset() != null)
	  expansions.put(cacheKey, vso);
	return vso;
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:21,代码来源:ValueSetExpansionCache.java

示例12: loadCache

import org.hl7.fhir.dstu3.model.ValueSet; //导入依赖的package包/类
private void loadCache() throws FHIRFormatError, IOException {
 File[] files = new File(cacheFolder).listFiles();
  for (File f : files) {
    if (f.getName().endsWith(".xml")) {
      final FileInputStream is = new FileInputStream(f);
      try {	   
      Resource r = context.newXmlParser().setOutputStyle(OutputStyle.PRETTY).parse(is);
      if (r instanceof OperationOutcome) {
        OperationOutcome oo = (OperationOutcome) r;
        expansions.put(ToolingExtensions.getExtension(oo,VS_ID_EXT).getValue().toString(),
          new ValueSetExpansionOutcome(new XhtmlComposer(XhtmlComposer.XML).composePlainText(oo.getText().getDiv()), TerminologyServiceErrorClass.UNKNOWN));
      } else {
        ValueSet vs = (ValueSet) r; 
        expansions.put(vs.getUrl(), new ValueSetExpansionOutcome(vs));
      }
      } finally {
        IOUtils.closeQuietly(is);
      }
    }
  }
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:22,代码来源:ValueSetExpansionCache.java

示例13: importValueSet

import org.hl7.fhir.dstu3.model.ValueSet; //导入依赖的package包/类
private ValueSet importValueSet(String value, List<ValueSetExpansionParameterComponent> params, ExpansionProfile profile)
    throws ETooCostly, TerminologyServiceException, FileNotFoundException, IOException {
  if (value == null)
    throw new TerminologyServiceException("unable to find value set with no identity");
  ValueSet vs = context.fetchResource(ValueSet.class, value);
  if (vs == null)
    throw new TerminologyServiceException("Unable to find imported value set " + value);
  ValueSetExpansionOutcome vso = factory.getExpander().expand(vs, profile);
  if (vso.getError() != null)
    throw new TerminologyServiceException("Unable to expand imported value set: " + vso.getError());
  if (vso.getService() != null)
    throw new TerminologyServiceException("Unable to expand imported value set " + value);
  if (vs.hasVersion())
    if (!existsInParams(params, "version", new UriType(vs.getUrl() + "|" + vs.getVersion())))
      params.add(new ValueSetExpansionParameterComponent().setName("version").setValue(new UriType(vs.getUrl() + "|" + vs.getVersion())));
  for (ValueSetExpansionParameterComponent p : vso.getValueset().getExpansion().getParameter()) {
    if (!existsInParams(params, p.getName(), p.getValue()))
      params.add(p);
  }
  canBeHeirarchy = false; // if we're importing a value set, we have to be combining, so we won't try for a heirarchy
  return vso.getValueset();
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:23,代码来源:ValueSetExpanderSimple.java

示例14: read

import org.hl7.fhir.dstu3.model.ValueSet; //导入依赖的package包/类
public ValueSet read(IIdType theId, RequestDetails theRequestDetails) {	
	ValueSet retVal = myEntityManager.find(ValueSet.class, theId.getIdPart());
	
	if (retVal == null) {
		throw new ResourceNotFoundException(theId);
	}				
	
	return retVal;
}
 
开发者ID:Discovery-Research-Network-SCCM,项目名称:FHIR-CQL-ODM-service,代码行数:10,代码来源:FhirValueSetDaoDstu3.java

示例15: ValueSets

import org.hl7.fhir.dstu3.model.ValueSet; //导入依赖的package包/类
private ValueSets(SparkSession spark,
    Dataset<UrlAndVersion> members,
    Dataset<ValueSet> valueSets,
    Dataset<Value> values) {

  this.spark = spark;
  this.members = members;
  this.valueSets = valueSets;
  this.values = values;
}
 
开发者ID:cerner,项目名称:bunsen,代码行数:11,代码来源:ValueSets.java


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