# Automatically convert webtemplate .t.json to .opt format

**URL:** https://discourse.openehr.org/t/automatically-convert-webtemplate-t-json-to-opt-format/4885
**Category:** Archetype Designer
**Tags:** opt, tools, template, json, adl
**Created:** [30 January 2024 10:18 UTC](https://discourse.openehr.org/t/automatically-convert-webtemplate-t-json-to-opt-format/4885 "2024-01-30T10:18:46Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Cartwright](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/c/47e85d/32.png) [@Cartwright](https://discourse.openehr.org/u/Cartwright)
#### Post date: [30 January 2024 10:18 UTC](https://discourse.openehr.org/t/automatically-convert-webtemplate-t-json-to-opt-format/4885/1 "2024-01-30T10:18:46Z")

</div>

Hello,

I have linked my GitHub account to Archetype Designer for better template versioning.

Every time I save a new version of my template, a webtemplate “.t.json” is pushed to my GitHub repository. However, I need the .opt template format for later use and I want to avoid exporting the opt file manually from Archetype Designer for every new version.

Is there a way to change the configuration in Archetype Designer. Or any available tool to convert .t.json to .opt template format?

Thanks for your help

---

<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: [30 January 2024 12:56 UTC](https://discourse.openehr.org/t/automatically-convert-webtemplate-t-json-to-opt-format/4885/2 "2024-01-30T12:56:21Z")

</div>

Hi Kat,

Right now, no - you need to export the .opt manually, unless you are a paid customer of Better with a local hosted version of AD where there is an option to upload the .opt directly to a CDR.

I’d suggest that you probably don’t want to export an .opt every time you change the t.json files - we would only recreate the .opt when there is a signifcant need e.g from update, api update. THere is a lot of modelling churn in AD that is probably best kept there and not always reflected in a new .opt.

Having said that, I agree it would be nice to be able to generate new .opts and other export formats in bulk or as a more auomated process.

---

<div class="post-metadata">

### Author: ![Cartwright](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/c/47e85d/32.png) [@Cartwright](https://discourse.openehr.org/u/Cartwright)
#### Post date: [30 January 2024 13:17 UTC](https://discourse.openehr.org/t/automatically-convert-webtemplate-t-json-to-opt-format/4885/3 "2024-01-30T13:17:07Z")

</div>

Thank you for your answer Ian!

I would expect that there might be an available open-source tool for doing such a conversion between template formats? I couldn’t find much on GitHub repositories so far that could help. But thanks anyway!

---

<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: [30 January 2024 13:24 UTC](https://discourse.openehr.org/t/automatically-convert-webtemplate-t-json-to-opt-format/4885/4 "2024-01-30T13:24:13Z")

</div>

Both EhrBase and Better have open source code for converting .opt to webtemplates and example compositions but not for ‘native json’ to .opt

---

<div class="post-metadata">

### Author: ![tstolker](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/t/779978/32.png) [@tstolker](https://discourse.openehr.org/u/tstolker)
#### Post date: [20 February 2026 15:03 UTC](https://discourse.openehr.org/t/automatically-convert-webtemplate-t-json-to-opt-format/4885/5 "2026-02-20T15:03:27Z")

</div>

Hi iain,  
I am really struggling with how to translate .opt to webtemplate. Can you point me to the specific open source components being used?

Thanks,

Theo

---

<div class="post-metadata">

### Author: ![SevKohler](https://discourse.openehr.org/user_avatar/discourse.openehr.org/sevkohler/32/3504_2.png) [@SevKohler](https://discourse.openehr.org/u/SevKohler)
#### Post date: [3 March 2026 16:14 UTC](https://discourse.openehr.org/t/automatically-convert-webtemplate-t-json-to-opt-format/4885/6 "2026-03-03T16:14:21Z")

</div>

check here [GitHub - ehrbase/openEHR\_SDK: A SDK to facilitate the development of openEHR applications · GitHub](https://github.com/ehrbase/openEHR_SDK) there is some marshal and unmarshal logic.
