Missing "magnitude" for DV_QUANTITY constraint

I don’t think the fundamentals of how we do constraints changed in adl 2, so I’ll comment on that assumption. I’m also assuming you’re using adl 2, based on the opt file name extension you provided.

openEHR’s description of valid data is based on two levels: the RM (level 1), which is a fixed set of types (classes and I think we have an interface or two there), and archetypes, which are constraints on those types (level 2).

If you do not express any constraints on an RM type or its attributes, it means all data that is based on that RM type is valid data. In other words, if a property of a type is not mentioned in your archetype, it means any RM data with that property would be valid according to that archetype.

In your case, it is the magnitude of DV_QUANTITY. RM says that it is a real number, and every DV_QUANTITY instance should have this property set to a value. The only way you can constrain RM here is to say that the value is in an interval etc. Other than that, you cannot make magnitude optional, since an archetype can never remove an RM constraint. If you don’t introduce any constraints for that value, it means any REAL typed value goes here.

To see an example of this behaviour, get the blood pressure archetype from the global CKM, then use either the Ocean archetype editor, or Better’s tool (online) and modify the archetype so that sytsolic has no constraints for value, and diastolic has constraints. Here is what I did:

Then:

And look at the resulting adl (when you save the archetype):

No magnitude constraint for systolic!!!

Leaving aside adl version and tooling details etc, this should be what is going on mainly.

Someone should jump in and correct me in a minute if I’m not even getting the basics right anymore :slight_smile: