Is valid_iso8601_duration correct?

Two things to note:

  1. the valid format doesn’t mention the fractional seconds which are allowed in openEHR durations, we even have a specific constraint for that in C_DURATION.fractional_seconds_allowed in the AOM spec;

  2. IMO the description of the parameter s should be separated from the expected result: s being any string, and result being: if s has this form … then the result is true, the result will be false otherwise. (also noting the way other methods of Time_Definitions could be improved).

From Foundation Types

String is a valid ISO 8601 duration, i.e. takes the form:

  • P[nnY][nnM][nnW][nnD][T[nnH][nnM][nnS]]

Where each nn represents a number of years, months, etc. nnW represents a number of 7-day weeks.

Note: allowing the W designator in the same expression as other designators is an exception to the published standard, but necessary in clinical information (typically for representing pregnancy duration).

Parameters

s String is a valid ISO 8601 duration, i.e. takes the form:

  • P[nnY][nnM][nnW][nnD][T[nnH][nnM][nnS]]

Where each nn represents a number of years, months, etc. nnW represents a number of 7- day weeks.

Note allowing the W designator in the same expression as other designators is an exception to the published standard, but necessary in clinical information (typically for representing pregnancy duration).

1 Like