cdisc-org / ddf-core-poc

This repository will contain the results from the Proof of Concept project.
MIT License
0 stars 1 forks source link

Create rule DDF99973: A ScheduleTimeline must have exactly one "entry" link to a ScheduledInstance within the same timeline. #166

Open ASL-rmarshall opened 3 months ago

ASL-rmarshall commented 3 months ago

Create rule defined for #158

ASL-rmarshall commented 3 months ago

It might be better to split this into 3 rules:

  1. Every ScheduleTimeline must have at least one ScheduledInstance (i.e., at least one ScheduledActivityInstance or ScheduledDecisionInstance).
  2. Every ScheduleTimeline must have exactly one "entry" link to a ScheduledInstance. This looks like a straightforward cardinality check.
  3. Every ScheduleTimeline must have at least one link to a ScheduledTimelineExit.

As mentioned in #158, the third check appears to be a duplication of (at least part of) the rule defined for #110 (see discussion in #123). Some of the checks identified from the model can be represented from more than one point of view (e.g., from the source/target, from the parent/child(ren), etc.). It doesn't really matter which way the checks are implemented as rules, as long as all the necessary checks are covered without duplicating checks.

BSnoeijerCD commented 3 months ago

@ASL-rmarshall : If you agree we can remove the scheduledtimelineExit id requirement from this one as it is already covered by DDF00037. Also we can combine that the entryId should exist and that it should be one of the scheduledInstances defined for the same timeline. ScheduledInstances are nested within the timeline so no need to do an extra check if we do the crosscheck with scheduledInstances and entryId.

BSnoeijerCD commented 3 months ago

@ASL-rmarshall : I reconsidered this today - there is no duplication. #123 is checking from the ScheduleInstance perspective while this one is checking from the ScheduleTimeline perspective. I think it good to keep them both. However, to keep it more clear, the exit check can be better separated from this one. So I changed the description to "A scheduledInstance should have 1at least 1 entry Id pointing to a referenced instance within the same timeline.