Bulk Web Templates export in Archetype Designer

Hello,

I am looking for the possibility to bulk export all my templates from Archetype Designer as Web Template (JSON) format, ideally with all languages selected. Is this even possible? We have 100+ templates and I can’t imagine going through all of them one-by-one.

The export link in the bottom left corner does indeed bulk export all the data, but the format is not compatible with Web Templates for all our templates.

Does anyone know how we can do this? Is this perhaps available in some other tool? I think it would be nice to have this feature available, I find it hard that we’re the only ones with this requirement :slight_smile:

Thank you in advance!
Owen

Wow that is a lot of templates!! I’d love to hear more about what you are up to !!

The simple answer is no, you can’t right now. I do agree that this might be helpful but remember that web templates are themselves derived from operational templates, which in turn are compiled forms of the raw template plus component archetypes.

The end result is that any bulk export of web templates would be fairly resource intensive and may not play nicely with other users/ openEHR resources.

Having said that, I do share a desire to be able to bulk export both .opts and web templates.

This probably ties in with the recent post on Devops for openEHR models, in terms of starting to automate and safety check some of these processes.

It would be good to understand more about what your environment.

e.g. I would probably try to automate the upload of .opt to a CDR and then use the CDR API to generate the web templates in bulk.

2 Likes

Hello @ian.mcnicoll, thank you for your quick reply and suggestions. I didn’t know that we can generate web templates from the API once we have uploaded the OPT files. I have forwarded this to the backend developers.

Unfortunately I cannot provide too much details about the work we do, but we require the list of available templates as Web Templates format, since it’s easier to generate front-end UI from this.

Thanks once again. I will leave the right solution here once we have figured it out.

1 Like

Thanks Owen,

I completely appreciate there may be commercial constraints in what you can say.

Both Ehrbase and Better APIs will generate Web templates and flat/structured format compositions.

The Ehrbase version is at .../ehrbase/rest/ecis/v1/template/{{templateId}}

1 Like

There might be a possibility to make an external conversion script (outside Archetype Designer) between certain formats by using the code open sourced by Better, see links in the thread Is anyone using Marand's web-template project? I doesn't build (@birger.haarbrandt also mentions EHRbase openEHR SDK in that thread, I have not explored if that wouls cover your use case or not.)

I also believe @thomas.beale made it possible to run the ADL Workbench (AWB) tool in command-line mode so that certain conversions/exports can be scripted for batch jobs, but I am not sure AWB supports the web template format (yet).

@Owen_Far if you get some conversion script/tool working, then please share it with the world.

@erik.sundvall yes, the openEHR SDK can transform OPT to WebTemplate format and is actively maintained and used in EHRbase.

Agree but you still have the initial problem of generating an .opt from the source template and archetypes.

1 Like