001package org.hl7.fhir.convertors.conv14_30.resources14_30;
002
003import org.hl7.fhir.convertors.context.ConversionContext14_30;
004import org.hl7.fhir.convertors.conv14_30.VersionConvertor_14_30;
005import org.hl7.fhir.convertors.conv14_30.datatypes14_30.Reference14_30;
006import org.hl7.fhir.convertors.conv14_30.datatypes14_30.complextypes14_30.CodeableConcept14_30;
007import org.hl7.fhir.convertors.conv14_30.datatypes14_30.complextypes14_30.ContactPoint14_30;
008import org.hl7.fhir.convertors.conv14_30.datatypes14_30.complextypes14_30.Identifier14_30;
009import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.Boolean14_30;
010import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.Code14_30;
011import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.DateTime14_30;
012import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.Integer14_30;
013import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.String14_30;
014import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.Uri14_30;
015import org.hl7.fhir.dstu3.model.ContactDetail;
016import org.hl7.fhir.dstu3.model.UsageContext;
017import org.hl7.fhir.exceptions.FHIRException;
018
019public class Questionnaire14_30 {
020
021  public static org.hl7.fhir.dstu2016may.model.Questionnaire convertQuestionnaire(org.hl7.fhir.dstu3.model.Questionnaire src) throws FHIRException {
022    if (src == null || src.isEmpty())
023      return null;
024    org.hl7.fhir.dstu2016may.model.Questionnaire tgt = new org.hl7.fhir.dstu2016may.model.Questionnaire();
025    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyDomainResource(src, tgt);
026    if (src.hasUrl())
027      tgt.setUrlElement(Uri14_30.convertUri(src.getUrlElement()));
028    for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())
029      tgt.addIdentifier(Identifier14_30.convertIdentifier(t));
030    if (src.hasVersion())
031      tgt.setVersionElement(String14_30.convertString(src.getVersionElement()));
032    if (src.hasStatus())
033      tgt.setStatusElement(convertQuestionnaireStatus(src.getStatusElement()));
034    if (src.hasDate())
035      tgt.setDateElement(DateTime14_30.convertDateTime(src.getDateElement()));
036    if (src.hasPublisher())
037      tgt.setPublisherElement(String14_30.convertString(src.getPublisherElement()));
038    for (ContactDetail t : src.getContact())
039      for (org.hl7.fhir.dstu3.model.ContactPoint t1 : t.getTelecom())
040        tgt.addTelecom(ContactPoint14_30.convertContactPoint(t1));
041    for (UsageContext t : src.getUseContext())
042      tgt.addUseContext(CodeableConcept14_30.convertCodeableConcept(t.getValueCodeableConcept()));
043    for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction())
044      tgt.addUseContext(CodeableConcept14_30.convertCodeableConcept(t));
045    if (src.hasTitle())
046      tgt.setTitleElement(String14_30.convertString(src.getTitleElement()));
047    for (org.hl7.fhir.dstu3.model.Coding t : src.getCode()) tgt.addConcept(Code14_30.convertCoding(t));
048    for (org.hl7.fhir.dstu3.model.CodeType t : src.getSubjectType()) tgt.addSubjectType(t.getValue());
049    for (org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemComponent t : src.getItem())
050      tgt.addItem(convertQuestionnaireItemComponent(t));
051    return tgt;
052  }
053
054  public static org.hl7.fhir.dstu3.model.Questionnaire convertQuestionnaire(org.hl7.fhir.dstu2016may.model.Questionnaire src) throws FHIRException {
055    if (src == null || src.isEmpty())
056      return null;
057    org.hl7.fhir.dstu3.model.Questionnaire tgt = new org.hl7.fhir.dstu3.model.Questionnaire();
058    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyDomainResource(src, tgt);
059    if (src.hasUrl())
060      tgt.setUrlElement(Uri14_30.convertUri(src.getUrlElement()));
061    for (org.hl7.fhir.dstu2016may.model.Identifier t : src.getIdentifier())
062      tgt.addIdentifier(Identifier14_30.convertIdentifier(t));
063    if (src.hasVersion())
064      tgt.setVersionElement(String14_30.convertString(src.getVersionElement()));
065    if (src.hasStatus())
066      tgt.setStatusElement(convertQuestionnaireStatus(src.getStatusElement()));
067    if (src.hasDate())
068      tgt.setDateElement(DateTime14_30.convertDateTime(src.getDateElement()));
069    if (src.hasPublisher())
070      tgt.setPublisherElement(String14_30.convertString(src.getPublisherElement()));
071    for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom())
072      tgt.addContact(convertQuestionnaireContactComponent(t));
073    for (org.hl7.fhir.dstu2016may.model.CodeableConcept t : src.getUseContext())
074      if (VersionConvertor_14_30.isJurisdiction(t))
075        tgt.addJurisdiction(CodeableConcept14_30.convertCodeableConcept(t));
076      else
077        tgt.addUseContext(CodeableConcept14_30.convertCodeableConceptToUsageContext(t));
078    if (src.hasTitle())
079      tgt.setTitleElement(String14_30.convertString(src.getTitleElement()));
080    for (org.hl7.fhir.dstu2016may.model.Coding t : src.getConcept()) tgt.addCode(Code14_30.convertCoding(t));
081    for (org.hl7.fhir.dstu2016may.model.CodeType t : src.getSubjectType()) tgt.addSubjectType(t.getValue());
082    for (org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemComponent t : src.getItem())
083      tgt.addItem(convertQuestionnaireItemComponent(t));
084    return tgt;
085  }
086
087  public static org.hl7.fhir.dstu3.model.ContactDetail convertQuestionnaireContactComponent(org.hl7.fhir.dstu2016may.model.ContactPoint src) throws FHIRException {
088    if (src == null || src.isEmpty())
089      return null;
090    org.hl7.fhir.dstu3.model.ContactDetail tgt = new org.hl7.fhir.dstu3.model.ContactDetail();
091    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
092    tgt.addTelecom(ContactPoint14_30.convertContactPoint(src));
093    return tgt;
094  }
095
096  public static org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemComponent convertQuestionnaireItemComponent(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemComponent src) throws FHIRException {
097    if (src == null || src.isEmpty())
098      return null;
099    org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemComponent tgt = new org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemComponent();
100    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyBackboneElement(src,tgt);
101    if (src.hasLinkId())
102      tgt.setLinkIdElement(String14_30.convertString(src.getLinkIdElement()));
103    for (org.hl7.fhir.dstu2016may.model.Coding t : src.getConcept()) tgt.addCode(Code14_30.convertCoding(t));
104    if (src.hasPrefix())
105      tgt.setPrefixElement(String14_30.convertString(src.getPrefixElement()));
106    if (src.hasText())
107      tgt.setTextElement(String14_30.convertString(src.getTextElement()));
108    if (src.hasType())
109      tgt.setTypeElement(convertQuestionnaireItemType(src.getTypeElement()));
110    for (org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemEnableWhenComponent t : src.getEnableWhen())
111      tgt.addEnableWhen(convertQuestionnaireItemEnableWhenComponent(t));
112    if (src.hasRequired())
113      tgt.setRequiredElement(Boolean14_30.convertBoolean(src.getRequiredElement()));
114    if (src.hasRepeats())
115      tgt.setRepeatsElement(Boolean14_30.convertBoolean(src.getRepeatsElement()));
116    if (src.hasReadOnly())
117      tgt.setReadOnlyElement(Boolean14_30.convertBoolean(src.getReadOnlyElement()));
118    if (src.hasMaxLength())
119      tgt.setMaxLengthElement(Integer14_30.convertInteger(src.getMaxLengthElement()));
120    if (src.hasOptions())
121      tgt.setOptions(Reference14_30.convertReference(src.getOptions()));
122    for (org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemOptionComponent t : src.getOption())
123      tgt.addOption(convertQuestionnaireItemOptionComponent(t));
124    if (src.hasInitial())
125      tgt.setInitial(ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().convertType(src.getInitial()));
126    for (org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemComponent t : src.getItem())
127      tgt.addItem(convertQuestionnaireItemComponent(t));
128    return tgt;
129  }
130
131  public static org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemComponent convertQuestionnaireItemComponent(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemComponent src) throws FHIRException {
132    if (src == null || src.isEmpty())
133      return null;
134    org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemComponent tgt = new org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemComponent();
135    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyBackboneElement(src,tgt);
136    if (src.hasLinkId())
137      tgt.setLinkIdElement(String14_30.convertString(src.getLinkIdElement()));
138    for (org.hl7.fhir.dstu3.model.Coding t : src.getCode()) tgt.addConcept(Code14_30.convertCoding(t));
139    if (src.hasPrefix())
140      tgt.setPrefixElement(String14_30.convertString(src.getPrefixElement()));
141    if (src.hasText())
142      tgt.setTextElement(String14_30.convertString(src.getTextElement()));
143    if (src.hasType())
144      tgt.setTypeElement(convertQuestionnaireItemType(src.getTypeElement()));
145    for (org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemEnableWhenComponent t : src.getEnableWhen())
146      tgt.addEnableWhen(convertQuestionnaireItemEnableWhenComponent(t));
147    if (src.hasRequired())
148      tgt.setRequiredElement(Boolean14_30.convertBoolean(src.getRequiredElement()));
149    if (src.hasRepeats())
150      tgt.setRepeatsElement(Boolean14_30.convertBoolean(src.getRepeatsElement()));
151    if (src.hasReadOnly())
152      tgt.setReadOnlyElement(Boolean14_30.convertBoolean(src.getReadOnlyElement()));
153    if (src.hasMaxLength())
154      tgt.setMaxLengthElement(Integer14_30.convertInteger(src.getMaxLengthElement()));
155    if (src.hasOptions())
156      tgt.setOptions(Reference14_30.convertReference(src.getOptions()));
157    for (org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemOptionComponent t : src.getOption())
158      tgt.addOption(convertQuestionnaireItemOptionComponent(t));
159    if (src.hasInitial())
160      tgt.setInitial(ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().convertType(src.getInitial()));
161    for (org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemComponent t : src.getItem())
162      tgt.addItem(convertQuestionnaireItemComponent(t));
163    return tgt;
164  }
165
166  public static org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemEnableWhenComponent convertQuestionnaireItemEnableWhenComponent(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemEnableWhenComponent src) throws FHIRException {
167    if (src == null || src.isEmpty())
168      return null;
169    org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemEnableWhenComponent tgt = new org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemEnableWhenComponent();
170    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyBackboneElement(src,tgt);
171    if (src.hasQuestionElement())
172      tgt.setQuestionElement(String14_30.convertString(src.getQuestionElement()));
173    if (src.hasHasAnswer())
174      tgt.setAnsweredElement(Boolean14_30.convertBoolean(src.getHasAnswerElement()));
175    if (src.hasAnswer())
176      tgt.setAnswer(ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().convertType(src.getAnswer()));
177    return tgt;
178  }
179
180  public static org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemEnableWhenComponent convertQuestionnaireItemEnableWhenComponent(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemEnableWhenComponent src) throws FHIRException {
181    if (src == null || src.isEmpty())
182      return null;
183    org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemEnableWhenComponent tgt = new org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemEnableWhenComponent();
184    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyBackboneElement(src,tgt);
185    if (src.hasQuestionElement())
186      tgt.setQuestionElement(String14_30.convertString(src.getQuestionElement()));
187    if (src.hasAnswered())
188      tgt.setHasAnswerElement(Boolean14_30.convertBoolean(src.getAnsweredElement()));
189    if (src.hasAnswer())
190      tgt.setAnswer(ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().convertType(src.getAnswer()));
191    return tgt;
192  }
193
194  public static org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemOptionComponent convertQuestionnaireItemOptionComponent(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemOptionComponent src) throws FHIRException {
195    if (src == null || src.isEmpty())
196      return null;
197    org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemOptionComponent tgt = new org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemOptionComponent();
198    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyBackboneElement(src,tgt);
199    if (src.hasValue())
200      tgt.setValue(ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().convertType(src.getValue()));
201    return tgt;
202  }
203
204  public static org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemOptionComponent convertQuestionnaireItemOptionComponent(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemOptionComponent src) throws FHIRException {
205    if (src == null || src.isEmpty())
206      return null;
207    org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemOptionComponent tgt = new org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemOptionComponent();
208    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyBackboneElement(src,tgt);
209    if (src.hasValue())
210      tgt.setValue(ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().convertType(src.getValue()));
211    return tgt;
212  }
213
214  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType> convertQuestionnaireItemType(org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType> src) throws FHIRException {
215    if (src == null || src.isEmpty())
216      return null;
217    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());
218    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
219    switch (src.getValue()) {
220      case GROUP:
221        tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.GROUP);
222        break;
223      case DISPLAY:
224        tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.DISPLAY);
225        break;
226      case QUESTION:
227        tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.QUESTION);
228        break;
229      case BOOLEAN:
230        tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.BOOLEAN);
231        break;
232      case DECIMAL:
233        tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.DECIMAL);
234        break;
235      case INTEGER:
236        tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.INTEGER);
237        break;
238      case DATE:
239        tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.DATE);
240        break;
241      case DATETIME:
242        tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.DATETIME);
243        break;
244      case INSTANT:
245        tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.DATETIME);
246        break;
247      case TIME:
248        tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.TIME);
249        break;
250      case STRING:
251        tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.STRING);
252        break;
253      case TEXT:
254        tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.TEXT);
255        break;
256      case URL:
257        tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.URL);
258        break;
259      case CHOICE:
260        tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.CHOICE);
261        break;
262      case OPENCHOICE:
263        tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.OPENCHOICE);
264        break;
265      case ATTACHMENT:
266        tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.ATTACHMENT);
267        break;
268      case REFERENCE:
269        tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.REFERENCE);
270        break;
271      case QUANTITY:
272        tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.QUANTITY);
273        break;
274      default:
275        tgt.setValue(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.NULL);
276        break;
277    }
278    return tgt;
279  }
280
281  static public org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType> convertQuestionnaireItemType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType> src) throws FHIRException {
282    if (src == null || src.isEmpty())
283      return null;
284    org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType> tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemTypeEnumFactory());
285    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
286    switch (src.getValue()) {
287      case GROUP:
288        tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.GROUP);
289        break;
290      case DISPLAY:
291        tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.DISPLAY);
292        break;
293      case QUESTION:
294        tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.QUESTION);
295        break;
296      case BOOLEAN:
297        tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.BOOLEAN);
298        break;
299      case DECIMAL:
300        tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.DECIMAL);
301        break;
302      case INTEGER:
303        tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.INTEGER);
304        break;
305      case DATE:
306        tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.DATE);
307        break;
308      case DATETIME:
309        tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.DATETIME);
310        break;
311      case TIME:
312        tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.TIME);
313        break;
314      case STRING:
315        tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.STRING);
316        break;
317      case TEXT:
318        tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.TEXT);
319        break;
320      case URL:
321        tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.URL);
322        break;
323      case CHOICE:
324        tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.CHOICE);
325        break;
326      case OPENCHOICE:
327        tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.OPENCHOICE);
328        break;
329      case ATTACHMENT:
330        tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.ATTACHMENT);
331        break;
332      case REFERENCE:
333        tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.REFERENCE);
334        break;
335      case QUANTITY:
336        tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.QUANTITY);
337        break;
338      default:
339        tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType.NULL);
340        break;
341    }
342    return tgt;
343  }
344
345  static public org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireStatus> convertQuestionnaireStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus> src) throws FHIRException {
346    if (src == null || src.isEmpty())
347      return null;
348    org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireStatus> tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireStatusEnumFactory());
349    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
350    switch (src.getValue()) {
351      case DRAFT:
352        tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireStatus.DRAFT);
353        break;
354      case ACTIVE:
355        tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireStatus.PUBLISHED);
356        break;
357      case RETIRED:
358        tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireStatus.RETIRED);
359        break;
360      default:
361        tgt.setValue(org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireStatus.NULL);
362        break;
363    }
364    return tgt;
365  }
366
367  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus> convertQuestionnaireStatus(org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireStatus> src) throws FHIRException {
368    if (src == null || src.isEmpty())
369      return null;
370    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Enumerations.PublicationStatusEnumFactory());
371    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
372    switch (src.getValue()) {
373      case DRAFT:
374        tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.DRAFT);
375        break;
376      case PUBLISHED:
377        tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.ACTIVE);
378        break;
379      case RETIRED:
380        tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.RETIRED);
381        break;
382      default:
383        tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.NULL);
384        break;
385    }
386    return tgt;
387  }
388}