# How to construct a CKM URL from an archetype identifier? **Category:** [CKM](https://discourse.openehr.org/c/ckm/89) **Created:** 2024-06-04 20:32 UTC **Views:** 212 **Replies:** 13 **URL:** https://discourse.openehr.org/t/how-to-construct-a-ckm-url-from-an-archetype-identifier/5315 --- ## Post #1 by @thomas.beale Is there a way to create a URL for citation purposes from an archetype id? Is something like the following defined, or easy to support? `http://ckm.openehr.org/archetypes?id=openEHR-EHR-OBSERVATION.blood_pressure.v1.0.3` Possibly mainly for @sebastian.garde --- ## Post #2 by @sebastian.garde [quote="thomas.beale, post:1, topic:5315"] openEHR-EHR-OBSERVATION.blood_pressure.v1 [/quote] It has some limitations, but essentially this works https://ckm.openehr.org/ckm/archetypes/openEHR-EHR-OBSERVATION.blood_pressure.v1 Also e.g. https://ckm.openehr.org/ckm/archetypes/openEHR-EHR-OBSERVATION.blood_pressure.v1/mindmap Note that if the archetype id changes before/on publication this URL would no longer work, whereas the citeable id (e.g. 1013.1.130) remains stable. --- ## Post #3 by @siljelb Alternatively, could the REST API be used to get the cid initially? `https://ckm.openehr.org/ckm/rest/v1/archetypes/citeable-identifier/openEHR-EHR-OBSERVATION.blood_pressure.v2` --- ## Post #4 by @sebastian.garde Oh yes, you can do that as well - especially helpful if you do something programmatically like the rest of the [CKM REST API](https://ckm.openehr.org/ckm/rest-doc/). The direct link is just useful if you quickly want to open the archetype in ckm directly. --- ## Post #5 by @ian.mcnicoll Interesting idea but I think I prefer the simplicity of https://ckm.openehr.org/ckm/archetypes/openEHR-EHR-OBSERVATION.blood_pressure.v1 We will need to factor in namespaces though, quite soon. I think it preferable to stick with major version only, though I guess it depends on the citation requirement. --- ## Post #6 by @joostholslag Definitely it will be useful to specify minor versions. And probably patch. Since in adl2 I often include/specialise at the minor level. --- ## Post #7 by @thomas.beale [quote="ian.mcnicoll, post:5, topic:5315"] I think it preferable to stick with major version only, though I guess it depends on the citation requirement. [/quote] Well major version only is going to get latest of that version, which is not really what you want to do when citing an existing model, whereas if you just want to 'refer' to the latest (whatever it is), sure. So ideally we need support for minor+patch version as well. --- ## Post #8 by @joostholslag Agree. It relates a bit to the discussion wether a new major version means a new archetype. Clinically to me that’s a strange concept, but technically it makes a lot of sense. I think we should discuss this a bit to get so,e consensus for cases like this. --- ## Post #9 by @sebastian.garde [quote="thomas.beale, post:7, topic:5315"] Well major version only is going to get latest of that version, which is not really what you want to do when citing an existing model, whereas if you just want to ‘refer’ to the latest (whatever it is), sure. So ideally we need support for minor+patch version as well. [/quote] Yes, agree. For now if you want to specify an explicit version, you can use the citeable identifier and add the asset version, e.g. [https://ckm.openehr.org/ckm/archetypes/1013.1.3574/9](https://ckm.openehr.org/ckm/archetypes/1013.1.3574/9) for the currently latest published version. --- ## Post #10 by @thomas.beale [quote="sebastian.garde, post:9, topic:5315"] For now if you want to specify an explicit version, you can use the citeable identifier and add the asset version, e.g. https://ckm.openehr.org/ckm/archetypes/1013.1.3574/9 for the currently latest published version. [/quote] This was my original problem: this ID is not in an archetype, so the only way to figure it out given a particular archetype is make some sort of query to CKM REST API. --- ## Post #11 by @sebastian.garde We will support the following in the next CKM release: First, this has always been possible and will go to the latest revision of the archetype: - ckm/archetypes/1013.1.3574 - ckm/archetypes/openEHR-EHR-OBSERVATION.blood_pressure.v2 New: Use the semantic version of the archetype either with the citeable id or the archetype id: - ckm/archetypes/1013.1.3574/2.0.8 - ckm/archetypes/openEHR-EHR-OBSERVATION.blood_pressure.v2/2.0.8 In addition, if you want to point to the *latest published* i.e. current stable version, you will be able to do this. Again, this works with the the citeable id as well as with the archetype id: - ckm/archetypes/1013.1.3574/latestpublished - ckm/archetypes/openEHR-EHR-OBSERVATION.blood_pressure.v2/latestpublished In *all* of these cases, you can append an action, for example to go the adl tab of the latest published bp v2 version: /ckm/archetypes/openEHR-EHR-OBSERVATION.blood_pressure.v2/latestpublished/adl And because it is a little bit complex, we have also extended the Share with Colleague tab, so that you can construct the URL if needed: ![image|690x114](upload://hIM639K9l9YAzh0Hr0js0Wh6Ge2.png) Hope this will be helpful to you @thomas.beale (and others of course!) --- ## Post #12 by @yampeku I've been a user of CKM URIs since forever and they work really well. Love the "latestpublished", although I could see just "latest" for obtaining the latest published one in general, as it is possible to point to specific non-published ones if needed --- ## Post #13 by @sebastian.garde [quote="yampeku, post:12, topic:5315"] Love the “latestpublished”, although I could see just “latest” [/quote] Well, you will actually be able to use "latest" as well. However, this is not the same as "latestpublished". "latest" is the same as not stating anything, i.e. it points to the latest and greatest, but that may not necessarily be stable/published, generally speaking. In practice, I believe, the archetype is often republished immediately, especially for patches, but this is an editorial decision. E.g., at the time of writing /ckm/archetypes/openEHR-EHR-OBSERVATION.blood_pressure.v2/latestpublished is the same as /ckm/archetypes/openEHR-EHR-OBSERVATION.blood_pressure.v2/2.0.8 And this *happens* to also be the same as /ckm/archetypes/openEHR-EHR-OBSERVATION.blood_pressure.v2/latest and /ckm/archetypes/openEHR-EHR-OBSERVATION.blood_pressure.v2 However, if e.g. @varntzen chooses to commit a 2.0.9-alpha version to the trunk without republishing it immediately, then */latestpublished* will stay at 2.0.8 whereas */latest* will now point to 2.0.9-alpha. --- ## Post #14 by @ian.mcnicoll One other issue we will need to consider is how/where archetype namespaces come in with ADL2. This is already an issue when trying to construct URIs when mapping archetypes into FHIR or indeed openEHR local valuesets into FHIR. --- **Canonical:** https://discourse.openehr.org/t/how-to-construct-a-ckm-url-from-an-archetype-identifier/5315 **Original content:** https://discourse.openehr.org/t/how-to-construct-a-ckm-url-from-an-archetype-identifier/5315