# the periodic definition in data structures IM **Category:** [Technical (archive)](https://discourse.openehr.org/c/technical-archive/156) **Created:** 2006-09-26 11:29 UTC **Views:** 18 **Replies:** 4 **URL:** https://discourse.openehr.org/t/the-periodic-definition-in-data-structures-im/14573 --- ## Post #1 by @Andrew_Patterson The HISTORY IM has a definition for a period which is meant to represent the time between contained events\. However, in the case where this period is filled in, the spec makes no restriction on the EVENT\.time field \- i\.e\. what is the meaning of a HISTORY object with a period set, but yet which contains EVENTs that are not according to this periodic duration? It would be good if the spec clarified what the indented behaviour of an openEHR system that encounters such data should be\. Andrew --- ## Post #2 by @thomas.beale Andrew Patterson wrote: > The HISTORY IM has a definition for a period which > is meant to represent the time between contained > events\. However, in the case where this > period is filled in, the spec makes no restriction on the > EVENT\.time field \- i\.e\. what is the meaning of > a HISTORY object with a period set, but yet which > contains EVENTs that are not according to this > periodic duration? It would be good if the spec > clarified what the indented behaviour of an openEHR > system that encounters such data should be\. >   I have improved the documentation in the class definitions, and added the following invariant to History: period\_consistency: is\_periodic implies events\.for\_all \(e: EVENT | e\.offset\.to\_seconds\.mod\(period\.to\_seconds\) = e\.offset\.to\_seconds/period\.to\_seconds\) and added the query to\_seconds: Double to the ISO8601\_DURATION class in the Support IM package\. \- thomas --- ## Post #3 by @thomas.beale Andrew Patterson wrote: > The HISTORY IM has a definition for a period which > is meant to represent the time between contained > events\. However, in the case where this > period is filled in, the spec makes no restriction on the > EVENT\.time field \- i\.e\. what is the meaning of > a HISTORY object with a period set, but yet which > contains EVENTs that are not according to this > periodic duration? It would be good if the spec > clarified what the indented behaviour of an openEHR > system that encounters such data should be\. > > Andrew > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ > openEHR\-technical mailing list > openEHR\-technical@openehr\.org > http://www.chime.ucl.ac.uk/mailman/listinfo/openehr-technical > this is now CR\-000220 \- http://coruscant.chime.ucl.ac.uk:8200/openEHR_Collector/projects/specifications/CR/220 \- thomas --- ## Post #4 by @Mattias_Forss1 2006/9/26, Thomas Beale <[Thomas.Beale@oceaninformatics.biz](mailto:Thomas.Beale@oceaninformatics.biz)>: > I have improved the documentation in the class definitions, and added > the following invariant to History: > > period_consistency: is_periodic implies events.for_all (e: EVENT | > e.offset.to_seconds.mod(period.to_seconds) = > e.offset.to_seconds/period.to_seconds) Hi Thomas, With the risk of making a fool of my self, shouldn't a consistent period mean that all events should have an offset to the original time of starting the observations which is periodic? In that case, doesn't it mean that the offset modulo the period should be zero and not offset/period? If the offset is evenly dividable with the period, then it should mean that the event is periodic and if all events are periodic then the period for the history is consistent. Correct me if I'm wrong. /Mattias --- ## Post #5 by @thomas.beale Mattias Forss wrote: > > 2006/9/26, Thomas Beale <Thomas\.Beale@oceaninformatics\.biz > <mailto:Thomas.Beale@oceaninformatics.biz>>: > >     I have improved the documentation in the class definitions, and added >     the following invariant to History: > >     period\_consistency: is\_periodic implies events\.for\_all \(e: EVENT | >     e\.offset\.to\_seconds\.mod\(period\.to\_seconds\) = >     e\.offset\.to\_seconds/period\.to\_seconds\) > > Hi Thomas, > > With the risk of making a fool of my self, shouldn't a consistent > period mean that all events should have an offset to the original time > of starting the observations which is periodic? In that case, doesn't > it mean that the offset modulo the period should be zero and not > offset/period? If the offset is evenly dividable with the period, then > it should mean that the event is periodic and if all events are > periodic then the period for the history is consistent\. > > Correct me if I'm wrong\. > no you are not wrong; I was messing around with div and mod functions trying to think of the easiest formulation, and accidentally left mod instead of div\. mod\(x\) = 0 is probably the easiest actually\. I must stop multi\-tasking \(they say males can't do it anyway;\-\) \- thomas --- **Canonical:** https://discourse.openehr.org/t/the-periodic-definition-in-data-structures-im/14573 **Original content:** https://discourse.openehr.org/t/the-periodic-definition-in-data-structures-im/14573