beda-software/fhir-sdc

Populate repeating groups into item with duplicating linkId instead of answers

ruscoder opened this issue · 0 comments

According to the specification and discussions around repeating groups we decided to change storing answers for repeating groups.

Previously used:

item: [
  {
    linkId: 'repeating-group',
    answer: [
        {
            'item':  {linkId: 'subanswer', answer: [{value: {string: 'value'}}]},
        },
        {
            'item':  {linkId: 'subanswer', answer: [{value: {string: 'value'}}]},
        },
    ]
  }
]

Proposed:

item: [
  {
    linkId: 'repeating-group',
    item: [
        {linkId: 'subanswer', answer: [{value: {string: 'value'}}]},
    ]
  },
  {
    linkId: 'repeating-group',
    item: [
        {linkId: 'subanswer', answer: [{value: {string: 'value'}}]},
    ]
  }
]

The previously used solution had some disadvantages:

  1. constraint violations:
    • group can not have direct answers
    • missing linkId in answer (it worked because of Aidbox bug Aidbox/Issues#283)
  2. different behaviour for repeating and non-repeating group
  3. unable to use %context in expressions