Versions Compared

Key

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

...

To just see what we have loaded, clear the  1 + 1 line the  '1 + 1' line and simply type  vmr 'vmr'

Run that and unfold the result in Results Explorer. Can you see 24 31 Observations? have Have a look at the first one:

Image Added

 

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 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: