Fix archetypeNodeId pattern

Description

I found a patched from 2012-2013 definition of the archetypeNodeId type pattern.
Still need to investigate what was the initial problem at that time:
```
fix for archetypeNodeId () - see support_im.pdf 4.3.10.1 Archetype ID Syntax
([a-zA-Z][\w_]-[\w][\w_][\w][\w_]\.[\w][\w_]([\w][\w_])\.v\d+(\.\d))|(at(0\.[0-9]{1,4}|[0-9]{4})(\.[0-9]{1,3}))
vs
([a-zA-Z]\w+([a-zA-Z]\w+){2}\.[a-zA-Z]\w+([a-zA-Z]\w+)\.v[1-9]\d)|(at(0\.[0-9]{1,4}|[0-9]{4})(\.[0-9]{1,3})*)
```
perhaps this might be rejected eventually

----------
final version can be checked at https://regex101.com/r/IX5KjF/5

Activity

Show:
Diego Bosca
December 13, 2018, 4:29 PM

Seems ok to me, it also supports other RMs that start with numbers

Thomas Beale
December 13, 2018, 5:32 PM

Just for the record, openEHR universally uses so-called Perl regex (PCRE), which is where the \d, \w etc etc comes from. So you can use that safely anywhere you like.

Pablo Pazos
December 13, 2018, 9:33 PM

If we use PCREs, we can use this site to validate https://regex101.com/

Choosing multiline tag, many test cases, one per line, can be set on the test string box to verify the regex works on every desired case.

Sebastian Iancu
December 14, 2018, 11:04 AM
Edited

I have a new version of it: https://regex101.com/r/IX5KjF/3
I added support for -rc and -alpha in the version part but also for the namespace of hrid.
For the at-code part I also added support for 'id' prefixed ids - I'm not sure if this is needed for data instances.
The overall expression is optimistic (for instance versions like v000.000.000 are allowed)
Can some of you give me some feedback?

ps: to make these I consulted

Diego Bosca
December 14, 2018, 11:11 AM

I think this is fine. If we really want to disallow the v000 part maybe is just a matter of transforming the \d+ after the version into something like [1-9]*\d
But this probably makes the expression more difficult to read, so your current proposal is ok for me

Reporter

Sebastian Iancu

Raised By

Sebastian Iancu

Components

Affects versions

Configure