How to model relationship between archetypes?

Hi,

I’m try to understand how to model relationship between archetypes. For example, there are two archetypes in CKM,

openEHR-EHR-INSTRUCTION.request-lab_test.v1 and
openEHR-EHR-OBSERVATION.lab_test.v1

My question is, how to express the relationship that openEHR-EHR-OBSERVATION.lab_test.v1 relates to openEHR-EHR-INSTRUCTION.request-lab_test.v1?

I tried possible methods:

  1. Add an attribute in openEHR-EHR-OBSERVATION.lab_test.v1 referring to uid of openEHR-EHR-INSTRUCTION.request-lab_test.v1.
  2. Use archetype slots. But I think archetype slots are not allowed between Entry based archetypes, is that correct?
  3. Define a new Section archetype as container and put both openEHR-EHR-INSTRUCTION.request-lab_test.v1 and openEHR-EHR-OBSERVATION.lab_test.v1 in it.

Which is correct? And is there any better method?

Thanks!

Kind regards,
Wang Li

openEHR Reference Model has a Link class that is suitable to your
needs. You can find more info about it in the "EHR IM" document from
the openEHR specifications

Hello Wang

It depends on the relationship. INSTRUCTION and OBSERVATION are separate entities because they map to two completely different things in reality. Is the INSTRUCTION an integral part of the OBSERVATION?

If you really want to maintain some sort of relationship between these two then you could use a LINK (see www.openehr.org/releases/1.0.2/architecture/rm/common_im.pdf) But they would still have to be stored separately.

If these two are related within the context of a specific operation / examination / consultation or other process, then it would be better to create a template that brings these two separate archetypes together with any additional information you might need to capture.

Hope this helps

All the best
Athanasios Anastasiou

Thanks a lot!

LINK can solve my problems very well. But I still have some questions between using LINK and templates.

  1. Does LINK require the linking attributes to be explicitly defined in archetypes? For example, should one more LINK typed attribute be added under links attribute in openEHR-EHR-OBSERVATION.lab_test.v1 target at openEHR-EHR-INSTRUCTION.request-lab_test.v1?

  2. If I use a template with a SECTION node and put both openEHR-EHR-INSTRUCTION.request-lab_test.v1 and openEHR-EHR-OBSERVATION.lab_test.v1 under it using archetype slots, does that means these two archetypes are implicitly related to each other? For example, in openEHR-EHR-SECTION.soap.v1, is OBSERVATION[at0006] node implicitly related to SECTION[at0007]? And how to express one to many relationship between these two in template?

Thanks again!

Kind regards,
Li Wang

Hello Wang

> 1. Does LINK require the linking attributes to be explicitly defined in
> archetypes?
A LINK uses an EHR URI (page 77 in http://www.openehr.org/releases/1.0.1/architecture/rm/data_types_im.pdf) to define its end-points and that can be as detailed as needed. However, the LINK's mission is not to relate fields (as if it were a foreign key for example) but to relate concepts which are represented by archetypes. The overview in Page 23 in that previous document I linked is a very good starting point about LINKs.

> For example, should one more LINK typed attribute be added
> under links attribute in openEHR-EHR-OBSERVATION.lab_test.v1 target at
> openEHR-EHR-INSTRUCTION.request-lab_test.v1?
It would really depend on what you are trying to do. My recommendation would be to make sure that all information necessary for defining the OBSERVATION stays with the OBSERVATION rather than linked to another entity.

Is it possible for you to share a bit more information about what you are trying to model?

> 2. If I use a template with a SECTION node and put both
> openEHR-EHR-INSTRUCTION.request-lab_test.v1 and
> openEHR-EHR-OBSERVATION.lab_test.v1 under it using archetype slots, does
> that means these two archetypes are implicitly related to each other?
If you do it in that way you would effectively be relating SOME request-lab_test with SOME lab_test in the context described by that specific template. Better specialise it all the way down to the specific archetypes you want to use. That relation would be semantic, i.e. for a process to occur (in the real world) it requires these two pieces of data to be known / recorded.

> For example, in openEHR-EHR-SECTION.soap.v1, is OBSERVATION[at0006] node
> implicitly related to SECTION[at0007]?
They will be related because when it comes to querying for that piece of data you would have to specify that you require all EHR's that contain data structured according to that particular template and that furthermore the OBSERVATION is (for example) 125 BPM.

> And how to express one to many
> relationship between these two in template?
Do you mean one section to many observations? It does not exactly work like this.

The Reference Model is a palette of data structures and each one fits a particular use (in the "real" world). If you have more than one OBSERVATIONs associated with the same event, perhaps you need to express this in a different way.

Which brings us back to an earlier question, what are you trying to model?

Hope this helps.

All the best
Athanasios Anastasiou

Sorry for not put myself clear.

My model is simple, an doctor requests a lab test and gets corresponding result, and the result are related to the request. For example, if the doctor orders two lab test requests, full-blood-count-request and liver-function-request, then there are two lab test results, full-blood-count-result and liver-function-result, and the full-blood-count-result is related to the full-blood-count-request, the liver-function-result is related to the liver-function-request. So that the corresponding result can be found from the request and vice versa.

Is that clear enough?

In programming language, a possible implementation I think may be that there are two classes, lab-test-request and lab-test-result, lab-test-result has an attribute stores id of lab-test-request instances to hold the relationship between these two classes.
Does use LINK in archetypes go the same way? The LINK attribute in archetype lab test result points to archetype lab test request, and in lab test result archetype instance the LINK attribute stores id of lab test request archetype instance? Is that right?

And how to use template to model the relationship between lab test request and lab test result?

Thanks a lot!

Kind regards,
Li Wang

Hello Wang

Please see below:

My model is simple, an doctor requests a lab test and gets corresponding
result, and the result are related to the request.

Great, what is the real world need that triggers the design of this template? What is the purpose for this doctor's request? Is this to cover a standard procedure that is going on in the Health System or to serve the purposes of a specific research project?

For example, if the
doctor orders two lab test requests, full-blood-count-request and
liver-function-request, then there are two lab test results,
full-blood-count-result and liver-function-result, and the
full-blood-count-result is related to the full-blood-count-request, the
liver-function-result is related to the liver-function-request. So that
the corresponding result can be found from the request and vice versa.

My perception from the way you describe this use case is that you don't need a template that brings the archetypes together. What you can do is create (or re-use) an archetype for your INSTRUCTION. This will have its own lifetime within the EHR. Furthermore, you can create (or re-use) another archetype for your OBSERVATION that will contain a link (perhaps of type "related_to") to the INSTRUCTION that generated it.

There is a detail here that I am not sure about and this is that an INSTRUCTION will trigger a set of ACTIONs and ACTIVITYs of which one could be leading to the generation of the actual OBSERVATION. In this case, there will effectively be a trace between the OBSERVATION and the INSTRUCTION but I am not sure if that would be as easily query able.

In programming language, a possible implementation I think may be that
there are two classes, lab-test-request and lab-test-result,
lab-test-result has an attribute stores id of lab-test-request instances
to hold the relationship between these two classes.
Does use LINK in archetypes go the same way? The LINK attribute
in archetype lab test result points to archetype lab test request, and
in lab test result archetype instance the LINK attribute stores id of
lab test request archetype instance? Is that right?

I would advise against thinking in programming terms when you are at the level of archetype/templates. When you are "up there" it is better to think in terms of the real-world, the real need, the facts and processes of reality. Data and information will be captured within the EHR no matter what the back-end gets to be (relational, graph, other).

And how to use template to model the relationship between lab test
request and lab test result?

I get the sense that you need to do a bit of background reading about how the whole thing works and for this I would recommend that you go through the Architecture Overview (http://www.openehr.org/releases/1.0.2/architecture/overview.pdf) and EHR IM (http://www.openehr.org/releases/1.0.2/architecture/rm/ehr_im.pdf) cover-to-cover.

Very briefly though, think of Archetypes as models of atomic concepts of reality. These are building blocks of more complex data structures used in healthcare. Archetypes tend to be general, i.e. "Blood Pressure" rather than "Blood Pressure Observation To Cover The Needs Of Project XYZ". You can still do the second by _specialising_ a definitive "Blood Pressure" archetype. To create more complex data structures used in healthcare, you use templates. Think of the template as a form (in the real world). Templates can apply further constraints on one or more archetypes that compose them.

That whole thing of course is half the story. The other half is how is an openEHR storage system structured. That is, a set of EHRs. Each EHR is composed of folders and each folder has a set of compositions which in turn have a set of entries. That is where the (archetypeable) data actually live (think of a huge tree). This general structure along with the specific structure of the archetypes and templates determines how are data stored and how they will be queried via AQL.

Hope this helps.

All the best
Athanasios Anastasiou

Thanks for your reply!

I think link is a good fit in my model.
And I will go through the specification in more detail.
Still I’m glad to hear any suggestion on this questions.

Thanks!

Kind regards,
Li Wang

Hi Li
Work flow is managed using instructions and actions. The order is an instruction, activities for each test if you like. Actions may include taking, sending the sample, receiving, reviewing, acting on the result. At some point the status of the Instruction is set to complete. This allows complex pathway steps.

Heather Leslie should be able to point you to the archetypes.

I think workflowID is used.

Cheers Sam

Hi,

I put some test archetypes in this github repository: https://github.com/daowangli/archetype_test.git
Please help to review for some issues:

  1. I select archetypes in CKM and add new attributes according to my requirements, do these new attributes belong to the proper archetypes?
  2. I use subject in all archetypes to represent patient, is that correct?
  3. I use otherParticipations to define all the clinicians involved in the event, but in some archetypes, for example openEHR-EHR-INSTRUCTION.request-lab_test.v1, Requestor(at0141) and Receiver(at0142) are defined under the protocol attribute. Which is better?
  4. In openEHR-EHR-ACTION.lab_test-zju.v1, I use instructionDetails.activityId and instructionDetails.instructionId to represent the correspond activity, is that correct?
  5. In my situation, there are hundreds of lab test subject such as full blood count, liver function, and each lab test subject contains several lab test items, for example, full blood count contains white blood cell count, red blood count, platelet count, and so on. I cannot define one archetype for each lab test subject. Can I just define a single item lab test archetype for each lab test item, please refer to openEHR-EHR-OBSERVATION.lab_test_single-zju.v1 for an example. Is this ok?

If you have any suggestions, please tell me too.
Thanks!

Kind regards,
Li Wang

Interesting – reposting this as my University has changed reply-to address so lists haven’t been accepting my posts. Funny that I am only aware of this as Outlook places sent mail under that thread nicely – makes you think it’s actually posted by the list manager!