Run-time name constraints and appropriate use of terminologies

I have been having an email conversation with Sebastian Iancu of Code24 about some issues concerning the design of the Demographics PARTY_IDENTITY.person_name.v1

http://www.openehr.org/knowledge/OKM.html#showArchetype_1013.1.477

There were 2 key areas discussed:

  1. In ‘Person identifier’ the concept name of the archetype has a ‘run-time constraint’ allowing the archetype concept to be re-defined at Template/tun-time. e.g the original name of the archetype is ‘person identifier’ which may be re-defined i.e.







Concept name





|





Person name
Runtime name constraint:
Choice of:

- Coded Text
- Reporting name [The subject’s name as it is to be used for reporting, when used with a specific identifier.]
- Newborn name [A type reserved for the identification of unnamed newborn babies.]
- Professional or business name [The name used by the subject for business or professional purposes.]
- Maiden name [The name used by the subject of care prior to marriage.]
- Legal name [Registered name (Legal name).]
- Other name [Any other name by which the subject is known, or has been known by in the past.]
- Free or coded text






|

  • | - |

The constraint is deliberately left open (via the ‘Free or coded text’ choice) as we felt that we could not be certain that the Code Text options (derived from ISO) were universally applicable and that other national name categories are likely to be required in the forseeable future.

The concept name constraint approach for compatibility with the purpose() function in the RM class:

purpose() : DV_TEXT | | Purpose of identity, e.g. “legal”, “stagename”, “nickname”, “tribal name”, “trading name”. Taken from value of inherited name attribute. |

  • | - | - |
  1. A related but broader issue is how/where we should define the terms for such a constraint - in the openEHR terminology, in the archetype as local atcodes, or in an external terminology such as Snomed.

I am reasonably confident that we have adopted the correct approach to these design issues and will post my own thoughts and replies, but I felt that the topic merited wider discussion, particularly as Sebastian has explained his concerns so clearly and is happy to move the discussion to the lists.

Sebastian’s latest reply to me needs to be in a separate post as the combined message is too large for the email server.

I hope a lively debate will ensue :slight_smile:

Regards,

Ian

Dr Ian McNicoll
office / fax +44(0)141 560 4657
mobile +44 (0)775 209 7859
skype ianmcnicoll
ian.mcnicoll@oceaninformatics.com
ian@mcmi.co.uk

Clinical Analyst Ocean Informatics
Honorary Senior Research Associate, CHIME, University College London
openEHR Archetype Editorial Group
Member BCS Primary Health Care SG Group www.phcsg.org / BCS Health Scotland

PART 1 of Sebastian’s latest reply to me …

PART 2 :

As about the other issue of as_string(), let me give you an example to express my concerns:
Lets suppose we have again hospital A residing in UK while B residing in NL. A is going to use CKM archetypes for ADDRESS, while B not, and lets suppose we have the following case/data for an address (I will only detail relevant fields)

... - other data

ADDRESS/details/items[at0002]/items[at0023]/value = 'MyHouseName'

ADDRESS/details/items[at0002]/items[at0028]/value = 'MyStreet'

ADDRESS/details/items[at0002]/items[at0029]/value = 100

ADDRESS/details/items[at0002]/items[at0031]/value = ' .... MyStreet 100 ...,  MyHouseName' -- address line

ADDRESS/details/items[at0004]/value = 'XYZ 123' -- zip

ADDRESS/details/items[at0005]/value = 'MyTown'

ADDRESS/details/items[at0007]/value = 'UK'

... - other data

So what you would expect from the as_string() is basically something like:

MyHouseName

100 MyStreet

MyTown

XYZ 123

UK

which I guess is ‘statically’ implemented in the application used in A. As you can see the expected string might not be just a concatenated string of all values found in the object but rather a templated/formatted string.

Now, if A is sending these data to B for further processing, then B requires the same archetype in order to parse/understand the data he got. Using local terminology (found in archetype) B can assign meaning to each of the node, but he cannot produce the same as_string() as he doesn’t have the same knowledge as A. So he will probably produce a B-localized version of it. Is this enough or not? Is it really a problem or just weak in theory? - I don’t know, but perhaps if we can capture the pattern in the archetype it will be better. This is why I was asking about this as_string().

If I can think of something like rules/assertions (although I’m not very familiar with them) in the cADL they can look similar to:

as_string: 

details/items[at0002]/items[at0023]/value + CRLF +

details/items[at0002]/items[at0029]/value +

details/items[at0002]/items[at0028]/value + CRLF +

details/items[at0005]/value +

details/items[at0007]/value

although I know this is not a valid cADL grammar. As I said, I’m not very familiar with the syntax, and I’m not sure how to use it afterwards - i.e. is the above going to assign an expression to as_string() function?

I have been having an email conversation with Sebastian Iancu of Code24 about some issues concerning the design of the Demographics PARTY_IDENTITY.person_name.v1

http://www.openehr.org/knowledge/OKM.html#showArchetype_1013.1.477

There were 2 key areas discussed:

  1. In ‘Person identifier’ the concept name of the archetype has a ‘run-time constraint’ allowing the archetype concept to be re-defined at Template/tun-time. e.g the original name of the archetype is ‘person identifier’ which may be re-defined i.e.

Hi Ian, I could not see the following in the archetype mentioned above.







Concept name





|





Person name
Runtime name constraint:
Choice of:

- Coded Text
- Reporting name [The subject’s name as it is to be used for reporting, when used with a specific identifier.]
- Newborn name [A type reserved for the identification of unnamed newborn babies.]
- Professional or business name [The name used by the subject for business or professional purposes.]
- Maiden name [The name used by the subject of care prior to marriage.]
- Legal name [Registered name (Legal name).]
- Other name [Any other name by which the subject is known, or has been known by in the past.]
- Free or coded text






|

  • | - |

The constraint is deliberately left open (via the ‘Free or coded text’ choice) as we felt that we could not be certain that the Code Text options (derived from ISO) were universally applicable and that other national name categories are likely to be required in the forseeable future.

The concept name constraint approach for compatibility with the purpose() function in the RM class:

purpose() : DV_TEXT | | Purpose of identity, e.g. “legal”, “stagename”, “nickname”, “tribal name”, “trading name”. Taken from value of inherited name attribute. |

  • | - | - |
  1. A related but broader issue is how/where we should define the terms for such a constraint - in the openEHR terminology, in the archetype as local atcodes, or in an external terminology such as Snomed.

presumably in the same place as where we define things like ‘family relationship’. Currently this is done in openEHR, because of the lack of a reliable alternative, but we should take this up at IHTSDO to see if these kind of vocabularies cannot all be done in Snomed.

  • thomas beale

Hi Sebastian,

PART 1 of Sebastian’s latest reply to me …

============================================================

… My main approach and views while I’m looking over archetypes and specifications is from a technical perspective, as I’m working as software developer.

About the name attribute issue: whether or not to use purpose() or directly name/defining_code attributes is not so relevant, as the concern I have is in fact that the name holds the type and the semantics of the (owner) object. I think I understand the principles behind that (as you already explained in previous emails) and also the RM design as well as the design aspects on CKM archetypes made by Sergio. But when it comes to software development, if I want to get the meaning of that object the only solution is to know the item-structure beforehand, thus that piece of software handling PARTY_IDENTITY will be highly dependent on the archetype itself.

well, queries will be archetype-dependent, that is the idea.

Any structural change or re-coding local terms made in those archetypes will require change in the software.

this depends on how the software is designed. If it is designed to use AQL queries, then it should not require changes, only the query might require changes.

Even worst, if I make the software rely on the DV_TEXT/value instead of DV_CODED_TEXT/defining_code (which is a bad ideea from my perspective) I will get problems only by changing the language of the archetype or just by renaming the node on the template level.

normally, you would use both the value and the defining_code fields of a DV_CODED_TEXT object.

Indeed, at-code gives us language-neutral terminology, designers or archetype owners have the flexibility to do whatever they need in an archetype, but they will have to agree on using and sharing archetypes and templates. Still, if there is no common ground to share and safely transfer semantics (and what I mean here is the knowledge provided by a specific archetype) between parties I don’t see interoperability working that smoothly.

that is correct - and what these documents are about at http://www.openehr.org/wiki/display/spec/Development+and+Governance+of+Knowledge+Artefacts

Under the collaboration of openEHR and IHTSDO, these will be further developed into a basis for reliable sharing and improved identification.

Let me give you an example of what and how can go wrong:
Suppose there is hospital A will going to use CKM archetypes and another hospital B developing their own ones. A is going to exchange openEHR information with hospital B, one of the topic being is PATIENTs. As A will going to use openEHR-DEMOGRAPHIC-PERSON.person.v1and openEHR-DEMOGRAPHIC-CLUSTER.person_identifier_iso.v1 the ‘legal identity’ type is modeled by that famous

identities[openEHR-DEMOGRAPHIC-CLUSTER.person_identifier_iso.v1]/name/defining_code = ‘local:at0027’

B is going for other, CKM similar but not the same, in-house developed, archetypes; for the sake of exercise the original (and only) language will be dutch: openEHR*-DEMOGRAPHIC-PERSON.b_persoon.v1 and* openEHR*-DEMOGRAPHIC-CLUSTER.b_persoon_identifier.v1* and will use the following path to test legal identity:

identities[openEHR-DEMOGRAPHIC-CLUSTER.b_persoon_identifier.v1*]/name/value = ‘juridische identiteit’*

As time passes B learns that he must use internal codes to be more efficient on handling or exchanging data so he publish a new modified version: openEHR*-DEMOGRAPHIC-PERSON.b_persoon.v2* and the path becomes:

identities[openEHR-DEMOGRAPHIC-CLUSTER.b_persoon_identifier.v2]/name/defining_code = ‘local:at0008’

Notice, it is at0008 because it is completely different archetype, and that was the code rightfully assigned by the archetype tool used in the B organization.

this is normal - if two organisations want to share data, they need to share archetypes concerning that data. It doesn’t matter what mechanism they use, this must be the case. Doing anything that works means relying on some external (to both) or shared resource - whether it is archetypes or SNOMED or ICD or anything else. What does not need to be shared is templates - each institution can happily create as many as it wants, based on the same archetype repository. Each institution can also create its own private archetypes for data

  • not intended to be shared
  • intended to be shared one day, when the private archetypes will be shared
  • intended to be shared , but not processed by the receiver in an intelligent way (but display would still be possible)

Now, as you might see already, if B wants to exchange data with A, they will have to share archetypes because only looking to the at-codes is not enough (at0027 vs at0008) - i.e. A must access and read openEHR*-DEMOGRAPHIC-PERSON.b_persoon.v2* in order to validate and use terminology associated with at0008.

yes, this is because the archetype acts as the name space for the at-codes.

Suppose that is not an issue and A accomplished that reading… but now the question is how can A understand what should be the right code associated with legal identity. Previously, in his own domain, A used (instructed by the application level) to look for at0027 but there is no clue for him how to locate the same concept in B domain.

but you are still pre-supposing that each place is developing essentially the same archetypes independently. This won’t work, and isn’t sustainable in terms of work anyway - it will obviously be less work to develop shared archetypes once (and of better quality) rather than develop the same thing many times.

I guess in this case a quite good solution (as you already mentioned) is to use term bindings to a common external terminology. It will not enforce but probably just facilitate common semantics. Without it, the above use-case will be quite a challenge to solved for good. Still, adopting this solution requires agreement between A and B on using a common external terminology service which might add some adoption issues (maybe even scalability) on top of whole openEHR solution.

for many reasons this is also useful. But if A & B really don’t want to cooperate, or share, or agree on anything, it is kind of hard to help them!

Another solution, which I was referring on in my previous email is to use openehr terminology directly instead of local at-codes. This will be pretty similar (at least from my point of view) to the way the way Entry package is regulated (see for instance ISM_TRANSITION class attributes), the only difference being that over there specifications (instead of archetypes) are ‘enforcing’ terminology. Beside this, like you already mentioned, it will also allow re-use of some terms accross demographic archetypes. On the other hand, can you tell me how come there is openEHR terminology for instructions, audit change types, composition categories, etc instead of coding those terms locally on the archetype level?

The openEHR terminology is used for attribute codes in the model where it is thought that the possible set of codes is universally applicable and unlikely to change, or only very slowly. Any coded attribute that has a value set that could be contextually dependent is going to require a more dynamic and sophisticated approach to terminology. At the moment this is done in archetypes, because there is nowhere else to do it. However, the future approach may be that it could be done in SNOMED national extensions, or lower level extensions of SNOMED.

  • thomas

Hi Thomas,

In CKM, the run-time name constraint is displayed under ‘Concept name’
.
The ADL is

PARTY_IDENTITY[at0000] matches { – Person name
name matches { – A classification that enables differentiation between the usage of names for a person.
DV_TEXT matches {*}
DV_CODED_TEXT matches {
defining_code matches {
[local::
at0023,
at0024,
at0025,
at0026,
at0027,
at0028]
}
}

Dr Ian McNicoll
office / fax +44(0)141 560 4657
mobile +44 (0)775 209 7859
skype ianmcnicoll
ian.mcnicoll@oceaninformatics.com
ian@mcmi.co.uk

Clinical Analyst Ocean Informatics
Honorary Senior Research Associate, CHIME, University College London
openEHR Archetype Editorial Group
Member BCS Primary Health Care SG Group www.phcsg.org / BCS Health Scotland

The as_string() function certainly needs more thinking, but is essential for practical purposes. One way could be for another archetyped attribute to carry a formatting template, e.g.

ADDRESS/details/items[at0002]/items[at0096]/value = ‘$at0023\r\n$at0029 $at0028\r\n$at0005 $at0004\r\n$at0007’ – at0096 = ‘string formatting template’

This would then be processed by the application using the named siblings of at0096 to generate a string. There is currently no agreed ‘standard’ for this syntax, but for practical purposes, if one of the typical kinds of syntax, like unix as I have used above, or perhaps C printf were agreed, then the template could be shared. In this way in fact, more than one template could be shared, e.g. ‘mailing format template’, ‘screen display template’ etc.

If this kind of approach were broadly acceptable, it could be documented in the demographic IM.

  • thomas beale

The as_string() function certainly needs more thinking, but is essential for practical purposes. One way could be for another archetyped attribute to carry a formatting template, e.g.

ADDRESS/details/items[at0002]/items[at0096]/value = ‘$at0023\r\n$at0029 $at0028\r\n$at0005 $at0004\r\n$at0007’ – at0096 = ‘string formatting template’

This would then be processed by the application using the named siblings of at0096 to generate a string. There is currently no agreed ‘standard’ for this syntax, but for practical purposes, if one of the typical kinds of syntax, like unix as I have used above, or perhaps C printf were agreed, then the template could be shared. In this way in fact, more than one template could be shared, e.g. ‘mailing format template’, ‘screen display template’ etc.

This can be indeed a workable solution; perhaps in this case the ‘ADDRESS/details/items[at0002]/items[at0096]’ can be even set as a DV_PARSABLE to carry also the language/formalism, and thus no agreement on the standard is really necessary, isn’t it?

However, I see this whole solution a bit cryptic towards end users, as requires some level of technical background (or at least knowledge outside openehr-language domain). I would prefer it to be in sync with is already stated within specifications, and that’s why I though it can be accomplished with rules/assertions or some sort of constraint on as_string().

If this kind of approach were broadly acceptable, it could be documented in the demographic IM.

  • thomas beale

Sebastian

The as_string() function certainly needs more thinking, but is essential for practical purposes. One way could be for another archetyped attribute to carry a formatting template, e.g.

ADDRESS/details/items[at0002]/items[at0096]/value = ‘$at0023\r\n$at0029 $at0028\r\n$at0005 $at0004\r\n$at0007’ – at0096 = ‘string formatting template’

This would then be processed by the application using the named siblings of at0096 to generate a string. There is currently no agreed ‘standard’ for this syntax, but for practical purposes, if one of the typical kinds of syntax, like unix as I have used above, or perhaps C printf were agreed, then the template could be shared. In this way in fact, more than one template could be shared, e.g. ‘mailing format template’, ‘screen display template’ etc.

This can be indeed a workable solution; perhaps in this case the ‘ADDRESS/details/items[at0002]/items[at0096]’ can be even set as a DV_PARSABLE to carry also the language/formalism, and thus no agreement on the standard is really necessary, isn’t it?

yes, should have thought of that myself;-) Only small challenge is that we would still have to be careful to say what we mean by ‘printf’ syntax, or ‘excel’ syntax (from memory excel or MS word have some kind of templating mini-language for this kind of thing as well).

However, I see this whole solution a bit cryptic towards end users

do you mean ‘users’ of archetype / template tools (presumably not system users)? I would envisage a wizard for building the template - only hardcore syntax fiends would look at the source.

, as requires some level of technical background (or at least knowledge outside openehr-language domain). I would prefer it to be in sync with is already stated within specifications, and that’s why I though it can be accomplished with rules/assertions or some sort of constraint on as_string().

You gave the example:

as_string: 

details/items[at0002]/items[at0023]/value + CRLF +

details/items[at0002]/items[at0029]/value +

details/items[at0002]/items[at0028]/value + CRLF +

details/items[at0005]/value +

details/items[at0007]/value

Issues here:

  • you would need multiples of these to accommodate more than one preferred style of address string formatting

  • the expression would go very close to being legal rule, assuming ‘CRLF’ were defined in some way. openEHR rule syntax will migrate toward Xpath, in the manner of the a-path specification done by a Brazilian group (search wiki for this if you are interested).

  • I personally think that a rule syntax is even more difficult for people who are not mathematically / logically minded (which can be doctors and IT people just like anyone else!). I think this is the reason simpler formatting syntaxes are used in tools like Excel and so on.

  • I also think that we don’t want to have to use a generic expression editor to build string formatting expression templates; I think something more like a wizard with elements you can drop together would be better.
    my thoughts for now. If you want to, feel free to raise this as a problem report on the openEHR SPEC_PR Jira tracker - please include some of the relevant discussion content, or else a URL pointing to the mail archives.

  • thomas

Hi Thomas,

well, queries will be archetype-dependent, that is the idea.

I think generally they are archetype-dependent, as most of the times queries are looking for data within the concept-namespace created by the archetype. But my issues presented earlier were related to the case when queries are looking for type/purpose information, which I think is a bit out of that archetype space. Let me give you another example:

Suppose you’re looking for persistent type composition. Luckily, as there is an openEHR terminology, you can query (in a xpath like manner) for COMPOSITION[category/defining_code/code_string = ‘341’] regardless those compositions’ archetype_id.

But if you’re looking for legal names of a person, I guess you’ll have to look for those PARTY_IDENTITIY objects (contained by PERSON) with a relevant purpose - which I guess will be matched by a path like:
PERSON[openEHR-DEMOGRAPHIC-PERSON.person.v1]/identities[openEHR-DEMOGRAPHIC-PARTY_IDENTITY.person_name.v1, name/value=“Legal Name”, name/defining_code/code_string=“at0027”] if your dealing with CKM archetypes.

Looking only into current demographic specifications, if someone else (from another organisation) develops other archetypes, the path can perhaps look like: PERSON[openEHR-DEMOGRAPHIC-PERSON.b_person.v1]/identities[openEHR-DEMOGRAPHIC-PARTY_IDENTITY.b_person_name.v1, name/value=“legal”] (as demographic_im.pdf is suggesting “legal” there - page 13).

Even if both organisations share both archetype sets, a demographic query is only possible by considering both paths. Perhaps an external mapping is neccesary so solve this, and of course it is the application’s job to handle it (without any addition/change to archetypes content). But it would be even more helpful to support a generic query like: PERSON/identities[name/defining_code/code_string=“xxxxx”] or something else with a similar outcome.

The openEHR terminology is used for attribute codes in the model where it is thought that the possible set of codes is universally applicable and unlikely to change, or only very slowly. Any coded attribute that has a value set that could be contextually dependent is going to require a more dynamic and sophisticated approach to terminology. At the moment this is done in archetypes, because there is nowhere else to do it. However, the future approach may be that it could be done in SNOMED national extensions, or lower level extensions of SNOMED.

  • thomas

Again, the concerns I have are only related to certain terms, certain attributes, as used across demographic package to assign meaning to some structures/objects - it is not about data contained by an archetype (data contextualy depended on the namespace of that archetype). Maybe the future, with the SNOMED collaboration you mentioned, will bring solutions to these issues - I’m looking forward to this.

Regards,
Sebastian

Hi Sebastian,

I am not sure I understand the distinction you are trying to make for the purpose/type attribute in the demographics archetypes which I would regard as simply a 'shortcut to ConceptName/value, and not an attempt ot make a semantic statement about all names - the name types will be dependent on the concept being defined by the archetype - it could equally well be Oragnisation_name, or Professional_name, which would have very different ‘name types’.

It certainly makes sense to define the persistence type of the composition within the openEHR terminology since this is wholly associated with the openEHR Reference Model.

There are some exceptions like the UCUM units, and subject of data terms e.g self, brother, sister, mother etc, which I believe in time will be expressed and governed outside openEHR, but until SNOMED or some other reference terminology is used ubiquitously, these terms must be defined within openEHR, as we cannot assume that all openEHR users have access to the equivalent SNOMED terms.

So I think there is a fundamental difference between a ‘type’ expressed within the Reference model, which will often/always need direct openEHR terminology support, and a ‘type’ expressed at archetype level, where using any sort of reference terminology is much more difficult and the correct list is wholly dependent on the concept being expressed in the archetype.

As Thomas suggests, the whole assumption within openEHR is that the semantics are based almost wholly in the archetype. If two organisations use different archetypes to express Patient_name, there is very little that can be done to enforce semantic interoperability. The purpose() function is not designed to aid interoperability, but even if it was agreed to use an external reference terminology to supply values for purpose(), via the Concept name archetype root node, if we are using 2 different archetypes to define PatientName, we cannot further process the data i.e. the remainder of the archetypes are semantically incompatible. I cannot really see the value of being able to query for ‘legal name’, unless the remainder of the 2 different archetypes are to some degree aligned e.g. have a common specialisation parent.

So, if we want to harmonise different Patient_Name models, we will need to do much more than identify the name type, and we should start from the basis of a common archetype, even if this is extended to encompass differing requirements, or specialised for different countries/vendors. Of course, having a universal set of terms for ‘name type’ would be helpful but it really only makers sense to do within the context of a common ‘base’ Patient Name archetype.

Ian

Dr Ian McNicoll
office / fax +44(0)141 560 4657
mobile +44 (0)775 209 7859
skype ianmcnicoll
ian.mcnicoll@oceaninformatics.com
ian@mcmi.co.uk

Clinical Analyst Ocean Informatics
Honorary Senior Research Associate, CHIME, University College London
openEHR Archetype Editorial Group
Member BCS Primary Health Care SG Group www.phcsg.org / BCS Health Scotland

Hi Ian,

I was not thinking on names attribute of an archetype as holding more than names. Yet, the demographic_im.pdf is suggesting/stating to use them to associate a type meaning the the owner objects (i.e. things like PERSON/name/value = “PERSON” or ROLE/name/value = “General practitioner”), and for some objects the purpose() is designed that way as well.

As you previously said, there can be RM-types and Archetype-types and the later is introduced in demographic package through this construction of ‘name’ attribute. As long as the scope of that ‘type’ is within (or related) that owner archetype domain I don’t see any problem, but if that that ‘type’ need used outside I don’t really see it working, without a proper coding system or at least a binding.

Maybe I was not very clear in previous emails about my reasoning, maybe I am just confused about specifications or about the modeled archetypes on CKM, but nevertheless one of my main technical question remains:
how can a function like ACTOR.has_legal_identity() be implemented regardless the archetypes being used?
If you or somebody else can give some suggestion on this, I think it will be much more easier to understand the concepts behind the demographic package.

Sebastian

Hi Sebastian and all,

IMHO, I think that the invariant Legal_identity_exists: has_legal_identity is too restrictive, because it may happen that you may register a person without no known legal identity at the moment of registration. I think it should be removed from the reference model.

We also had to include the types of identity as a constraint in the name attribute because the rm demands it. Again I think this is too restrictive because we cannot register two identities of the same type because the name must be unique among siblings. I wonder why the name attribute should receive the type of the identity. If we remove these restrictions, the type of identity could be moved to a normal ELEMENT in the archetype.

Cheers,

Sergio

Hi Sergio,

From a non-technical perspective: what’s the use of registering a person with no known legal identity? I one would allow that to happens your database will be contaminated with unidentifiable ‘ghosts’ and I don’t think we should let that happen. I forgot where but there is a special function to register anonymous people, maybe that’s something you can use.

Cheers,

Stef

What about a person that is only used for family history for an
illness? Maybe you only know that the grandparent called 'John'
suffered from the same disease of your patient, but you don't know
much more about him.

that can only be done if the concept ‘legal_entity’ is also hardwired into the information model, which is exactly what we are avoiding via the use of archetypes. A function like this would make more sense with a template-generated programming object, not the base RM objects. A template, based on specific archetypes might have a legal_entity defined somewhere, and this could be queried with a hardwired function.

Otherwise the approach has to be to implement functions like this using AQL or similar queries that make use of paths from available archetypes. But in this case you would not be doing ACTOR.has_legal_entity, but a query over the whole demographic repository, or some subset of it, which searches for ACTOR objects containing the specific path.

  • thomas beale

You will have to excuse my failing eyesight - I read ‘legal_entity’ not ‘legal_identity’. I realise now that Sebastian was referring to the has_legal_identity() function in the invariants of ACTOR. I think there is a problem in the model here - we either should get rid of this function, as Sergio suggests, or else we need to add something more to the model, so that the function can indeed be impelmented in a reasonable way. Which we do depends on whether we think it is reasonable to force all ACTORs (in all openEHR demographic data, forever!) to have a ‘level identity’. This is the debate we need to have. My feeling today is that it is probably too restrictive.

  • thomas

We could also need to register someone who is unconscious and with no legal documents, or a newborn who has not been registered yet.
There are even people who has not been registered yet in some places.

Cheers,

Sergio