We hope you'll join us for our 4/23 webinar on using data tables to apply reference ranges and AE codes in OC4. For more information and to register, visit https://register.gotowebinar.com/register/2882170018956684555

A non-repeating item in a repeating event

Hi community,
How can i implement this:
-i have a
repeating event where one of the items(variables) should appear only on
the first instance, then the following repeating instances it should not
appear, for example, in treatment, weight should only be
taken on first day,
then the remaining treatment visits, it should not be taken.
regards



Seth Okeyo- DNDi Africa Data Center


Comments

  • haenselhaensel Posts: 602 ✭✭✭
    Hi Seth Okeyo

    That's not not directly possible with OC standard features but you have the following options to mimic the behavior.
    1. One option is to include a new field 'event occurrence' (which isn't
    provided automatic) and make the 'non-repeating items' depend on this
    field (e.g. Simple Conditional Display: event_occurrence, 1, weight is
    allowed for the first event occurrence only). Then the field is shown only if the user sets 'event occurrence' to 1.
    2.a. Another option is to extract the 'non-repeating items' from the CRF to another CRF and define a new event for each event occurrence where the CRF with the 'non-repeating items' is visible only in the first event. This is practical only if the number of occurrences is fix.
    2.b. If the number of occurrences isn't fix, you can define two events. The first is non-repeating an contains the 'non-repeating items' crf and the 'repeating items' crf. The second is repeating and contains the 'repeating items' crf only.
    3. Variation to option 2.: Instead of using two different cfrs you can create two versions of the same CRF and attach the repeating version to the first event and the non-repeating to the second (and following).
    4. You can mess around with rules or javascript but this looks like a lot of work to me that might not work probably in the end.

    Regards,
    Christian
  • lindsay.stevenslindsay.stevens Posts: 404 ✭✭✭
    via Email
    Rules can target event repeats using the same index syntax as targeting
    item group rows. For example eventoid[1].crfoid.igoid.itemoid. The
    limitation is that action rules can only affect objects in the same event
    repeat as the rule target.

    Write a rule that targets an item that is always answered in every event
    repeat, like a visit date, and use it to trigger a show action that
    displays the weight field.

    Probably a JavaScript solution could be put together if you don't like the
    save->show workflow, but js is more fragile. Read the CRF header to get the
    event repeat and hide the CRF table row containing the item you want to
    hide.

    Although like Christian was saying, its probably better to put "collect
    once" fields on a "collect once" form, like an Enrolment form in a non
    repeating Enrol event.
    Hi Seth Okeyo

    That's not not directly possible with OC standard features but you have the
    following options to mimic the behavior.
    1. One option is to include a new field 'event occurrence' (which isn't
    provided automatic) and make the 'non-repeating items' depend on this
    field (e.g. Simple Conditional Display: event_occurrence, 1, weight is
    allowed for the first event occurrence only). Then the field is shown only
    if the user sets 'event occurrence' to 1.
    2.a. Another option is to extract the 'non-repeating items' from the CRF to
    another CRF and define a new event for each event occurrence where the CRF
    with the 'non-repeating items' is visible only in the first event. This is
    practical only if the number of occurrences is fix.
    2.b. If the number of occurrences isn't fix, you can define two events. The
    first is non-repeating an contains the 'non-repeating items' crf and the
    'repeating items' crf. The second is repeating and contains the 'repeating
    items' crf only.
    3. Variation to option 2.: Instead of using two different cfrs you can
    create two versions of the same CRF and attach the repeating version to the
    first event and the non-repeating to the second (and following).
    4. You can mess around with rules or javascript but this looks like a lot
    of work to me that might not work probably in the end.

    Regards,
    Christian
This discussion has been closed.