Versions Compared

Key

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

...

This worked example will demonstrate using screen shots from the Medical Objects Explorer software. It will show some GELLO that looks for archetyped clinical patient data of height , weight, waist circumference and Blood pressure, such as might be obtained when a patient presents to a medical clinic. The code will takes take this data, and also look for recent blood tests results; and run its logic as to whether certain conditions are present such as being overweight or having abnormal metabolic profiles. We will use BMI and Triglyceride/HDL ratio. The result of the GELLO is another observation that presents in the UI as System Generated information, below the displayed Observation that has triggered the Comment GELLO.

...

     Let measured_weight_LN: CD = CD{code = '29463-7', codeSystem = '2.16.840.1.113883.6.1', codeSystemName ='LN'}
     Let measured_height_LN: CD = CD{code = '8302-2', codeSystem = '2.16.840.1.113883.6.1', codeSystemName ='LN'}
     Let measured_waist_LN: CD = CD{code = '8280-0', codeSystem = '2.16.840.1.113883.6.1', codeSystemName ='LN'}
     Let sys_BP_LN: CD = CD{code = '8480-6',c odeSystemcodeSystem = '2.16.840.1.113883.6.1', codeSystemName ='LN'}
     Let diast_BP_LN: CD = CD{code = '8462-4', codeSystem = '2.16.840.1.113883.6.1', codeSystemName ='LN'}

...

     --TG HDL ratio
Let trig_HDL_Ratio : Real = If last_trigObservation.oclIsDefined() and last_hdlObservation.oclIsDefined() then
last_trigObservation.value.oclAsType(PQ).value / last_hdlObservation.value.oclAsType(PQ).value
else null endif
Let trig_HDL_Ratio_raised: Boolean = If last_trigObservation.oclIsDefined() and last_hdlObservation.oclIsDefined() then
If last_trigObservation.value.oclAsType(PQ).value / last_hdlObservation.value.oclAsType(PQ).value > 2
then True
else False endif
else False endif
     Let trig_HDL_ratio_asChar: String = If trig_HDL_Ratio.oclIsDefined() then trig_HDL_Ratio.toChar() else '' endif

     Prepare comments:

     -- prepare comments
     Let commentCode:CD =CD{code = '8251-1', codeSystem = '2.16.840.1.113883.6.1', codeSystemName ='LN', displayName = ST{value='Comment'}}
     Let bmiString: String = 'BMI is '
     Let additionalBMIComment: String = If bmi.oclIsDefined() then
        If bmi <18.6 then '. Patient is considered to be Underweight.' else
        If bmi >25 and bmi < 30 then '. Patient is considered to be Overweight.' else
        If bmi >29.9 then '. Patient is considered to be Obese.' else
         ''
       endif endif endif else '' endif
     Let trig_HDL_ratio_asChar: String = If trig_HDL_Ratio.oclIsDefined() then trig_HDL_Ratio.toChar() else '' endif
     Let trig_HDL_ratio_comment1: String = If trig_HDL_Ratio_raised then
        '\nTriglyceride-HDL ratio is ' else '' endif
     Let trig_HDL_ratio_comment2: String = If trig_HDL_Ratio_raised then trig_HDL_ratio_asChar.concat('. Levels above 2 are significant.')
        else '' endif
     Let trig_HDL_ratio_comment: String = trig_HDL_ratio_comment1.concat(trig_HDL_ratio_comment2)
     Let comment: String = bmiString.concat(bmi_AsString).concat(additionalBMIComment).concat(trig_HDL_ratio_comment)


Produce the result:

     -- result 
Let result_comment:ST = ST{value=comment}
Let result:Sequence(Observation)
= Sequence{Observation{
value = result_comment,
observationCode = commentCode
}
}
result


OK! So here's the input screen in MO Explorer, for the archetype that becomes the Incoming Observation that the GELLO is watching for the LOINC codes for (Comment GELLO just as easily runs against HL7 lab data Observations)

...

:

Image Added


Here's what happens when we run the gello explicitly against this patient's data:

Image Added


Here's the UI of the Observation showing the comment as a string under 'System Generated information':

Image Addeduwf