Documentation
¶
Overview ¶
Package model provides an ELM-like data structure for an intermediate representation of CQL.
Index ¶
- type AccessLevel
- type Add
- type After
- type AggregateClause
- type AliasRef
- type AliasedSource
- type And
- type As
- type Before
- type BinaryExpression
- type BinaryExpressionWithPrecision
- type CalculateAge
- type CalculateAgeAt
- type CanConvertQuantity
- type Case
- type CaseItem
- type Coalesce
- type Code
- type CodeDef
- type CodeRef
- type CodeSystemDef
- type CodeSystemRef
- type Concatenate
- type ConceptDef
- type ConceptRef
- type Contains
- type Date
- type DateTime
- type DateTimePrecision
- type DifferenceBetween
- type Divide
- type Element
- type End
- type Equal
- type Equivalent
- type Except
- type Exists
- type Expression
- type ExpressionDef
- type ExpressionRef
- type First
- type FunctionDef
- type FunctionRef
- type Greater
- type GreaterOrEqual
- type IBinaryExpression
- type IElement
- type IExpression
- type IExpressionDef
- type INaryExpression
- type IRelationshipClause
- type ISortByItem
- type IUnaryExpression
- type IfThenElse
- type Implies
- type In
- type InCodeSystem
- type InValueSet
- type Include
- type IncludedIn
- type Instance
- type InstanceElement
- type Intersect
- type Interval
- type Is
- type IsFalse
- type IsNull
- type IsTrue
- type Last
- type Less
- type LessOrEqual
- type LetClause
- type Library
- type LibraryIdentifier
- type List
- type Literal
- type MaxValue
- type Message
- type MessageSeverity
- type MinValue
- type Modulo
- type Multiply
- type NaryExpression
- type Negate
- type Not
- type Now
- type OperandDef
- type OperandRef
- type Or
- type ParameterDef
- type ParameterRef
- type Predecessor
- type Property
- type Quantity
- type Query
- type QueryLetRef
- type Ratio
- type RelationshipClause
- type Retrieve
- type ReturnClause
- type SameOrAfter
- type SameOrBefore
- type SingletonFrom
- type SortByColumn
- type SortByDirection
- type SortByItem
- type SortClause
- type SortDirection
- type Start
- type Statements
- type Subtract
- type Successor
- type Time
- type TimeOfDay
- type ToBoolean
- type ToConcept
- type ToDate
- type ToDateTime
- type ToDecimal
- type ToInteger
- type ToLong
- type ToQuantity
- type ToString
- type ToTime
- type Today
- type TruncatedDivide
- type Tuple
- type TupleElement
- type UnaryExpression
- type Union
- type Unit
- type Using
- type ValuesetDef
- type ValuesetRef
- type With
- type Without
- type XOr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessLevel ¶
type AccessLevel string
AccessLevel defines the access modifier for a definition (ExpressionDef, ParameterDef, ValueSetDef). If the user does not specify an access modifier the default is public. If the library is unnamed then the interpreter should treat all definitions as private even if the access modifier is public.
const ( // Public means other CQL libraries can access the definition. Public AccessLevel = "PUBLIC" // Private means only the local CQL libraries can access the definition. Private AccessLevel = "PRIVATE" )
type Add ¶
type Add struct{ *BinaryExpression }
Add ELM Expression https://cql.hl7.org/04-logicalspecification.html#add
type After ¶
type After BinaryExpressionWithPrecision
After ELM expression from https://cql.hl7.org/04-logicalspecification.html#after.
type AggregateClause ¶
type AggregateClause struct { *Element Expression IExpression // Starting is the starting value of the aggregate variable. It is always set. If the user does // not set it the parser will insert a null literal. Starting IExpression // Identifier is the alias for the aggregate variable. Identifier string Distinct bool }
AggregateClause for a Query expression.
type AliasRef ¶
type AliasRef struct { *Expression Name string }
AliasRef defines a reference to a source within the scope of a query.
type AliasedSource ¶
type AliasedSource struct { *Expression Alias string Source IExpression }
AliasedSource is a query source with an alias.
type And ¶
type And struct{ *BinaryExpression }
And is https://cql.hl7.org/04-logicalspecification.html#and.
type Before ¶
type Before BinaryExpressionWithPrecision
Before ELM expression from https://cql.hl7.org/04-logicalspecification.html#before.
type BinaryExpression ¶
type BinaryExpression struct { *Expression Operands []IExpression }
BinaryExpression is a CQL expression that has two operands. The ELM representation may have additional operands (ex BinaryExpressionWithPrecision).
func (*BinaryExpression) Left ¶
func (b *BinaryExpression) Left() IExpression
Left returns the Left expression (first operand) of the BinaryExpression. If not present, returns nil.
func (*BinaryExpression) Right ¶
func (b *BinaryExpression) Right() IExpression
Right returns the Right expression (second operand) of the BinaryExpression. If not present, returns nil.
func (*BinaryExpression) SetOperands ¶
func (b *BinaryExpression) SetOperands(left, right IExpression)
SetOperands sets the BinaryExpression's operands.
type BinaryExpressionWithPrecision ¶
type BinaryExpressionWithPrecision struct { *BinaryExpression // Precision returns the precision of this BinaryExpression. It must be one of the following: // https://cql.hl7.org/19-l-cqlsyntaxdiagrams.html#dateTimePrecision. Precision DateTimePrecision }
BinaryExpressionWithPrecision represents a BinaryExpression with a precision property.
type CalculateAge ¶
type CalculateAge struct { *UnaryExpression Precision DateTimePrecision }
CalculateAge CQL expression type
func (*CalculateAge) GetName ¶
func (a *CalculateAge) GetName() string
GetName returns the name of the system operator.
type CalculateAgeAt ¶
type CalculateAgeAt BinaryExpressionWithPrecision
CalculateAgeAt ELM expression from https://cql.hl7.org/04-logicalspecification.html#calculateageat.
func (*CalculateAgeAt) GetName ¶
func (a *CalculateAgeAt) GetName() string
GetName returns the name of the system operator.
type CanConvertQuantity ¶
type CanConvertQuantity struct{ *BinaryExpression }
CanConvertQuantity ELM Expression from https://cql.hl7.org/04-logicalspecification.html#canconvertquantity.
func (*CanConvertQuantity) GetName ¶
func (a *CanConvertQuantity) GetName() string
GetName returns the name of the system operator.
type Case ¶
type Case struct { *Expression // If comparand is provided it is compared against each When in the CaseItems. The CaseItems are // expected to be of the same type or implicitly convertible to the same type as the Comparand. If // the comparand is not provided then each When must have resultType boolean. Comparand IExpression CaseItem []*CaseItem // Else must always be provided. Else IExpression }
Case is a conditional case expression https://cql.hl7.org/04-logicalspecification.html#case.
type CaseItem ¶
type CaseItem struct { *Element When IExpression Then IExpression }
CaseItem is a single case item in a Case expression.
type Coalesce ¶
type Coalesce struct{ *NaryExpression }
Coalesce is https://cql.hl7.org/04-logicalspecification.html#coalesce.
type Code ¶
type Code struct { *Expression System *CodeSystemRef Code string Display string }
Code is a literal code selector.
type CodeDef ¶
type CodeDef struct { *Element Name string Code string // 1..1 CodeSystem *CodeSystemRef // 0..1 Display string // 0..1 AccessLevel AccessLevel }
CodeDef is a named definition that references an external code from a CodeSystem by ID.
type CodeRef ¶
type CodeRef struct { *Expression Name string // LibraryName is empty for Codes defined in the local CQL library. Otherwise it is the // local identifier of the included library. LibraryName string }
CodeRef defines a reference to a Code definition used in CQL expressions.
type CodeSystemDef ¶
type CodeSystemDef struct { *Element Name string ID string // 1..1 Version string // 0..1 AccessLevel AccessLevel }
CodeSystemDef is a named definition that references an external code system by ID and version.
type CodeSystemRef ¶
type CodeSystemRef struct { *Expression Name string // LibraryName is empty for CodeSystems defined in the local CQL library. Otherwise it is the // local identifier of the included library. LibraryName string }
CodeSystemRef defines a reference to a CodeSystemDef definition used in CQL expressions.
type Concatenate ¶
type Concatenate struct{ *NaryExpression }
Concatenate is https://cql.hl7.org/04-logicalspecification.html#concatenate.
func (*Concatenate) GetName ¶
func (a *Concatenate) GetName() string
GetName returns the name of the system operator.
type ConceptDef ¶
type ConceptDef struct { *Element Name string Codes []*CodeRef // 1..* Display string // 0..1 AccessLevel AccessLevel }
ConceptDef is a named definition that represents a terminology concept. It is made up of code(s) from one or more CodeSystems. At least one code is required.
type ConceptRef ¶
type ConceptRef struct { *Expression Name string // LibraryName is empty for Concepts defined in the local CQL library. Otherwise it is the // local identifier of the included library. LibraryName string }
ConceptRef defines a reference to a ConceptDef definition used in CQL expressions.
type Contains ¶
type Contains BinaryExpressionWithPrecision
Contains ELM expression from https://cql.hl7.org/04-logicalspecification.html#contains.
type Date ¶
type Date struct{ *NaryExpression }
Date is the functional syntax to create a Date https://cql.hl7.org/09-b-cqlreference.html#date-1.
type DateTime ¶
type DateTime struct{ *NaryExpression }
DateTime is the functional syntax to create a to create a CQL DateTime https://cql.hl7.org/09-b-cqlreference.html#datetime-1.
type DateTimePrecision ¶
type DateTimePrecision string
DateTimePrecision represents the precision of a DateTimeValue (or soon, TimeValue). This is a string and not an integer value so that the default JSON marshaled value is readable and useful.
const ( // UNSETDATETIMEPRECISION represents unknown precision. UNSETDATETIMEPRECISION DateTimePrecision = "" // YEAR represents year precision. YEAR DateTimePrecision = "year" // MONTH represents month precision. MONTH DateTimePrecision = "month" // WEEK represents a week precision. Not valid for Date / DateTime values. WEEK DateTimePrecision = "week" // DAY represents day precision. DAY DateTimePrecision = "day" // HOUR represents an hour precision. HOUR DateTimePrecision = "hour" // MINUTE represents a minute precision. MINUTE DateTimePrecision = "minute" // SECOND represents second precision. SECOND DateTimePrecision = "second" // MILLISECOND represents millisecond precision. MILLISECOND DateTimePrecision = "millisecond" )
type DifferenceBetween ¶
type DifferenceBetween BinaryExpressionWithPrecision
DifferenceBetween ELM expression from https://cql.hl7.org/04-logicalspecification.html#differencebetween.
func (*DifferenceBetween) GetName ¶
func (a *DifferenceBetween) GetName() string
GetName returns the name of the system operator.
type Divide ¶
type Divide struct{ *BinaryExpression }
Divide ELM Expression https://cql.hl7.org/04-logicalspecification.html#divide
type Element ¶
Element is the base for all CQL nodes.
func (*Element) GetResultType ¶
GetResultType returns the type of the result which may be nil if unknown or not yet implemented.
type End ¶
type End struct{ *UnaryExpression }
End is https://cql.hl7.org/04-logicalspecification.html#end.
type Equal ¶
type Equal struct{ *BinaryExpression }
Equal ELM Expression from https://cql.hl7.org/04-logicalspecification.html#equal.
type Equivalent ¶
type Equivalent struct{ *BinaryExpression }
Equivalent ELM Expression from https://cql.hl7.org/04-logicalspecification.html#equivalent.
func (*Equivalent) GetName ¶
func (a *Equivalent) GetName() string
GetName returns the name of the system operator.
type Except ¶
type Except struct{ *BinaryExpression }
Except ELM Expression https://cql.hl7.org/04-logicalspecification.html#except Except is a nary expression but we are only supporting two operands.
type Exists ¶
type Exists struct{ *UnaryExpression }
Exists is https://cql.hl7.org/04-logicalspecification.html#exists.
type Expression ¶
type Expression struct {
*Element
}
Expression is a base type containing common metadata for all CQL expression types.
func ResultType ¶
func ResultType(t types.IType) *Expression
ResultType is a helper function to set the resultType in a model.Element.
func (*Expression) GetResultType ¶
func (e *Expression) GetResultType() types.IType
GetResultType returns the type of the result which may be nil if unknown or not yet implemented.
type ExpressionDef ¶
type ExpressionDef struct { *Element Name string Context string Expression IExpression AccessLevel AccessLevel }
ExpressionDef is a top-level named definition of a CQL expression.
func (*ExpressionDef) GetAccessLevel ¶
func (e *ExpressionDef) GetAccessLevel() AccessLevel
GetAccessLevel returns the access level of the definition.
func (*ExpressionDef) GetContext ¶
func (e *ExpressionDef) GetContext() string
GetContext returns the context of the definition.
func (*ExpressionDef) GetExpression ¶
func (e *ExpressionDef) GetExpression() IExpression
GetExpression returns the expression of the definition.
func (*ExpressionDef) GetName ¶
func (e *ExpressionDef) GetName() string
GetName returns the name of the definition.
type ExpressionRef ¶
type ExpressionRef struct { *Expression Name string // LibraryName is empty for expressions defined in the local CQL library. Otherwise it is the // local identifier of the included library. LibraryName string }
ExpressionRef defines a reference to a ExpressionDef definition used in CQL expressions.
type First ¶
type First struct {
*UnaryExpression
}
First ELM expression from https://cql.hl7.org/04-logicalspecification.html#first
type FunctionDef ¶
type FunctionDef struct { // The body of the function is represented by the Expression field in the ExpressionDef. The // return type is the ResultType set in the Element. *ExpressionDef Operands []OperandDef Fluent bool // External functions do not have a function body. External bool }
FunctionDef represents a user defined function. All CQL built-in functions have their own struct defined below.
type FunctionRef ¶
type FunctionRef struct { *Expression Name string // LibraryName is empty for expressions defined in the local CQL library. Otherwise it is the // local identifier of the included library. LibraryName string Operands []IExpression }
FunctionRef defines a reference to a user defined function.
type Greater ¶
type Greater struct{ *BinaryExpression }
Greater ELM Expression https://cql.hl7.org/04-logicalspecification.html#greater
type GreaterOrEqual ¶
type GreaterOrEqual struct{ *BinaryExpression }
GreaterOrEqual ELM Expression https://cql.hl7.org/04-logicalspecification.html#greaterorequal
func (*GreaterOrEqual) GetName ¶
func (a *GreaterOrEqual) GetName() string
GetName returns the name of the system operator.
type IBinaryExpression ¶
type IBinaryExpression interface { IExpression // GetName returns the name of the BinaryExpression. GetName() string // Left returns the Left expression (first operand) of the BinaryExpression. If not present, // returns nil. Left() IExpression // Right returns the Right expression (second operand) of the BinaryExpression. If not present, // returns nil. Right() IExpression SetOperands(left, right IExpression) // contains filtered or unexported methods }
IBinaryExpression is an interface that all Binary Expressions meet. Get prefixes are used below so as to not conflict with struct property names.
type IExpression ¶
type IExpression interface { IElement // contains filtered or unexported methods }
IExpression is an interface implemented by all CQL Expression structs
type IExpressionDef ¶
type IExpressionDef interface { IElement GetName() string GetContext() string GetExpression() IExpression GetAccessLevel() AccessLevel }
IExpressionDef is implemented by both ExpressionDef and FunctionDef.
type INaryExpression ¶
type INaryExpression interface { IExpression GetName() string GetOperands() []IExpression SetOperands([]IExpression) // contains filtered or unexported methods }
INaryExpression is an interface that Expressions with any number of operands meet.
type IRelationshipClause ¶
type IRelationshipClause interface { IElement // contains filtered or unexported methods }
IRelationshipClause is an interface that all With and Without meet.
type ISortByItem ¶
type ISortByItem interface { IElement // contains filtered or unexported methods }
ISortByItem defines one or more items that a query can be sorted by. Follows format outlined in https://cql.hl7.org/elm/schema/expression.xsd.
type IUnaryExpression ¶
type IUnaryExpression interface { IExpression GetName() string GetOperand() IExpression SetOperand(IExpression) // contains filtered or unexported methods }
IUnaryExpression is an interface that all Unary expressions meet.
type IfThenElse ¶
type IfThenElse struct { *Expression Condition IExpression Then IExpression Else IExpression }
IfThenElse Elm expression from https://cql.hl7.org/04-logicalspecification.html#if
type Implies ¶
type Implies struct{ *BinaryExpression }
Implies is https://cql.hl7.org/04-logicalspecification.html#implies
type In ¶
type In BinaryExpressionWithPrecision
In ELM expression from https://cql.hl7.org/04-logicalspecification.html#in.
type InCodeSystem ¶
type InCodeSystem struct{ *BinaryExpression }
InCodeSystem is https://cql.hl7.org/09-b-cqlreference.html#in-codesystem. This is not technically 1:1 with the ELM definition. The ELM defines Code, CodeSystem and CodeSystemExpression arguments, the last being seemingly impossible to set for for now we're treating this as a binary expression.
func (*InCodeSystem) GetName ¶
func (a *InCodeSystem) GetName() string
GetName returns the name of the system operator.
type InValueSet ¶
type InValueSet struct{ *BinaryExpression }
InValueSet is https://cql.hl7.org/09-b-cqlreference.html#in-valueset. This is not technically 1:1 with the ELM definition. The ELM defines Code, ValueSet and ValueSetExpression arguments, the last being seemingly impossible to set for for now we're treating this as a binary expression.
func (*InValueSet) GetName ¶
func (a *InValueSet) GetName() string
GetName returns the name of the system operator.
type Include ¶
type Include struct { *Element Identifier *LibraryIdentifier }
Include defines an Include library statement in CQL.
type IncludedIn ¶
type IncludedIn BinaryExpressionWithPrecision
IncludedIn ELM expression from https://cql.hl7.org/04-logicalspecification.html#included-in.
func (*IncludedIn) GetName ¶
func (a *IncludedIn) GetName() string
GetName returns the name of the system operator.
type Instance ¶
type Instance struct { *Expression ClassType types.IType Elements []*InstanceElement }
Instance represents an instance of a Class (aka Named Structured Value), see https://cql.hl7.org/04-logicalspecification.html#instance
type InstanceElement ¶
type InstanceElement struct { Name string Value IExpression }
InstanceElement is an element in a CQL structure Instance.
type Intersect ¶
type Intersect struct{ *BinaryExpression }
Intersect ELM Expression https://cql.hl7.org/04-logicalspecification.html#intersect Intersect is a nary expression but we are only supporting two operands.
type Interval ¶
type Interval struct { *Expression Low IExpression High IExpression // Either LowClosedExpression or LowInclusive should be set. LowClosedExpression IExpression LowInclusive bool // Either HighClosedExpression or HighInclusive should be set. HighClosedExpression IExpression HighInclusive bool }
An Interval expression.
type Is ¶
type Is struct { *UnaryExpression IsTypeSpecifier types.IType }
type IsFalse ¶
type IsFalse struct{ *UnaryExpression }
IsFalse is https://cql.hl7.org/04-logicalspecification.html#isfalse.
type IsNull ¶
type IsNull struct{ *UnaryExpression }
IsNull is https://cql.hl7.org/04-logicalspecification.html#isnull.
type IsTrue ¶
type IsTrue struct{ *UnaryExpression }
IsTrue is https://cql.hl7.org/04-logicalspecification.html#istrue.
type Last ¶
type Last struct {
*UnaryExpression
}
Last ELM expression from https://cql.hl7.org/04-logicalspecification.html#last.
type Less ¶
type Less struct{ *BinaryExpression }
Less ELM Expression https://cql.hl7.org/04-logicalspecification.html#less
type LessOrEqual ¶
type LessOrEqual struct{ *BinaryExpression }
LessOrEqual ELM Expression https://cql.hl7.org/04-logicalspecification.html#lessorequal
func (*LessOrEqual) GetName ¶
func (a *LessOrEqual) GetName() string
GetName returns the name of the system operator.
type LetClause ¶
type LetClause struct { *Element Expression IExpression Identifier string }
LetClause is https://cql.hl7.org/04-logicalspecification.html#letclause.
type Library ¶
type Library struct { Identifier *LibraryIdentifier Usings []*Using Includes []*Include Parameters []*ParameterDef CodeSystems []*CodeSystemDef Concepts []*ConceptDef Valuesets []*ValuesetDef Codes []*CodeDef Statements *Statements }
Library represents a base level CQL library, typically from one CQL file.
type LibraryIdentifier ¶
type LibraryIdentifier struct { *Element Local string Qualified string // The full identifier of the library. Version string }
LibraryIdentifier for the library definition. This matches up with the ELM VersionedIdentifier (https://cql.hl7.org/04-logicalspecification.html#versionedidentifier). If nil then this is an unnamed library.
type MaxValue ¶
type MaxValue struct { *Expression ValueType types.IType }
MaxValue ELM expression from https://cql.hl7.org/04-logicalspecification.html#maxvalue
type Message ¶
type Message struct { *Expression Source IExpression Condition IExpression Code IExpression Severity IExpression Message IExpression }
Message is a CQL expression that represents a message, which is the equivalent of print in most other languages. https://cql.hl7.org/04-logicalspecification.html#message
type MessageSeverity ¶
type MessageSeverity string
A MessageSeverity determines the type of the message and how it will be processed.
const ( // UNSETMESSAGESEVERITY denotes a message severity that shouldn't be allowed. UNSETMESSAGESEVERITY MessageSeverity = "" // TRACE denotes a message that should be printed with trace information. TRACE MessageSeverity = "Trace" // MESSAGE denotes a simple message that should be printed. MESSAGE MessageSeverity = "Message" // WARNING denotes a message that should log a warning to users. WARNING MessageSeverity = "Warning" // ERROR denotes an error message that should also halt execution. ERROR MessageSeverity = "Error" )
type MinValue ¶
type MinValue struct { *Expression ValueType types.IType }
MinValue ELM expression from https://cql.hl7.org/04-logicalspecification.html#minvalue
type Modulo ¶
type Modulo struct{ *BinaryExpression }
Modulo ELM Expression https://cql.hl7.org/04-logicalspecification.html#modulo
type Multiply ¶
type Multiply struct{ *BinaryExpression }
Multiply ELM Expression https://cql.hl7.org/04-logicalspecification.html#multiply
type NaryExpression ¶
type NaryExpression struct { *Expression Operands []IExpression }
NaryExpression that takes any number of operands including zero. The ELM representation may have additional operands.
func (*NaryExpression) GetOperands ¶
func (n *NaryExpression) GetOperands() []IExpression
GetOperands returns the operands of the NaryExpression.
func (*NaryExpression) SetOperands ¶
func (n *NaryExpression) SetOperands(ops []IExpression)
SetOperands sets the NaryExpression's operands.
type Negate ¶
type Negate struct{ *UnaryExpression }
Negate is https://cql.hl7.org/04-logicalspecification.html#negate.
type Not ¶
type Not struct{ *UnaryExpression }
Not is https://cql.hl7.org/04-logicalspecification.html#not.
type Now ¶
type Now struct{ *NaryExpression }
Now is https://cql.hl7.org/04-logicalspecification.html#now. Note: in the future we may implement the OperatorExpression, and should convert this to one of those at that point.
type OperandDef ¶
type OperandDef struct { // The type of the operand is the ResultType set in the Element. *Expression Name string }
OperandDef defines an operand for a user defined function.
type OperandRef ¶
type OperandRef struct { *Expression Name string }
OperandRef defines a reference to an operand within a function.
type Or ¶
type Or struct{ *BinaryExpression }
type ParameterDef ¶
type ParameterDef struct { *Element Name string Default IExpression AccessLevel AccessLevel }
ParameterDef is a top-level statement that defines a named CQL parameter.
type ParameterRef ¶
type ParameterRef struct { *Expression Name string // LibraryName is empty for parameters defined in the local CQL library. Otherwise it is the // local identifier of the included library. LibraryName string }
ParameterRef defines a reference to a ParameterDef definition used in CQL expressions.
type Predecessor ¶
type Predecessor struct{ *UnaryExpression }
Predecessor ELM expression from https://cql.hl7.org/04-logicalspecification.html#predecessor.
func (*Predecessor) GetName ¶
func (a *Predecessor) GetName() string
GetName returns the name of the system operator.
type Property ¶
type Property struct { *Expression Source IExpression Path string }
Property gets a property from an expression. In ELM if the expression is an AliasRef then Scope is set instead of Source. In our model Source is set to AliasRef; there is no Scope.
type Quantity ¶
type Quantity struct { *Expression Value float64 Unit Unit }
Quantity is an expression representation of a clinical quantity. https://cql.hl7.org/04-logicalspecification.html#quantity
type Query ¶
type Query struct { *Expression Source []*AliasedSource Let []*LetClause Relationship []IRelationshipClause Where IExpression Sort *SortClause Aggregate *AggregateClause // Only aggregate or Return can be populated, not both. Return *ReturnClause }
A Query expression.
type QueryLetRef ¶
type QueryLetRef struct { *Expression Name string }
QueryLetRef is similar to an AliasRef except specific to references to let clauses.
type Ratio ¶
type Ratio struct { *Expression Numerator Quantity Denominator Quantity }
A Ratio is an expression that expresses a ratio between two Quantities. https://cql.hl7.org/04-logicalspecification.html#ratio
type RelationshipClause ¶
type RelationshipClause struct { *Element // Expression is the source of the inclusion clause. Expression IExpression Alias string SuchThat IExpression }
RelationshipClause for a Query expression.
type Retrieve ¶
type Retrieve struct { *Expression // TODO(b/312172420): Changing DataType to a named type would make life much easier. DataType string TemplateID string CodeProperty string // Codes is an expression that returns a list of code values. Codes IExpression }
A Retrieve expression.
type ReturnClause ¶
type ReturnClause struct { *Element Expression IExpression Distinct bool }
ReturnClause for a Query expression.
type SameOrAfter ¶
type SameOrAfter BinaryExpressionWithPrecision
SameOrAfter ELM expression from https://cql.hl7.org/04-logicalspecification.html#sameorafter.
func (*SameOrAfter) GetName ¶
func (a *SameOrAfter) GetName() string
GetName returns the name of the system operator.
type SameOrBefore ¶
type SameOrBefore BinaryExpressionWithPrecision
SameOrBefore ELM expression from https://cql.hl7.org/04-logicalspecification.html#sameorbefore.
func (*SameOrBefore) GetName ¶
func (a *SameOrBefore) GetName() string
GetName returns the name of the system operator.
type SingletonFrom ¶
type SingletonFrom struct{ *UnaryExpression }
SingletonFrom is https://cql.hl7.org/04-logicalspecification.html#singletonfrom.
func (*SingletonFrom) GetName ¶
func (s *SingletonFrom) GetName() string
GetName returns the name of the system operator.
type SortByColumn ¶
type SortByColumn struct { *SortByItem Path string }
SortByColumn enables sorting by a given column and direction.
type SortByDirection ¶
type SortByDirection struct {
*SortByItem
}
SortByDirection enables sorting non-tuple values by direction
type SortByItem ¶
type SortByItem struct { *Element Direction SortDirection }
SortByItem is the base abstract type for all query types.
type SortClause ¶
type SortClause struct { *Element ByItems []ISortByItem }
SortClause for a Query expression.
type SortDirection ¶
type SortDirection string
A SortDirection determines what ordering to use for a query if sorting is enabled.
const ( // UNSETSORTDIRECTION denotes a sort direction that shouldn't be allowed. UNSETSORTDIRECTION SortDirection = "" // ASCENDING denotes query sorting from smallest to largest values. ASCENDING SortDirection = "ASCENDING" // DESCENDING denotes query sorting from largest to smallest values. DESCENDING SortDirection = "DESCENDING" )
type Start ¶
type Start struct{ *UnaryExpression }
Start is https://cql.hl7.org/04-logicalspecification.html#start.
type Statements ¶
type Statements struct {
Defs []IExpressionDef
}
Statements is a collection of expression and function definitions, similar to the ELM structure.
type Subtract ¶
type Subtract struct{ *BinaryExpression }
Subtract ELM Expression https://cql.hl7.org/04-logicalspecification.html#subtract
type Successor ¶
type Successor struct{ *UnaryExpression }
Successor ELM expression from https://cql.hl7.org/04-logicalspecification.html#successor.
type Time ¶
type Time struct{ *NaryExpression }
Time is the functional syntax to create a CQL Time https://cql.hl7.org/09-b-cqlreference.html#time-1.
type TimeOfDay ¶
type TimeOfDay struct{ *NaryExpression }
TimeOfDay is https://cql.hl7.org/04-logicalspecification.html#timeofday Note: in the future we may implement the OperatorExpression, and should convert this to one of those at that point.
type ToBoolean ¶
type ToBoolean struct{ *UnaryExpression }
ToBoolean ELM expression from https://cql.hl7.org/09-b-cqlreference.html#toboolean.
type ToConcept ¶
type ToConcept struct{ *UnaryExpression }
ToConcept ELM expression from https://cql.hl7.org/09-b-cqlreference.html#toconcept.
type ToDate ¶
type ToDate struct{ *UnaryExpression }
ToDate ELM expression from https://cql.hl7.org/04-logicalspecification.html#todate.
type ToDateTime ¶
type ToDateTime struct{ *UnaryExpression }
ToDateTime ELM expression from https://cql.hl7.org/04-logicalspecification.html#todatetime
func (*ToDateTime) GetName ¶
func (a *ToDateTime) GetName() string
GetName returns the name of the system operator.
type ToDecimal ¶
type ToDecimal struct{ *UnaryExpression }
ToDecimal ELM expression from https://cql.hl7.org/04-logicalspecification.html#todecimal.
type ToInteger ¶
type ToInteger struct{ *UnaryExpression }
ToInteger ELM expression from https://cql.hl7.org/09-b-cqlreference.html#tointeger.
type ToLong ¶
type ToLong struct{ *UnaryExpression }
ToLong ELM expression from https://cql.hl7.org/04-logicalspecification.html#tolong.
type ToQuantity ¶
type ToQuantity struct{ *UnaryExpression }
ToQuantity ELM expression from https://cql.hl7.org/04-logicalspecification.html#toquantity.
func (*ToQuantity) GetName ¶
func (a *ToQuantity) GetName() string
GetName returns the name of the system operator.
type ToString ¶
type ToString struct{ *UnaryExpression }
ToString ELM expression from https://cql.hl7.org/09-b-cqlreference.html#tostring.
type ToTime ¶
type ToTime struct{ *UnaryExpression }
ToTime ELM expression from https://cql.hl7.org/09-b-cqlreference.html#totime.
type Today ¶
type Today struct{ *NaryExpression }
Today is https://cql.hl7.org/04-logicalspecification.html#today. Note: in the future we may implement the OperatorExpression, and should convert this to one of thse at that point.
type TruncatedDivide ¶
type TruncatedDivide struct{ *BinaryExpression }
TruncatedDivide ELM Expression https://cql.hl7.org/04-logicalspecification.html#truncateddivide
func (*TruncatedDivide) GetName ¶
func (a *TruncatedDivide) GetName() string
GetName returns the name of the system operator.
type Tuple ¶
type Tuple struct { *Expression Elements []*TupleElement }
Tuple represents a tuple (aka Structured Value), see https://cql.hl7.org/04-logicalspecification.html#tuple
type TupleElement ¶
type TupleElement struct { Name string Value IExpression }
TupleElement is an element in a CQL Tuple.
type UnaryExpression ¶
type UnaryExpression struct { *Expression Operand IExpression }
UnaryExpression is a CQL expression that has one operand. The ELM representation may have additional operands.
func (*UnaryExpression) GetOperand ¶
func (a *UnaryExpression) GetOperand() IExpression
GetOperand returns the unary expression's operand.
func (*UnaryExpression) SetOperand ¶
func (a *UnaryExpression) SetOperand(operand IExpression)
SetOperand sets the unary expression's operand.
type Union ¶
type Union struct{ *BinaryExpression }
Union ELM Expression https://cql.hl7.org/04-logicalspecification.html#union Union is a nary expression but we are only supporting two operands.
type Unit ¶
type Unit string
Unit represents the unit for a QuantityValue.
const ( // UNSETUNIT represents unknown unit. UNSETUNIT Unit = "" // ONEUNIT defines a base unit. // This is often the result of dividing quantities with the same unit, canceling the unit out. ONEUNIT Unit = "1" // YEARUNIT represents year unit. YEARUNIT Unit = "year" // MONTHUNIT represents month unit. MONTHUNIT Unit = "month" // WEEKUNIT represents a week unit. WEEKUNIT Unit = "week" // DAYUNIT represents day unit. DAYUNIT Unit = "day" // HOURUNIT represents an hour unit. HOURUNIT Unit = "hour" // MINUTEUNIT represents a minute unit. MINUTEUNIT Unit = "minute" // SECONDUNIT represents second unit. SECONDUNIT Unit = "second" // MILLISECONDUNIT represents millisecond unit. MILLISECONDUNIT Unit = "millisecond" )
TODO(b/319155752) Add support for UCUM values.
type Using ¶
type Using struct { *Element LocalIdentifier string // URI is the URL specified at the top of the modelinfo, for FHIR "http://hl7.org/fhir". URI string Version string }
Using defines a Using directive in CQL.
type ValuesetDef ¶
type ValuesetDef struct { *Element Name string ID string // 1..1 Version string // 0..1 CodeSystems []*CodeSystemRef // 0..* AccessLevel AccessLevel }
ValuesetDef is a named valueset definition that references a value set by ID.
type ValuesetRef ¶
type ValuesetRef struct { *Expression Name string // LibraryName is empty for valuesets defined in the local CQL library. Otherwise it is the // local identifier of the included library. LibraryName string }
ValuesetRef defines a reference to a ValuesetDef definition used in CQL expressions.
type With ¶
type With struct{ *RelationshipClause }
With is https://cql.hl7.org/04-logicalspecification.html#with.
type Without ¶
type Without struct{ *RelationshipClause }
Without is https://cql.hl7.org/04-logicalspecification.html#without.
type XOr ¶
type XOr struct{ *BinaryExpression }