Add support for Real values with DV_SCALE

Description

See SPECPR-44.

Activity

Show:
Sebastian Garde
5 days ago

What we haven’t really talked about here as far as I can see is how a DV_SCALE is represented in adl1.4:

For its sister data type DV_ORDINAL we not only have the standard syntax, see 5.2.1 in https://specifications.openehr.org/releases/1.0.2/architecture/am/openehr_archetype_profile.pdf

but also the C_DV_ORDINAL inline adl (5.2.2) and then the short custom syntax (5.2.3).

On the one hand, I would say, we just support the standard syntax to keep it simple.

On the other hand, for DV_ORDINAL, I think it is nearly always the short custom syntax that is used:

ELEMENT[at0006] occurrences matches {0..1} matches { -- Scale1
value matches {
1|[local::at0007],
2|[local::at0008],
3|[local::at0009]
}
}

and the most natural way would be to express the same for a DV_SCALE constraint would be this:

ELEMENT[at0006] occurrences matches {0..1} matches { -- Scale1
value matches {
0.5|[local::at0007],
2|[local::at0008],
3.5|[local::at0009]
}
}

Note that in that syntax, there would be no way to differentiate between DV_ORDINAL and DV_SCALE (other than looking at the values and assuming if all are just integers, it is a DV_ORDINAL…and that sounds like a hack)

any comments?

Rong Chen
5 days ago

This is a good analysis we would need something to differentiate DV_SCALE form DV_ORDINAL.

How about adding a “=“ before the value:

Diego Bosca
5 days ago
Edited

I would go the standard way, but maybe it’s just me that I’m strongly against domain types :)

Also, domain types are deprecated in ADL2, and tuples should be used instead, what about using a tuple syntax for this one so everyone starts using/getting used to see it?

This would also help going forward and not having to change the syntax twice

(edit: that’s also how a DV_ORDINAL would be defined, type would be there)

Thomas Beale
5 days ago

I would just scan the values, and if any value is a real number (i.e. has a decimal), treat the whole thing as a DV_SCALE.

Diego Bosca
5 days ago

So in that case this part of the documentation should be changed

“For scores that include only Integers, DV_SCALE may also be used, but DV_ORDINAL should be supported to accommodate existing data instances of that type.”

Wasn’t DV_SCALE introduced to deal with a DV_ORDINAL design flaw?

Reporter

Thomas Beale

Raised By

Ian McNicoll

Components

Affects versions

Configure