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