本文整理汇总了Java中org.opencds.cqf.cql.terminology.ValueSetInfo类的典型用法代码示例。如果您正苦于以下问题:Java ValueSetInfo类的具体用法?Java ValueSetInfo怎么用?Java ValueSetInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ValueSetInfo类属于org.opencds.cqf.cql.terminology包,在下文中一共展示了ValueSetInfo类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: in
import org.opencds.cqf.cql.terminology.ValueSetInfo; //导入依赖的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.terminology.ValueSetInfo; //导入依赖的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;
}
示例3: checkCodeMembership
import org.opencds.cqf.cql.terminology.ValueSetInfo; //导入依赖的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
示例4: expand
import org.opencds.cqf.cql.terminology.ValueSetInfo; //导入依赖的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
示例5: in
import org.opencds.cqf.cql.terminology.ValueSetInfo; //导入依赖的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();
}
示例6: in
import org.opencds.cqf.cql.terminology.ValueSetInfo; //导入依赖的package包/类
@Override
public boolean in(Code code, ValueSetInfo valueSet) throws ResourceNotFoundException {
for (Code c : expand(valueSet)) {
if (c == null) continue;
if (c.getCode().equals(code.getCode()) && c.getSystem().equals(code.getSystem())) {
return true;
}
}
return false;
}
示例7: expand
import org.opencds.cqf.cql.terminology.ValueSetInfo; //导入依赖的package包/类
@Override
public Iterable<Code> expand(ValueSetInfo valueSet) throws ResourceNotFoundException {
ValueSet vs = valueSetProvider.getDao().read(new IdType(valueSet.getId()));
List<Code> codes = new ArrayList<>();
for (ValueSet.ValueSetExpansionContainsComponent expansion : vs.getExpansion().getContains()) {
codes.add(new Code().withCode(expansion.getCode()).withSystem(expansion.getSystem()));
}
return codes;
}
示例8: retrieve
import org.opencds.cqf.cql.terminology.ValueSetInfo; //导入依赖的package包/类
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)
{
SearchParameterMap map = new SearchParameterMap();
map.setLastUpdated(new DateRangeParam());
if (templateId != null && !templateId.equals("")) {
// do something?
}
if (valueSet != null && valueSet.startsWith("urn:oid:")) {
valueSet = valueSet.replace("urn:oid:", "");
}
if (codePath == null && (codes != null || valueSet != null)) {
throw new IllegalArgumentException("A code path must be provided when filtering on codes or a valueset.");
}
if (dataType == null) {
throw new IllegalArgumentException("A data type (i.e. Procedure, Valueset, etc...) must be specified for clinical data retrieval");
}
if (context != null && context.equals("Patient") && contextValue != null) {
ReferenceParam patientParam = new ReferenceParam(contextValue.toString());
map.add(getPatientSearchParam(dataType), patientParam);
}
if (codePath != null && !codePath.equals("")) {
if (terminologyProvider != null && expandValueSets) {
ValueSetInfo valueSetInfo = new ValueSetInfo().withId(valueSet);
codes = terminologyProvider.expand(valueSetInfo);
}
if (codes != null) {
TokenOrListParam codeParams = new TokenOrListParam();
for (Code code : codes) {
codeParams.addOr(new TokenParam(code.getSystem(), code.getCode()));
}
map.add(convertPathToSearchParam(codePath), codeParams);
}
}
if (dateRange != null) {
DateParam low = null;
DateParam high = null;
if (dateRange.getLow() != null) {
low = new DateParam(ParamPrefixEnum.GREATERTHAN_OR_EQUALS, convertPathToSearchParam(dateLowPath != null ? dateLowPath : datePath));
}
if (dateRange.getHigh() != null) {
high = new DateParam(ParamPrefixEnum.LESSTHAN_OR_EQUALS, convertPathToSearchParam(dateHighPath != null ? dateHighPath : datePath));
}
DateRangeParam rangeParam;
if (low == null && high != null) {
rangeParam = new DateRangeParam(high);
}
else if (high == null && low != null) {
rangeParam = new DateRangeParam(low);
}
else {
rangeParam = new DateRangeParam(high, low);
}
map.add(convertPathToSearchParam(datePath), rangeParam);
}
JpaResourceProviderDstu3<? extends IAnyResource> jpaResProvider = resolveResourceProvider(dataType);
IBundleProvider bundleProvider = jpaResProvider.getDao().search(map);
List<IBaseResource> resourceList = bundleProvider.getResources(0, 50);
return resolveResourceList(resourceList);
}