Class Questionnaire.Item.Builder

    • Method Detail

      • id

        public Questionnaire.Item.Builder id​(java.lang.String id)
        Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
        Overrides:
        id in class BackboneElement.Builder
        Parameters:
        id - Unique id for inter-element referencing
        Returns:
        A reference to this Builder instance
      • extension

        public Questionnaire.Item.Builder extension​(Extension... extension)
        May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.

        Adds new element(s) to the existing list. If any of the elements are null, calling build() will fail.

        Overrides:
        extension in class BackboneElement.Builder
        Parameters:
        extension - Additional content defined by implementations
        Returns:
        A reference to this Builder instance
      • extension

        public Questionnaire.Item.Builder extension​(java.util.Collection<Extension> extension)
        May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.

        Replaces the existing list with a new one containing elements from the Collection. If any of the elements are null, calling build() will fail.

        Overrides:
        extension in class BackboneElement.Builder
        Parameters:
        extension - Additional content defined by implementations
        Returns:
        A reference to this Builder instance
        Throws:
        java.lang.NullPointerException - If the passed collection is null
      • modifierExtension

        public Questionnaire.Item.Builder modifierExtension​(Extension... modifierExtension)
        May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.

        Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).

        Adds new element(s) to the existing list. If any of the elements are null, calling build() will fail.

        Overrides:
        modifierExtension in class BackboneElement.Builder
        Parameters:
        modifierExtension - Extensions that cannot be ignored even if unrecognized
        Returns:
        A reference to this Builder instance
      • modifierExtension

        public Questionnaire.Item.Builder modifierExtension​(java.util.Collection<Extension> modifierExtension)
        May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.

        Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).

        Replaces the existing list with a new one containing elements from the Collection. If any of the elements are null, calling build() will fail.

        Overrides:
        modifierExtension in class BackboneElement.Builder
        Parameters:
        modifierExtension - Extensions that cannot be ignored even if unrecognized
        Returns:
        A reference to this Builder instance
        Throws:
        java.lang.NullPointerException - If the passed collection is null
      • linkId

        public Questionnaire.Item.Builder linkId​(String linkId)
        An identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resource.

        This element is required.

        Parameters:
        linkId - Unique id for item in questionnaire
        Returns:
        A reference to this Builder instance
      • definition

        public Questionnaire.Item.Builder definition​(Uri definition)
        This element is a URI that refers to an [ElementDefinition](elementdefinition.html) that provides information about this item, including information that might otherwise be included in the instance of the Questionnaire resource. A detailed description of the construction of the URI is shown in Comments, below. If this element is present then the following element values MAY be derived from the Element Definition if the corresponding elements of this Questionnaire resource instance have no value:

        * code (ElementDefinition.code)

        * type (ElementDefinition.type)

        * required (ElementDefinition.min)

        * repeats (ElementDefinition.max)

        * maxLength (ElementDefinition.maxLength)

        * answerValueSet (ElementDefinition.binding)

        * options (ElementDefinition.binding).

        Parameters:
        definition - ElementDefinition - details for the item
        Returns:
        A reference to this Builder instance
      • code

        public Questionnaire.Item.Builder code​(Coding... code)
        A terminology code that corresponds to this group or question (e.g. a code from LOINC, which defines many questions and answers).

        Adds new element(s) to the existing list. If any of the elements are null, calling build() will fail.

        Parameters:
        code - Corresponding concept for this item in a terminology
        Returns:
        A reference to this Builder instance
      • code

        public Questionnaire.Item.Builder code​(java.util.Collection<Coding> code)
        A terminology code that corresponds to this group or question (e.g. a code from LOINC, which defines many questions and answers).

        Replaces the existing list with a new one containing elements from the Collection. If any of the elements are null, calling build() will fail.

        Parameters:
        code - Corresponding concept for this item in a terminology
        Returns:
        A reference to this Builder instance
        Throws:
        java.lang.NullPointerException - If the passed collection is null
      • prefix

        public Questionnaire.Item.Builder prefix​(String prefix)
        A short label for a particular group, question or set of display text within the questionnaire used for reference by the individual completing the questionnaire.
        Parameters:
        prefix - E.g. "1(a)", "2.5.3"
        Returns:
        A reference to this Builder instance
      • text

        public Questionnaire.Item.Builder text​(String text)
        The name of a section, the text of a question or text content for a display item.
        Parameters:
        text - Primary text for the item
        Returns:
        A reference to this Builder instance
      • type

        public Questionnaire.Item.Builder type​(QuestionnaireItemType type)
        The type of questionnaire item this is - whether text for display, a grouping of other items or a particular type of data to be captured (string, integer, coded choice, etc.).

        This element is required.

        Parameters:
        type - group | display | boolean | decimal | integer | date | dateTime +
        Returns:
        A reference to this Builder instance
      • enableWhen

        public Questionnaire.Item.Builder enableWhen​(Questionnaire.Item.EnableWhen... enableWhen)
        A constraint indicating that this item should only be enabled (displayed/allow answers to be captured) when the specified condition is true.

        Adds new element(s) to the existing list. If any of the elements are null, calling build() will fail.

        Parameters:
        enableWhen - Only allow data when
        Returns:
        A reference to this Builder instance
      • enableWhen

        public Questionnaire.Item.Builder enableWhen​(java.util.Collection<Questionnaire.Item.EnableWhen> enableWhen)
        A constraint indicating that this item should only be enabled (displayed/allow answers to be captured) when the specified condition is true.

        Replaces the existing list with a new one containing elements from the Collection. If any of the elements are null, calling build() will fail.

        Parameters:
        enableWhen - Only allow data when
        Returns:
        A reference to this Builder instance
        Throws:
        java.lang.NullPointerException - If the passed collection is null
      • enableBehavior

        public Questionnaire.Item.Builder enableBehavior​(EnableWhenBehavior enableBehavior)
        Controls how multiple enableWhen values are interpreted - whether all or any must be true.
        Parameters:
        enableBehavior - all | any
        Returns:
        A reference to this Builder instance
      • required

        public Questionnaire.Item.Builder required​(Boolean required)
        An indication, if true, that the item must be present in a "completed" QuestionnaireResponse. If false, the item may be skipped when answering the questionnaire.
        Parameters:
        required - Whether the item must be included in data results
        Returns:
        A reference to this Builder instance
      • repeats

        public Questionnaire.Item.Builder repeats​(Boolean repeats)
        An indication, if true, that the item may occur multiple times in the response, collecting multiple answers for questions or multiple sets of answers for groups.
        Parameters:
        repeats - Whether the item may repeat
        Returns:
        A reference to this Builder instance
      • readOnly

        public Questionnaire.Item.Builder readOnly​(Boolean readOnly)
        An indication, when true, that the value cannot be changed by a human respondent to the Questionnaire.
        Parameters:
        readOnly - Don't allow human editing
        Returns:
        A reference to this Builder instance
      • maxLength

        public Questionnaire.Item.Builder maxLength​(Integer maxLength)
        The maximum number of characters that are permitted in the answer to be considered a "valid" QuestionnaireResponse.
        Parameters:
        maxLength - No more than this many characters
        Returns:
        A reference to this Builder instance
      • answerValueSet

        public Questionnaire.Item.Builder answerValueSet​(Canonical answerValueSet)
        A reference to a value set containing a list of codes representing permitted answers for a "choice" or "open-choice" question.
        Parameters:
        answerValueSet - Valueset containing permitted answers
        Returns:
        A reference to this Builder instance
      • answerOption

        public Questionnaire.Item.Builder answerOption​(Questionnaire.Item.AnswerOption... answerOption)
        One of the permitted answers for a "choice" or "open-choice" question.

        Adds new element(s) to the existing list. If any of the elements are null, calling build() will fail.

        Parameters:
        answerOption - Permitted answer
        Returns:
        A reference to this Builder instance
      • answerOption

        public Questionnaire.Item.Builder answerOption​(java.util.Collection<Questionnaire.Item.AnswerOption> answerOption)
        One of the permitted answers for a "choice" or "open-choice" question.

        Replaces the existing list with a new one containing elements from the Collection. If any of the elements are null, calling build() will fail.

        Parameters:
        answerOption - Permitted answer
        Returns:
        A reference to this Builder instance
        Throws:
        java.lang.NullPointerException - If the passed collection is null
      • initial

        public Questionnaire.Item.Builder initial​(Questionnaire.Item.Initial... initial)
        One or more values that should be pre-populated in the answer when initially rendering the questionnaire for user input.

        Adds new element(s) to the existing list. If any of the elements are null, calling build() will fail.

        Parameters:
        initial - Initial value(s) when item is first rendered
        Returns:
        A reference to this Builder instance
      • initial

        public Questionnaire.Item.Builder initial​(java.util.Collection<Questionnaire.Item.Initial> initial)
        One or more values that should be pre-populated in the answer when initially rendering the questionnaire for user input.

        Replaces the existing list with a new one containing elements from the Collection. If any of the elements are null, calling build() will fail.

        Parameters:
        initial - Initial value(s) when item is first rendered
        Returns:
        A reference to this Builder instance
        Throws:
        java.lang.NullPointerException - If the passed collection is null
      • item

        public Questionnaire.Item.Builder item​(Questionnaire.Item... item)
        Text, questions and other groups to be nested beneath a question or group.

        Adds new element(s) to the existing list. If any of the elements are null, calling build() will fail.

        Parameters:
        item - Nested questionnaire items
        Returns:
        A reference to this Builder instance
      • item

        public Questionnaire.Item.Builder item​(java.util.Collection<Questionnaire.Item> item)
        Text, questions and other groups to be nested beneath a question or group.

        Replaces the existing list with a new one containing elements from the Collection. If any of the elements are null, calling build() will fail.

        Parameters:
        item - Nested questionnaire items
        Returns:
        A reference to this Builder instance
        Throws:
        java.lang.NullPointerException - If the passed collection is null