openEHR Process, Task Planning and Guidelines Overview

For those following Task Planning, Decision Language etc, I have made a major update to the Overview spec. It is still draft, but is getting toward (I hope) a clearer explanation of the kinds of artefacts we deal with in the real world such as care pathways, guidelines, order sets, and care plans, and executable artefacts that could be used to implement them.

All feedback and fixes welcome.

1 Like

I have made a further update, adding examples and improving text in most parts.

In my opinion an excellent document to provide an overview of the different components, and the complexity of medical domains. Few questions:

  • is the duration of a treatment a proxy subject variable? It is not really patient data, but it is indirectly related to patients. Would an event be able to change the treatment duration on the fly? This is often required for example in the treatment of infections.
  • have you considered collaboration with already existing decision logic systems (e.g. Drools) to accelerate DLM deployment?

Thanks and have a Happy Christmas day!

Natalia

1 Like

Well it depends on whether you mean a nominal duration, e.g. 6 weeks, prescribed by a some standard RCHOPS guideline, or the duration of treatment ultimately prescribed for patient 123 - let’s say her doc decided that a longer period of 8 weeks would help her recover from each round; or the actual duration patient 123 had in reality - let’s say that her treatment was stopped after 5 weeks due to whatever factors.

For the first and second, they should be visible as a ‘constant’ value in the DLM. For the actual duration, we could either:

  • define subject variables for treatment start and treatment end (behind which would be specific queries that are easy enough to write in openEHR, and I would think against FHIR, CDA, etc), and generate the duration with a simple rule that takes the difference; OR
  • just define a single subject variable whose back-end query encodes obtaining the difference, which is also easy to do in future versions of AQL in which server-side functions will be possible in the SELECT part of the query.

This value can clearly change if the underlying data changes, and the DLM rule is re-executed.

Well from my point of view, no options are off the table. However, my impression is that experiences by other groups in the past with Drools is that they are harder to use than they look, because you have to create all the connections to subject variables yourself; the rules language does not necessarily contain all the desired primitives or syntax approach (since we are aiming at a domain-friendly syntax, not a programmer’s syntax). However, I have not looked at what you can do in Drools in recent times - maybe it does everything needed - it would need someone to have a good look.

Generally speaking, the tools for building new languages are much better today than in previous times, so I am more inclined to look at building a new language either from the ground up (i.e. build a parser and interpreter), or a cross-compiler, or with tools such as JetBrains MPS or others (e.g. from Eclipse). I don’t have a strong opinion on the best way forward right now, but in terms of specification, we have nearly the whole language meta-model in BMM + DL. An Antlr4 parser spec will not be too hard - these things will at least provide a guiding model if some other technology is used.

2 Likes

In the treatment of infections first and second “treatment duration” are usually the same thing. The third duration is, as you say, something we can calculate from the patient record, as treatment start and end dates. So, concentrating on the first type, the prescribed treatment duration: this is something that can evolve during the course of the treatment, depending on the patient evolution. My question is if there is something in TP that allows to change not only the treatment duration in the EHR, but also any TP metatada using this value for example in a repeat loop. For example, if I get an antibiotic prescription of 14 days, and represent the administration of the antibiotic as a repeat task with period 8 hours, and upon certain events I need to increase the frequency, let’s say to a 4 hrs period and lengthen the therapy to 22 days, is that possible?

Well, I know Drools version 6. It allows different “dialects” to specify rules and I remember that there was a kind of workbench for domain experts, not necessarily technical people. Also it has an interesting Complex Event Processing system (Drools Fusion was its name). Knowledge maintenance was not complex as Drools rules are declarative, and the EHR data was represented by Java Plain Old Java Object (POJO) classes. If you for example map POJO classes (if they are still used) to OpenEHR classes using the Subject Proxy you propose, you are widening the scope of OpenEHR Drools-based rule systems, often used in medical domains. Not necessarily as a replacement of DLM, but as a collaborator.

If I may, my view on this is that all such decisions should be recorded as clinical data (probably within an INSTRUCTION, although one may argue for EVALUATION). Then the task of task plan modeller is to determine which aspects of the plan need to be flexible in this regard so as to pull the actual (timing etc.) values from the EHR.

This is kind of possible in the current model, but somewhat non-intuitive. I look forward to completion of the Decision Support/Language specification.

1 Like

Thanks for your reply. Yes, I agree with you, first the EHR, then the metadata