Adam's version of Diabetes (using 2 parallel lists for treatment)

version 1



PLAN Diabetes-Mellitus-Type-2
PLAN BODY

do sequentially , wait-for-optional-subplans = yes , wait-for one

Diagnostics
Policy
PLAN Diagnostics
PLAN BODY

do sequentially , wait-for-optional-subplans = yes , wait-for Anamnesis

Anamnesis
Glucose-determination
Risk-inventory
PLAN Anamnesis
PLAN BODY

do sequentially , wait-for all

do sequentially , wait-for-optional-subplans = yes , wait-for Anamnesis-typical-signs

Anamnesis-typical-signs
Anamnesis-olderthan-45
if (or (typical-signs = true) (risk-factors = true) )
then
glucose-determination-needed = true
else
glucose-determination-needed = false
PLAN Anamnesis-typical-signs
PLAN BODY

do sequentially , wait-for all

do any-order , wait-for all

ask thirst
ask polyuria
ask weight-loss
if (and (age > 60) (sex = female) )
then
ask pruritis-vulvae
if (or (thirst = true) (polyuria = true) (weight-loss = true) (and (age > 60) (sex = female) (pruritis-vulvae = true) ) )
then
typical-signs = true
else
typical-signs = false
PLAN Anamnesis-olderthan-45
PLAN BODY

do sequentially , wait-for all

do any-order , wait-for all

ask DMT2-in-1sr-grade-relatives
ask hypertension
ask CV-diseases
ask fat-metabolism-problems
ask quetelet-index
ask ethnic-group
if (sex = female)
then
ask DM-in-past
ask newborns-biggerthan-4kg
if (or (DMT2-in-1st-grade-relatives = true) (hypertension = true) (CV-diseases = true) (fat-metabolism-problems = true) (quetelet-index >= 27) (ethnic-group = hindustanian) (and (sex = female) (or (DM-in-past = true) (newborns-biggerthan-4kg = true) ) ) )
then
risk-factors = true
else
risk-factors = false
PLAN Glucose-determination
PLAN BODY

do sequentially , wait-for all

do any-order , wait-for one

Fasting-glucose-test-manual
Non-fasting-glucose-test-manual
if (glucose-evaluation = DMT2)
then
Fasting-glucose-test [2d, 7d] [-, -] [-, -]
PLAN Fasting-glucose-test-manual
Fasting glucose test
CONDITIONS activate-mode = manual
PLAN BODY

do any-order , wait-for all

ask glucose-measurement-type
ask fasting-glucose
PLAN Non-fasting-glucose-test-manual
Non-fasting glucose test
CONDITIONS activate-mode = manual
PLAN BODY

do any-order , wait-for all

ask glucose-measurement-type
ask non-fasting-glucose
PLAN Fasting-glucose-test
Fasting glucose test
PLAN BODY

do any-order , wait-for all

ask glucose-measurement-type
ask fasting-glucose
PLAN Risk-inventory
PLAN BODY

do any-order , wait-for all

ask CH-diseases
ask CH-disease-in-youngerthan-60-1st-grade-relatives
ask feeding-habits
ask smoking
ask alcohol-consuming
ask physical-exercise
ask quetelet-index
ask higher-blood-pressure
ask lower-blood-pressure
if (age < 50)
then
Albumin-test
ask GHb
ask creatinin
Cholesterol-tests
Feet-examination
Retinopathy-investigation [-, -] [, 6mon] [-, -]
PLAN Albumin-test
PLAN BODY

do any-order , wait-for one

Albumin-test-manual
Albumin-creatinin-ratio-test-manual
PLAN Albumin-test-manual
CONDITIONS activate-mode = manual
PLAN BODY
ask albumin-in-urine
PLAN Albumin-creatinin-ratio-test-manual
CONDITIONS activate-mode = manual
PLAN BODY
ask albumin-creatinin-ratio-in-urine
PLAN Cholesterol-tests
PLAN BODY

do sequentially , wait-for all

ask total-cholesterol
ask HDL-cholesterol
ask triglycerids
PLAN Feet-examination
Perform a feet examination
PLAN BODY
user-performed
PLAN Retinopathy-investigation
Perform a retinopathy investigation
PLAN BODY
user-performed
PLAN Policy
PLAN BODY

do sequentially , wait-for all

Education-DMT2

do unordered , retry-aborted-subplans = yes , wait-for Treatments-and-Controls

Treatments-and-Controls
Policy-for-concurrent-diseases
Policy-for-hypoglycemic-coma
Policy-for-consultation
Policy-for-chiropodist-referral
Policy-for-nurse-referral
PLAN Education-DMT2
Give information about the most important aspects of DM
PLAN BODY
user-performed
PLAN Treatments-and-Controls
PLAN BODY

do parallel , wait-for none

Non-insulin-DMT2-treatments
on-abort Insulin-DMT2-treatments
Treatment-of-CV-disease-risk-factors
cyclical-plan
Quarterly-control
repeat-specification
retry-delay min = 2.5mon, max = 3.5mon
cyclical-plan
Annual-control
repeat-specification
retry-delay min = 11.5mon, max = 12.5mon
PLAN Non-insulin-DMT2-treatments
PLAN BODY

do sequentially , wait-for-optional-subplans = yes , wait-for Diet-specialist-referral

Diet-specialist-referral
Fasting-glucose-test [11w, 13w] [-, -] [-, -]
SU-derivative-treatment
SU-derivative-plus-metformin-treatment
PLAN Diet-specialist-referral
Diet specialist referral
PLAN BODY
user-performed
PLAN SU-derivative-treatment
PLAN BODY

do sequentially , wait-for all

DMT2-treatment = antidiabetics
if (quetelet-index <= 27)
then
ask drug-name
put-last drug-name in antidiabetics
else
put-last metformin in antidiabetics
antidiabetic-doses = Initialise-drug-doses (antidiabetics, iterator-antidiabetics, antidiabetic-doses, iterator-antidiabetic-doses)
antidiabetic-doses = Find-antidiabetic-doses (antidiabetics, iterator-antidiabetics, antidiabetic-doses, iterator-antidiabetic-doses)
PLAN Initialise-drug-doses
ARGUMENTS drugs, iterator-drugs, drug-doses, iterator-drug-doses
PLAN BODY

do sequentially , wait-for all

reset-iterator iterator-drugs
reset-iterator iterator-drug-doses
go-to-next iterator-drug-doses
drug-dose
iterative-plan
do-repeatedly
ask drug-dose
go-to-next iterator-drugs
go-to-next iterator-drug-doses
termination-condition
is-at-end (iterator-drugs)
RETURNS drug-doses
PLAN Find-antidiabetic-doses
ARGUMENTS drugs, iterator-drugs, drug-doses, iterator-drug-doses, antidiabetic-maximal-doses
PLAN BODY
cyclical-plan
drug-doses ,... = Increase-drug-doses (drugs, iterator-drugs, drug-doses, iterator-drug-doses)
repeat-specification
retry-delay min = 2w, max = 4w
RETURNS drug-doses
PLAN Increase-drug-doses
ARGUMENTS drugs, iterator-drugs, drug-doses, iterator-drug-doses
PLAN BODY

do sequentially , wait-for all

ask maximal-drug-doses
reset-iterator iterator-drugs
reset-iterator iterator-drug-doses
iterative-plan
do-repeatedly
ask drug-dose-increase
put-last ( + drug-dose-increase get(iterator-drug-doses) ) in aux-doses
go-to-next iterator-drugs
go-to-next iterator-drug-doses
termination-condition
is-at-end (iterator-drugs)
RETURNS aux-doses , maximal-drug-doses
PLAN SU-derivative-plus-metformin-treatment
PLAN BODY

do sequentially , wait-for all

ask drug-name
put-last drug-name in antidiabetics
put-last metformin in antidiabetics
antidiabetic-doses = Initialise-drug-doses (antidiabetics, iterator-antidiabetics, antidiabetic-doses, iterator-antidiabetic-doses)

do unordered , wait-for Find-antidiabetic-doses

antidiabetic-doses = Find-antidiabetic-doses (antidiabetics, iterator-antidiabetics, antidiabetic-doses, iterator-antidiabetic-doses)
antidiabetics ,... = Check-for-antidiabetic-problems (antidiabetics, iterator-antidiabetics, antidiabetic-doses, iterator-antidiabetic-doses)
PLAN Check-for-antidiabetic-problems
ARGUMENTS drugs, iterator-drugs, drug-doses, iterator-drug-doses
PLAN BODY

do sequentially , wait-for all

ask problematic-antidiabetic
reset-iterator iterator-drugs
reset-iterator iterator-drug-doses
(or ( = problematic-antidiabetic) )
iterative-plan
do-repeatedly
go-to-next iterator-drugs
go-to-next iterator-drug-doses
termination-condition
is-at-end (iterator-drugs)
put-last acarbose in drugs
ask drug-dose
put-last drug-dose in drug-doses
RETURNS drugs , drug-doses
PLAN Insulin-DMT2-treatments
PLAN BODY

do sequentially , wait-for all

Education-insulin

do any-order , wait-for one

Insulin-plus-antidiabetics-treatment
Only-insulin-treatment
PLAN Education-insulin
Give information about insulin self-control
PLAN BODY
user-performed
PLAN Insulin-plus-antidiabetics-treatment
CONDITIONS activate-mode = manual
PLAN BODY

do sequentially , wait-for-optional-subplans = yes , wait-for Four-points-day-curve

DMT2-treatment = insulin-plus-antidiabetics
Four-points-day-curve
insulin-type = mid-term
insulin-dd = 1
ask par-evening-insulin-dose
evening-insulin-dose = par-evening-insulin-dose
evening-insulin-intake = after-meal
Find-evening-insulin-dose [2d, 3d] [-, -] [-, -]
insulin-dd ,... = Change-insulin-to-2dd (evening-insulin-dose)
PLAN Four-points-day-curve
PLAN BODY

do sequentially , wait-for all

ask fasting-glucose
ask after-breakfast-glucose
ask after-lunch-glucose
ask after-dinner-glucose
PLAN Find-evening-insulin-dose
ARGUMENTS evening-dose
PLAN BODY
cyclical-plan
evening-dose = Test-glucose-and-adapt-evening-insulin (evening-dose)
repeat-specification
retry-delay min = 7d, max = 10d
RETURNS evening-dose
PLAN Test-glucose-and-adapt-evening-insulin
ARGUMENTS evening-dose
PLAN BODY

do sequentially , wait-for all

Four-points-day-curve
ask evening-adaptation
RETURNS ( + evening-doseevening-adaptation)
PLAN Change-insulin-to-2dd
ARGUMENTS evening-dose
PLAN BODY

do sequentially , wait-for-optional-subplans = yes , wait-for Find-morning-insulin-dose

DMT2-treatment = insulin
dd = 2
evening-intake = before-meal
ask par-morning-insulin-dose
morning-dose = par-morning-insulin-dose
morning-intake = before-meal
morning-dose = Find-morning-insulin-dose (morning-dose)
Diabetes-specialist-referral
RETURNS dd , evening-intake , morning-dose , morning-intake
PLAN Find-morning-insulin-dose
ARGUMENTS morning-dose
PLAN BODY
cyclical-plan
morning-dose = Test-glucose-and-adapt-morning-insulin (morning-dose)
repeat-specification
retry-delay min = 7d, max = 10d
RETURNS morning-dose
PLAN Test-glucose-and-adapt-morning-insulin
ARGUMENTS morning-dose
PLAN BODY

do sequentially , wait-for all

Four-points-day-curve
ask morning-adaptation
RETURNS ( + morning-dosemorning-adaptation)
PLAN Diabetes-specialist-referral
Diabetes specialist referral for change of insulin regime
PLAN BODY
user-performed
PLAN Only-insulin-treatment
CONDITIONS activate-mode = manual
PLAN BODY

do sequentially , wait-for all

DMT2-treatment = insulin
ask par-insulin-type
insulin-type = par-insulin-type
insulin-dd = 2
morning-insulin-dose = 12
morning-insulin-intake = before-meal
evening-insulin-dose = 6
evening-insulin-intake = before-meal
evening-insulin-dose ,... = Find-insulin-doses (evening-insulin-dose, morning-insulin-dose)
PLAN Find-insulin-doses
ARGUMENTS morning-dose, evening-dose
PLAN BODY
cyclical-plan
evening-dose ,... = Test-glucose-and-adapt-insulin (evening-dose, morning-dose)
repeat-specification
retry-delay min = 2d, max = 3d
RETURNS evening-dose , morning-dose
PLAN Test-glucose-and-adapt-insulin
ARGUMENTS evening-dose, morning-dose
PLAN BODY

do sequentially , wait-for all

Four-points-day-curve
ask evening-adaptation
ask morning-adaptation
RETURNS ( + evening-doseevening-adaptation) , ( + morning-dosemorning-adaptation)
PLAN Treatment-of-CV-disease-risk-factors
PLAN BODY

do unordered , wait-for-optional-subplans = yes , wait-for none

Smoking-advice
Hypertension-treatment
Cholesterol-treatment
Microalbuminuria-treatment
PLAN Smoking-advice
Recommend strongly that the patient stops smoking
PLAN BODY
user-performed
PLAN Hypertension-treatment
Refer to NHG Hypertension protocol
PLAN BODY
user-performed
PLAN Cholesterol-treatment
Refer to NHG Cholesterol protocol
PLAN BODY
user-performed
PLAN Microalbuminuria-treatment
PLAN BODY

do sequentially , wait-for all

ask drug-name
put-last drug-name in ACE-inhibitors
ACE-inhibitor-doses = Initialise-drug-doses (ACE-inhibitors, iterator-ACE-inhibitors, ACE-inhibitor-doses, iterator-ACE-inhibitor-doses)
ACE-inhibitor-doses = Find-ACE-inhibitor-doses (ACE-inhibitors, iterator-ACE-inhibitors, ACE-inhibitor-doses, iterator-ACE-inhibitor-doses)
PLAN Find-ACE-inhibitor-doses
ARGUMENTS drugs, iterator-drugs, drug-doses, iterator-drug-doses, ACE-inhibitor-maximal-doses
PLAN BODY
cyclical-plan
drug-doses ,... = Increase-drug-doses (drugs, iterator-drugs, drug-doses, iterator-drug-doses)
repeat-specification
retry-delay min = 1mon, max = 3mon
RETURNS drug-doses
PLAN Quarterly-control
PLAN BODY

do any-order , wait-for all

ask wellbeing
ask hypoglycemia
ask feeding-problems
ask treatment-problems
ask weight
if (or (DMT2-treatment = insulin) (DMT2-treatment = insulin-plus-antidiabetics) )
then
Four-points-day-curve
else
Fasting-glucose-test

do sequentially , wait-for all

ask feet-problems
if (feet-problems = true)
then
Feet-examination
PLAN Annual-control
PLAN BODY

do any-order , wait-for all

Quarterly-control
ask visus-problems
ask CV-problems
ask neuropathy
ask sexual-problems
ask higher-blood-pressure
ask lower-blood-pressure
Feet-examination
if (or (DMT2-treatment = insulin) (DMT2-treatment = insulin-plus-antidiabetics) )
then
Injection-points-investigation
ask GHb
ask creatinin
if (cholesterol-treatment = false)
then
Cholesterol-tests
if (age < 50)
then
Albumin-test
Funduscopy
PLAN Injection-points-investigation
Perform an investigation of injection points
PLAN BODY
user-performed
PLAN Funduscopy
Perform a funduscopy
PLAN BODY
user-performed
PLAN Policy-for-concurrent-diseases
PLAN BODY

do sequentially , wait-for all

Extra-fluid-intake-prescription
Glucose-lowering-therapy-advice
ask concurrent-diseases-over
PLAN Glucose-lowering-therapy-advice
Temporary increase based on blood glucose levels. Never discontinue insulin, even if less food is consumed
PLAN BODY
user-performed
PLAN Extra-fluid-intake-prescription
Prescribe extra fluid intake
PLAN BODY
user-performed
PLAN Policy-for-hypoglycemic-coma
PLAN BODY

do sequentially , wait-for all

do any-order , wait-for one

Glucose-solution-prescription-manual
Glucagon-prescription-manual
Carbohydrate-rich-feeding-prescription
Hypoglycemia-cause-investigation
ask hypoglycemic-coma-over
PLAN Glucose-solution-prescription-manual
Prescribe glucose solution
CONDITIONS activate-mode = manual
PLAN BODY
user-performed
PLAN Glucagon-prescription-manual
Prescribe glucagon
CONDITIONS activate-mode = manual
PLAN BODY
user-performed
PLAN Carbohydrate-rich-feeding-prescription
Prescribe carbohydrate rich feeding
PLAN BODY
user-performed
PLAN Hypoglycemia-cause-investigation
Perform a investigation of hypoglycemia cause
PLAN BODY
user-performed
PLAN Policy-for-consultation
PLAN BODY

do sequentially , wait-for all

Consultation
ask consultation-over
PLAN Consultation
Consultation
PLAN BODY
user-performed
PLAN Policy-for-chiropodist-referral
PLAN BODY

do sequentially , wait-for all

Chiropodist-referral
ask chiropodist-referral-over
PLAN Chiropodist-referral
Chiropodist referral
PLAN BODY
user-performed
PLAN Policy-for-nurse-referral
PLAN BODY

do sequentially , wait-for all

Nurse-referral
ask nurse-referral-over
PLAN Nurse-referral
Nurse referral
PLAN BODY
user-performed


Created by Mar Marcos on -