I have introduced some new syntax ideas into the evolving Decision Logic Module (DLM) language, which is intended to become the formalism for representing next generation GDL guidelines and also decision logic associated with Task Plans. The particular innovation here is to convert what programmers think of as if/then/else chains and also case statements to a tabular approach:
rules
|
| This is a case statement on the variable amniotic_fluid_state
|
amniotic_fluid_risk: Terminology_term
Result :=
map amniotic_fluid_state
============================================
[premature rupture],
[polyhydramnios]: [obstetric_emergency],
--------------------------------------------
[oligohydramnios]: [refer_high_risk_care],
--------------------------------------------
*: [normal_obstetric_care]
============================================
|
| This is an if/then/else chain
|
hypertension_risk: Terminology_term
Result :=
===========================================================
has_pre_eclampsia or
has_eclampsia: [obstetric_emergency],
-----------------------------------------------------------
previous_obstetric_hypertension or
previous_pre_eclampsia or
previous_eclampsia or
has_pregnancy_hypertension: [refer_high_risk_care],
-----------------------------------------------------------
*: [normal_obstetric_care]
===========================================================
|
| This is a single Boolean expression
|
gestational_diabetes_risk: Boolean
Result :=
bmi.in_range ([high]) or
previous_macrosomic_baby or
previous_gestational_diabetes or
family_history_of_diabetes or
race_related_diabetes_risk
The proposition is that this approach, which is really just a cunning use of certain syntax elements like comment strings (----
and ====
), and the '*'
character to mean āelseā, allows a way to represent a lot of simple logic in a way very similar to what is found in published guidelines, i.e. as visual tables. The idea (so far) is that the meaning of the text is the same without without the comment lines, which makes life fairly easy for implementers.
In the future of course, we will have colourised syntax-sensitive editing and syntax display, as well as GUI tools for those who donāt like logic programming.
Nevertheless, my thesis at the moment is that if we can get the formal representation very close to the published natural language forms of guidelines, it will be relatively easy for (some) clinical / guidelines experts to do the authoring, with a bit of light training.
See full examples here.