Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Fold all that up and the next level up is SNOMED CT.  SNOMED CT is a large medical ontology looked after by IHTSDO.org. GELLO uses it especially for subsumption queries, with the "implies"method. We won't see this today but it is useful in the homework at the end ;-)

Above this is iso_21090_datatypes. If you look up the CD datatype in here you can see that is about coded values and that the implies method is understood by this datatype.

Ok lets go back to the middle workspace. Notice the editor puts the first line in for you. We are in a context of a GLIF Decision node.
Our first line of GELLO  below this context statement will be:

    1 + 1

Compile it (five buttons in from LHS top menu). All good, now run it (seven buttons in from LHS top menu). Can you see the result now in Results Explorer?

...

Class Observation gets used a lot. Here we can see it has an observationCode (unfold that too for a look - see it in turn has a code, a codeSystem and a codeSystemName); a value which is of type Physical Quantity and a dateTime.

Returning to the workspace code, when using the stand alone GELLO editor  we can specify what packages are being imported. This is useful for an extended vmr model or to import a Library with its pre-made functions.
Saying  'Imports HL7_v2_VMR_V1 ' directly after the Context statement is important in other contexts, but is usually not needed in the GLIFEditor environment.

Lets get all the Hemoglobin observations.
We can see in the image from just above that observations is a sequence of instances of class Observation. So we can use a select operator as this is a sequence and make use of the observationCode.
Here's two lines to put in now in the workspace. We will make local variables with 'Let' statements. Clear the 'vmr' line we had and cut and paste:

 

     Let hemoglobin:CD = CD{code = '718-7',
               codeSystem = '2.16.840.1.113883.6.1',
               codeSystemName ='LN'}

Let allHbObservations = vmr.observations->select(observationCode = hemoglobin)

...

Compile and run. The first line makes a local variable of type CD that is then plugged in the select operator in the second. The codeSystemName is 'LN" which is short for LOINC and 718-7 is the code. [Find this in the text.xml data if you like. You can read about this code by googling "hipaa 718-7". Loinc is produced by the Regenstrief Institute.]

Now are there any error messages?  - look down the bottom... Unlike 'hemoglobin:CD' we haven't specified a datatype for the variable 'allHbObservations'. This compile error didn't stop the code we have running, so its not critical. It is in fact sometimes useful to leave a LHS variable untyped and to see what is actually being returned from the RHS; but let's put in what is now suggested, and the line in question becomes:

    Let allHbObservations: Sequence(Observation) = vmr.observations->select(observationCode = hemoglobin)

Note vmr.observations is a sequence of Observation 


The second error message is that there is no final expression. Gello is made of an inner expression (in) an outer expression. We haven't done the final declarative line yet that consititutes the outer expression. This will be the GLIFDecisionResult object we come up  with at the end of this GELLO expression.

Making use of the populated dateTime attribute in class Observation:

    Let mostRecentHb = allHbObservations->last()

If you run/compile that couple of times you should again get the error suggesting a type for LHS, so becomes:

    Let mostRecentHb: Observation = allHbObservations->last()

and screenshot after running is :