# How to express a LINK? **Category:** [Implementers (archive)](https://discourse.openehr.org/c/implementers-archive/158) **Created:** 2008-01-29 12:05 UTC **Views:** 7 **Replies:** 6 **URL:** https://discourse.openehr.org/t/how-to-express-a-link/14730 --- ## Post #1 by @Cati_Martinez Hi everybody, I'm trying to model the class LINK in Openehr and I'm doubting about how to do it\. According to its syntax in ADL, a LINK could be expressed as the following \(use\_node\.\.\.\), isn't it? ELEMENT\[at0008\] occurrences matches \{0 \.\.1\} matches \{        value matches \{   DV\_CODED\_TEXT matches \{      defining\_code matches \{     \[local::     at0009, \-\- Chemistry     at0010\] \-\- Microbiology      \}   \}               use\_node ELEMENT /data\[at0001\]/events\[at0002\]/data\[at0003\]/items\[at0013\]       \} A LINK could also appear in any property \(value, defining\_code\.\.\.\.etc\) of any "element" which inherit from LOCATABLE ? If it'd be in that way, I'd have to check in each property if it was a LINK\. Another easier way could be to express the LINK with links property: ELEMENT\[at0008\] occurrences matches \{0 \.\.1\} matches \{        value matches \{   DV\_CODED\_TEXT matches \{      defining\_code matches \{     \[local::     at0009, \-\- Chemistry     at0010\] \-\- Microbiology      \}   \}        links matches\{ use\_node ELEMENT /data\[at0001\]/events\[at0002\]/data\[at0003\]/items\[at0013\]        \}       \} But in that way, my implementation wouldn't be compatible with the previous way\. Thank you very much for your help\. --- ## Post #2 by @thomas.beale Cati Martínez wrote: > Hi everybody, > > I'm trying to model the class LINK in Openehr and I'm doubting about > how to do it\. > According to its syntax in ADL, a LINK could be expressed as the > following \(use\_node\.\.\.\), isn't it? > no, use\_node has nothing to do with LINK\. use\_node is a way of reusing a previously defined part of an archetype later in the same archetype\. See e\.g\. the Apgar archetype\. LINK is a class of its own, from the Common Information Model\. Currently noone has constrained LINKs in archetypes, but it can be done just as for any other class\. \- thomas beale --- ## Post #3 by @Cati_Martinez Ok, then It wasn't what I was thinking\.\.\. My question now is, which is the correspondence with an "ARCHETYPE\_INTERNAL\_REF" \(use\_node\) in the OpenEHR reference model? Thank you again\. --- ## Post #4 by @thomas.beale Cati Martínez wrote: > Ok, then It wasn't what I was thinking\.\.\. My question now is, which is > the correspondence with an "ARCHETYPE\_INTERNAL\_REF" \(use\_node\) in the > OpenEHR reference model? > an ARCHETYPE\_INTERNAL\_REF does not correspond to anything in the RM, it gives the capability to create a reference in an archetype to a preivously defined part of the same archetype, allowing the later section to re\-use the definition from earlier\. It is a reuse mechanism\. \- thomas --- ## Post #5 by @Cati_Martinez Ok, so the "element" which the reference of the ARCHETYPE\_INTERNAL\_REFERENCE point to, should be present in the archetype itself or in its parent/s, shouldn't it? Thank you for your help\. --- ## Post #6 by @thomas.beale Cati Martínez wrote: > Ok, so the "element" which the reference of the > ARCHETYPE\_INTERNAL\_REFERENCE point to, should be present in the > archetype itself or in its parent/s, shouldn't it? > \*Correct\. \- thomas beale --- ## Post #7 by @system HI Cati The LINK class is a data class that allows instance data in a 'locatable class' to point to any other 'locatable class'. It is my view that this will be less used in archetypes than in data - where clinicians can use it to make references to other parts of the health record (even in different locations). There is also the EHR_URI class that is a datatype - so if you want an explicit link in an archetype then it is probably best to use this data type (and potentially make it mandatory). The Ocean archetype editor will allow links from the root of the entry class in the source code but it is not enabled in the release at present - we are not sure that we want these expressed in archetypes but the community may seek that in future. Cheers, Sam Cati Martínez wrote: [details="(attachments)"] ![OceanC\_small.png|74x72](upload://5I367QG2SMJUp18Pt3jF6yz13Ey.png) [/details] --- **Canonical:** https://discourse.openehr.org/t/how-to-express-a-link/14730 **Original content:** https://discourse.openehr.org/t/how-to-express-a-link/14730