PP: On the INTERVAL_EVENT field descriptions I noted that those might not be 100% correct or clear. Before raising an issue on JIRA I wanted to know what you think.
INTERVAL_EVENT.width: Length of the interval during which the state was true.
- since state can be modeled in two ways, inside the OBSERVATION and inside the EVENT, I think the description should not include the "during which the state was true" since not every instance will have a state in the EVENT.
TB: this is badly worded documentation... it actually means the value of the event, i.e. EVENT.data, and it rather casually uses the word 'state' in its informal English usage meaning the state/value/status/situation of something. But EVENT of course has a 'state' attribute, so, quite confusing. The proper wording would be 'the time interval during which the values recorded under 'data' are true and, if set, the values recorded under 'state' are true.
PP: INTERVAL_EVENT.math_function: Mathematical function of the data of this event, e.g. “maximum”, “mean” etc. Coded using openEHR Terminology group “event math function”.
- my interpretation of that is we use that function to summarize a list of numeric values into one value to be recorded. The problem I see is: this only works if the observation is numeric. I think we need to make the description clearer about what the function is, how should be used and also what is the domain / range of that function (maybe say that only applies to datatypes from the quantity package).
PP: - another possible issue (not sure about this) is that the EVENT.data is a structure, so we can have many data points there, on that case, how is the math_function related to all the data points? What happens if one data point is the "max" value and other the "avg", we have just one math_function and 2 data points.
TB: the assumption is that the math function applies meaningfully to whatever data are there - so it's the application designer's responsibility to get this right. Normally, the math function is understood to apply to each data point, e.g. if it is 'mean' and there are 'systolic' and 'diastolic', then they are assumed to be both means (probably not terribly clinically useful but you get the idea).
All of this documentation could be improved - can you raise a PR for it - we can fix it in RM Release-1.0.4...
PP: is it possible to record a mean and a max value no the same EVENT.data? e.g. mean syst BP and max syst BP in an interval of time. Since there is only one math_function, for that we'll need a completely separated EVENT that occurs at the same time and has the same width. Is this the only way of representing this case?