Skip to content

Questionnaire initialExpression (repeats inside repeats group) selects multiple values instead of one #92

@projkov

Description

@projkov

Resource example

extension:
  - url: >-
      http://example.com
    valueTiming:
      repeat:
        duration: 1
        dayOfWeek:
          - mon
          - tue
        timeOfDay:
          - '09:00:00'
        durationUnit: h
id: example-schedule
resourceType: Schedule

Questionnaire example

resourceType: Questionnaire
id: edit-schedule
status: active
launchContext:
  - type:
      - Schedule
    name:
      code: Schedule
    description: Schedule to edit
name: edit-schedule
title: Edit Schedule
url: edit-schedule
mapping:
  - reference: Mapping/edit-schedule-extract
item:
  - linkId: root-group
    type: group
    item:
      - linkId: time-period
        text: Time period
        type: group
        repeats: true
        itemPopulationContext:
          language: text/fhirpath
          expression: >-
            %Schedule.extension.where(url='http://example.com')
        item:
          - linkId: day-of-the-week
            text: Day of the week
            type: choice
            repeats: true
            answerOption:
              - valueCoding:
                  code: sun
                  system: http://hl7.org/fhir/ValueSet/days-of-week
                  display: Sunday
            initialExpression:
              language: text/fhirpath
              expression: "%Questionnaire.repeat(item).where(linkId='day-of-the-week').answerOption.valueCoding.where(code in 'sun')"
          - linkId: time-start
            text: Time start
            type: time
            initialExpression:
              language: text/fhirpath
              expression: '%context.valueTiming.repeat.timeOfDay'
meta:
  profile:
    - https://emr-core.beda.software/StructureDefinition/fhir-emr-questionnaire

Expected behaviour

Field with the linkId "day-of-the-week" should display 1 selected day

Current behaviour

Field with the linkId "day-of-the-week" displays 2 similar days

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions