當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。