
The above shows a typical web form calculator for the CHA2DS2-VASc score, used for estimating the risk of stroke in patients with non-rheumatic atrial fibrillation (AF), primarily for the purpose of deciding the use of anti-coagulant therapy [Wikipedia].
How would such a score be programmed?
The thesis of our approach in openEHR is the use of a high-level guideline programming language, which you may think of as an updated version of things like Arden Syntax. It aims to be more comprehensive and to solve some of the problems that Arden does not.
Here’s how the core calculation looks in the current version of openEHR Decision Logic (see the full module here):

The above calculates the basic score. There are further tables commonly used to convert the raw score to a stroke risk, such as the following.

The question here is: can we envisage that with a bit of training, domain experts (in this case, cardiologists, experts in AF, anti-coagulation etc) and clinical informaticists could use this kind of high-level language? Assume that there is a nice text editor with auto-complete, syntax colouring and so on.
The above syntax – openEHR DL – has been designed so that it appears as close as possible to the published (and indeed, mental) form used in the domain – in other words, to provide a cognitively easy pathway to converting (or authoring de novo) natural language guidelines in computable form. openEHR DL is integrated with related formalisms representing Plans as well as subject proxy variables, rather than being standalone, so it may be an attractive direction for the future.
With a published meta-modal and grammar, decision logic modules (DLMs) written in a language like the above could become an attractive way to share computable clinical guidelines.
Making such a language attractive means including features, even syntax tricks (such as the long line comments to create the appearance of in-line tables), to make this kind of programming appear natural to clinical / medical experts.
Over the next few months I will publish more such snippets of well-known guidelines in openEHR DL format, including some other interesting tricks.