001package org.hl7.fhir.convertors.conv30_40.resources30_40;
002
003import org.hl7.fhir.convertors.context.ConversionContext30_40;
004import org.hl7.fhir.convertors.conv30_40.datatypes30_40.ContactDetail30_40;
005import org.hl7.fhir.convertors.conv30_40.datatypes30_40.Extension30_40;
006import org.hl7.fhir.convertors.conv30_40.datatypes30_40.Reference30_40;
007import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.*;
008import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.*;
009import org.hl7.fhir.exceptions.FHIRException;
010import org.hl7.fhir.r4.model.Questionnaire;
011
012public class Questionnaire30_40 {
013
014  public static org.hl7.fhir.r4.model.Questionnaire convertQuestionnaire(org.hl7.fhir.dstu3.model.Questionnaire src) throws FHIRException {
015    if (src == null)
016      return null;
017    org.hl7.fhir.r4.model.Questionnaire tgt = new org.hl7.fhir.r4.model.Questionnaire();
018    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyDomainResource(src, tgt);
019    if (src.hasUrl())
020      tgt.setUrlElement(Uri30_40.convertUri(src.getUrlElement()));
021    for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())
022      tgt.addIdentifier(Identifier30_40.convertIdentifier(t));
023    if (src.hasVersion())
024      tgt.setVersionElement(String30_40.convertString(src.getVersionElement()));
025    if (src.hasName())
026      tgt.setNameElement(String30_40.convertString(src.getNameElement()));
027    if (src.hasTitle())
028      tgt.setTitleElement(String30_40.convertString(src.getTitleElement()));
029    if (src.hasStatus())
030      tgt.setStatusElement(Enumerations30_40.convertPublicationStatus(src.getStatusElement()));
031    if (src.hasExperimental())
032      tgt.setExperimentalElement(Boolean30_40.convertBoolean(src.getExperimentalElement()));
033    if (src.hasDateElement())
034      tgt.setDateElement(DateTime30_40.convertDateTime(src.getDateElement()));
035    if (src.hasPublisher())
036      tgt.setPublisherElement(String30_40.convertString(src.getPublisherElement()));
037    if (src.hasDescription())
038      tgt.setDescriptionElement(MarkDown30_40.convertMarkdown(src.getDescriptionElement()));
039    if (src.hasPurpose())
040      tgt.setPurposeElement(MarkDown30_40.convertMarkdown(src.getPurposeElement()));
041    if (src.hasApprovalDate())
042      tgt.setApprovalDateElement(Date30_40.convertDate(src.getApprovalDateElement()));
043    if (src.hasLastReviewDate())
044      tgt.setLastReviewDateElement(Date30_40.convertDate(src.getLastReviewDateElement()));
045    if (src.hasEffectivePeriod())
046      tgt.setEffectivePeriod(Period30_40.convertPeriod(src.getEffectivePeriod()));
047    for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext())
048      tgt.addUseContext(Timing30_40.convertUsageContext(t));
049    for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction())
050      tgt.addJurisdiction(CodeableConcept30_40.convertCodeableConcept(t));
051    for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact())
052      tgt.addContact(ContactDetail30_40.convertContactDetail(t));
053    if (src.hasCopyright())
054      tgt.setCopyrightElement(MarkDown30_40.convertMarkdown(src.getCopyrightElement()));
055    for (org.hl7.fhir.dstu3.model.Coding t : src.getCode()) tgt.addCode(Coding30_40.convertCoding(t));
056    for (org.hl7.fhir.dstu3.model.CodeType t : src.getSubjectType()) tgt.addSubjectType(t.getValue());
057    for (org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemComponent t : src.getItem())
058      tgt.addItem(convertQuestionnaireItemComponent(t));
059    return tgt;
060  }
061
062  public static org.hl7.fhir.dstu3.model.Questionnaire convertQuestionnaire(org.hl7.fhir.r4.model.Questionnaire src) throws FHIRException {
063    if (src == null)
064      return null;
065    org.hl7.fhir.dstu3.model.Questionnaire tgt = new org.hl7.fhir.dstu3.model.Questionnaire();
066    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyDomainResource(src, tgt);
067    if (src.hasUrl())
068      tgt.setUrlElement(Uri30_40.convertUri(src.getUrlElement()));
069    for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
070      tgt.addIdentifier(Identifier30_40.convertIdentifier(t));
071    if (src.hasVersion())
072      tgt.setVersionElement(String30_40.convertString(src.getVersionElement()));
073    if (src.hasName())
074      tgt.setNameElement(String30_40.convertString(src.getNameElement()));
075    if (src.hasTitle())
076      tgt.setTitleElement(String30_40.convertString(src.getTitleElement()));
077    if (src.hasStatus())
078      tgt.setStatusElement(Enumerations30_40.convertPublicationStatus(src.getStatusElement()));
079    if (src.hasExperimental())
080      tgt.setExperimentalElement(Boolean30_40.convertBoolean(src.getExperimentalElement()));
081    if (src.hasDateElement())
082      tgt.setDateElement(DateTime30_40.convertDateTime(src.getDateElement()));
083    if (src.hasPublisher())
084      tgt.setPublisherElement(String30_40.convertString(src.getPublisherElement()));
085    if (src.hasDescription())
086      tgt.setDescriptionElement(MarkDown30_40.convertMarkdown(src.getDescriptionElement()));
087    if (src.hasPurpose())
088      tgt.setPurposeElement(MarkDown30_40.convertMarkdown(src.getPurposeElement()));
089    if (src.hasApprovalDate())
090      tgt.setApprovalDateElement(Date30_40.convertDate(src.getApprovalDateElement()));
091    if (src.hasLastReviewDate())
092      tgt.setLastReviewDateElement(Date30_40.convertDate(src.getLastReviewDateElement()));
093    if (src.hasEffectivePeriod())
094      tgt.setEffectivePeriod(Period30_40.convertPeriod(src.getEffectivePeriod()));
095    for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext())
096      tgt.addUseContext(Timing30_40.convertUsageContext(t));
097    for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction())
098      tgt.addJurisdiction(CodeableConcept30_40.convertCodeableConcept(t));
099    for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact())
100      tgt.addContact(ContactDetail30_40.convertContactDetail(t));
101    if (src.hasCopyright())
102      tgt.setCopyrightElement(MarkDown30_40.convertMarkdown(src.getCopyrightElement()));
103    for (org.hl7.fhir.r4.model.Coding t : src.getCode()) tgt.addCode(Coding30_40.convertCoding(t));
104    for (org.hl7.fhir.r4.model.CodeType t : src.getSubjectType()) tgt.addSubjectType(t.getValue());
105    for (org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent t : src.getItem())
106      tgt.addItem(convertQuestionnaireItemComponent(t));
107    return tgt;
108  }
109
110  public static org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemComponent convertQuestionnaireItemComponent(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent src) throws FHIRException {
111    if (src == null)
112      return null;
113    org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemComponent tgt = new org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemComponent();
114    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
115    if (src.hasLinkId())
116      tgt.setLinkIdElement(String30_40.convertString(src.getLinkIdElement()));
117    if (src.hasDefinition())
118      tgt.setDefinitionElement(Uri30_40.convertUri(src.getDefinitionElement()));
119    for (org.hl7.fhir.r4.model.Coding t : src.getCode()) tgt.addCode(Coding30_40.convertCoding(t));
120    if (src.hasPrefix())
121      tgt.setPrefixElement(String30_40.convertString(src.getPrefixElement()));
122    if (src.hasText())
123      tgt.setTextElement(String30_40.convertString(src.getTextElement()));
124    if (src.hasType())
125      tgt.setTypeElement(convertQuestionnaireItemType(src.getTypeElement()));
126    for (org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemEnableWhenComponent t : src.getEnableWhen())
127      tgt.addEnableWhen(convertQuestionnaireItemEnableWhenComponent(t));
128    if (src.hasRequired())
129      tgt.setRequiredElement(Boolean30_40.convertBoolean(src.getRequiredElement()));
130    if (src.hasRepeats())
131      tgt.setRepeatsElement(Boolean30_40.convertBoolean(src.getRepeatsElement()));
132    if (src.hasReadOnly())
133      tgt.setReadOnlyElement(Boolean30_40.convertBoolean(src.getReadOnlyElement()));
134    if (src.hasMaxLength())
135      tgt.setMaxLengthElement(Integer30_40.convertInteger(src.getMaxLengthElement()));
136    if (src.hasAnswerValueSet())
137      tgt.setOptions(Reference30_40.convertCanonicalToReference(src.getAnswerValueSetElement()));
138    for (org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemAnswerOptionComponent t : src.getAnswerOption())
139      tgt.addOption(convertQuestionnaireItemOptionComponent(t));
140    if (src.hasInitial())
141      tgt.setInitial(ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().convertType(src.getInitialFirstRep().getValue()));
142    for (org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent t : src.getItem())
143      tgt.addItem(convertQuestionnaireItemComponent(t));
144    return tgt;
145  }
146
147  public static org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent convertQuestionnaireItemComponent(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemComponent src) throws FHIRException {
148    if (src == null)
149      return null;
150    org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent tgt = new org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemComponent();
151    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
152    if (src.hasLinkId())
153      tgt.setLinkIdElement(String30_40.convertString(src.getLinkIdElement()));
154    if (src.hasDefinition())
155      tgt.setDefinitionElement(Uri30_40.convertUri(src.getDefinitionElement()));
156    for (org.hl7.fhir.dstu3.model.Coding t : src.getCode()) tgt.addCode(Coding30_40.convertCoding(t));
157    if (src.hasPrefix())
158      tgt.setPrefixElement(String30_40.convertString(src.getPrefixElement()));
159    if (src.hasText())
160      tgt.setTextElement(String30_40.convertString(src.getTextElement()));
161    if (src.hasType())
162      tgt.setTypeElement(convertQuestionnaireItemType(src.getTypeElement()));
163    for (org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemEnableWhenComponent t : src.getEnableWhen())
164      tgt.addEnableWhen(convertQuestionnaireItemEnableWhenComponent(t));
165    tgt.setEnableBehavior(Questionnaire.EnableWhenBehavior.ANY);
166    if (src.hasRequired())
167      tgt.setRequiredElement(Boolean30_40.convertBoolean(src.getRequiredElement()));
168    if (src.hasRepeats())
169      tgt.setRepeatsElement(Boolean30_40.convertBoolean(src.getRepeatsElement()));
170    if (src.hasReadOnly())
171      tgt.setReadOnlyElement(Boolean30_40.convertBoolean(src.getReadOnlyElement()));
172    if (src.hasMaxLength())
173      tgt.setMaxLengthElement(Integer30_40.convertInteger(src.getMaxLengthElement()));
174    if (src.hasOptions())
175      tgt.setAnswerValueSetElement(Reference30_40.convertReferenceToCanonical(src.getOptions()));
176    for (org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemOptionComponent t : src.getOption())
177      tgt.addAnswerOption(convertQuestionnaireItemOptionComponent(t));
178    if (src.hasInitial())
179      tgt.addInitial().setValue(ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().convertType(src.getInitial()));
180    for (org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemComponent t : src.getItem())
181      tgt.addItem(convertQuestionnaireItemComponent(t));
182    for (org.hl7.fhir.dstu3.model.Extension t : src.getModifierExtension()) {
183      tgt.addModifierExtension(Extension30_40.convertExtension(t));
184    }
185    return tgt;
186  }
187
188  public static org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemEnableWhenComponent convertQuestionnaireItemEnableWhenComponent(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemEnableWhenComponent src) throws FHIRException {
189    if (src == null)
190      return null;
191    org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemEnableWhenComponent tgt = new org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemEnableWhenComponent();
192    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
193    if (src.hasQuestion())
194      tgt.setQuestionElement(String30_40.convertString(src.getQuestionElement()));
195    if (src.hasOperator() && src.getOperator() == org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator.EXISTS)
196      tgt.setHasAnswer(src.getAnswerBooleanType().getValue());
197    else if (src.hasAnswer())
198      tgt.setAnswer(ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().convertType(src.getAnswer()));
199    return tgt;
200  }
201
202  public static org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemEnableWhenComponent convertQuestionnaireItemEnableWhenComponent(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemEnableWhenComponent src) throws FHIRException {
203    if (src == null)
204      return null;
205    org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemEnableWhenComponent tgt = new org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemEnableWhenComponent();
206    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
207    if (src.hasQuestion())
208      tgt.setQuestionElement(String30_40.convertString(src.getQuestionElement()));
209    if (src.hasHasAnswer()) {
210      tgt.setOperator(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator.EXISTS);
211      if (src.hasHasAnswerElement())
212        tgt.setAnswer(ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().convertType(src.getHasAnswerElement()));
213    } else if (src.hasAnswer()) {
214      tgt.setOperator(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemOperator.EQUAL);
215      if (src.hasAnswer())
216        tgt.setAnswer(ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().convertType(src.getAnswer()));
217    }
218    return tgt;
219  }
220
221  public static org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemAnswerOptionComponent convertQuestionnaireItemOptionComponent(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemOptionComponent src) throws FHIRException {
222    if (src == null)
223      return null;
224    org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemAnswerOptionComponent tgt = new org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemAnswerOptionComponent();
225    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
226    if (src.hasValue())
227      tgt.setValue(ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().convertType(src.getValue()));
228    return tgt;
229  }
230
231  public static org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemOptionComponent convertQuestionnaireItemOptionComponent(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemAnswerOptionComponent src) throws FHIRException {
232    if (src == null)
233      return null;
234    org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemOptionComponent tgt = new org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemOptionComponent();
235    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
236    if (src.hasValue())
237      tgt.setValue(ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().convertType(src.getValue()));
238    return tgt;
239  }
240
241  static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType> convertQuestionnaireItemType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType> src) throws FHIRException {
242    if (src == null || src.isEmpty())
243      return null;
244    org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemTypeEnumFactory());
245    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
246    switch (src.getValue()) {
247      case GROUP:
248        tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.GROUP);
249        break;
250      case DISPLAY:
251        tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.DISPLAY);
252        break;
253      case QUESTION:
254        tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.QUESTION);
255        break;
256      case BOOLEAN:
257        tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.BOOLEAN);
258        break;
259      case DECIMAL:
260        tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.DECIMAL);
261        break;
262      case INTEGER:
263        tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.INTEGER);
264        break;
265      case DATE:
266        tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.DATE);
267        break;
268      case DATETIME:
269        tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.DATETIME);
270        break;
271      case TIME:
272        tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.TIME);
273        break;
274      case STRING:
275        tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.STRING);
276        break;
277      case TEXT:
278        tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.TEXT);
279        break;
280      case URL:
281        tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.URL);
282        break;
283      case CHOICE:
284        tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.CHOICE);
285        break;
286      case OPENCHOICE:
287        tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.OPENCHOICE);
288        break;
289      case ATTACHMENT:
290        tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.ATTACHMENT);
291        break;
292      case REFERENCE:
293        tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.REFERENCE);
294        break;
295      case QUANTITY:
296        tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.QUANTITY);
297        break;
298      default:
299        tgt.setValue(org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType.NULL);
300        break;
301    }
302    return tgt;
303  }
304
305  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType> convertQuestionnaireItemType(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Questionnaire.QuestionnaireItemType> src) throws FHIRException {
306    if (src == null || src.isEmpty())
307      return null;
308    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemTypeEnumFactory());
309    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
310    switch (src.getValue()) {
311      case GROUP:
312        tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.GROUP);
313        break;
314      case DISPLAY:
315        tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.DISPLAY);
316        break;
317      case QUESTION:
318        tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.QUESTION);
319        break;
320      case BOOLEAN:
321        tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.BOOLEAN);
322        break;
323      case DECIMAL:
324        tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.DECIMAL);
325        break;
326      case INTEGER:
327        tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.INTEGER);
328        break;
329      case DATE:
330        tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.DATE);
331        break;
332      case DATETIME:
333        tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.DATETIME);
334        break;
335      case TIME:
336        tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.TIME);
337        break;
338      case STRING:
339        tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.STRING);
340        break;
341      case TEXT:
342        tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.TEXT);
343        break;
344      case URL:
345        tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.URL);
346        break;
347      case CHOICE:
348        tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.CHOICE);
349        break;
350      case OPENCHOICE:
351        tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.OPENCHOICE);
352        break;
353      case ATTACHMENT:
354        tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.ATTACHMENT);
355        break;
356      case REFERENCE:
357        tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.REFERENCE);
358        break;
359      case QUANTITY:
360        tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.QUANTITY);
361        break;
362      default:
363        tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.NULL);
364        break;
365    }
366    return tgt;
367  }
368}