Validation
To validate the form, user must click the validate button in Preview. Form restrictions are not the same restrictions as the restrictions on EHR Server.
The validation algorithm is only concerned with the components that are visible on the current page. If a field is not included in a form, or is hidden, then the validation can be successful, but you still won't be able to publish a new composition to your EHR server since the form is not validated against the template.
If the validation against the template fails, you will get a error notification which will look like this:
If you click the show more
button we will also show you exactly on which field the validation failed and why, so you can go back to the form and correct it.
When are Inputs Required?
The rules that determine if a field is required or not are defined and inherited from the openEHR specification as follows:
- If a field is required, and all the parent containers are required then the field is always required. If a field is required and not present in any container then it is required.
- if a field is required and its direct parent container is not required, plus the direct parent container does not have any data stored (all the input fields are empty), then the field is not required.
- if a field is required and its direct parent container is not required, plus the direct parent container has non-empty fields (there exist an input field that is entered/non-empty in this parent container), then the field is required.