Re: DvDuration: Mixed Pattern and Interval not supported by ADL Parser
Hi Rong and all,
The ADLParser does not appear to support a mixed pattern and Interval for a DV_DURATION.
>From the ADL Specs
Mixed Pattern and IntervalI have implemented the following change in the Parser (in red).
In some cases there is a need to be able to limit the allowed units as well as state a duration interval.
This is common in obstetrics, where physicians want to be able to set an interval from say 0-50 weeks
and limit the units to only weeks and days. This can be done as follows:
PWD/|P0W..P50W| -- 0-50 weeks, expressed only using weeks and days
The general form is a pattern followed by a slash ('/') followed by an interval, as follows:
duration_pattern '/' duration_interval
CDuration c_duration() :
{
DvDuration value = null;
Interval interval = null;
DvDuration assumed = null;
Token t = null;
String pattern = null;
}
{
(
t = <V_ISO8601_DURATION_CONSTRAINT_PATTERN>
{ pattern = t.image; }
|
value = duration_value()
|
interval = duration_interval_value()
)
[
"/" interval = duration_interval_value()
]
[
";" assumed = duration_value()
]
{
return new CDuration(value, interval, assumed, pattern);
}
}
It works as far as I can tell, but maybe someone has a more elegant solution without having to repeat the interval part.
If not, I will commit this change soon.
Regards
Sebastian
--
Dr. sc. hum., Dipl.-Inform. Med, FACHI
Dr Sebastian GardeSenior Developer
Ocean Informatics
Skype: gardeseb
_______________________________________________
Ref_impl_java mailing list
Ref_impl_java@openehr.org
http://lists.chime.ucl.ac.uk/mailman/listinfo/ref_impl_java
_______________________________________________ Ref_impl_java mailing list Ref_impl_java@openehr.org http://lists.chime.ucl.ac.uk/mailman/listinfo/ref_impl_java