That’s exactly right
I would have liked to have assumed that when v0 was still in effect, I would have found all the old versions of Archetype(s) in the CKM and could have downloaded them and copied them into my local CKM repo, but not all of the old Archetype(s) existed in the CKM, such as openEHR-EHR-CLUSTER.structured_name.v0 shown in the following Error dialog.
It is still in CKM, just superceded and so not normally visible.
To find it …
then click on Published only, so that all versions becomes visible.
THen scroll right to find the v0 revisions . You can download from there, though it might be tricky to find exactly the correct revision that was used for the .oet
Alternatively, down load the template filset from the Cause of Death .oet export - that should hook up to the correct archetype.
I think it is correct for CKM to limit export to current revisions BTW.
Got it. Thank you so much! I can find the older versions now although some were potentially renamed, such as openEHR-EHR-CLUSTER.structured_name.v0.
Never mind. Please don’t waste your valueable time any more for this. I was just curious
No worries. It is useful to document this stuff for a wider audience.
Keep asking these great questions!!
Using openEHR-tool, an example Composition XML( Example-Data-Linkoping_University_Physical_Activity-Pretty.xml (44.6 KB)) was created mainly based on ** Cluster-focused models** in /proposals/2019-07-12_clst from Erik Sundvall 's team.
When trying to Post an example Composition XML, I got a 422 error as followings:
You need to add at least one valid item under the data
tree - see Erik’s original xml
<events xsi:type="INTERVAL_EVENT" archetype_node_id="at1036">
<name>
<value>Maximum</value>
</name>
<time>
<value>2022-02-03T04:05:06</value>
</time>
<data xsi:type="ITEM_TREE" archetype_node_id="at0001">
<name>
<value>structure</value>
</name>
<items xsi:type="ELEMENT" archetype_node_id="at1005">
<name xsi:type="DV_CODED_TEXT">
<value>Pulse presence</value>
<defining_code>
<terminology_id>
<value>local</value>
</terminology_id>
<code_string>at1045</code_string>
</defining_code>
</name>
<value xsi:type="DV_CODED_TEXT">
<value>Present</value>
<defining_code>
<terminology_id>
<value>local</value>
</terminology_id>
<code_string>at1024</code_string>
</defining_code>
</value>
Thanks a lot, Ian. I’ll give it a try tomorrow morning
Just followed your guidance and added two data items to the state element at the end, and the Composition POST operation was successful (response status code: 204). Thank you very much for your help.
However, I still don’t quite understand the actual clinical/business meaning of the data items I’ve added.
In this case, does the state at the end say that the minimum values of Ambient Temperature and Relative Humidity are 11.0 °C and 25% respectively within the specified time range (event time = 2022-02-03T04:05:06; time width = PT42H)?
Snippet for fixing the xml:
<state archetype_node_id="at0106">
<name>
<value>History</value>
</name>
<origin>
<value>2022-02-03T04:05:06</value>
</origin>
<period>
<value>PT0S</value>
</period>
<duration>
<value>PT0S</value>
</duration>
<events xsi:type="INTERVAL_EVENT" archetype_node_id="at0107">
<name>
<value>Minimum</value>
</name>
<time>
<value>2022-02-03T04:05:06</value>
</time>
<width>
<value>PT42H</value>
</width>
<math_function>
<value>minimum</value>
<defining_code>
<terminology_id>
<value>openehr</value>
</terminology_id>
<code_string>145</code_string>
</defining_code>
</math_function>
<data xsi:type="ITEM_TREE" archetype_node_id="at0001">
<name>
<value>structure</value>
</name>
<items xsi:type="ELEMENT" archetype_node_id="at0001">
<name>
<value>Ambient Temperature</value>
</name>
<value xsi:type="DV_QUANTITY">
<magnitude>11.0</magnitude>
<units>°C</units>
</value>
</items>
<items xsi:type="ELEMENT" archetype_node_id="at0002">
<name>
<value>Relative humidity</value>
</name>
<value xsi:type="DV_QUANTITY">
<magnitude>25.0</magnitude>
<units>%</units>
</value>
</items>
</data>
</events>
</state>
Where the state node resides in my template:
The Example Instance (Composition) used above:
Example-Data-Linkoping_University_Physical_Activity-Pretty-240829-1005.xml (45.3 KB)
Hi Lin,
You are almost there and I can see why you are confused.
The generated composition example is obviously dummy data and has populated every single data point in the composition structure.
In doing so, It has populated a couple of structures that although legal in the RM, so far have not been used or represented in archetype tools, and TBH possibly never will.
The main problem that is confusing you is that ‘state’ can be captured in 2 different ways.
see this part of the spec Data Structures Information Model
In openEHR there are two ways of recording state. One is via the use of a separate
HISTORY
structure within theOBSERVATION
class (seeehr.composition.content.entry
package). The other is via the use of the state attribute of typeITEM_STRUCTURE
defined in the classEVENT
itself. Experience with openEHR archetypes and systems has shown that the latter method corresponds to the most common clinical need…
The problem you are seeing is that the composition example has populated the second, much less common way of handling state.
The 'normal way , supported by Archetype Designer is
OBSERVATION
data
event[n]
data
state
protocol
Whereas you can do (in theory)
OBSERVATION
state
event[n]
data
protocol
I’m not clear in my own mind whether the example generator is actuially over-enthusiastic or just plain wrong!!
But fndamentally, I would have expected the state items to be inside the top datra tree, not alongside it. That would be the normal pattern of use and lines up with the template.
OBSERVATION
data
event[n]
data
state ←
protocol
I can’t find any examples ofvthsecond way of using state but from memory it was supposed to help with some sport medicine research. As I said I’ve never used it in practice.
Let me know if you are still stuck and I’ll try to fix the example myself
Thank you very vey much for your valuable and detailed guidance. Such a practice-based experience summary is pretty nutritious, quite beneficial for efficient learning and rapid growth of newcomers, and also helps to form systematic patterns and/or best practices.
Indeed, most data can be as simple and straightforward as the following vital signs template shows:
In view of my own practical experience, I still need to digest and understand your detailed explanation and instructions, in combination with the actual hands-on exercises, and the replies and examples you provided in other related posts. Thanks a lot, @ian.mcnicoll !
@surfer
In terms of the openEHR-tool’s UI, users don’t necessarily enter the relevant data or set the corresponding options in top-down order, but whenever they submit the file they want to upload, the values of the other data entry controls on the page will be reset, which could be inconvenient from my personal experience. For example, the drop-down list of templates in this screenshot is like this. So, is it necessary to consult other users and decide whether such an UI behavior needs to be impoved?
unfortunately you have to choose the file first and click submit then fill out the other field in any order otherwise, as you pointed out, you lose all the previous field input in the lower part of the screen under “Submit”.
Well, to improve user experience I could hide the fields under “Commit” and make them appear after the file has been chosen and committed.
@surfer
There are three opt template (xml) uploaded to EHRBase:
The third opt template (xml, highlighted) can be shown in the drop-down list on the page ‘Get Example Composition from a Template’:
But this template cannot be shown in the drop-down list on the page ‘Post a Composition’:
Following-Up:
When starting the virtual machine (OS image: Ubuntu 22) in the Hyper-V Manager again, the issue above disappears.
Hi, @surfer,
Another issue without detailed investgation:
Unit for Step cadence (mm) in the generated example Composition XML:
Unit for Step cadence (/min) in the OPT XML:
Hi, @birger.haarbrandt . Is this unit issue potentially related to EHRBase?
Can you provide me any detail about the whole environment where the error occurs: OS, Tool config file, EHRBase version. Which method to launch the Tool did you use? (all in one docker, docker only for the Tool, etc.
About the example unit mistake, you’ll have to ask someone from EHRBase team.
OS
Ubuntu 22.04.3 LTS
Tool config file
EHRBase version
v2.6.0
Which method to launch the Tool did you use?
Separated mode (docker only for the Tool)
Thanks, @surfer
Hello, @birger.haarbrandt
Question: In the example below, I’m wondering whether the inconsistency between the instance XML and the OPT template is deliberately designed for illustrating how to use an external code system rather than the local code system , or it’s an issue.
Example Code value for the [Physical] Activity name in the generated example Composition XML:
Valueset for the [Physical] Activity name in the OPT XML:
@ian.mcnicoll In the snippet above, why all the data (especially Ambient Temperature and Relative humidity) but those in the tag math_function doesn’t exist in the FLAT JSON fromat retrieved from the server? The missing data in the FLAT JSON fromat was inserted just for a successful POST operation and actually they are not needed in my example Composition.
Thanks in advance.