Class Questionnaire.Item.Builder
- java.lang.Object
-
- com.ibm.fhir.model.builder.AbstractBuilder<Element>
-
- com.ibm.fhir.model.type.Element.Builder
-
- com.ibm.fhir.model.type.BackboneElement.Builder
-
- com.ibm.fhir.model.resource.Questionnaire.Item.Builder
-
- Enclosing class:
- Questionnaire.Item
public static class Questionnaire.Item.Builder extends BackboneElement.Builder
-
-
Field Summary
-
Fields inherited from class com.ibm.fhir.model.type.BackboneElement.Builder
modifierExtension
-
Fields inherited from class com.ibm.fhir.model.type.Element.Builder
extension, id
-
Fields inherited from class com.ibm.fhir.model.builder.AbstractBuilder
validating
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Questionnaire.Item.BuilderanswerOption(Questionnaire.Item.AnswerOption... answerOption)One of the permitted answers for a "choice" or "open-choice" question.Questionnaire.Item.BuilderanswerOption(Collection<Questionnaire.Item.AnswerOption> answerOption)One of the permitted answers for a "choice" or "open-choice" question.Questionnaire.Item.BuilderanswerValueSet(Canonical answerValueSet)A reference to a value set containing a list of codes representing permitted answers for a "choice" or "open-choice" question.Questionnaire.Itembuild()Build theQuestionnaire.ItemQuestionnaire.Item.Buildercode(Coding... code)A terminology code that corresponds to this group or question (e.g.Questionnaire.Item.Buildercode(Collection<Coding> code)A terminology code that corresponds to this group or question (e.g.Questionnaire.Item.Builderdefinition(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.Questionnaire.Item.BuilderenableBehavior(EnableWhenBehavior enableBehavior)Controls how multiple enableWhen values are interpreted - whether all or any must be true.Questionnaire.Item.BuilderenableWhen(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.Questionnaire.Item.BuilderenableWhen(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.Questionnaire.Item.Builderextension(Extension... extension)May be used to represent additional information that is not part of the basic definition of the element.Questionnaire.Item.Builderextension(Collection<Extension> extension)May be used to represent additional information that is not part of the basic definition of the element.protected Questionnaire.Item.Builderfrom(Questionnaire.Item item)Questionnaire.Item.Builderid(String id)Unique id for the element within a resource (for internal references).Questionnaire.Item.Builderinitial(Questionnaire.Item.Initial... initial)One or more values that should be pre-populated in the answer when initially rendering the questionnaire for user input.Questionnaire.Item.Builderinitial(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.Questionnaire.Item.Builderitem(Questionnaire.Item... item)Text, questions and other groups to be nested beneath a question or group.Questionnaire.Item.Builderitem(Collection<Questionnaire.Item> item)Text, questions and other groups to be nested beneath a question or group.Questionnaire.Item.BuilderlinkId(String linkId)An identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resource.Questionnaire.Item.BuildermaxLength(Integer maxLength)The maximum number of characters that are permitted in the answer to be considered a "valid" QuestionnaireResponse.Questionnaire.Item.BuildermodifierExtension(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.Questionnaire.Item.BuildermodifierExtension(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.Questionnaire.Item.Builderprefix(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.Questionnaire.Item.BuilderreadOnly(Boolean readOnly)An indication, when true, that the value cannot be changed by a human respondent to the Questionnaire.Questionnaire.Item.Builderrepeats(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.Questionnaire.Item.Builderrequired(Boolean required)An indication, if true, that the item must be present in a "completed" QuestionnaireResponse.Questionnaire.Item.Buildertext(String text)The name of a section, the text of a question or text content for a display item.Questionnaire.Item.Buildertype(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.).protected voidvalidate(Questionnaire.Item item)-
Methods inherited from class com.ibm.fhir.model.type.BackboneElement.Builder
from, validate
-
Methods inherited from class com.ibm.fhir.model.type.Element.Builder
from, validate
-
Methods inherited from class com.ibm.fhir.model.builder.AbstractBuilder
isValidating, setValidating
-
-
-
-
Method Detail
-
id
public Questionnaire.Item.Builder id(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:
idin classBackboneElement.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
- Overrides:
extensionin classBackboneElement.Builder- Parameters:
extension- Additional content defined by implementations- Returns:
- A reference to this Builder instance
-
extension
public Questionnaire.Item.Builder extension(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
- Overrides:
extensionin classBackboneElement.Builder- Parameters:
extension- Additional content defined by implementations- Returns:
- A reference to this Builder instance
-
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
- Overrides:
modifierExtensionin classBackboneElement.Builder- Parameters:
modifierExtension- Extensions that cannot be ignored even if unrecognized- Returns:
- A reference to this Builder instance
-
modifierExtension
public Questionnaire.Item.Builder modifierExtension(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
- Overrides:
modifierExtensionin classBackboneElement.Builder- Parameters:
modifierExtension- Extensions that cannot be ignored even if unrecognized- Returns:
- A reference to this Builder instance
-
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
- Parameters:
code- Corresponding concept for this item in a terminology- Returns:
- A reference to this Builder instance
-
code
public Questionnaire.Item.Builder code(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
- Parameters:
code- Corresponding concept for this item in a terminology- Returns:
- A reference to this Builder instance
-
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
- Parameters:
enableWhen- Only allow data when- Returns:
- A reference to this Builder instance
-
enableWhen
public Questionnaire.Item.Builder enableWhen(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
- Parameters:
enableWhen- Only allow data when- Returns:
- A reference to this Builder instance
-
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
- Parameters:
answerOption- Permitted answer- Returns:
- A reference to this Builder instance
-
answerOption
public Questionnaire.Item.Builder answerOption(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
- Parameters:
answerOption- Permitted answer- Returns:
- A reference to this Builder instance
-
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
- Parameters:
initial- Initial value(s) when item is first rendered- Returns:
- A reference to this Builder instance
-
initial
public Questionnaire.Item.Builder initial(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
- Parameters:
initial- Initial value(s) when item is first rendered- Returns:
- A reference to this Builder instance
-
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
- Parameters:
item- Nested questionnaire items- Returns:
- A reference to this Builder instance
-
item
public Questionnaire.Item.Builder item(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
- Parameters:
item- Nested questionnaire items- Returns:
- A reference to this Builder instance
-
build
public Questionnaire.Item build()
- Specified by:
buildin interfaceBuilder<Element>- Specified by:
buildin classBackboneElement.Builder- Returns:
- An immutable object of type
Questionnaire.Item - Throws:
IllegalStateException- if the current state cannot be built into a valid Item per the base specification
-
validate
protected void validate(Questionnaire.Item item)
-
from
protected Questionnaire.Item.Builder from(Questionnaire.Item item)
-
-