Class Case
java.lang.Object
org.opencds.cqf.cql.engine.elm.execution.Executable
org.cqframework.cql.elm.execution.Element
org.cqframework.cql.elm.execution.Expression
org.cqframework.cql.elm.execution.Case
- All Implemented Interfaces:
org.jvnet.jaxb2_commons.lang.Equals2,org.jvnet.jaxb2_commons.lang.HashCode2,org.jvnet.jaxb2_commons.lang.ToString2
- Direct Known Subclasses:
CaseEvaluator
public class Case
extends Expression
implements org.jvnet.jaxb2_commons.lang.Equals2, org.jvnet.jaxb2_commons.lang.HashCode2, org.jvnet.jaxb2_commons.lang.ToString2
The Case operator allows for multiple conditional expressions to be chained together in a single expression, rather than having to nest multiple If operators. In addition, the comparand operand provides a variant on the case that allows a single value to be compared in each conditional.
If a comparand is not provided, the type of each when element of the caseItems within the Case is expected to be boolean. If a comparand is provided, the type of each when element of the caseItems within the Case is expected to be of the same type as the comparand. An else element must always be provided.
The static type of the then argument within the first caseItem determines the type of the result, and the then argument of each subsequent caseItem and the else argument must be of that same type.
Java class for Case complex type.
The following schema fragment specifies the expected content contained within this class.
<complexType name="Case">
<complexContent>
<extension base="{urn:hl7-org:elm:r1}Expression">
<sequence>
<element name="comparand" type="{urn:hl7-org:elm:r1}Expression" minOccurs="0"/>
<element name="caseItem" type="{urn:hl7-org:elm:r1}CaseItem" maxOccurs="unbounded"/>
<element name="else" type="{urn:hl7-org:elm:r1}Expression"/>
</sequence>
</extension>
</complexContent>
</complexType>
-
Field Summary
FieldsFields inherited from class org.cqframework.cql.elm.execution.Element
annotation, localId, locator, resultTypeName, resultTypeSpecifier -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappend(org.jvnet.jaxb2_commons.locator.ObjectLocator locator, StringBuilder buffer, org.jvnet.jaxb2_commons.lang.ToStringStrategy2 strategy) appendFields(org.jvnet.jaxb2_commons.locator.ObjectLocator locator, StringBuilder buffer, org.jvnet.jaxb2_commons.lang.ToStringStrategy2 strategy) booleanbooleanequals(org.jvnet.jaxb2_commons.locator.ObjectLocator thisLocator, org.jvnet.jaxb2_commons.locator.ObjectLocator thatLocator, Object object, org.jvnet.jaxb2_commons.lang.EqualsStrategy2 strategy) Gets the value of the caseItem property.Gets the value of the comparand property.getElse()Gets the value of the else property.inthashCode()inthashCode(org.jvnet.jaxb2_commons.locator.ObjectLocator locator, org.jvnet.jaxb2_commons.lang.HashCodeStrategy2 strategy) voidsetComparand(Expression value) Sets the value of the comparand property.voidsetElse(Expression value) Sets the value of the else property.toString()withAnnotation(Collection<CqlToElmBase> values) withAnnotation(CqlToElmBase... values) withCaseItem(Collection<CaseItem> values) withCaseItem(CaseItem... values) withComparand(Expression value) withElse(Expression value) withLocalId(String value) withLocator(String value) withResultTypeName(QName value) Methods inherited from class org.cqframework.cql.elm.execution.Element
getAnnotation, getLocalId, getLocator, getResultTypeName, getResultTypeSpecifier, setLocalId, setLocator, setResultTypeName, setResultTypeSpecifierMethods inherited from class org.opencds.cqf.cql.engine.elm.execution.Executable
evaluate, internalEvaluate
-
Field Details
-
comparand
-
caseItem
-
_else
-
-
Constructor Details
-
Case
public Case()
-
-
Method Details
-
getComparand
Gets the value of the comparand property.- Returns:
- possible object is
Expression
-
setComparand
Sets the value of the comparand property.- Parameters:
value- allowed object isExpression
-
getCaseItem
Gets the value of the caseItem property.This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. This is why there is not a
setmethod for the caseItem property.For example, to add a new item, do as follows:
getCaseItem().add(newItem);Objects of the following type(s) are allowed in the list
CaseItem -
getElse
Gets the value of the else property.- Returns:
- possible object is
Expression
-
setElse
Sets the value of the else property.- Parameters:
value- allowed object isExpression
-
withComparand
-
withCaseItem
-
withCaseItem
-
withElse
-
withAnnotation
- Overrides:
withAnnotationin classExpression
-
withAnnotation
- Overrides:
withAnnotationin classExpression
-
withResultTypeSpecifier
- Overrides:
withResultTypeSpecifierin classExpression
-
withLocalId
- Overrides:
withLocalIdin classExpression
-
withLocator
- Overrides:
withLocatorin classExpression
-
withResultTypeName
- Overrides:
withResultTypeNamein classExpression
-
equals
public boolean equals(org.jvnet.jaxb2_commons.locator.ObjectLocator thisLocator, org.jvnet.jaxb2_commons.locator.ObjectLocator thatLocator, Object object, org.jvnet.jaxb2_commons.lang.EqualsStrategy2 strategy) - Specified by:
equalsin interfaceorg.jvnet.jaxb2_commons.lang.Equals2- Overrides:
equalsin classExpression
-
equals
- Overrides:
equalsin classExpression
-
hashCode
public int hashCode(org.jvnet.jaxb2_commons.locator.ObjectLocator locator, org.jvnet.jaxb2_commons.lang.HashCodeStrategy2 strategy) - Specified by:
hashCodein interfaceorg.jvnet.jaxb2_commons.lang.HashCode2- Overrides:
hashCodein classExpression
-
hashCode
public int hashCode()- Overrides:
hashCodein classExpression
-
toString
- Overrides:
toStringin classExpression
-
append
public StringBuilder append(org.jvnet.jaxb2_commons.locator.ObjectLocator locator, StringBuilder buffer, org.jvnet.jaxb2_commons.lang.ToStringStrategy2 strategy) - Specified by:
appendin interfaceorg.jvnet.jaxb2_commons.lang.ToString2- Overrides:
appendin classExpression
-
appendFields
public StringBuilder appendFields(org.jvnet.jaxb2_commons.locator.ObjectLocator locator, StringBuilder buffer, org.jvnet.jaxb2_commons.lang.ToStringStrategy2 strategy) - Specified by:
appendFieldsin interfaceorg.jvnet.jaxb2_commons.lang.ToString2- Overrides:
appendFieldsin classExpression
-