Skip to content

Conversation

@SevKohler
Copy link

This is a first PR including the changes, this is to be discussed

Copy link
Member

@gardes gardes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not familiar with all that has been discussed so take my comments with a grain of salt

2+^h|*TEMPLATE_ID*

h|*Description*
2+a|Identifier for templates. Lexical form to be determined.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to remove "Lexical form to be determined." now that it is determined.

2+|`<<_object_id_class,OBJECT_ID>>`

h|*Invariants*
2+a|__Template_ID_validity__: `not matches("^(?:(?<namespace>[a-zA-Z][a-zA-Z0-9_.:/&?=+-]*\.)::)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure the namespace part of the regex is ok?

I am not familiar with all that has been discussed but a couple of observations:

  1. It seems like it must have a dot at the end of the regex before the :: separator. This seems unintuitive/wrong
  2. Do we really need the characters .:/&?=+ within the namespace?
  3. It seems to allow any number of subsequent "." after the first character which seem counter-intuitive.

Maybe something like this regex works better as a replacement:
(?<namespace>(?:(?:[a-zA-Z_][a-zA-Z0-9_-])(?:.[a-zA-Z_][a-zA-Z0-9_-])+]*)+)::

This would enable org.openehr, org.highmed com.my-test or uk.org.my_organisation.
However unlike the above regex, o....-..c&/=+._ would not be supported as an extreme example of a namespace supported by the current namespace suggestion.

Also, should it not be "matches" instead of "not matches"?

Copy link
Author

@SevKohler SevKohler May 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im not sure, i just made the PR so we have something to work on and move the progress.
Thanks for the input. I copied actually your regex from the comment on confluence.
Can you provide me with the full one ?
I did now:

matches("^(?<namespace>(?:(?:[a-zA-Z_][a-zA-Z0-9_-])(?:.[a-zA-Z_][a-zA-Z0-9_-])]*))::)
(?<rm_publisher>[a-zA-Z])-
(?<rm_package>[a-zA-Z][a-zA-Z0-9_])-
(?<rm_class>[a-zA-Z])\.
(?<concept_name>[a-zA-Z][a-zA-Z0-9_-])\.
(?<release_version>v\d+(?:\.\d+){0,2})
(?:-(?<version_status>))?
(?:\.(?<build_count>\d))?$
")

I think your right and it should be matches

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I think a few required + went missing somewhere and there is an unmatched parentheses after :: and a dot that needed escaping and the version_status regex part that was missing.

Let me try again in total:

matches("/^(?<namespace>(?:[a-zA-Z][a-zA-Z0-9_-]*)(?:\.[a-zA-Z][a-zA-Z0-9_-]*)+)::
(?<rm_publisher>[a-zA-Z]+)-
(?<rm_package>[a-zA-Z][a-zA-Z0-9_]+)-
(?<rm_class>[a-zA-Z]+)\.
(?<concept_name>[a-zA-Z][a-zA-Z0-9_-]+)\.
(?<release_version>v\d+(?:\.\d+){0,2})
(?:-(?<version_status>[a-zA-Z0-9]+))?
(?:\.(?<build_count>\d))?$
")

Please see https://regex101.com/r/vLdk5l/2 to confirm that this is what you want - you can just add more test strings, one per line to see whether they match or not.

@wolandscat
Copy link
Member

Everyone should note that if you change a file like template_id.adoc you are changing a generated file. Changes will be wiped out on next regen from MagicDraw. With no regenerate, we are accumulating formal changes that are expressed at text mods to a rendered output precursor file (adoc)., not a model file of any kind.

@SevKohler
Copy link
Author

SevKohler commented May 21, 2025

Do you mean that these ascidocs are also generated over MagicDraw not only the UMLs ?
Or how does this work.

This whole construct seems very intransparent to me and most of the spec people :(
Maybe its time we move the spec over to something accessible and modern.

@wolandscat
Copy link
Member

The models have been maintained in MagicDraw for about 12 years from memory. All of the files in the directory docs/UML/classes are generated by the UML extractor. It's modern enough, and has worked very well.

But I fear there is a lack of knowledge about this pathway, and some people are unwittingly creating PRs to those generated files. All such changes will be lost the next time I or anyone regenerates from MagicDraw. I have posted quite a few times about this, but not sure if people are reading it.

There has been a lot of discussion about moving from MagicDraw to e.g. PlantUML, but there's significant work involved. We probably should do it, but we need to plan for a transition period.

@SevKohler
Copy link
Author

SevKohler commented May 22, 2025

Okay, on monday there is the spec meeting, we may discuss it there.
Where do i need to alter the fields in order for them to be generated ?
In the computableUML ?

@wolandscat
Copy link
Member

Yes it's via the UML tool. I need about a week to figure out licenses for openEHR and then we can do that.

@joostholslag
Copy link
Contributor

We should add a text, that states that any (legacy) template_id.value string that matches the regex for HRID is considered an HRID, including the assumptions around semantic versioning.

@joostholslag
Copy link
Contributor

@joostholslag joostholslag marked this pull request as draft November 11, 2025 10:44
Updated the description of TEMPLATE_ID to clarify the use of HRID format and backwards compatibility.

For workgroup agreement and discussion see the CR https://openehr.atlassian.net/browse/SPECBASE-42?focusedCommentId=31103
@joostholslag
Copy link
Contributor

joostholslag commented Nov 11, 2025

I changed the description to reflect the latest consensus. Jelte Zeilstra will suggest a definition for the function (instead of the invariant).
TODO:

  • 1. update UML/BMM (later)
  • 2. update function name if different from current
  • 3. consider changing link to refer to ADL grammar instead of AOM class.
  • 4. check styling (links, class name capitalization).

@joostholslag joostholslag changed the title Change the Template ID as discussed in SPEC. Implement SPECBASE-42 Define TEMPLATE_ID aligned with HRID Nov 11, 2025
SevKohler and others added 2 commits November 11, 2025 21:22
Co-authored-by: Jelte Zeilstra <J3173@users.noreply.github.com>
@joostholslag
Copy link
Contributor

I changed the description to reflect the latest consensus. Jelte Zeilstra will suggest a definition for the function (instead of the invariant). TODO:

  • 1. update UML/BMM (later)
  • 2. update function name if different from current
  • 3. consider changing link to refer to ADL grammar instead of AOM class.
  • 4. check styling (links, class name capitalization).

@sebastian-iancu @wolandscat could you help re 3 and 4 please?

@joostholslag joostholslag changed the title Implement SPECBASE-42 Define TEMPLATE_ID aligned with HRID SPECBASE-42 Define TEMPLATE_ID aligned with HRID Nov 13, 2025
@SevKohler
Copy link
Author

how do we mark this in the jira then ?
I would suggest we make one template_id hrid issue and then link two smaller ones to it so we dont block the other PR.

@joostholslag
Copy link
Contributor

In jira the CRs need to be per spec (am and base). The PR (problem report) can be singular.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants