On 18/12/2018 16:48, Sebastian Garde wrote:
Hi Silje, hi Thomas, hi all,
Whether the CKM validation errors from below are correct or bogus
boils down to my question from before whether it is valid or not to
just leave the version part out completely.
In my understanding the regex needs to be fully matched which means
you cannot just leave it out completely – but it is not 100% clear
from the specs as far as I can see (but see my excerpt from the ADL2
specs from before).
if you are using the regex to validate ids, then you will need the full
regex to match any valid id. If the regex is just to filter out ids that
are validated elsewhere then you can minimise the regex.
If we assume the regex does NOT need to be a full match, then the
validation errors from CKM below are bogus of course.
But if partial matches are sufficient, this in turn requires some
reinterpretation of existing regexes as well:
For example,
openEHR-EHR-OBSERVATION\.body_mass_index(-[a-zA-Z0-9_]+)*\.v1 would
then also match openEHR-EHR-OBSERVATION.body_mass_index.v15 (or v10
v11 etc. for example)
The example below
openEHR-EHR-OBSERVATION\.body_mass_index(-[a-zA-Z0-9_]+)*\.v[0-2]
means that not only v0, v1, v2 are valid, but also v10, v15, v27 to
name a few.
the regex character class [0-2] matches only a single digit having the
character values in the series 0-2, i.e. 0, 1, or 2.
Now that you mention it, I do seem to remember we specified a very long
time ago that those regexes did have to be full validating ones. So that
means using something more like
openEHR-EHR-OBSERVATION\.body_mass_index(-[a-zA-Z0-9_]+)*\.v(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*)){0.2}
as the checker regex in CKM, and patterns like
openEHR-EHR-OBSERVATION\.body_mass_index(-[a-zA-Z0-9_]+)*\.v.*, where
the trailing '.*' matches anything, and the validator regex ensures it
is only semver dotted version patterns.
- thomas
_______________________________________________
openEHR-technical mailing list
openEHR-technical@lists.openehr.org
http://lists.openehr.org/mailman/listinfo/openehr-technical_lists.openehr.org