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 classQuestionnaire.Item.AnswerOptionOne of the permitted answers for a "choice" or "open-choice" question.static classQuestionnaire.Item.Builderstatic classQuestionnaire.Item.EnableWhenA constraint indicating that this item should only be enabled (displayed/allow answers to be captured) when the specified condition is true.static classQuestionnaire.Item.InitialOne 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 voidaccept(java.lang.String elementName, int elementIndex, Visitor visitor)Accept a Visitor and invoke the appropriate visit methods.static Questionnaire.Item.Builderbuilder()booleanequals(java.lang.Object obj)java.util.List<Questionnaire.Item.AnswerOption>getAnswerOption()One of the permitted answers for a "choice" or "open-choice" question.CanonicalgetAnswerValueSet()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.UrigetDefinition()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.EnableWhenBehaviorgetEnableBehavior()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.StringgetLinkId()An identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resource.IntegergetMaxLength()The maximum number of characters that are permitted in the answer to be considered a "valid" QuestionnaireResponse.StringgetPrefix()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.BooleangetReadOnly()An indication, when true, that the value cannot be changed by a human respondent to the Questionnaire.BooleangetRepeats()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.BooleangetRequired()An indication, if true, that the item must be present in a "completed" QuestionnaireResponse.StringgetText()The name of a section, the text of a question or text content for a display item.QuestionnaireItemTypegetType()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.).booleanhasChildren()inthashCode()Questionnaire.Item.BuildertoBuilder()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
Stringthat 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
Urithat 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
Codingthat 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
Stringthat 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
Stringthat 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
QuestionnaireItemTypethat 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.EnableWhenthat 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
EnableWhenBehaviorthat 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
Booleanthat 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
Booleanthat 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
Booleanthat 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
Integerthat 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
Canonicalthat 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.AnswerOptionthat 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.Initialthat 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.Itemthat may be empty.
-
hasChildren
public boolean hasChildren()
- Overrides:
hasChildrenin classBackboneElement
-
accept
public void accept(java.lang.String elementName, int elementIndex, Visitor visitor)Description copied from interface:VisitableAccept 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:
acceptin interfaceVisitable- Specified by:
acceptin 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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toBuilder
public Questionnaire.Item.Builder toBuilder()
Description copied from class:ElementCreate a new Builder from the contents of this Element- Specified by:
toBuilderin classBackboneElement
-
builder
public static Questionnaire.Item.Builder builder()
-
-