Class Questionnaire.Item
- java.lang.Object
-
- org.linuxforhealth.fhir.model.visitor.AbstractVisitable
-
- org.linuxforhealth.fhir.model.type.Element
-
- org.linuxforhealth.fhir.model.type.BackboneElement
-
- org.linuxforhealth.fhir.model.resource.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Questionnaire.Item.AnswerOption
One of the permitted answers for a "choice" or "open-choice" question.static class
Questionnaire.Item.Builder
static class
Questionnaire.Item.EnableWhen
A constraint indicating that this item should only be enabled (displayed/allow answers to be captured) when the specified condition is true.static class
Questionnaire.Item.Initial
One or more values that should be pre-populated in the answer when initially rendering the questionnaire for user input.
-
Field Summary
-
Fields inherited from class org.linuxforhealth.fhir.model.type.BackboneElement
modifierExtension
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(java.lang.String elementName, int elementIndex, Visitor visitor)
Accept a Visitor and invoke the appropriate visit methods.static Questionnaire.Item.Builder
builder()
boolean
equals(java.lang.Object obj)
java.util.List<Questionnaire.Item.AnswerOption>
getAnswerOption()
One of the permitted answers for a "choice" or "open-choice" question.Canonical
getAnswerValueSet()
A reference to a value set containing a list of codes representing permitted answers for a "choice" or "open-choice" question.java.util.List<Coding>
getCode()
A terminology code that corresponds to this group or question (e.g.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.EnableWhenBehavior
getEnableBehavior()
Controls how multiple enableWhen values are interpreted - whether all or any must be true.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.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.java.util.List<Questionnaire.Item>
getItem()
Text, questions and other groups to be nested beneath a question or group.String
getLinkId()
An identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resource.Integer
getMaxLength()
The maximum number of characters that are permitted in the answer to be considered a "valid" QuestionnaireResponse.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.Boolean
getReadOnly()
An indication, when true, that the value cannot be changed by a human respondent to the Questionnaire.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.Boolean
getRequired()
An indication, if true, that the item must be present in a "completed" QuestionnaireResponse.String
getText()
The name of a section, the text of a question or text content for a display item.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.).boolean
hasChildren()
int
hashCode()
Questionnaire.Item.Builder
toBuilder()
Create a new Builder from the contents of this Element-
Methods inherited from class org.linuxforhealth.fhir.model.type.BackboneElement
getModifierExtension
-
Methods inherited from class org.linuxforhealth.fhir.model.type.Element
as, getExtension, getId, hasValue, is
-
-
-
-
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.
-
getAnswerOption
public java.util.List<Questionnaire.Item.AnswerOption> getAnswerOption()
One of the permitted answers for a "choice" or "open-choice" question.- Returns:
- An unmodifiable list containing immutable objects of type
Questionnaire.Item.AnswerOption
that may be empty.
-
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.
-
hasChildren
public boolean hasChildren()
- Overrides:
hasChildren
in classBackboneElement
-
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 interfaceVisitable
- Specified by:
accept
in classAbstractVisitable
- Parameters:
elementName
- the name of the element in the context of this visitelementIndex
- the index of the element in a list or -1 if it is not contained within a Listvisitor
- the visitor to use
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toBuilder
public Questionnaire.Item.Builder toBuilder()
Description copied from class:Element
Create a new Builder from the contents of this Element- Specified by:
toBuilder
in classBackboneElement
-
builder
public static Questionnaire.Item.Builder builder()
-
-