GELLO Update
E N D
Presentation Transcript
GELLO Update HL7 Working Group Meeting @ Baltimore 2nd October 2002 Aziz Boxwala and Robert Greenes Brigham and Women’s Hospital Harvard Medical School
What is GELLO? • Expression language • Query language • maps variables in expressions to data in external systems • Embedded language • Can be used as part of other specs • MLM, guidelines, RIM, template constraints, etc. • Goal is to facilitate sharing of knowledge HL7 @ Baltimore
Arden Syntax Guideline (Sequential Knowledge) RIM Expressions (Ontology) Other DS & KBs GELLO Q&E GELLO Q&E GELLO Q&E GELLO Q&E vMR Object-oriented data model Model HL7 @ Baltimore
Status report • As of May 2002 meeting, we had agreed to bring this to TC ballot • But decided to defer because of desire to: • Reduce complexity of syntax • Make more compatible with generic language specification efforts • Eliminate side effects in expressions • Facilitate use as embedded language distinct from other elements of an application, e.g., those that do assignment or flow control • Revised language specification developed • To be presented here HL7 @ Baltimore
Requirements - 1 • Work with an object-oriented data structure compatible with the RIM • Should support different data models (such as VMR) • Be platform independent • Be easy to write and read for defined class of users • Be usable in different ‘applications’ (Arden MLMs, guidelines, templates, …) • Leverage existing standard frameworks/languages where possible HL7 @ Baltimore
Requirements - 2 • Be side-effects free • Built-in data types (if any) should be compatible with those defined in the RIM • Be extensible • classes must be compatible with the RIM and language framework • Be free of ambiguities HL7 @ Baltimore
Using OCL grammar • Object Constraint Language • Part of UML spec • Object Management Group standard • Language for specifying invariants on classes and its member attributes and functions • Not a complete programming language • Side-effects free • Maps to our needs and requirements HL7 @ Baltimore
An example with an MLM maintenance: title: Screening for elevated calcium-phosphate product;; library: purpose: provide an alert if the product of the blood calcium and phosphorus exceeds a certain threshold in the setting of renal failure;; explanation: An elevated Ca-PO4 product suggests a tendency toward renal osteodystrophy and predisposes to soft-tissue calcification;; HL7 @ Baltimore
…MLM knowledge: data: /* trigger on Ca, PO4 or Cr */ creatinine := read last {'dam'="PDQRES2",'constraints'="C****"; ;'32752'}; calcium := read last {'dam'="PDQRES2",'constraints'="C****"; ;'32109'}; phosphate := read last {'dam'="PDQRES2",'constraints'="C****"; ;'33824'}; creatinine_threshold := 2; product_threshold := 70; HL7 @ Baltimore
…MLM logic: if (creatinine is not number) or (calcium is not number) or (phosphate is not number) then conclude false; endif; product := calcium * phosphate; if (creatinine >= creatinine_threshold) and (product >= product_threshold) then conclude true; else conclude false; endif; HL7 @ Baltimore
MLM in GELLO (data slot) data: creatinine := Observation.allInstances->select(coded_concept= "C0428279") .sort(critical_time.high).last() calcium := Observation.allInstances ->select(coded_concept= "C0428302") .sort(critical_time.high).last() phosphate := Observation.allInstances ->select(coded_concept = "C0428304") .sort(critical_time.high).last() List<Observation> := last(select obs from Observation as obs where obs.service_cd.equals(new Concept(“MTH”, “C042879”)) sort descending obs.critical_time.high); creatinine := read last {'dam'="PDQRES2",'constraints'="C****"; ;'32752'}; There are ways to make the GELLO query syntax easier – for example by defining class/static functions in VMR classes to retrieve instances Observation.select(coded_concept = "C0428279").last() HL7 @ Baltimore
… MLM in GELLO (data slot) • renal_failure_threshold := PhysicalQuantity.new(2.0, "mg/dl") • renal_failure := • if creatinine->notEmpty and • creatine.observed_quantity > renal_failure_threshold then • true • else • false • endif • threshold_for_osteodystrophy := 70 • calcium_phosphate_product := • if calcium->notEmpty and phosphate->notEmpty then • calcium.observed_quantity.value * phospate.observed_quantity.value • else • -1 • endif HL7 @ Baltimore
… MLM in GELLO logic: renal_failure and calcium_phosphate_product > threshold_for_osteodystrophy if (creatinine is not number) or (calcium is not number) or (phosphate is not number) then conclude false; endif; product := calcium * phosphate; if (creatinine >= creatinine_threshold) and (product >= product_threshold) then conclude true; else conclude false; endif; HL7 @ Baltimore
Implementation model Application (e.g., Arden alert engine) GELLO Interpreter evaluate(a+b) result: 7 Variable evaluator valueOf(a) 5 Observation.allInstances->select(…) Data retrieval result:Collection/tuple HL7 @ Baltimore
Issues • Side-effect free language • Constructors • Restructuring of MLM… Let expressions • Built-in datatypes • Same specification or different? • Reconciling OCL standard lib with HL7 datatypes • Writing back data • Observation.write(…) • Exception management HL7 @ Baltimore