Background
Our versioning guidelines state that the template ID should include the major version, meaning that a breaking change should result in a new template with a new template ID.
The reason for this approach is that we cannot have multiple versions of the same template (with the same template ID) stored in the CDR in parallel. A breaking change therefore requires a new template ID to allow the different versions to coexist.
Problem
We now need to update an existing Better Studio form to use a new major version of its template.
So far, we have avoided changing the template ID when updating templates, since this allows the existing form to continue using the updated template. However, this conflicts with our versioning guidelines and the requirement to be able to have different template versions in the CDR.
If we instead create a new template with a new ID, it appears that we would need to create a completely new form in Better Studio. This would require reconfiguring all existing logic and dependencies, which would be very time-consuming for complex forms.
I found that it may be possible to change the template reference for an existing form through the Better EHR Admin Console, but when I tried this I received an error.
Question
What is the recommended way to handle this?
Is there a way to update the template reference for an existing Better Studio form when the template gets a new ID, without having to recreate the entire form and its dependencies?
If this is intended to be done through the Better EHR Admin Console, is that the recommended approach, and what could cause the error I encountered?
The approach via the CDR Admin Console certainly used to work, and would be the best approach - what error are you getting?
An alternative might be to download the form definition files and change all the internal references to the new ID but that feels a little scary to me .
This is going to become a much more significant issue for all tooling/ form-building developers as we move into a world of ADL2 HRID type identifiers for both archetypes and templates, so we need to find easier ways of changing these IDs, or better still allowing more relaxed ‘version-matching’ as a template up-versions during development. Luckily ADL2 supports this but the various tools will need to be adapted.
We have the same issue at RSO Zuid-Limburg. Although the form is developed by Better, so the resort is on them. They have some internal tricks to facilitate I got the impression. We’re planning a chat with their product team for more advanced support of adl2 HRID for templates, as Ian hinted at.
It would be helpful if we could align on this to create a shared request to Better.
Thanks for the reply
{"status":400,"code":"FORM-5722","userMessage":"The form does not have valid content in some of the resources.","developerMessage":"The form does not have valid content in some of the resources.","exceptionMessage":"Conflict between templateId on form and template ids in resources. When resources have defined templateId or templates, templateId on form must be null.","requestHref":"https://qa.regionstockholm.openplatform-test.lifecare.app/ehr/adminconsole/forms/edit","additionalInformation":{}}
For information, this is the reply i got in Better Hive
Community
"Hi Oscar,
Thank you for the detailed write-up. Your versioning approach is sound, and we understand why a breaking change needs a new template ID.
Better Studio can’t currently move an existing form to a template with a different template ID. A form can only follow template updates when the new template keeps the same ID. Studio then matches the form’s fields to the updated template and highlights anything that changed or was removed.
The Admin Console does let you edit a form’s template reference, and if the archetype structure matches it can look like it works. But we don’t recommend it. Studio was never designed for the template reference to change underneath a form, and some parts of a form may depend on the original template ID, for example:
These problems might not appear right away and can be hard to track down later. That’s why we’d rather you didn’t rely on this solution, and we suggest not spending time troubleshooting the error you got.
What we recommend for now:
-
Non-breaking changes: keep the same template ID and update the existing form as usual.
-
Breaking changes with a new template ID: creating a new form for the new template is currently the only approach we can fully support.
We know that second option is a lot of work for complex forms. We’ll keep this case in mind for future improvements."