beda-software / fhir-sdc

http://hl7.org/fhir/uv/sdc/ implementation with python
MIT License
18 stars 4 forks source link

Populate repeating groups into item with duplicating linkId instead of answers #23

Closed ruscoder closed 3 years ago

ruscoder commented 3 years ago

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:
  2. different behaviour for repeating and non-repeating group
  3. unable to use %context in expressions