# openEHR-tool

**URL:** https://discourse.openehr.org/t/openehr-tool/3108
**Category:** Tools
**Tags:** rest-apis
**Created:** [28 October 2022 08:30 UTC](https://discourse.openehr.org/t/openehr-tool/3108 "2022-10-28T08:30:03Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![surfer](https://discourse.openehr.org/user_avatar/discourse.openehr.org/surfer/32/2326_2.png) [@surfer](https://discourse.openehr.org/u/surfer)
#### Post date: [28 October 2022 08:30 UTC](https://discourse.openehr.org/t/openehr-tool/3108/1 "2022-10-28T08:30:03Z")

</div>

We at crs4 have created a simple GUI for EHRBase. The project still in beta is at the following url:

> **[GitHub - sasurfer/openEHR-tool: Tool for openEHR](https://github.com/sasurfer/openEHR-tool)**
>
> Tool for openEHR. Contribute to sasurfer/openEHR-tool development by creating an account on GitHub.

It has most of the main methods from the openEHR API specification.I hope to extend it to other backends.

Enjoy it

---

<div class="post-metadata">

### Author: ![borut.jures](https://discourse.openehr.org/user_avatar/discourse.openehr.org/borut.jures/32/1391_2.png) [@borut.jures](https://discourse.openehr.org/u/borut.jures)
#### Post date: [28 October 2022 09:33 UTC](https://discourse.openehr.org/t/openehr-tool/3108/2 "2022-10-28T09:33:50Z")

</div>

Great instructions!

Can you please add few screenshots here/GitHub? It is a GUI tool 😉

---

<div class="post-metadata">

### Author: ![surfer](https://discourse.openehr.org/user_avatar/discourse.openehr.org/surfer/32/2326_2.png) [@surfer](https://discourse.openehr.org/u/surfer)
#### Post date: [28 October 2022 10:58 UTC](https://discourse.openehr.org/t/openehr-tool/3108/3 "2022-10-28T10:58:37Z")

</div>

I added at the end of the README.md in the github repo some screenshots to give an idea of the interface. I attach them here too.

 ![postcomp](https://discourse.openehr.org/uploads/default/original/2X/d/d95f22105ba88a2c96d5f60a467385d9488f917f.png)  
 ![sessionactivities](https://discourse.openehr.org/uploads/default/original/2X/7/7a13cca44ef4612819455ef437c5926f5a824b88.png)  
 ![homepage](https://discourse.openehr.org/uploads/default/original/2X/0/03438481c98ddfac7adfe84190925b6d572bc84b.png)  
 ![gettemplate](https://discourse.openehr.org/uploads/default/original/2X/5/5bff1b71403c75955f17da18c6ced97db13320ff.png)  
 ![examplecomp](https://discourse.openehr.org/uploads/default/original/2X/7/737ad5dee5b05eea2e1ab9540aacd12a320825d2.png)

---

<div class="post-metadata">

### Author: ![joostholslag](https://discourse.openehr.org/user_avatar/discourse.openehr.org/joostholslag/32/1981_2.png) [@joostholslag](https://discourse.openehr.org/u/joostholslag)
#### Post date: [18 August 2023 10:25 UTC](https://discourse.openehr.org/t/openehr-tool/3108/5 "2023-08-18T10:25:48Z")

</div>

[https://linkehr.veratech.es/getlinkehr.html](https://linkehr.veratech.es/getlinkehr.html)  
This is the download site of the vendor. If you have special security concerns you could discuss integrity checks with @yampeku

---

<div class="post-metadata">

### Author: ![joostholslag](https://discourse.openehr.org/user_avatar/discourse.openehr.org/joostholslag/32/1981_2.png) [@joostholslag](https://discourse.openehr.org/u/joostholslag)
#### Post date: [11 June 2024 16:51 UTC](https://discourse.openehr.org/t/openehr-tool/3108/6 "2024-06-11T16:51:41Z")

</div>

Just tried for the first time today. Super useful!  
Might deserve some attention from @Sidharth_Ramesh in a video.

---

<div class="post-metadata">

### Author: ![linforest](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/l/ac8455/32.png) [@linforest](https://discourse.openehr.org/u/linforest)
#### Post date: [21 August 2024 08:57 UTC](https://discourse.openehr.org/t/openehr-tool/3108/7 "2024-08-21T08:57:29Z")

</div>

openEHR-tool is very useful indeed!  
I can start it in separated mode with my EHRBase instance.  
Now, I can’t delete a specified Template.

**404 Error**

 ![image](https://discourse.openehr.org/uploads/default/original/2X/5/51e49d87393b41e8aa519300151a941c0e174a77.png)

**Current Settings**

 ![image](https://discourse.openehr.org/uploads/default/original/2X/b/b11d2aad7b171f90506ae845a78eb968ec4314de.png)

---

<div class="post-metadata">

### Author: ![surfer](https://discourse.openehr.org/user_avatar/discourse.openehr.org/surfer/32/2326_2.png) [@surfer](https://discourse.openehr.org/u/surfer)
#### Post date: [21 August 2024 13:12 UTC](https://discourse.openehr.org/t/openehr-tool/3108/8 "2024-08-21T13:12:25Z")

</div>

1)Did you check in the template list if the template was deleted?  
2)Did you use any other “admin” method before this one? did it work?

If the template is still there and other admin method work, can you provide me the template ? that way I try it myself to better understand what is going on

you can open an issue in any of these two repo:

> **[GitHub - crs4/openEHR-tool: Tool for openEHR](https://github.com/crs4/openEHR-tool)**
>
> Tool for openEHR

> **[GitHub - sasurfer/openEHR-tool: Tool for openEHR](https://github.com/sasurfer/openEHR-tool)**
>
> Tool for openEHR

---

<div class="post-metadata">

### Author: ![linforest](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/l/ac8455/32.png) [@linforest](https://discourse.openehr.org/u/linforest)
#### Post date: [21 August 2024 13:33 UTC](https://discourse.openehr.org/t/openehr-tool/3108/9 "2024-08-21T13:33:09Z")

</div>

Hi Giovanni! The template is still there (in the list). It tried to deleted it only with the user/role showed in the snapshot above.

Tomorrow morning, I’ll share the opt with you.

Hi, [Giovanni](https://discourse.openehr.org/u/surfer).  
Here is the OPT template I uploaded to my EHRBase instance:  
**[Cause of death.opt](https://discourse.openehr.org/uploads/short-url/t9j7N8zYKthf5nYk6dlfJRKCZeB.opt) (35.4 KB)**

A database query shows that the template still exists in the ehr.template\_store.

 ![image](https://discourse.openehr.org/uploads/default/original/2X/d/d526155298e9af94d4c066e9e8c53744e489c2b3.png)

And the GET operation ‘ **List Templates** ’ still returns the template in the result list as following:

 ![image](https://discourse.openehr.org/uploads/default/original/2X/6/6efd03ecedf152d64bc7a065428de462b83c18c0.png)

When trying to do the operation ‘ **Delete Template** ’ in the ‘ADMIN methods’ menu,

_EHRBase console_ gave the following Warning:

 ![image](https://discourse.openehr.org/uploads/default/original/2X/0/0706331dd85932a020296eb603b40a20f5db10ba.png)

_openEHR-tool console_ gave the following messages:

 ![image](https://discourse.openehr.org/uploads/default/original/2X/b/b396ec91eb7fe2f8bcf72d4feb7736fd4c7bf245.png)

In fact, through testing, it was found that all templates had such a deletion issue.

---

<div class="post-metadata">

### Author: ![linforest](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/l/ac8455/32.png) [@linforest](https://discourse.openehr.org/u/linforest)
#### Post date: [22 August 2024 07:03 UTC](https://discourse.openehr.org/t/openehr-tool/3108/10 "2024-08-22T07:03:51Z")

</div>

**Solution** :

Add these related EHRBase **environment vars** in the docker-compose.yml and restart the docker images:

```auto
ADMINAPI_ACTIVE=true
ADMIN_API_ACTIVE=true
ADMINAPI_ALLOWDELETEALL=true

```

**Reference** :

> [@Admin delete composition](https://discourse.openehr.org/t/admin-delete-composition/4943/3):
>
> @surfer also make sure the admin-api.enabled is set to ture. In newer versions, spring security returns 401 in case a secured path doesn’t exist, so that might be another reason why you get a 401.

---

<div class="post-metadata">

### Author: ![surfer](https://discourse.openehr.org/user_avatar/discourse.openehr.org/surfer/32/2326_2.png) [@surfer](https://discourse.openehr.org/u/surfer)
#### Post date: [22 August 2024 14:49 UTC](https://discourse.openehr.org/t/openehr-tool/3108/11 "2024-08-22T14:49:53Z")

</div>

I tried to reproduce the problem. In my environment the deletion works. I thought it could be related to the name that has spaces but it’s not that, the deletion works irrespective of the added/removed spaces.

As you said it must be related to the environment variables. About the environment variables, they are already included in .env.ehrbase which is loaded by the docker “total” yaml file (the only exception being “admin-api.enabled” which is not present in .env.ehrbase).

thank you for your post. I updated the README to include the environment variables you mentioned apart from admin-api.enabled.

---

<div class="post-metadata">

### Author: ![linforest](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/l/ac8455/32.png) [@linforest](https://discourse.openehr.org/u/linforest)
#### Post date: [23 August 2024 00:08 UTC](https://discourse.openehr.org/t/openehr-tool/3108/12 "2024-08-23T00:08:29Z")

</div>

Thanks, Surfer. At last, I had to delete the only one opt without any comp instance by SQL.

Is this possibly related to indexing?

---

<div class="post-metadata">

### Author: ![surfer](https://discourse.openehr.org/user_avatar/discourse.openehr.org/surfer/32/2326_2.png) [@surfer](https://discourse.openehr.org/u/surfer)
#### Post date: [26 August 2024 09:18 UTC](https://discourse.openehr.org/t/openehr-tool/3108/13 "2024-08-26T09:18:42Z")

</div>

I really don’t know

---

<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: [26 August 2024 15:43 UTC](https://discourse.openehr.org/t/openehr-tool/3108/14 "2024-08-26T15:43:28Z")

</div>

I just realised that the Caszue of Death .opt is based on an EVALUATION archetype and irt should only really be possible to create an .opt from a COMPOSITION archetype.

Entry-based templates only act as pre-constrained components to pull into a Composition template, they cannot (or should not) be used to create .opts directly.

@Lin - how did you create that .opt?

---

<div class="post-metadata">

### Author: ![linforest](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/l/ac8455/32.png) [@linforest](https://discourse.openehr.org/u/linforest)
#### Post date: [27 August 2024 00:03 UTC](https://discourse.openehr.org/t/openehr-tool/3108/15 "2024-08-27T00:03:51Z")

</div>

Oh, I see. This is my first time uploading a template. Thanks, Ian.

---

<div class="post-metadata">

### Author: ![linforest](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/l/ac8455/32.png) [@linforest](https://discourse.openehr.org/u/linforest)
#### Post date: [27 August 2024 07:46 UTC](https://discourse.openehr.org/t/openehr-tool/3108/16 "2024-08-27T07:46:38Z")

</div>

@heather.leslie  
In addition, what purpose(s) are these non-Composition Templates (OET) for?

 ![image](https://discourse.openehr.org/uploads/default/original/2X/6/67d4184bfcaa526a83ddc5e41ca2eae591db51ef.png)

---

<div class="post-metadata">

### Author: ![linforest](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/l/ac8455/32.png) [@linforest](https://discourse.openehr.org/u/linforest)
#### Post date: [27 August 2024 07:50 UTC](https://discourse.openehr.org/t/openehr-tool/3108/17 "2024-08-27T07:50:29Z")

</div>

> [@ian.mcnicoll](#):
>
> irt should only really be possible to create an .opt from a COMPOSITION archetype

Why such an OET Template couldn’t loaded normally by Ocean Template Designer, but CKM can? Because Ocean Template Designer is using my local copy of the CKM repo downloaded by CKM Bulk Export, which doesn’t include previous versions of the Archetype(s) renferenced by the OET Template?

 ![image](https://discourse.openehr.org/uploads/default/original/2X/0/09dc308c21a7ee6c4726e2487afa98ee22e2b043.png)

 ![image](https://discourse.openehr.org/uploads/default/original/2X/c/c1d526d3b224639243d999d45175d92404c3760f.png)

---

<div class="post-metadata">

### Author: ![siljelb](https://discourse.openehr.org/user_avatar/discourse.openehr.org/siljelb/32/12_2.png) [@siljelb](https://discourse.openehr.org/u/siljelb)
#### Post date: [27 August 2024 08:01 UTC](https://discourse.openehr.org/t/openehr-tool/3108/18 "2024-08-27T08:01:17Z")

</div>

Non-composition templates (we often call them “embedded templates”) are used as preconstrained components to build composition templates, to avoid having to do the same constraints multiple times, and/or standardise them.

---

<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: [27 August 2024 08:04 UTC](https://discourse.openehr.org/t/openehr-tool/3108/19 "2024-08-27T08:04:44Z")

</div>

Yup - so what has happened here is that the .oet was built with an older version of the archetype that is not exported by the bulk import (or by the Git mirror).

We do probably need to cull these ‘broken’ .oets or rebuild with the latest archetype equivalent.

---

<div class="post-metadata">

### Author: ![linforest](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/l/ac8455/32.png) [@linforest](https://discourse.openehr.org/u/linforest)
#### Post date: [27 August 2024 08:05 UTC](https://discourse.openehr.org/t/openehr-tool/3108/20 "2024-08-27T08:05:42Z")

</div>

Thanks, [Silje](https://discourse.openehr.org/u/siljelb).  
You mean such an embedded template can be directly imported into a new template to accelerate the template editing process?

---

<div class="post-metadata">

### Author: ![siljelb](https://discourse.openehr.org/user_avatar/discourse.openehr.org/siljelb/32/12_2.png) [@siljelb](https://discourse.openehr.org/u/siljelb)
#### Post date: [27 August 2024 08:06 UTC](https://discourse.openehr.org/t/openehr-tool/3108/21 "2024-08-27T08:06:40Z")

</div>

That’s exactly right 😊

[Next page](https://discourse.openehr.org/t/openehr-tool/3108.md?page=2)
