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


Java VersionedIdentifier类代码示例

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


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

示例1: resolveLibrary

import org.cqframework.cql.elm.execution.VersionedIdentifier; //导入依赖的package包/类
private Library resolveLibrary(VersionedIdentifier libraryIdentifier) throws FileNotFoundException, ExecutionException, JAXBException {
    if (libraryIdentifier == null) {
        throw new IllegalArgumentException("Library identifier is null.");
    }

    if (libraryIdentifier.getId() == null) {
        throw new IllegalArgumentException("Library identifier id is null.");
    }

    Library library = libraries.get(libraryIdentifier.getId());
    if (library != null && libraryIdentifier.getVersion() != null && !libraryIdentifier.getVersion().equals(library.getIdentifier().getVersion())) {
        throw new IllegalArgumentException(String.format("Could not load library %s, version %s because version %s is already loaded.",
                libraryIdentifier.getId(), libraryIdentifier.getVersion(), library.getIdentifier().getVersion()));
    }
    else {
        library = loadLibrary(libraryIdentifier);
        libraries.put(libraryIdentifier.getId(), library);
    }

    return library;
}
 
开发者ID:Discovery-Research-Network-SCCM,项目名称:FHIR-CQL-ODM-service,代码行数:22,代码来源:LibraryLoaderImpl.java

示例2: testInValueSetCql

import org.cqframework.cql.elm.execution.VersionedIdentifier; //导入依赖的package包/类
@Test
  public void testInValueSetCql() throws IOException, JAXBException {
      terminologyProvider = new JpaFhirTerminologyProvider(fhirTerminologyProviderService.getValueSetProvider(),
              fhirTerminologyProviderService.getCodeSystemProvider());
      dataProvider.setTerminologyProvider(terminologyProvider);
     
UsciitgLibraryManager libraryManager = new UsciitgLibraryManager(
		new ModelManager(),
		System.getProperty("user.dir") + "/src/test/resources/org/partners/usciitg_prep/fhir/cql");
LibraryLoader libraryLoader = new LibraryLoaderImpl(libraryManager);
VersionedIdentifier libraryIdentifier = new VersionedIdentifier()
	.withId("terminology_test");

      contextValues.clear();
      contextValues.put("Patient", "fhirTest");

      Map<String, Object> results;

      CqlExecutor executor = new CqlFhirExecutorImpl(dataProvider, terminologyProvider, libraryIdentifier, libraryLoader);
      results = executor.execute(contextValues, contextParameters);

      assertEquals(true, (Boolean) results.get("fluinvalueset"));
      assertEquals(true, (Boolean) results.get("antiviralinvalueset"));
  }
 
开发者ID:Discovery-Research-Network-SCCM,项目名称:FHIR-CQL-ODM-service,代码行数:25,代码来源:JpaFhirTerminologyProviderIT.java

示例3: getData

import org.cqframework.cql.elm.execution.VersionedIdentifier; //导入依赖的package包/类
public Map<String, Object> getData(String path, VersionedIdentifier libraryIdentifier, String endpoint, 
		String PatientId, String encounterStart, String encounterEnd) throws JAXBException {
	setupDataProvider(endpoint);	
	LibraryLoader libraryLoader = new LibraryLoaderImpl(getLibraryManager(path));

	contextValues.clear();
	contextValues.put("Patient", PatientId);

	contextParameters.clear();
	DateTime encounterStartCqf = createCqfDateTime(encounterStart); 
	contextParameters.put("EncounterStart", encounterStartCqf);
	if(encounterEnd != null){
		DateTime encounterEndCqf = createCqfDateTime(encounterEnd); 	
		contextParameters.put("EncounterEnd", encounterEndCqf);	
	}

	Map<String, Object> results = null;
	
	CqlExecutor executor = new CqlFhirExecutorImpl(dataProvider, terminologyProvider, libraryIdentifier, libraryLoader);		
	logger.debug("Start executor Patient: " + PatientId);
	results = executor.execute(contextValues, contextParameters);
	logger.debug("End executor Patient: " + PatientId);

	return results;
}
 
开发者ID:Discovery-Research-Network-SCCM,项目名称:FHIR-CQL-ODM-service,代码行数:26,代码来源:FhirUtil.java

示例4: resolveLibrary

import org.cqframework.cql.elm.execution.VersionedIdentifier; //导入依赖的package包/类
private Library resolveLibrary(VersionedIdentifier libraryIdentifier) {
    if (libraryIdentifier == null) {
        throw new IllegalArgumentException("Library identifier is null.");
    }

    if (libraryIdentifier.getId() == null) {
        throw new IllegalArgumentException("Library identifier id is null.");
    }

    Library library = libraries.get(libraryIdentifier.getId());
    if (library != null && libraryIdentifier.getVersion() != null && !libraryIdentifier.getVersion().equals(library.getIdentifier().getVersion())) {
        throw new IllegalArgumentException(String.format("Could not load library %s, version %s because version %s is already loaded.",
                libraryIdentifier.getId(), libraryIdentifier.getVersion(), library.getIdentifier().getVersion()));
    }
    else {
        library = loadLibrary(libraryIdentifier);
        libraries.put(libraryIdentifier.getId(), library);
    }

    return library;
}
 
开发者ID:DBCG,项目名称:cql_engine,代码行数:22,代码来源:TestLibraryLoader.java

示例5: resolveLibrary

import org.cqframework.cql.elm.execution.VersionedIdentifier; //导入依赖的package包/类
private Library resolveLibrary(VersionedIdentifier libraryIdentifier) {
    if (libraryIdentifier == null) {
        throw new IllegalArgumentException("Library identifier is null.");
    }

    if (libraryIdentifier.getId() == null) {
        throw new IllegalArgumentException("Library identifier id is null.");
    }

    Library library = libraries.get(libraryIdentifier.getId());
    if (library != null && libraryIdentifier.getVersion() != null
            && !libraryIdentifier.getVersion().equals(library.getIdentifier().getVersion())) {
        throw new IllegalArgumentException(String.format("Could not load library %s, version %s because version %s is already loaded.",
                libraryIdentifier.getId(), libraryIdentifier.getVersion(), library.getIdentifier().getVersion()));
    }
    else {
        library = loadLibrary(libraryIdentifier);
        libraries.put(libraryIdentifier.getId(), library);
    }

    return library;
}
 
开发者ID:DBCG,项目名称:cqf-ruler,代码行数:23,代码来源:STU3LibraryLoader.java

示例6: CqlFhirExecutorImpl

import org.cqframework.cql.elm.execution.VersionedIdentifier; //导入依赖的package包/类
public CqlFhirExecutorImpl(DataProvider dataProvider, TerminologyProvider terminologyProvider,
		VersionedIdentifier libraryIdentifier, LibraryLoader libraryLoader){
    super(dataProvider, terminologyProvider, libraryIdentifier, libraryLoader);

    //assumes modelUri is fhir
    context.registerDataProvider("http://hl7.org/fhir", dataProvider);
}
 
开发者ID:Discovery-Research-Network-SCCM,项目名称:FHIR-CQL-ODM-service,代码行数:8,代码来源:CqlFhirExecutorImpl.java

示例7: CqlExecutor

import org.cqframework.cql.elm.execution.VersionedIdentifier; //导入依赖的package包/类
public CqlExecutor(DataProvider dataProvider, TerminologyProvider terminologyProvider,
		VersionedIdentifier libraryIdentifier, org.opencds.cqf.cql.execution.LibraryLoader libraryLoader){
    this.libraryIdentifier = libraryIdentifier;
    this.libraryLoader = libraryLoader;
    library = libraryLoader.load(libraryIdentifier);
    this.dataProvider = dataProvider;
    this.terminologyProvider = terminologyProvider;
    
    context = new Context(library);
    context.setExpressionCaching(true);
    context.registerTerminologyProvider(terminologyProvider);
    if(libraryLoader != null){
        context.registerLibraryLoader(libraryLoader);
    }
}
 
开发者ID:Discovery-Research-Network-SCCM,项目名称:FHIR-CQL-ODM-service,代码行数:16,代码来源:CqlExecutor.java

示例8: setContextParameters

import org.cqframework.cql.elm.execution.VersionedIdentifier; //导入依赖的package包/类
public void setContextParameters(VersionedIdentifier libraryIdentifier, Map<String, Object> contextParameters){
    if(contextParameters == null){
        return;
    }

    for(Map.Entry<String, Object> entry: contextParameters.entrySet()){
        //only sets params in top level library
        context.setParameter(library.getLocalId(), entry.getKey(), entry.getValue());
    }
}
 
开发者ID:Discovery-Research-Network-SCCM,项目名称:FHIR-CQL-ODM-service,代码行数:11,代码来源:CqlExecutor.java

示例9: getCachedLibrary

import org.cqframework.cql.elm.execution.VersionedIdentifier; //导入依赖的package包/类
private Library getCachedLibrary(VersionedIdentifier libraryIdentifier) {
	org.hl7.elm.r1.VersionedIdentifier vi = new org.hl7.elm.r1.VersionedIdentifier()
	.withId(libraryIdentifier.getId())
	.withSystem(libraryIdentifier.getSystem())
	.withVersion(libraryIdentifier.getVersion());
	InputStream is = this.getLibrarySourceLoader().getLibrarySource(vi);			
			
	if(is == null){
		return null;
	}

	Library library = null;
	try {
		library = readLibrary(is);
	} catch (JAXBException e) {
		// failed to parse xml, try cql
		// not ideal, but caching so should not need to load often		
		try {
			is = this.getLibrarySourceLoader().getLibrarySource(vi);	
			library = readCqlLibrary(is);
		} catch (JAXBException | IOException e1) {
			throw new IllegalArgumentException(String.format("Could not load source for library %s.", libraryIdentifier.getId()), e1);
		}
	}
	
	return library;
}
 
开发者ID:Discovery-Research-Network-SCCM,项目名称:FHIR-CQL-ODM-service,代码行数:28,代码来源:UsciitgLibraryManager.java

示例10: load

import org.cqframework.cql.elm.execution.VersionedIdentifier; //导入依赖的package包/类
@Override
  public Library load(VersionedIdentifier libraryIdentifier) {
      try {
	return resolveLibrary(libraryIdentifier);
} catch (FileNotFoundException | ExecutionException | JAXBException e) {
	throw new IllegalArgumentException("Unable to load Library identifier.", e);
}
  }
 
开发者ID:Discovery-Research-Network-SCCM,项目名称:FHIR-CQL-ODM-service,代码行数:9,代码来源:LibraryLoaderImpl.java

示例11: testGetLibraryCql

import org.cqframework.cql.elm.execution.VersionedIdentifier; //导入依赖的package包/类
@Test
public void testGetLibraryCql() throws ExecutionException, JAXBException, IOException {
	ModelManager modelManager = new ModelManager();
	UsciitgLibraryManager libraryManager = new UsciitgLibraryManager(
			modelManager,
			System.getProperty("user.dir") + "/src/test/resources/org/partners/usciitg_prep/fhir/cql");		

	VersionedIdentifier libraryIdentifier = new VersionedIdentifier()
		.withId("test_flu_study");
	Library library = libraryManager.getLibrary(libraryIdentifier);
	assertNotNull(library);
}
 
开发者ID:Discovery-Research-Network-SCCM,项目名称:FHIR-CQL-ODM-service,代码行数:13,代码来源:UsciitgLibraryManagerTest.java

示例12: testGetLibraryXml

import org.cqframework.cql.elm.execution.VersionedIdentifier; //导入依赖的package包/类
@Test
public void testGetLibraryXml() throws FileNotFoundException, ExecutionException, JAXBException {
	UsciitgLibraryManager libraryManager = new UsciitgLibraryManager(
			new ModelManager(),
			System.getProperty("user.dir") + "/src/test/resources/org/partners/usciitg_prep/fhir/cql");
	VersionedIdentifier libraryIdentifier = new VersionedIdentifier()
		.withId("usciitg_flu_study");
	Library library = libraryManager.getLibrary(libraryIdentifier);
	assertNotNull(library);
}
 
开发者ID:Discovery-Research-Network-SCCM,项目名称:FHIR-CQL-ODM-service,代码行数:11,代码来源:UsciitgLibraryManagerTest.java

示例13: testExecuteFluStudyCql

import org.cqframework.cql.elm.execution.VersionedIdentifier; //导入依赖的package包/类
@Test
  public void testExecuteFluStudyCql() throws IOException, JAXBException {       
  	FileBasedFhirDstu2Provider cqlDataProvider = new FileBasedFhirDstu2Provider(
  			System.getProperty("user.dir") + "/src/test/resources/org/partners/usciitg_prep/fhir/cql/data", 
  			null,
  			true);
  	UsciitgLibraryManager libraryManager = new UsciitgLibraryManager(
  			new ModelManager(),
  			System.getProperty("user.dir") + "/src/test/resources/org/partners/usciitg_prep/fhir/cql");
LibraryLoader libraryLoader = new LibraryLoaderImpl(libraryManager);
VersionedIdentifier libraryIdentifier = new VersionedIdentifier()
	.withId("test_flu_study");

      contextValues.clear();
      contextValues.put("Patient", "fhirTest");

      contextParameters.clear();
      DateTime encounterStart = createCqfDateTime("2016-05-29T09:00:00");
      DateTime encounterEnd = createCqfDateTime("2016-06-30");
      contextParameters.put("EncounterStart", encounterStart);
      contextParameters.put("EncounterEnd", encounterEnd);

      Map<String, Object> results;

      CqlExecutor executor = new CqlFhirExecutorImpl(cqlDataProvider, terminologyProvider, libraryIdentifier, libraryLoader);
      results = executor.execute(contextValues, contextParameters);

      assertEquals(String.valueOf(2), (String) results.get("sex"));        
      assertEquals("true", (String) results.get("flu"));
  }
 
开发者ID:Discovery-Research-Network-SCCM,项目名称:FHIR-CQL-ODM-service,代码行数:31,代码来源:FileBasedFhirDstu2ProviderIT.java

示例14: testExecuteFluStudy

import org.cqframework.cql.elm.execution.VersionedIdentifier; //导入依赖的package包/类
private Map<String, Object> testExecuteFluStudy(String endpoint, String patientId, String encounterStart, String encounterEnd) throws IOException, JAXBException {
	UsciitgFhirDataProviderHL7 dataProvider = new UsciitgFhirDataProviderHL7();
	dataProvider.setFhirContext(FhirContext.forDstu2Hl7Org());
	dataProvider.setPackageName("org.hl7.fhir.instance.model");
	dataProvider.setEndpoint(endpoint);

	TerminologyProvider terminologyProvider = new TestTerminologyProvider();
	dataProvider.setTerminologyProvider(terminologyProvider);			
	
	UsciitgLibraryManager libraryManager = new UsciitgLibraryManager(
			new ModelManager(),
			System.getProperty("user.dir") + "/src/test/resources/org/partners/usciitg_prep/fhir/cql");
	LibraryLoader libraryLoader = new LibraryLoaderImpl(libraryManager);
	VersionedIdentifier libraryIdentifier = new VersionedIdentifier()
		.withId("usciitg_flu_study");
	
	Map<String, Object> contextValues = new HashMap<String, Object>();
	Map<String, Object> contextParameters = new HashMap<String, Object>();
	Map<String, Object> results;

	contextValues.put("Patient", patientId);

	DateTime encounterStartDt = createCqfDateTime(encounterStart);
	DateTime encounterEndDt = createCqfDateTime(encounterEnd);
	contextParameters.put("EncounterStart", encounterStartDt);
	contextParameters.put("EncounterEnd", encounterEndDt);

	CqlExecutor executor = new CqlFhirExecutorImpl(dataProvider, terminologyProvider, libraryIdentifier, libraryLoader);
	results = executor.execute(contextValues, contextParameters);
	
	return results;
}
 
开发者ID:Discovery-Research-Network-SCCM,项目名称:FHIR-CQL-ODM-service,代码行数:33,代码来源:UsciitgFhirDataProviderHL7IT.java

示例15: loadHapiTestData

import org.cqframework.cql.elm.execution.VersionedIdentifier; //导入依赖的package包/类
/**
 * Load test data files onto HAPI test server using FileBasedFhirDstu2Provider
 * Assumes each resource has an identifier with system http://mcm.usciitg-prep.org 
 * and value equal to json file resource Id
 * 
 * @throws JAXBException
 */
@BeforeClass  
public static void loadHapiTestData() throws JAXBException {
	FhirContext fhirContext = FhirContext.forDstu2Hl7Org();
	FileBasedFhirDstu2Provider provider = new FileBasedFhirDstu2Provider(System.getProperty("user.dir") + "/src/test/resources/org/partners/usciitg_prep/fhir/cql/data", null);
	provider.setFhirContext(fhirContext);
	provider.setPackageName("org.hl7.fhir.instance.model");

	UsciitgLibraryManager libraryManager = new UsciitgLibraryManager(
			new ModelManager(),
			System.getProperty("user.dir") + "/src/test/resources/org/partners/usciitg_prep/fhir/cql");
	LibraryLoader libraryLoader = new LibraryLoaderImpl(libraryManager);
	VersionedIdentifier libraryIdentifier = new VersionedIdentifier()
		.withId("usciitg_flu_study");
	Context context = new Context(libraryLoader.load(libraryIdentifier));

	TerminologyProvider terminologyProvider = new TestTerminologyProvider();
	provider.setTerminologyProvider(terminologyProvider);

	context.registerDataProvider("http://hl7.org/fhir", provider);
	context.registerTerminologyProvider(terminologyProvider);

	context.setContextValue("Patient", "fhirTest");

	IGenericClient client = fhirContext.newRestfulGenericClient("http://fhirtest.uhn.ca/baseDstu2");

	Iterable<Object> resources = provider.retrieve("Patient", "fhirTest", "Patient", null, null, null, null, null, null, null, null);		
	createServerResources(client, resources, "Patient");		
	resources = provider.retrieve("Patient", "fhirTest", "Observation", null, null, null, null, null, null, null, null);
	deleteServerResources(client, resources, "Observation");
	createServerResources(client, resources, "Observation");
	resources = provider.retrieve("Patient", "fhirTest", "MedicationOrder", null, null, null, null, null, null, null, null);
	deleteServerResources(client, resources, "MedicationOrder");
	createServerResources(client, resources, "MedicationOrder");
	resources = provider.retrieve("Patient", "fhirTest", "Immunization", null, null, null, null, null, null, null, null);
	deleteServerResources(client, resources, "Immunization");
	createServerResources(client, resources, "Immunization");
}
 
开发者ID:Discovery-Research-Network-SCCM,项目名称:FHIR-CQL-ODM-service,代码行数:45,代码来源:UsciitgFhirDataProviderHL7IT.java


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