...
else false
endif
has_Tachycardia
Save that and save the GLIF file. Let's test what we have so far.
Go File, Load xml Test Data and choose GLIF_TutorialSix.xml
Click on the Run button. What happens? Yes the patient state gets a little green arrow in it and the link arrow from it to the next action step should remain green ( ie it is running). Click on the green arrow and you can see the value being persisted for the patient state as a result of the GELLO that has been executed.
Now we will re-use that intermediate persisted state in a Decision. Add a decision node and call it 'Tachycardia and aged over 75?' Flow the decision out to two action nodes.
In the Yes link, use this code:
Context GLIF_VMR::GLIFDecisionNode
Let q: String = "Is patient tachycardic and aged over 75yrs?"
Let aWeight: Integer = 50
Let isTachycardic: Boolean = GLIFNodes.patient_state_by_name('tachycardic?')
Let age: PQ = factory.Now() - vmr.patient.dob
Let ageInYears: PQ = age.convert('yr')
Let result:GLIFDecisionResult =
if not vmr.vitals.pulseRate.oclIsDefined() and not vmr.patient.dob.oclIsDefined() then
GLIFDecisionResult{Question = q,Answer = unknown, Reason = "No pulse rate or age information",Weight = aWeight}
else
If isTachycardic and ageInYears >= factory.PQ(75, 'yr')
then
GLIFDecisionResult{Question = q,Answer = true, Reason = "Patient is tachycardic and aged over 75 years",Weight = aWeight}
else
GLIFDecisionResult{Question = q,Answer = false, Reason = "Patient is not tachycardic and aged oiver 75 years",Weight = aWeight}
endif
endif
result
and I will leave it you to put the corresponding code for the 'No' link.
jsvdjv
T