| Register
Thursday, August 21, 2008   
GELLO overview
GELLO is a HL7/ANSI standard decision support language. It has its roots in OCL but has been optimised and extended for decision support. Its primary role is as a query language for obtaining clinical information from a EHR system in a standard way. The uses an abstract "virtual medical record" (vMR) so that the same GELLO code can run on multiple systems accessing data stored in different formats. The vMR is a simplified view of the HL7 V3 RIM (Reference Information Model)

GELLO cannot alter a medical record but can perform complex logic in order to make a decision about a patients care. It can be used to provide standards based data access for othe advanced decision support applications. Medical-Objects produced the first GELLO compiler in clinical use and uses GELLO for Guidelines (using GLIF or Guideline Interchange Format) and for constraints, validation and calculated fields in Archetyped data entry. It is also used to create complex data series for graphing or statistical analysis.

In our initial deployment the GELLO engine can abstract HL7 V2 data to produce a vMR that is RIM compliant. It can be integrated into any system with structured data through the abstract vMR interface. It integrates seemlessly with the HL7 based Medical-Objects EHR servers and has full support for SNOMED-CT expressions using canonical forms to compare different SNOMED-CT pre and post co-ordinated concepts. It also have LOINC and ICD-10 support.

Medical-Objects GELLO represents the cutting edge of Clinical Decision support capabilities using a standards based, cross platform, high performance GELLO engine.

Medical-Objects is currently heavily involved in correcting errors in the initial standard. The current GELLO engine is compliant with the normative parts of the standard and the candidate BNF update is presented below.
GELLO BNF
At the Phoenix HL7 meeting as decision was made to look at updating the GELLO grammar without making wholesale changes to the language. The current grammar is not correct and does not allow a parser to be built. MedicalObjects is leading this work.

The grammar below is the the latest candidate grammar. It is LALR(1). Medical-Objects is working on an open source GELLO editor that uses this grammar. Please email us if you are interested in trying this out before its official release.


This grammar follows the conventions set in the original version. The inclusion of method names in the grammar is unusual, but we have left those elements unchanged. The main change, of any significance, is the inclusion of an optional "in" keyword to allow disambiguation of the Let statements from the final expression when the final expression starts with a '+', a '-' or a '('. In normal use it is not required. This maintains backward compatibility with all the published GELLO examples.


GELLOExpression::=      OuterExpression

OuterExpression::=      Declarative+ ( ExpressionNP? | <IN> Expression ) | Expression

Declarative::=          LetStatement
                                |   ContextNavigationStatement

InnerExpression::=      LetStatement+ (ExpressionNP | <IN> Expression) | Expression

LetStatement::=     <LET> <ID> ":" DataTypes <EQUAL> Expression

IfStatement::=     <IF> Expression <THEN> InnerExpression <ELSE> InnerExpression <ENDIF>

ContextNavigationStatement::=     ContextStatement
                                |   PackageStatement

ContextStatement::=     <CONTEXT>  ClassName ContextBlock
                       | <CONTEXT>  Alias ":" ClassName ContextBlock

ContextBlock::=        ( ContextBody  | DefinitionBody+ )


ContextBody::=     <SELF> "." Expression  |   Expression

DefinitionBody::=     <DEF> ":" <ID> ":" DataTypes <EQUAL> InnerExpression
             | <DEF> ":" <ID> "(" FormalParams? ")" ":" DataTypes <EQUAL> InnerExpression
             | <DEF> ":" <ID>  (":" DataTypes)? <ARROW> <ID> "(" <ID>? "|" <ID>? ")"<EQUAL> InnerExpression

FormalParams::= <ID> ":" DataTypes ("," FormalParams )?

Alias::=     <ID>

PackageStatement::=     <PACKAGE> PackageName
                                       ContextStatement+
                                  <ENDPACKAGE>

PackageName::=     Name


Literal::=          <STRING_LITERAL>
                                |   <INTEGER_LITERAL>
                                |   <REAL_LITERAL>
                                |   <TRUE>
                                |   <FALSE>
                                |   <UNKNOWN>
                                |   <NULL> 
                                |   CollectionLiteral
                                |   TupleLiteral
                                |   "#" <ID>

CollectionLiteral::=  CollectionType? "{" ( CollectionLiteralElement ( "," CollectionLiteralElement )* )? "}"

CollectionLiteralElement::= Expression ( ".." Expression )?

TupleLiteral::= <TUPLE> "{" TupleLiteralElement ( "," TupleLiteralElement )* "}"

TupleLiteralElement::= <ID> (":" DataTypes)? <EQUAL> Expression


DataTypes::=      GELLOType
                                |   ModelTypes

GELLOType::=      BasicType
                                |   CollectionType ("(" DataTypes ")")?
                                |   TupleType
                                |   EnumerationType

BasicType::=         <INTEGER>
                                |   <STRING>
                                |   <REAL>
                                |   <BOOLEAN>
ModelTypes::=   ClassName

CollectionType::=        <SET>  |  <BAG> |  <SEQUENCE>

TupleType::=            <TUPLE> "(" TupleTypeElement ( "," TupleTypeElement )* ")"

TupleTypeElement::=      <ID> ":" DataTypes

EnumerationType::=      <ENUM> "(" <ID> ( "," <ID> )* ")"

ClassName::=            NameWithPath

NameWithPath::=         Name ( "::" Name )*

Name::=                 <ID> ( "." <ID>)*

Expression::=     ConditionalExpression

ConditionalExpression::=     OrExpression

OrExpression::=     ConditionalAndExpression (<OR> ConditionalAndExpression  |
                                    <XOR> ConditionalAndExpression)*

ConditionalAndExpression::=     ComparisonExpression (<AND> ComparisonExpression)*

ComparisonExpression::=        AddExpression (<EQUAL> AddExpression |
                                    <NEQ> AddExpression | <LT> AddExpression  |
                                    <LEQ> AddExpression | <GT>  AddExpression  |
                                    <GEQ> AddExpression)*

AddExpression::=     MultiplyExpression (<MINUS> MultiplyExpression |
                                    <PLUS> MultiplyExpression)*

MultiplyExpression::=     UnaryExpression (<TIMES> UnaryExpression |
                                    <DIVIDE> UnaryExpression | <MAX>  UnaryExpression |
                                    <MIN> UnaryExpression | <INTDIV> UnaryExpression |
                                    <MOD> UnaryExpression )*

UnaryExpression::=       PrimaryExpression
                                |   <NOT> UnaryExpression
                                |   <MINUS> UnaryExpression
                                |   <PLUS> UnaryExpression

PrimaryExpression::=    Literal
                                |   Operand
                                |   ReferenceToInstance
                                |   IfStatement
                                | "(" Expression ")"

ExpressionNP::=     ConditionalExpressionNP

ConditionalExpressionNP::=     OrExpressionNP

OrExpressionNP::=     ConditionalAndExpressionNP (<OR> ConditionalAndExpression  |
                                    <XOR> ConditionalAndExpression)*

ConditionalAndExpressionNP::=     ComparisonExpressionNP (<AND> ComparisonExpression)*

ComparisonExpressionNP::=        AddExpressionNP (<EQUAL> AddExpression |
                                    <NEQ> AddExpression | <LT> AddExpression  |
                                    <LEQ> AddExpression | <GT>  AddExpression  |
                                    <GEQ> AddExpression)*

AddExpressionNP::=     MultiplyExpressionNP(<MINUS> MultiplyExpression |
                                    <PLUS> MultiplyExpression)*

MultiplyExpressionNP::=     UnaryExpressionNP (<TIMES> UnaryExpression |
                                    <DIVIDE> UnaryExpression | <MAX>  UnaryExpression |
                                    <MIN> UnaryExpression | <INTDIV> UnaryExpression |
                                    <MOD> UnaryExpression )*

UnaryExpressionNP::=       PrimaryExpressionNP
                                |   <NOT> UnaryExpression

PrimaryExpressionNP::=    Literal
                                |   Operand
                                |   ReferenceToInstance
                                |   IfStatement

Operand::=              <ID>
                                | Operand "."  <ID>
                                | Operand "." StringOperation
                                | Operand "." TupleOperation
                                | Operand "." StringOrTupleSize
                                | Operand "(" ParameterList ")"
                                | Operand "[" ExpressionList "]"
                                | Operand <ARROW> CollectionBody
                                | CollectionLiteral <ARROW> CollectionBody

CollectionBody::=     NonParamExp
                                |   SelectionExp
                                |   QuantifierExp
                                |   SingleObjExp
                                |   ListObjExp
                                |   GetExp
                                |   SetExp
                                |   IterateExp
                                |   JoinExp

SelectionExp::=     <SELECT> "(" CExp ")"
                                |   <REJECT> "(" CExp ")"
                                |   <COLLECT> "(" CExp ")"

QuantifierExp::=     <FORALL> "(" CExp ")"
                                |   <EXISTS>  "(" CExp ")"

CExp::=     ConditionalExpression
                                |   ConditionalExpressionWithIterator
                                |   ConditionalExpressionWithIteratorType

ConditionalExpressionWithIterator::=     <ID> "|" ConditionalExpression

ConditionalExpressionWithIteratorType::=      <ID> ":" DataTypes "|" ConditionalExpression

NonParamExp::=     <SIZE> "(" ")"
                                |   <ISEMPTY> "(" ")"
                                |   <NOTEMPTY> "(" ")"
                                |   <SUM> "(" ")"
                                |   <REVERSE> "(" ")"
                                |   <MIN> "(" ")"
                                |   <MAX> "(" ")"
                                |   <FLATTEN> "(" ")"
                                |   <AVERAGE> "(" ")"
                                |   <MEAN> "(" ")"
                                |   <MEDIAN> "(" ")"
                                |   <MODE>  "(" ")"
                                |   <STDEV> "(" ")"
                                |   <VARIANCE> "(" ")"
                                |   <DISTINCT> "(" ")"
                               

SingleObjExp::=         <COUNT> "(" Object ")"
                                |   <INCLUDES> "(" Object ")"
                                |   <INCLUDING> "(" Object ")"
                                |   <EXCLUDING> "(" Object ")"

ListObjExp::=     <INCLUDESALL> "(" ObjectList ")"
                                |   <SORTBY> "(" PropertyList ")"

GetExp::=     <FIRSTN> "(" Expression ")"
                                |   <LASTN> "(" Expression ")"
                                |   <ELEMAT> "(" Expression ")"
                                |   <LIKE> "(" Expression ")"
                |   <NOTLIKE> "(" Expression ")"
                                |   <BETWEEN> "(" Expression "," Expression ")"

SetExp::=     <INTERSECTION> "(" Expression ")"
                                |   <UNION> "(" Expression ")"

IterateExp::=     <ITERATE> "(" IterateParameterList ")"

JoinExp::=    <JOIN>  "(" ParameterList ";" ParameterList ";"
                                    ConditionalExpression ";" ParameterList ")"

StringOperation::=     StrConcat
                                |   StrToUpper
                                |   StrToLower
                                |   Substring

StringOrTupleSize::=          <SIZE> "(" ")"

StrConcat::=     <CONCAT> "(" Expression ")"

StrToUpper::=     <TOUPPER> "(" ")"

StrToLower::=     <TOLOWER> "(" ")"

Substring::=     <SUBSTRING> "(" Expression "," Expression ")"

TupleOperation::=     TupleGetValue
                                |   TupleGetElemName
                                |   TupleGetElemType

TupleGetValue::=     <GETVALUE> "(" TupleElemName ")"

TupleGetElemName::=     <GETELEMNAME> "(" Expression ")"

TupleGetElemType::=     <GETELEMTYPE> "(" Expression ")"

IterateParameterList::=     <ID> (":" DataTypes)? ";" <ID> ":" DataTypes
                                    <EQUAL> Expression "|" Expression

ParameterList::=     ExpressionList?

ExpressionList::=     Expression ("," Expression)*


ObjectList::=    Object ("," Object)*

Object::=     Expression

PropertyList::=     Property ("," Property)*

Property::=     Name

TupleElemName::=     Name


ReferenceToInstance::= <FACTORY> "." <ID> "(" ParameterList ")"


<DECIMAL_LITERAL: (["0"-"9"])+ >

<EXPONENT: ["e", "E"] (["+","-"])? (["0"-"9"])+>

<INTEGER_LITERAL: <DECIMAL_LITERAL>>

<REAL_LITERAL: <DECIMAL_LITERAL> "." (["0"-"9"])* (<EXPONENT>)? | "." (["0"-"9"])+ (<EXPONENT>)? >

<STRING_LITERAL: ('\"' (~[ '\"' , "\n", "\r"])* '\"' | "\'" (~[ "\'" , "\n", "\r"])* "\'" ) >

<ID: ["a"-"z","A"-"Z"] (["a"-"z","A"-"Z","0"-"9"] | "_"(["a"-"z","A"-"Z","0"-"9"])+)* >

<BAG: "Bag">

<BOOLEAN: "Boolean">

<ENUM: "Enum">

<INTEGER: "Integer">

<REAL: "Real">

<SEQUENCE: "Sequence">

<SET: "Set">

<STRING: "String">

<SELF: "Self">

<TUPLE: "Tuple" >

<AND: "&" | "and" >

<ARROW: "->" >

<AVERAGE: "average" >

<BETWEEN: "between" >

<COLLECT: "collect" >

<CONCAT: "concat" >

<COUNT: "count" >

<DEF: "Def" | "def" >

<DISTINCT: "distinct" >

<DIVIDE: "/" >

<ELEMAT: "elemAt" >

<EXCLUDING: "excluding" >

<EXISTS: "exists" >

<FACTORY: "factory" >

<FALSE: "false" | "False" >

<FIRSTN: "firstN" >

<FLATTEN: "flatten" >

<FORALL: "forAll" >

<EQUAL: "=" >

<GEQ: ">=" >

<GETELEMNAME: "getElemName" >

<GETELEMTYPE: "getElemType" >

<GETVALUE: "getValue" >

<GT: ">" >

<INCLUDES: "includes" >

<INCLUDESALL: "includesAll" >

<INCLUDING: "including" >

<INTDIV: "div" >

<INTERSECTION: "intersection" >

<ISEMPTY: "isEmpty" >

<ITERATE: "iterate" >

<JOIN: "join" >

<LASTN: "lastN" >

<LEQ: "<=" >

<LIKE: "like" >

<LT: "<" >

<MAX: "max" >

<MEAN: "mean">

<MEDIAN: "median" >

<MIN: "min" >

<MINUS: "-" >

<MOD: "mod" >

<MODE: "mode" >

<NEQ: "!=" | "<>" >

<NOT: "!" | "not" >

<NOTEMPTY: "notEmpty" >

<NOTLIKE: "notlike" >

<OR: "or" >

<PLUS: "+" >

<REJECT: "reject" >

<REVERSE: "reverse" >

<SELECT: "select" >

<SIZE: "size" >

<SORTBY: "sortBy" >

<STDEV: "stdev" >

<SUBSTRING: "substring" >

<SUM: "sum" >

<TIMES: "*" >

<TOLOWER: "toLower" >

<TOUPPER: "toUpper">

<TRUE: "true" | "True" >

<UNION: "union" >

<UNKNOWN: "unknown" | "Unknown" >

<VARIANCE: "variance" >

<XOR: "*|" | "xor" >

<CONTEXT: "context" | "Context">

<ELSE: "else" >

<ENDPACKAGE: "endPackage" | "EndPackage" | "endpackage">

<ENDIF: "endif" >

<IF: "If" | "if" >

<LET: "Let" | "let" >

<PACKAGE: "Package" | "package">

<THEN: "then" >

<IN: "in" >

<NULL: "null" >

GELLO compiler Demo
Medical-Objects presented its GELLO compiler and suggested updates to the BNF to the Clinical Decision Support meeting at the HL7 Meeting in Atlanta. A copy of the PowerPoint slide presentation is available here

We would like to invite people or organisations interested in trying out GELLO to contact us and we will make a download available. Email us at info@medical-objects.com.au
Announcements
GELLO Compiler Available - Tuesday, August 21, 2007
Medical-Objects today released demo versions of our GELLO compiler and an interim Version of a GLIF editor. The GELLO compiler supports our new grammer. There are many GELLO examples included, both as standalone files and integrated into a GLIF Lymphoma Wizard. The GLIF wizard is the result of a reseach project which was partially funded by The Australian Governments ITOL (Information Technology Online) Program. Included in the download is quite extensive documentation on GELL, GLIF and archetypes in HL7 V2

The link to the installer is below.
 

Gello Lives
Medical-Objects have recently implemented a GELLO compiler and Virtual Medical record (vEMR). This will enable high level decision support and is a development we are very excited about.

We are documenting the properties of the GELLO language here and will gradually present examples of the real world use of GELLO to provide Clinical Decision Support services. GELLO is an ANSI standard language, but the actual implementation brings out some issues with the standard that need to be addressed.

The Medical-Objects GELLO IDE is currently undergoing beta testing and is available for no charge in return for feedback and bug reports. If you are interested please Email support@medical-objects.com.au and include you name, Company/institution and Email address, and we will supply installation instructions.
Links
Copyright 2008 Medical Objects   |  Privacy Statement  |  Terms Of Use