...
class InfrastructureRoot extends Any
singlePatient: ExtendedDiabeticFootExample_SinglePatient
EndPackage
As before with a Library, this file needs to be saved to the same folder as any GELLO files that use it.
Now lets add some more clinical data to fifthTest.xml and save it as SeventhTuteTest.xml.
Add it between </vitals> and </singlePatient> at the end:
<observations>
<observationCode code="43396009"
codeSystem="2.16.840.1.113883.6.96"
codeSystemName="SNOMED-CT">
<displayName value = "Hemoglobin A1c measurement " />
<translation code="4548-4"
codeSystem="2.16.840.1.113883.6.1"
codeSystemName="LN">
<displayName value = "Hemoglobin A1c/Hemoglobin.Total In Blood" />
</translation>
</observationCode>
<dateTime value = "20160616" />
<value xsi:type = "PQ" value = "9.0" unit = "%"/>
</observations>
<diabeticFootObservations>
<diabeticFootExamDate value = "20160616" />
<leftDorsalisPedisPulseFull value = "false" />
<rightDorsalisPedisPulseFull value = "true" />
<leftPosteriorTibialPulseFull value = "true" />
<rightPosteriorTibialPulseFull value = "true" />
<leftAnkleBrachialIndex value = "0.7" />
<rightAnkleBrachialIndex value = "0.9" />
<anyFootDeformity value = "false" />
<anyNeurologicalChanges value = "false" />
<anyUlcerPresent value = "false" />
</diabeticFootObservations>
Cut and paste the following GELLO into a new workspace:
Imports ExtendedDiabeticFoot
Context ExtendedDiabeticFootExample_SinglePatient
Let lastFootExam: DiabeticFootObservations = diabeticFootObservations->
sortedBy(diabeticFootExamDate)->last()
Let lastHBA1c: PQ = observations->
select(o|o.observationCode.code='43396009')
->sortedBy(dateTime)->last().value.oclAsType(PQ)
--flag a high risk situation
Let highRiskDiabeticFoot: Boolean =
(lastFootExam.leftAnkleBrachialIndex < 0.9 or
lastFootExam.rightAnkleBrachialIndex < 0.9) or
(lastFootExam.leftDorsalisPedisPulseFull = false or
lastFootExam.rightDorsalisPedisPulseFull = false) or
lastFootExam.anyFootDeformity = true or
lastFootExam.anyNeurologicalChanges = true or
lastFootExam.anyUlcerPresent= true
and
lastHBA1c > factory.PQ(7.5, '%')
If highRiskDiabeticFoot then 'High Risk DiabeticFoot - consider referral'
else
''
endif
And after compiling and saving it say as tuteSeven.gello , run:
jkebgrkbn