Should DV_MULTIMEDIA.data be a mandatory field? + simplifications

Description

Right now it has 0..1 occurrence and I think because of the semantics of datatype, data should be 1..1: there is no sense in creating a multimedia type without data IMHO.

There is the uri field also, so I thing data and uri are alternatives but one of them should be present. There is no invariant about this in the model.

Also I would suggest to have two types of DV_MULTIMEDIA, internal and external, instead of using the same class for these two purposes (needs extra methods, needs extra XOR invariants, etc.)

Environment

None

Activity

Show:
Bjørn Næss
August 16, 2016, 9:23 AM

You may store DV_MULTIMEDIA with only a reference to the real data. Then the data is NULL. This makes sense for us in the current implementation.

I agree that this is a XOR situation; you will either have data or uri. I am not sure if this is good, average or bad practice.

Thomas Beale
August 16, 2016, 9:35 AM

See http://www.openehr.org/releases/RM/latest/docs/data_types/data_types.html#_dv_multimedia_class
There is an invariant
Not_empty: is_inline or is_external

I think this says what you want.

Pablo Pazos
March 9, 2018, 3:39 PM

One last question, the only mandatory field of DV_MULTIMEDIA is media_type. So for external media only the DV_URI uri and the media_type are set.

Is the media_type really needed when having an external reference?

Why not use just DV_URI for external references?

Reporter

Pablo Pazos

Labels

Components

Affects versions

Priority

Minor
Configure