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


Java Code类代码示例

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


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

示例1: in

import org.opencds.cqf.cql.runtime.Code; //导入依赖的package包/类
@Override
public boolean in(org.opencds.cqf.cql.runtime.Code code,
                  ValueSetInfo valueSet) {

    if(!valueSet.getId().isEmpty()){
    	List<Code> valueSetCodes = codes.get(valueSet.getId());
    	if(valueSetCodes == null){return false;}
    	for(Code valueSetCode: valueSetCodes){
    		if(valueSetCode.getCode().equalsIgnoreCase(code.getCode()) && valueSetCode.getSystem().equalsIgnoreCase(code.getSystem())){
    			//ignore display and version
    			return true;
    		}
    	}
    }

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

示例2: expand

import org.opencds.cqf.cql.runtime.Code; //导入依赖的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

示例3: loadExpectedResults

import org.opencds.cqf.cql.runtime.Code; //导入依赖的package包/类
private Iterable<Object> loadExpectedResults(org.hl7.fhirpath.tests.Test test) {
    List<Object> results = new ArrayList<>();
    if (test.getOutput() != null) {
        for (org.hl7.fhirpath.tests.Output output : test.getOutput()) {
            switch (output.getType()) {
                case BOOLEAN:
                    results.add(Boolean.valueOf(output.getValue()));
                    break;
                case DATE:
                    results.add(DateTime.fromJodaDateTime(org.joda.time.DateTime.parse(output.getValue())));
                    break;
                case INTEGER:
                    results.add(Integer.valueOf(output.getValue()));
                    break;
                case STRING:
                    results.add(output.getValue());
                    break;
                case CODE:
                    results.add(new Code().withCode(output.getValue()));
                    break;
            }
        }
    }

    return results;
}
 
开发者ID:DBCG,项目名称:cql_engine,代码行数:27,代码来源:TestFhirPath.java

示例4: toConcept

import org.opencds.cqf.cql.runtime.Code; //导入依赖的package包/类
public static Object toConcept(Object operand) {
    if (operand == null) {
        return null;
    }

    Concept result = new Concept();

    if (operand instanceof Iterable) {
        for (Object code : (Iterable) operand) {
            result.withCode((Code)code);
        }
    }
    else {
        result.withCode((Code) operand);
    }

    return result;
}
 
开发者ID:DBCG,项目名称:cql_engine,代码行数:19,代码来源:ToConceptEvaluator.java

示例5: checkCodeMembership

import org.opencds.cqf.cql.runtime.Code; //导入依赖的package包/类
public boolean checkCodeMembership(Object codeObj, String vsId) {
    Iterable<Coding> conceptCodes = ((CodeableConcept)codeObj).getCoding();
    for (Coding code : conceptCodes) {
        if (terminologyProvider.in(new Code()
                        .withCode(code.getCodeElement().getValue())
                        .withSystem(code.getSystem()),
                new ValueSetInfo().withId(vsId)))
        {
            return true;
        }
    }
    return false;
}
 
开发者ID:Discovery-Research-Network-SCCM,项目名称:FHIR-CQL-ODM-service,代码行数:14,代码来源:FileBasedFhirDstu2Provider.java

示例6: toCode

import org.opencds.cqf.cql.runtime.Code; //导入依赖的package包/类
protected Code toCode(Coding value) {
    Code code = new Code();
    return code.withCode(value.getCode())
    		.withDisplay(value.getDisplay())
    		.withSystem(value.getSystem())
    		.withVersion(value.getVersion());
}
 
开发者ID:Discovery-Research-Network-SCCM,项目名称:FHIR-CQL-ODM-service,代码行数:8,代码来源:UsciitgFhirDataProviderHL7.java

示例7: toConcept

import org.opencds.cqf.cql.runtime.Code; //导入依赖的package包/类
protected Concept toConcept(CodeableConcept value) {
    Concept concept = new Concept();
    List<Code> codes = new ArrayList<Code>();
    for(Coding coding : value.getCoding()){
        codes.add(toCode(coding));
    }
    concept.setCodes(codes);
    concept.setDisplay(value.getText());
    return concept;
}
 
开发者ID:Discovery-Research-Network-SCCM,项目名称:FHIR-CQL-ODM-service,代码行数:11,代码来源:UsciitgFhirDataProviderHL7.java

示例8: expand

import org.opencds.cqf.cql.runtime.Code; //导入依赖的package包/类
@Override
public Iterable<org.opencds.cqf.cql.runtime.Code> expand(
        ValueSetInfo valueSet) {
    if(!valueSet.getId().isEmpty()){
    	return codes.get(valueSet.getId());
    }

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

示例9: createValueSet

import org.opencds.cqf.cql.runtime.Code; //导入依赖的package包/类
private void createValueSet(String id){
    ValueSet valueSet = new ValueSet();
    Id oid = new Id();
    oid.setId(id);
    valueSet.setId(oid);
    valueSets.put(id, valueSet);
    
    List<Code> valueSetCodes = new ArrayList<Code>();        
    codes.put(id, valueSetCodes);
}
 
开发者ID:Discovery-Research-Network-SCCM,项目名称:FHIR-CQL-ODM-service,代码行数:11,代码来源:TestTerminologyProvider.java

示例10: addCode

import org.opencds.cqf.cql.runtime.Code; //导入依赖的package包/类
private void addCode(String id, String codeval, String system){
    Code code = new Code();
    code.setCode(codeval);
    code.setSystem(system);
    
    List<Code> valueSetCodes = codes.get(id);
    valueSetCodes.add(code);
}
 
开发者ID:Discovery-Research-Network-SCCM,项目名称:FHIR-CQL-ODM-service,代码行数:9,代码来源:TestTerminologyProvider.java

示例11: retrieve

import org.opencds.cqf.cql.runtime.Code; //导入依赖的package包/类
@Override
public Iterable<Object> retrieve(String context, Object contextValue, String dataType,
                                 String templateId, String codePath, Iterable<Code> codes,
                                 String valueSet, String datePath, String dateLowPath,
                                 String dateHighPath, Interval dateRange)
{
    return null;
}
 
开发者ID:DBCG,项目名称:cql_engine,代码行数:9,代码来源:BaseDataProviderDstu2.java

示例12: in

import org.opencds.cqf.cql.runtime.Code; //导入依赖的package包/类
@Override
public boolean in(Code code, ValueSetInfo valueSet) throws ResourceNotFoundException {
    // Implement as ValueSet/$validate-code
    // http://hl7.org/fhir/2016Sep/valueset-operations.html#validate-code

    // Potential problems:
    // ValueSetInfo void of id --> want .ontype() instead
    Parameters respParam;
    if (code.getSystem() != null) {
        respParam = fhirClient
                .operation()
                .onInstance(new IdType("ValueSet", valueSet.getId()))
                // .onType(ValueSet.class)
                .named("validate-code")
                .withParameter(Parameters.class, "code", new StringType(code.getCode()))
                .andParameter("system", new StringType(code.getSystem()))
                .useHttpGet()
                .execute();
    }
    else {
        respParam = fhirClient
                .operation()
                .onInstance(new IdType("ValueSet", valueSet.getId()))
                // .onType(ValueSet.class)
                .named("validate-code")
                .withParameter(Parameters.class, "code", new StringType(code.getCode()))
                .useHttpGet()
                .execute();
    }
    return ((BooleanType)respParam.getParameter().get(0).getValue()).booleanValue();
}
 
开发者ID:DBCG,项目名称:cql_engine,代码行数:32,代码来源:FhirTerminologyProvider.java

示例13: lookup

import org.opencds.cqf.cql.runtime.Code; //导入依赖的package包/类
@Override
public Code lookup(Code code, CodeSystemInfo codeSystem) throws ResourceNotFoundException {
  // TODO: Implement as CodeSystem/$lookup
  // http://hl7.org/fhir/2016Sep/codesystem-operations.html#lookup
  Parameters respParam = fhirClient
        .operation()
        .onType(CodeSystem.class)
        .named("lookup")
        .withParameter(Parameters.class, "code", new CodeType(code.getCode()))
        .andParameter("system", new UriType(codeSystem.getId()))
        .execute();

  return code.withSystem(codeSystem.getId())
             .withDisplay(((StringType)respParam.getParameter().get(1).getValue()).getValue());
}
 
开发者ID:DBCG,项目名称:cql_engine,代码行数:16,代码来源:FhirTerminologyProvider.java

示例14: compareResults

import org.opencds.cqf.cql.runtime.Code; //导入依赖的package包/类
private Boolean compareResults(Object expectedResult, Object actualResult) {
    // Perform FHIR system-defined type conversions
    if (actualResult instanceof Enumeration) {
        actualResult = new Code().withCode(((Enumeration)actualResult).getValueAsString());
    }
    else if (actualResult instanceof BooleanType) {
        actualResult = ((BooleanType)actualResult).getValue();
    }
    else if (actualResult instanceof IntegerType) {
        actualResult = ((IntegerType)actualResult).getValue();
    }
    else if (actualResult instanceof DecimalType) {
        actualResult = ((DecimalType)actualResult).getValue();
    }
    else if (actualResult instanceof StringType) {
        actualResult = ((StringType)actualResult).getValue();
    }
    else if (actualResult instanceof BaseDateTimeType) {
        actualResult = DateTime.fromJavaDate(((BaseDateTimeType)actualResult).getValue());
    }
    else if (actualResult instanceof Quantity) {
        Quantity quantity = (Quantity)actualResult;
        actualResult = new org.opencds.cqf.cql.runtime.Quantity()
                .withValue(quantity.getValue())
                .withUnit(quantity.getUnit());
    }
    else if (actualResult instanceof Coding) {
        Coding coding = (Coding)actualResult;
        actualResult = new Code()
                .withCode(coding.getCode())
                .withDisplay(coding.getDisplay())
                .withSystem(coding.getSystem())
                .withVersion(coding.getVersion());
    }
    return EqualEvaluator.equal(expectedResult, actualResult);
}
 
开发者ID:DBCG,项目名称:cql_engine,代码行数:37,代码来源:TestFhirPath.java

示例15: evaluate

import org.opencds.cqf.cql.runtime.Code; //导入依赖的package包/类
@Override
public Object evaluate(Context context) {
  ArrayList<Code> codes = new ArrayList<>();
  for (int i = 0; i < this.getCode().size(); ++i) {
    codes.add((Code)this.getCode().get(i).evaluate(context));
  }
  String display = this.getDisplay();
  return new org.opencds.cqf.cql.runtime.Concept().withCodes(codes).withDisplay(display);
}
 
开发者ID:DBCG,项目名称:cql_engine,代码行数:10,代码来源:ConceptEvaluator.java


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