Issues

Select view

Enter to search
Shift+Enter to add a new line
    Select search mode

     

    Serial data format for DV_QUANTITY is ambiguous

    Description

    In https://specifications.openehr.org/releases/SM/latest/serial_data_formats.html#_openehr_reference_model_data_value_types The format for DV_QUANTITY is "<value>,<unit>" example: "78.500,kg" This is not considering on some locales like French, Russian, Uruguayan, etc. the decimal point in numbers is actually a comma, so the example becomes "78,500,kg". Though it's possible to parse it either way, it can become a source of errors depending on how that is parsed and noting that the parsing might depend on the locale. I would prefer to change the comma separation for something else like value|units. Also not that the names "value" and "unit" are not the names of the fields in DV_QUANTITY but "magnitude" and "units". Another item to consider is what to do with the rest of the attributes in DV_QUANTITY like precision, units_system, accuracy, magnitude_status, normal_range, etc. The proposed format doesn't seem to be enough.

    Details

    Reporter

    Components

    Priority

    Created October 5, 2024 at 1:08 AM
    Updated October 6, 2024 at 1:50 AM

    Activity

    Show:

    Pablo PazosOctober 6, 2024 at 1:50 AM

    we have the same localization rules, comma is the decimal point and point is the thousands marker. For JSON I looked for a standard formatting rule and couldn’t find that all numbers with decimal digits use the dot for the decimal point. In fact, in PHP this will depend on the locale. If US is used, then the JSON serializer will use dot, and for DE or UY it will serialize the JSON with the comma as the decimal point. That is why I raised the issue

    Sebastian GardeOctober 5, 2024 at 8:59 AM

    Interesting issue. As a German, I would indeed read 78.500 as 78500.

    Nonetheless, the json syntax elements in 4.1 define a number with a fraction that can only use a dot, not a comma. I think it would be dangerous if anything else is allowed (even if it is more natural to me) as that would make it up to interpretation and context to what 78.500 means.

    If only a dot is allowed, the comma is not so big an issue, although a pipe would work just as well.

    Agree with ‚magnitude‘ vs ‚value‘

    Loading...