# Best practice for updating templates

**URL:** https://discourse.openehr.org/t/best-practice-for-updating-templates/904
**Category:** Platform
**Created:** [31 July 2020 06:25 UTC](https://discourse.openehr.org/t/best-practice-for-updating-templates/904 "2020-07-31T06:25:00Z")
**Posts on this page:** 5
**Page:** 2

<div class="post-metadata">

### Author: ![birger.haarbrandt](https://discourse.openehr.org/user_avatar/discourse.openehr.org/birger.haarbrandt/32/24_2.png) [@birger.haarbrandt](https://discourse.openehr.org/u/birger.haarbrandt)
#### Post date: [26 September 2024 15:53 UTC](https://discourse.openehr.org/t/best-practice-for-updating-templates/904/21 "2024-09-26T15:53:27Z")

</div>

What do you mean by

> load the template on startup

When the server is started for the very first time?

---

<div class="post-metadata">

### Author: ![Callum\_Anderson](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/c/aeb1de/32.png) [@Callum\_Anderson](https://discourse.openehr.org/u/Callum_Anderson)
#### Post date: [30 September 2024 09:23 UTC](https://discourse.openehr.org/t/best-practice-for-updating-templates/904/22 "2024-09-30T09:23:58Z")

</div>

Yes, exactly, and on restart too (although in that case you’d expect it to detect that it’s already loaded).

I guess it’s similar to the way [HAPI FHIR can load implementation guides on startup](https://github.com/hapifhir/hapi-fhir-jpaserver-starter/blob/e2d2ea7726975e76010fc3f98149fad72a48fe84/src/main/resources/application.yaml#L150), I wondered if EHRBase could do a similar thing for templates.

---

<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 September 2024 09:37 UTC](https://discourse.openehr.org/t/best-practice-for-updating-templates/904/23 "2024-09-30T09:37:01Z")

</div>

Interesting idea - might even be possible to use FHIR IGs for that purpose.

---

<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 September 2024 09:37 UTC](https://discourse.openehr.org/t/best-practice-for-updating-templates/904/24 "2024-09-30T09:37:54Z")

</div>

FWIW - we use a Postman script for this kind of standard loading of templates plus associated sample compositions.

---

<div class="post-metadata">

### Author: ![birger.haarbrandt](https://discourse.openehr.org/user_avatar/discourse.openehr.org/birger.haarbrandt/32/24_2.png) [@birger.haarbrandt](https://discourse.openehr.org/u/birger.haarbrandt)
#### Post date: [30 September 2024 10:20 UTC](https://discourse.openehr.org/t/best-practice-for-updating-templates/904/25 "2024-09-30T10:20:49Z")

</div>

Inside the openEHR SDK, there is an interface for a TemplateProvider. The default client ([openEHR\_SDK/client/src/main/java/org/ehrbase/openehr/sdk/client/openehrclient/defaultrestclient/DefaultRestTemplateEndpoint.java at develop · ehrbase/openEHR\_SDK · GitHub](https://github.com/ehrbase/openEHR_SDK/blob/develop/client/src/main/java/org/ehrbase/openehr/sdk/client/openehrclient/defaultrestclient/DefaultRestTemplateEndpoint.java)) implementation of this TemplateProvider checks a folder and synchronizes the EHRbase server. We use this mechanism in the integration components like FHIR Bridge (and our commercial CDR Bridge) to ensure all templates are in place.

So you could quite easily incorporate a mechanism like this as part of a batch file for system startup or your CI/CD pipeline.

[Previous page](https://discourse.openehr.org/t/best-practice-for-updating-templates/904.md?page=1)
