Suitable data type to record frequency of something happening

Hi,

I need to record the frequency of occurrence of an event.Typical readings will be like 2/day, 5/week, 1/month etc.In archetype editor I could not find a suitable property to use under quantity. The count also does not work as it does not have a unit associated. Please advise the best approach.

Also what is the difference between Duration and Quantity with time property? Both seem to be doing the same.

regards

Hi Dileep,

For frequency, use the Frequency property and the {Qualified real/Time} Unit. This will display a popup where you choose one unit from the left column and one from the right. Select ‘1’ from the left and the unit of your choice (eg wk) from the right – this allows you to say a frequency like 5/week, where ‘5’ will be the quantity value recorded in the system

Re Quantity>Time vs Duration – the relevant section of the specs are here:

I can only recall modelling Time using the Quantity data type in one archetype – http://www.openehr.org/ckm/#showArchetype_1013.1.44 - for the specifications of how a stimulus has been set up in an audiometer. I’m honestly not sure if this is a good use case as it has had no collaborative review but it definitely seemed not to fit the proper use of duration as a period of time with respect to a notional point in time. I’m interested in other’s views as to whether they agree or not.

And others might have other use cases I’m not aware of.

If someone can document simply and succinctly the difference, with use cases, I’d be grateful for the clarification too. It’s not easy.

Regards

Heather

There is no functional difference between those two data types.

In order to avoid this duality, in the new data types for the revised ISO 13606 we have defined Duration as a specialization of Physical Quantity, with units constrained to units of time. The reasoning behind this decision is that a period of time should be always stored using the minimal unit of measurement. Then, we can transform it automatically to any desired format for visualization purposes.

Thanks for the replies and clarifications. I will try the frequency property and see if I can figure it out

regards

Dear Heather,

For frequency, use the Frequency property and the {Qualified real/Time} Unit. This will display a popup where you choose one unit from the left column and one from the right. Select ‘1’ from the left and the unit of your choice (eg wk) from the right – this allows you to say a frequency like 5/week, where ‘5’ will be the quantity value recorded in the system

I tested this, but feel is is not the most elegant way. The unit part shows up as 1/d, 1/wk, 1/mo (for /day, /week & /month respectively). While recording values you have to select a number and one of the units. So if I have to record 5/week, the composition will have magnitude as ‘5’ and unit as ‘1/wk’. The UI will need to do some manipulation/mapping to present an elegant view to the user (1/wk >/week).

A more elegant method would be a ability to mark units as /d, /wk, /mo etc.

regards

Duration in openEHR is represented in ISO8601 string format, and is usually used for representing 'social time' durations, including with more than one unit, e.g, '2 years, 3 months and 20 days', '39 weeks 4 days' and so on.

DV_QUANTITY with units of time enables the representation of any time, but with only a single unit at a time, e.g. 501.3 ns. There is no unit such as 'month' since months are not regular units, just customary pseudo-units.

Theoretically there is some overlap, but practically speaking I have never seen it cause a problem. Conversion between the two forms if needed is easy enough in any programming environment.

- thomas