Templates for application form development

Hi!

I agree that in many use-cases it is better to have a separate template intended for GUI/application hints overlayed on a “normal” data content definition template. (Quick experimentation may be an exception.)

That is why I added “layers of templates” in my previous comment - sorry for not explaining in detail. So a GUI-hint-annotated template based on another “normal” content aggregation/constraint-focused template would be a way to do it. I guess the effect in a resulting operational template (OPT) is essentially the same no matter how many layers of templates you choose to work with, right? So a form/GUI-renderer based on OPTs does not care how you layer the design, but your maintenance headaches might be affected if not separating things at design time.

I agree with Diego and Bert and suggest starting experimenting in the AM end (for example using annotations with GUI-hints in templates) and see how far that takes us, before possibly considering extending the RM (or whatever *M).

Annotations do not require any changes to AM or RM, the mechanism is already defined in the specifications. Conventions regarding patterns or prefixes in annotation keys and/or annotation values will likely give enough to start with.

A (not so very thought through yet) possible example of annotation use for application building is available in picture 40 (and supported by picture 36 in
https://drive.google.com/file/d/1kxXeJMe0ltfLlchGA0Lm8mfOD-PQDLFy/view?usp=sharing

//Erik

mån 19 feb. 2018 kl. 10:22 skrev Bert Verhees <bert.verhees@rosa.nl>:

note that a key problem I want to address is that templates based on COMPOSITIONs don’t really make sense as models of data retrieval/display forms - they are really only useful for data capture forms (or messages, or documents), because COMPOSITION is a container for committing data to the EHR.

Displaying data is a different question - it may be EHR data, it may be demographic data, and it may be something else entirely. So the data items we want to mention in templates are mostly of ENTRY level, and will be the results of queries; the relevant queries could be included in such templates.

So the starting point for many forms won’t be a COMPOSITION - it is instead a different logical container that groups data that result from one or more queries, into a ‘use group’, i.e the group of data items intended to be visualised or used as a report etc.

One problem today is that people trying to define screens for visual applications are forced (more or less) to create templates starting with COMPOSITIONs, which is incorrect; my impression is that such templates are only used for data capture and that other display forms are modelled in various non-standard ways, or not at all.

I think annotations (based on paths) will be useful, but I not completely adequate to achieved what is needed.

  • thomas

It can be that Compositions appear in a single GUI-form (in GP applications this happens regularly), but there is still no need to to show them from a single template. That can be up to the GUI-designer, he can use HTML-features to handle one or more entries in a single GUI-view. Having the entries offered to the GUI-developer separated from the composition offers all the flexibility the GUI-developer needs.

He can show a complete composition by connecting GUI-blocks on client-level, he can show history-lists of medications or observations without composition context, what ever is desired.

Bert

Yes, this is about two different problems

  1. having extra RM structures tree be used to group RM data in different ways than the one defined for a composition, in order to use y as a data retrieval for APIs and GUI.

  2. another level of definition, above OPTs, to specify GUI structures and attributes, and maybe bindings with specific GUI technologies. This doesn’t affect current RM or change anything on the OPT model.

Is there a terminology with concepts we can use to annotate?
Probably there is and there are more.
Which one, will be the question.

Gerard Freriks
+31 620347088
gfrer@luna.nl

Kattensingel 20
2801 CA Gouda
the Netherlands

IMO annotating templates with UI info is not a good idea. A layered approach is much cleaner and scalable, i.e. to define a new artifact on top of current templates / archetypes / RM (these are also examples of layered design).

Under this approach, if we have UITemplates on top of openEHR Templates, when we generate Operational UITemplates, that will contain UI + structure (template and archetype constraints) + RM references. This would be the final element to be used to feed software. but the underlying models are all separated and have a specific responsibility.

If we go ahead, we can add another level for workflow, defining an order and conditions under which each “screen” should be displayed, like a WFTemplate, having an Operational WFTemplate that will include all WF + GUI + structure + RM references.

We can continue adding layers :slight_smile:

We also have a Final Degree Project where a student made a proposal for a Visual Template Model. It’s from 2012, for ISO 13606, and also in Spanish, but the main idea probably remains the same :slight_smile:

I’ve been always in favor of having a third layer for visualization purposes that defines some of the expected behaviors and the visual aspect. As Erik said, this is not about reinventing what the existing UI frameworks can do, but to have a way of instructing them on how to show the information on screen.

Often Spanish is not always a big problem, let us try drag through Google translate to make it al readable

Bert

I was reviewing that work, and I found it cited this reference. This is an old topic…

H. van der Linden, T. Austin, J. Talmon, Generic screen representations for future-proof systems, is it possible? There is more to a GUI than meets the eye, Comput Methods Programs Biomed. 95 (2009) 213–226. doi:10.1016/j.cmpb.2009.03.003.

In fact David, the work is about how an interface should look like, that is interesting for GUI designers. But the discussion here is not about GUI design but about offering a technical environment to GUI designers.

Bert

Could we have access to that Pablo?
Regards
Jussara Rotzsch

Hi,

There is NO need for an other RM.

Templates (imo) describe an interface.
Templates for an interface used for display only need annotations in the appropriate nodes of the Display Archetype

Gerard Freriks
+31 620347088
gfrer@luna.nl

Kattensingel 20
2801 CA Gouda
the Netherlands

Gerard Freriks
+31 620347088
gfrer@luna.nl

Kattensingel 20
2801 CA Gouda
the Netherlands

note that a key problem I want to address is that templates based on COMPOSITIONs don’t really make sense as models of data retrieval/display forms - they are really only useful for data capture forms (or messages, or documents), because COMPOSITION is a container for committing data to the EHR.

Or any interface be it for committing, querying, display, data entry, documents, messages, clinical decision support interactions?
These all can be dedicated kinds of Template/Interface

Displaying data is a different question - it may be EHR data, it may be demographic data, and it may be something else entirely. So the data items we want to mention in templates are mostly of ENTRY level, and will be the results of queries; the relevant queries could be included in such templates.

So the starting point for many forms won’t be a COMPOSITION - it is instead a different logical container that groups data that result from one or more queries, into a ‘use group’, i.e the group of data items intended to be visualised or used as a report etc.

Unless the COMPOSITION is the description of any interface.

One problem today is that people trying to define screens for visual applications are forced (more or less) to create templates starting with COMPOSITIONs, which is incorrect; my impression is that such templates are only used for data capture and that other display forms are modelled in various non-standard ways, or not at all.

I think annotations (based on paths) will be useful, but I not completely adequate to achieved what is needed.

Why?

We need to be clear on what we mean by ‘RM’ here. Colloquially, ‘RM’ in openEHR has meant ‘the information model’ (of the EHR and demographics). Now, we create models for everything we want to compute with, otherwise we get instances with no model, and that is not useful.

Hence, we also have the ‘AM’ - Archetype Model, that consists of ADL, the AOM (the actual model of archetypes), and a few other bits and pieces. We also had for a long time the notion of a ‘SM’, or Service Model - a formal model of services. We have only just started to defined that last part.

In more recent times it became clear that we needed to have a set of common models of elements that are re-used across the other models - basic things like primitive data types, identifiers, the notion of a ‘resource’ (a thing that has a lot of authoring and languages meta-data); also generic languages like ODIN, BMM, and so on. So we defined another component called ‘BASE’ to contain those things.

We also create components for

  • Querying (‘QUERY’) - to contain models / languages of querying (so far, AQL)
  • Process (‘PROC’) - to contain models of clinical process - so far, the Task Planning model
  • Clinical decision support (‘CDS’) - to contain models of CDS elements

These components are illustrated on the specs governance page.

So, the kind of proposal we are discussing in this thread is whether it could make sense to try to formalise in an open, standard way, the definition of how data elements and groups are mapped to presentation data sets and groups, where the latter are understandable as e.g. logical visual components, document components, message components etc.

To do this, there could be a new openEHR model component that would contain a few classes, or maybe some language definition, or some other formal specification artefact, that would enable the data <=> presentation elements relationship to be expressed for any particular case, e.g. a screen form. It might be called ‘PRES’, for obvious reasons.

If it were done as a model, we might imagine some classes like DATA_SET, DATA_GROUP, and so on, as proposed in my first rough post. It could mean more classes and/or attributes, e.g. it might make sense to have an attribute DATA_GROUP.can_repeat, or TEXT_FIELD or whatever. Possibly elements that represent ‘selectors’ like menu items, tabs etc need classes as well, or maybe they can be specified by generic meta-data, e.g.

“presentation_characteristics”: [
“visible”: True;
“can_repeat”: True;
“etc”: “etc”;
]

and so on. If it is done like this, then there is another model somewhere else of the above structure - most likely outside of openEHR. On the other hand, it may be that all the externally defined models are concrete and product-specific, i.e. things like React, Angular, Node and so on, and underlying widget primitives. In that case maybe we want a more generic model of visualisation elements such as would be found in XUL, i.e. things like the following (from the XUL wikipedia page):

Top-level elements
[window](https://en.wikipedia.org/wiki/Window_%28computing%29), page, [dialog](https://en.wikipedia.org/wiki/Dialog_box), [wizard](https://en.wikipedia.org/wiki/Wizard_%28software%29), etc.
Widgets
label, [button](https://en.wikipedia.org/wiki/Button_%28computing%29), [text box](https://en.wikipedia.org/wiki/Text_box), list box, [combo box](https://en.wikipedia.org/wiki/Combo_box), [radio button](https://en.wikipedia.org/wiki/Radio_button), [check box](https://en.wikipedia.org/wiki/Check_box), [tree](https://en.wikipedia.org/wiki/Tree_view), [menu](https://en.wikipedia.org/wiki/Menu_%28computing%29), [toolbar](https://en.wikipedia.org/wiki/Toolbar), group box, [tab box](https://en.wikipedia.org/wiki/Tab_%28GUI%29), colorpicker, spacer, splitter, etc.
Box model
box, grid, stack, deck, etc.
Events and scripts
script, command, key, broadcaster, observer, etc.
Data source
template, rule, etc.

Hi Thomas, good clarification, although too much in detail at some points in this moment of thinking about it.

I see it as more simple,

1) about the classes, it would be nice, in my opinion, if they can stand alone, without needing other RM-classes. I think this will makes life easier in the future.

2) about XUL, the workout is very usable, and it defines, as I read, in a standardized way GUI-components. I don't know if XUL also offers ways to constraint the input in the components, if not, then that is a shortcoming. We need to solve that. It will be so good for the user experience if validation of component content can be validated client-side.

3) The targetting to frameworks (like Angular or (stupid simple) javascript), I think that is something for the community to write, we do not need a standard for that. As contribution to the community I (or some else) could write a tool to generate very simple javascripts which instantiate the GUI-elements, activate the constraints for them, and gather the validated contents of them to the REST-calls, or in case of displaying data, retrieve them from the REST calls and spread them over the components. Such simple scripts could be used in almost any framework by just adding the URL of that script to the target (maybe Angular, simple HTML or any other framework.) Also important is that the Javascripts do not contain CSS, so that styling will be imposed by the container which links the script. This makes it usable in all platforms without any target defined in the presentation-archetype.
Visually testing those Javascripts is very easy.

There is no need to define datasources, because the REST calls handle that, even for AQL this could be possible to work that way. In fact, it is how 99% of the Javascripts-frameworks do their job.

Bert

IMO annotating templates with UI info is not a good idea. A layered approach is much cleaner and scalable, i.e. to define a new artifact on top of current templates / archetypes / RM (these are also examples of layered design).

here, 'templates' means pure data templates, i.e. pure RM or other data constructs, e.g. PROC (Task Planning) or CDS etc.

Under this approach, if we have UITemplates on top of openEHR Templates, when we generate Operational UITemplates, that will contain UI + structure (template and archetype constraints) + RM references. This would be the final element to be used to feed software. but the underlying models are all separated and have a specific responsibility.

So what I am proposing is what you are calling UITemplates (one could also think of DOCTemplates and MSGTemplates) - they are openEHR templates, as in being ADL/AOM artefacts, but based on a model of UI/presentation primitives that enables RM and other data elements to be embedded.

If we go ahead, we can add another level for workflow, defining an order and conditions under which each "screen" should be displayed, like a WFTemplate, having an Operational WFTemplate that will include all WF + GUI + structure + RM references.

I think this can make sense as either another model layer, or maybe better as specific annotations that use FOPL-like or rule statements to define work flow, e.g.

when /data/path1/value = "coded" then display (/ui/path5)

where /data/path1 is an archetype path of the kind we are used to, pointing to some DV_TEXT element and /ui/path5 is a path through the UI template that points to a sub-form, presumably one that knows how to ask for a coded text.

If we separate out screen workflow from screen logical layout, then we can re-use the latter with different workflows, reprocess it into a PDF or other document structure and so on.

We can continue adding layers :slight_smile:

exactly right.

- thomas

These rules/assertions are things we can express with the AM right now, right? :smiley:

Let me look for it, haveit on a backup disk somewhere :slight_smile:

Templates have no information about user interfaces, are mainly full document data structures + semantic definitions + constraints + terminology (local and bindings).

User interface information includes layout, form composition, position, size, style, etc. Clearly this is not included in current openEHR templates.

BTW all those elements are part of the UITemplate model that I mentioned before. Will try to have an english translation to share next week.

We’re still working on this somewhat, using Task Planning as the excuse to finally get it right…