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