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