# More RM statistics

**URL:** <https://discourse.openehr.org/t/more-rm-statistics/15091>\
**Category:** Technical (archive)\
**Created:** [24 October 2011 14:43 UTC](https://discourse.openehr.org/t/more-rm-statistics/15091 "2011-10-24T14:43:04Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![thomas.beale](https://discourse.openehr.org/user_avatar/discourse.openehr.org/thomas.beale/32/35_2.png) [@thomas.beale](https://discourse.openehr.org/u/thomas.beale)\
**Post date:** [24 October 2011 14:43 UTC](https://discourse.openehr.org/t/more-rm-statistics/15091/1 "2011-10-24T14:43:04Z")

</div>

I have refined the generated statistics in AWB, and the result is shown below for CKM archetypes (snapshot June 2011). Notes:

- the stats are over the 197 archetypes validated by the ADL 1.5 compiler (note that this is more strict than any of the ADL 1.4 tools). Another 80 archetypes did not pass, most for trivial reasons of 1.5 validity like repeated occurrences and cardinality constraints.

- the stats are obviously skewed toward the actual archetypes that have been done and are currently valid, which is more heavily OBSERVATION and EVALUATION related types.

- the first group of stats is aggregated ontology codes, e.g. 3794 at-code definitions over those 197 archetypes (I will add in average computation, but it is easy enough to see that its about 19 at-code average per archetype).

- this is a guide to costs and scale of translation and binding work

- in the RM metrics stats group, these are aggregated counts of archetyped nodes of any kind, i.e. there are 4327 nodes of any kind of C\_OBJECT. This is an average of around 21.5 nodes per archetype

- this is potentially a guide to complexity and maintainability- in the RM breakdown stats group, each row indicates how many times that RM class was mentioned (i.e. constrained) in the 197 valid archetypes. E.g. the ADDRESS class was constrained 7 times.

- for each class, the number of occurrences of constraints on each attribute is available on the next level breakout (see further down)

- what this tells us (usually) is that a relatively small subset of the total number of attributes defined for a given type (e.g. DV\_QUANTITY) are archetyped

- within the DATA\_VALUE types, it also tells us what DV\_XXX types are actually needed, according to clinical modellers, e.g. DV\_DATE, DV\_DURATION and DV\_DATE\_TME are all used.

- not surprisingly CLUSTERs, ELEMENTS, ITEM\_TREE and a few other classes figure prominently

- re: the recent debates about ITEM\_STRUCTURE simplification, note that ITEM\_SINGLE and ITEM\_LIST types turn up in the stats (maybe these classes are candidates for turning into ITEM\_TREEs, or maybe they are evidence that we need to retain ITEM\_LIST?)  
There is more work to go here obviously, and I won’t try to draw any hard conclusions right from what we see here. In terms of tooling the next steps are:

- add a few further stats like average, max, min

- some cleanup in visual presentation

- generate an XML report form of this data with a .css for use with normal browsers

- publish a new beta release of the Workbench, including all this functionality  
Any suggestions, feedback is of course welcome.

![](https://discourse.openehr.org/images/transparent.png)

> **(attachments)**
>
> ![jgafeceb.png](https://discourse.openehr.org/images/transparent.png)  
> ![gbccjicj.png](https://discourse.openehr.org/images/transparent.png)

---

<div class="post-metadata">

**Author:** ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)\
**Post date:** [24 October 2011 15:20 UTC](https://discourse.openehr.org/t/more-rm-statistics/15091/2 "2011-10-24T15:20:13Z")

</div>

Thanks, Thomas!

This is definitely the feature I have been waiting for. Dose RM class/attribute statistics also work for customised RM, i.e. non-standard openEHR RM?

Cheers,  
Rong

---

<div class="post-metadata">

**Author:** ![thomas.beale](https://discourse.openehr.org/user_avatar/discourse.openehr.org/thomas.beale/32/35_2.png) [@thomas.beale](https://discourse.openehr.org/u/thomas.beale)\
**Post date:** [24 October 2011 17:19 UTC](https://discourse.openehr.org/t/more-rm-statistics/15091/3 "2011-10-24T17:19:51Z")

</div>

I have refined the generated statistics in AWB, and the result is shown below for CKM archetypes (snapshot June 2011). Notes:

- the stats are over the 197 archetypes validated by the ADL 1.5 compiler (note that this is more strict than any of the ADL 1.4 tools). Another 80 archetypes did not pass, most for trivial reasons of 1.5 validity like repeated occurrences and cardinality constraints.

- the stats are obviously skewed toward the actual archetypes that have been done and are currently valid, which is more heavily OBSERVATION and EVALUATION related types.

- the first group of stats is aggregated ontology codes, e.g. 3794 at-code definitions over those 197 archetypes (I will add in average computation, but it is easy enough to see that its about 19 at-code average per archetype).

- this is a guide to costs and scale of translation and binding work

- in the RM metrics stats group, these are aggregated counts of archetyped nodes of any kind, i.e. there are 4327 nodes of any kind of C\_OBJECT. This is an average of around 21.5 nodes per archetype

- this is potentially a guide to complexity and maintainability- in the RM breakdown stats group, each row indicates how many times that RM class was mentioned (i.e. constrained) in the 197 valid archetypes. E.g. the ADDRESS class was constrained 7 times.

- for each class, the number of occurrences of constraints on each attribute is available on the next level breakout (see further down)

- what this tells us (usually) is that a relatively small subset of the total number of attributes defined for a given type (e.g. DV\_QUANTITY) are archetyped

- within the DATA\_VALUE types, it also tells us what DV\_XXX types are actually needed, according to clinical modellers, e.g. DV\_DATE, DV\_DURATION and DV\_DATE\_TME are all used.

- not surprisingly CLUSTERs, ELEMENTS, ITEM\_TREE and a few other classes figure prominently

- re: the recent debates about ITEM\_STRUCTURE simplification, note that ITEM\_SINGLE and ITEM\_LIST types turn up in the stats (maybe these classes are candidates for turning into ITEM\_TREEs, or maybe they are evidence that we need to retain ITEM\_LIST?)  
There is more work to go here obviously, and I won’t try to draw any hard conclusions right from what we see here. In terms of tooling the next steps are:

- add a few further stats like average, max, min

- some cleanup in visual presentation

- generate an XML report form of this data with a .css for use with normal browsers

- publish a new beta release of the Workbench, including all this functionality  
Any suggestions, feedback is of course welcome.

![]()

---

<div class="post-metadata">

**Author:** ![thomas.beale](https://discourse.openehr.org/user_avatar/discourse.openehr.org/thomas.beale/32/35_2.png) [@thomas.beale](https://discourse.openehr.org/u/thomas.beale)\
**Post date:** [24 October 2011 18:07 UTC](https://discourse.openehr.org/t/more-rm-statistics/15091/4 "2011-10-24T18:07:07Z")

</div>

> Thanks, Thomas!
> 
> This is definitely the feature I have been waiting for. Dose RM class/attribute statistics also work for customised RM, i.e. non-standard openEHR RM?
> 
> Cheers,  
> Rong

they certainly do. The adltest repository is a non-standard test RM with all kinds of funny classes in it. Here are the results for it.

![](https://discourse.openehr.org/images/transparent.png)

![](https://discourse.openehr.org/images/transparent.png)

Here is the output for the EHR Extract archetypes, based on the [proposed EHR Extract RM](http://www.openehr.org/svn/knowledge2/BRANCHES/P_schema/rm_schemas/openehr_ehr_extract_200.bmm), which includes new and changed classes in it:

![](https://discourse.openehr.org/images/transparent.png)

For any RM you can also get a separate tool that displays RM stats and info. Here it is for 13606:

> **(attachments)**
>
> ![ehiccghd.png](https://discourse.openehr.org/images/transparent.png)  
> ![egcefbeh.png](https://discourse.openehr.org/images/transparent.png)

---

<div class="post-metadata">

**Author:** ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)\
**Post date:** [24 October 2011 21:45 UTC](https://discourse.openehr.org/t/more-rm-statistics/15091/5 "2011-10-24T21:45:27Z")

</div>

Excellent!  
/Rong

---

<div class="post-metadata">

**Author:** ![yampeku](https://discourse.openehr.org/user_avatar/discourse.openehr.org/yampeku/32/25_2.png) [@yampeku](https://discourse.openehr.org/u/yampeku)\
**Post date:** [24 October 2011 21:52 UTC](https://discourse.openehr.org/t/more-rm-statistics/15091/6 "2011-10-24T21:52:13Z")

</div>

just for curiosity...  
how many archetypes use partial ISO dates?

---

<div class="post-metadata">

**Author:** ![thomas.beale](https://discourse.openehr.org/user_avatar/discourse.openehr.org/thomas.beale/32/35_2.png) [@thomas.beale](https://discourse.openehr.org/u/thomas.beale)\
**Post date:** [24 October 2011 22:08 UTC](https://discourse.openehr.org/t/more-rm-statistics/15091/7 "2011-10-24T22:08:49Z")

</div>

good question - I will look at adding a special query to pick that up.

- thomas

---

<div class="post-metadata">

**Author:** ![thomas.beale](https://discourse.openehr.org/user_avatar/discourse.openehr.org/thomas.beale/32/35_2.png) [@thomas.beale](https://discourse.openehr.org/u/thomas.beale)\
**Post date:** [24 October 2011 22:15 UTC](https://discourse.openehr.org/t/more-rm-statistics/15091/8 "2011-10-24T22:15:33Z")

</div>

I should point out that the .bmm file format has changed, so if you have a custom model to add, it probably won’t work if it is in the previous format. Changing it is easy, and you can see the new format [here](http://www.openehr.org/svn/knowledge2/BRANCHES/P_schema/rm_schemas/). I will replace the old format files on the trunk in a few days once I have done a bit more testing.

- thomas

---

<div class="post-metadata">

**Author:** ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)\
**Post date:** [25 October 2011 06:26 UTC](https://discourse.openehr.org/t/more-rm-statistics/15091/9 "2011-10-25T06:26:04Z")

</div>

Hi Diego,

Generally there is no constraint on dates so partial dates are allowed. When  
dates occur as data points they will usually want to allow partial dates.  
The concise dates are almost always part of OBSERVATIONs or ACTIONs where  
they are reference model attributes and generally not constrained. Some  
administrative dates are examples where partials may not be acceptable.

Cheers, Sam

---

<div class="post-metadata">

**Author:** ![ian.mcnicoll](https://discourse.openehr.org/user_avatar/discourse.openehr.org/ian.mcnicoll/32/4430_2.png) [@ian.mcnicoll](https://discourse.openehr.org/u/ian.mcnicoll)\
**Post date:** [25 October 2011 07:05 UTC](https://discourse.openehr.org/t/more-rm-statistics/15091/10 "2011-10-25T07:05:51Z")

</div>

Hi Diego,

Interesting question but although I would suspect the number of  
archetyped partial dates is extremely low, partial dates are very  
common in real world clinical data, e.g. year of diagnosis or  
month/year of procedure.

Ian

Dr Ian McNicoll  
office +44 (0)1536 414 994  
fax +44 (0)1536 516317  
mobile +44 (0)775 209 7859  
skype ianmcnicoll  
ian.mcnicoll@oceaninformatics.com

Clinical Modelling Consultant, Ocean Informatics, UK  
openEHR Clinical Knowledge Editor www.openehr.org/knowledge  
Honorary Senior Research Associate, CHIME, UCL  
BCS Primary Health Care www.phcsg.org

---

<div class="post-metadata">

**Author:** ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)\
**Post date:** [25 October 2011 08:34 UTC](https://discourse.openehr.org/t/more-rm-statistics/15091/11 "2011-10-25T08:34:34Z")

</div>

Thanks for pointing out the change. I will let you know if I run into  
any issues.  
/Rong

---

<div class="post-metadata">

**Author:** ![thomas.beale](https://discourse.openehr.org/user_avatar/discourse.openehr.org/thomas.beale/32/35_2.png) [@thomas.beale](https://discourse.openehr.org/u/thomas.beale)\
**Post date:** [25 October 2011 14:41 UTC](https://discourse.openehr.org/t/more-rm-statistics/15091/12 "2011-10-25T14:41:02Z")

</div>

This file should help writing a new schema, plus the existing schemas:  
[http://www.openehr.org/svn/knowledge2/BRANCHES/P\_schema/rm\_schemas/EXAMPLE.bmm.txt](http://www.openehr.org/svn/knowledge2/BRANCHES/P_schema/rm_schemas/EXAMPLE.bmm.txt)

(these files will all move into the TRUNK in a day or so....)

- thomas

---

<div class="post-metadata">

**Author:** ![thomas.beale](https://discourse.openehr.org/user_avatar/discourse.openehr.org/thomas.beale/32/35_2.png) [@thomas.beale](https://discourse.openehr.org/u/thomas.beale)\
**Post date:** [28 October 2011 07:44 UTC](https://discourse.openehr.org/t/more-rm-statistics/15091/13 "2011-10-28T07:44:03Z")

</div>

The statistics view finally looks as follows. This will be released in the next few days.

![](https://discourse.openehr.org/images/transparent.png)
