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


Java ValueSet.setId方法代码示例

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


在下文中一共展示了ValueSet.setId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: transform

import org.hl7.fhir.dstu3.model.ValueSet; //导入方法依赖的package包/类
@Override
public ValueSet transform(final ValueSetEntity valueSetEntity) {
    final ValueSet valueSet = new ValueSet();

    valueSet.setDescription(valueSetEntity.getDescription());
    valueSet.setName(valueSetEntity.getName());
    if (valueSetEntity.getStrId() != null) {
        valueSet.setId(valueSetEntity.getStrId());
    }
    else {
        valueSet.setId(valueSetEntity.getId().toString());
    }
    valueSet.setUrl(valueSetEntity.getUrl());

    valueSet.setStatus(valueSetEntity.getStatus());

    log.trace("ValueSetEntity name ="+valueSetEntity.getName());

    if (valueSetEntity.getCodeSystem() != null) {
        log.trace("CodeSystem Id = "+valueSetEntity.getCodeSystem().getId());
    }
    // Hard coded to not attempt to retrieve SNOMED!


    for (ValueSetInclude includeEntity : valueSetEntity.getIncludes()) {
        log.trace("Compose CodeSystem : "+includeEntity.getSystem());
        ValueSet.ConceptSetComponent include = valueSet.getCompose().addInclude().setSystem(includeEntity.getSystem());

        for (ValueSetIncludeConcept
                conceptEntity : includeEntity.getConcepts()) {
            include.addConcept()
                    .setCode(conceptEntity.getConcept().getCode())
                    .setDisplay(conceptEntity.getConcept().getDisplay());
        }
        for (ValueSetIncludeFilter filterEntity : includeEntity.getFilters()) {
            include.addFilter()
                    .setOp(filterEntity.getOperator())
                    .setValue(filterEntity.getValue().getCode());
        }
    }



    return valueSet;



    // STU 3 Removed
    /*
    if ((valueSetEntity.getCodeSystem() != null) && (valueSetEntity.getCodeSystem().getId() != 9)) {
        // ONly for DSTU2 - This should be in the CodeSystemEntity for STU3
     //   ValueSet.ValueSetCodeSystemComponent valueSetCodeSystemComponent = new ValueSet.ValueSetCodeSystemComponent();
      //  valueSetCodeSystemComponent.setSystem(valueSetEntity.getCodeSystem().getCodeSystemUri());

     //   valueSet.setCodeSystem(valueSetCodeSystemComponent);
        log.info("Internal CodeSystem: "+valueSetEntity.getCodeSystem().getCodeSystemUri()+" size="+valueSetEntity.getCodeSystem().getConcepts().size());
        if (valueSetEntity.getCodeSystem().getConcepts().size() < 1000) {
            for (ConceptEntity concept : valueSetEntity.getCodeSystem().getConcepts()) {

                    ValueSet.ConceptDefinitionComponent CSconcept = valueSetCodeSystemComponent.addConcept()
                            .setCode(concept.getCode())
                            .setDisplay(concept.getDisplay());
                    if (concept.getDescription() != null) {
                        CSconcept.setDefinition(concept.getDescription());
                    }

                    getChildCodes(concept, CSconcept);
                }
            }
        }
    }
    */
}
 
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:74,代码来源:ValueSetEntityToFHIRValueSetTransformer.java

示例3: uploadDefinitionsCareConnectDstu2

import org.hl7.fhir.dstu3.model.ValueSet; //导入方法依赖的package包/类
private void uploadDefinitionsCareConnectDstu2(String targetServer, FhirContext ctx,String careConnectServer) throws CommandFailureException {
     IGenericClient client = newClient(ctx, targetServer);

     ourLog.info("Uploading definitions to server: " + targetServer);

    // IGenericClient clientCareConnect = newClient(ctx, careConnectServer);
     ourLog.info("From server: " + careConnectServer);

     long start = System.currentTimeMillis();

     String vsContents;


     Bundle bundle = null;
     try {
         URL url = new URL(careConnectServer+"/ValueSet?_format=xml");

         HttpURLConnection con = (HttpURLConnection) url.openConnection();
         con.setRequestProperty("Accept","application/xml");
         con.setRequestMethod("GET");
         con.setDoOutput(true);
         con.setDoInput(true);
         con.setUseCaches(false);
         con.setConnectTimeout(1000 * 5);
         con.connect();


         int responseCode = con.getResponseCode();

         ourLog.info("Resonse Code "+ responseCode);
         System.out.println("Resonse Code "+ responseCode);


         BufferedReader br = new BufferedReader(new InputStreamReader(con.getInputStream()));


bundle = ctx.newXmlParser().parseResource(Bundle.class,br);

     } catch (Exception e) {
         throw new CommandFailureException(e.toString());
     }


     int total = bundle.getEntry().size();
     int count = 1;
     for (Bundle.BundleEntryComponent i : bundle.getEntry()) {
         ValueSet next = (ValueSet) i.getResource();
         next.setId(next.getIdElement().toUnqualifiedVersionless());
        // System.out.println("Uploading ValueSet "+ next.getUrl());
         ourLog.info("Uploading ValueSet {}/{} : {}", new Object[]{count, total, next.getIdElement().getValue()});

         try {
             client.update().resource(next).execute();
         }
         catch (Exception ex) {
             System.out.println("ValueSet "+ next.getUrl() + " ERROR " +ex.getMessage());
         }

         count++;
     }



     ourLog.info("Finished uploading ValueSets");



     long delay = System.currentTimeMillis() - start;

     ourLog.info("Finished uploading definitions to server (took {} ms)", delay);
 }
 
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:72,代码来源:ValidationDataUploader.java


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