Class Questionnaire.Item

  • All Implemented Interfaces:
    Visitable
    Enclosing class:
    Questionnaire

    public static class Questionnaire.Item
    extends BackboneElement
    A particular question, question grouping or display text that is part of the questionnaire.
    • Method Detail

      • getLinkId

        public String getLinkId()
        An identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resource.
        Returns:
        An immutable object of type String that is non-null.
      • getDefinition

        public Uri getDefinition()
        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).

        Returns:
        An immutable object of type Uri that may be null.
      • getCode

        public java.util.List<Coding> getCode()
        A terminology code that corresponds to this group or question (e.g. a code from LOINC, which defines many questions and answers).
        Returns:
        An unmodifiable list containing immutable objects of type Coding that may be empty.
      • getPrefix

        public String getPrefix()
        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.
        Returns:
        An immutable object of type String that may be null.
      • getText

        public String getText()
        The name of a section, the text of a question or text content for a display item.
        Returns:
        An immutable object of type String that may be null.
      • getType

        public QuestionnaireItemType getType()
        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.).
        Returns:
        An immutable object of type QuestionnaireItemType that is non-null.
      • getEnableWhen

        public java.util.List<Questionnaire.Item.EnableWhen> getEnableWhen()
        A constraint indicating that this item should only be enabled (displayed/allow answers to be captured) when the specified condition is true.
        Returns:
        An unmodifiable list containing immutable objects of type Questionnaire.Item.EnableWhen that may be empty.
      • getEnableBehavior

        public EnableWhenBehavior getEnableBehavior()
        Controls how multiple enableWhen values are interpreted - whether all or any must be true.
        Returns:
        An immutable object of type EnableWhenBehavior that may be null.
      • getRequired

        public Boolean getRequired()
        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.
        Returns:
        An immutable object of type Boolean that may be null.
      • getRepeats

        public Boolean getRepeats()
        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.
        Returns:
        An immutable object of type Boolean that may be null.
      • getReadOnly

        public Boolean getReadOnly()
        An indication, when true, that the value cannot be changed by a human respondent to the Questionnaire.
        Returns:
        An immutable object of type Boolean that may be null.
      • getMaxLength

        public Integer getMaxLength()
        The maximum number of characters that are permitted in the answer to be considered a "valid" QuestionnaireResponse.
        Returns:
        An immutable object of type Integer that may be null.
      • getAnswerValueSet

        public Canonical getAnswerValueSet()
        A reference to a value set containing a list of codes representing permitted answers for a "choice" or "open-choice" question.
        Returns:
        An immutable object of type Canonical that may be null.
      • getInitial

        public java.util.List<Questionnaire.Item.Initial> getInitial()
        One or more values that should be pre-populated in the answer when initially rendering the questionnaire for user input.
        Returns:
        An unmodifiable list containing immutable objects of type Questionnaire.Item.Initial that may be empty.
      • getItem

        public java.util.List<Questionnaire.Item> getItem()
        Text, questions and other groups to be nested beneath a question or group.
        Returns:
        An unmodifiable list containing immutable objects of type Questionnaire.Item that may be empty.
      • accept

        public void accept​(java.lang.String elementName,
                           int elementIndex,
                           Visitor visitor)
        Description copied from interface: Visitable
        Accept a Visitor and invoke the appropriate visit methods. A typical implementation would look like this:
         if (visitor.preVisit(this)) {
             visitor.visitStart(elementName, elementIndex, this);
             if (visitor.visit(elementName, elementIndex, this)) {
                 // visit children
             }
             visitor.visitEnd(elementName, elementIndex, this);
             visitor.postVisit(this);
         }
         
        Specified by:
        accept in interface Visitable
        Specified by:
        accept in class AbstractVisitable
        Parameters:
        elementName - the name of the element in the context of this visit
        elementIndex - the index of the element in a list or -1 if it is not contained within a List
        visitor - the visitor to use
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object