use of org.hl7.fhir.r4.model.Expression in project clinical_quality_language by cqframework.
the class TakeInvocation method setOperands.
@Override
public void setOperands(Iterable<Expression> operands) {
boolean first = true;
for (Expression operand : operands) {
if (first) {
((Slice) expression).setSource(operand);
first = false;
} else {
((Slice) expression).setEndIndex(operand);
}
}
}
use of org.hl7.fhir.r4.model.Expression in project clinical_quality_language by cqframework.
the class TimeInvocation method getOperands.
@Override
public Iterable<Expression> getOperands() {
Time t = (Time) expression;
List<Expression> opList = Arrays.asList(t.getHour(), t.getMinute(), t.getSecond(), t.getMillisecond());
// If the last expression is null, we should trim this down
int i;
for (i = 3; i > 0 && opList.get(i) == null; i--) ;
return opList.subList(0, i + 1);
}
use of org.hl7.fhir.r4.model.Expression in project clinical_quality_language by cqframework.
the class FunctionRefInvocation method setResolution.
@Override
public void setResolution(OperatorResolution resolution) {
super.setResolution(resolution);
FunctionRef fr = (FunctionRef) expression;
if (resolution.getLibraryName() != null && !resolution.getLibraryName().equals(fr.getLibraryName())) {
fr.setLibraryName(resolution.getLibraryName());
}
}
use of org.hl7.fhir.r4.model.Expression in project clinical_quality_language by cqframework.
the class IndexOfInvocation method setOperands.
@Override
public void setOperands(Iterable<Expression> operands) {
Iterator<Expression> it = operands.iterator();
if (!it.hasNext()) {
throw new IllegalArgumentException("IndexOf operation requires two operands.");
}
IndexOf indexOf = (IndexOf) expression;
indexOf.setSource(it.next());
if (!it.hasNext()) {
throw new IllegalArgumentException("IndexOf operation requires two operands.");
}
indexOf.setElement(it.next());
if (it.hasNext()) {
throw new IllegalArgumentException("IndexOf operation requires two operands.");
}
}
use of org.hl7.fhir.r4.model.Expression in project clinical_quality_language by cqframework.
the class NaryExpressionInvocation method setOperands.
@Override
public void setOperands(Iterable<Expression> operands) {
List<Expression> expOperands = ((NaryExpression) expression).getOperand();
expOperands.clear();
for (Expression operand : operands) {
expOperands.add(operand);
}
}
Aggregations