Inconsistence in inContext in Webtemplate

In the following Webtemplate

The width && time for any_event have “inContext” : true
where width && time for a24_hour_average have no inContext set.

I assumed this is because the second one has fixed values set.

Now the question is: Is this a bug or a feature?

event_in_context.ehrbase.v0.json (16.8 KB)

event_in_context.ehrbase.v0.opt (61.0 KB)

1 Like

@borut.fabjan I second this.

Me and @Athul_K_Nair have been using the inContext attribute from the web template to decide which UI elements to show to the end user, and which ones to populate automatically in the background.

There is definitely some inconsistency in how it is handled. I’d like to know when you consider inContext should be set to true.

In this situation ideally both width, time and math_function of 24 hour events / maximum events should have inContext: true?

Summoning @borut.fabjan :wink:

Sorry for late response. This is a feature. If you skip the width attribute of the 24 hour average, it will due to its constraints in fact not be taken from “the context (ctx)” but rather will be set to exactly 24 hours. That said, in practice it was never needed to set interval widths from the ctx, so it in fact does not have an attribute for it, but this value rather defaults to PT0S when inContext=true.