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.complextypes14_30.CodeableConcept14_30;
006import org.hl7.fhir.convertors.conv14_30.datatypes14_30.complextypes14_30.ContactPoint14_30;
007import org.hl7.fhir.convertors.conv14_30.datatypes14_30.complextypes14_30.Identifier14_30;
008import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.*;
009import org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionPropertyComponent;
010import org.hl7.fhir.dstu3.model.CodeSystem;
011import org.hl7.fhir.dstu3.model.CodeSystem.FilterOperator;
012import org.hl7.fhir.dstu3.model.Enumeration;
013import org.hl7.fhir.exceptions.FHIRException;
014
015public class CodeSystem14_30 {
016
017  public static org.hl7.fhir.dstu3.model.CodeSystem convertCodeSystem(org.hl7.fhir.dstu2016may.model.CodeSystem src) throws FHIRException {
018    if (src == null || src.isEmpty())
019      return null;
020    org.hl7.fhir.dstu3.model.CodeSystem tgt = new org.hl7.fhir.dstu3.model.CodeSystem();
021    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyDomainResource(src, tgt);
022    if (src.hasUrl())
023      tgt.setUrlElement(Uri14_30.convertUri(src.getUrlElement()));
024    if (src.hasIdentifier())
025      tgt.setIdentifier(Identifier14_30.convertIdentifier(src.getIdentifier()));
026    if (src.hasVersion())
027      tgt.setVersionElement(String14_30.convertString(src.getVersionElement()));
028    if (src.hasName())
029      tgt.setNameElement(String14_30.convertString(src.getNameElement()));
030    if (src.hasStatus())
031      tgt.setStatusElement(Enumerations14_30.convertConformanceResourceStatus(src.getStatusElement()));
032    if (src.hasExperimental())
033      tgt.setExperimentalElement(Boolean14_30.convertBoolean(src.getExperimentalElement()));
034    if (src.hasPublisher())
035      tgt.setPublisherElement(String14_30.convertString(src.getPublisherElement()));
036    for (org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContactComponent t : src.getContact())
037      tgt.addContact(convertCodeSystemContactComponent(t));
038    if (src.hasDate())
039      tgt.setDateElement(DateTime14_30.convertDateTime(src.getDateElement()));
040    if (src.hasDescription())
041      tgt.setDescription(src.getDescription());
042    for (org.hl7.fhir.dstu2016may.model.CodeableConcept t : src.getUseContext())
043      if (VersionConvertor_14_30.isJurisdiction(t))
044        tgt.addJurisdiction(CodeableConcept14_30.convertCodeableConcept(t));
045      else
046        tgt.addUseContext(CodeableConcept14_30.convertCodeableConceptToUsageContext(t));
047    if (src.hasRequirements())
048      tgt.setPurpose(src.getRequirements());
049    if (src.hasCopyright())
050      tgt.setCopyright(src.getCopyright());
051    if (src.hasCaseSensitive())
052      tgt.setCaseSensitiveElement(Boolean14_30.convertBoolean(src.getCaseSensitiveElement()));
053    if (src.hasValueSet())
054      tgt.setValueSetElement(Uri14_30.convertUri(src.getValueSetElement()));
055    if (src.hasCompositional())
056      tgt.setCompositionalElement(Boolean14_30.convertBoolean(src.getCompositionalElement()));
057    if (src.hasVersionNeeded())
058      tgt.setVersionNeededElement(Boolean14_30.convertBoolean(src.getVersionNeededElement()));
059    if (src.hasContent())
060      tgt.setContentElement(convertCodeSystemContentMode(src.getContentElement()));
061    if (src.hasCount())
062      tgt.setCountElement(UnsignedInt14_30.convertUnsignedInt(src.getCountElement()));
063    for (org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemFilterComponent t : src.getFilter())
064      tgt.addFilter(convertCodeSystemFilterComponent(t));
065    for (org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemPropertyComponent t : src.getProperty())
066      tgt.addProperty(convertPropertyComponent(t));
067    for (org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept())
068      tgt.addConcept(convertConceptDefinitionComponent(t));
069    return tgt;
070  }
071
072  public static org.hl7.fhir.dstu2016may.model.CodeSystem convertCodeSystem(org.hl7.fhir.dstu3.model.CodeSystem src) throws FHIRException {
073    if (src == null || src.isEmpty())
074      return null;
075    org.hl7.fhir.dstu2016may.model.CodeSystem tgt = new org.hl7.fhir.dstu2016may.model.CodeSystem();
076    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyDomainResource(src, tgt);
077    if (src.hasUrl())
078      tgt.setUrlElement(Uri14_30.convertUri(src.getUrlElement()));
079    if (src.hasIdentifier())
080      tgt.setIdentifier(Identifier14_30.convertIdentifier(src.getIdentifier()));
081    if (src.hasVersion())
082      tgt.setVersionElement(String14_30.convertString(src.getVersionElement()));
083    if (src.hasName())
084      tgt.setNameElement(String14_30.convertString(src.getNameElement()));
085    if (src.hasStatus())
086      tgt.setStatusElement(Enumerations14_30.convertConformanceResourceStatus(src.getStatusElement()));
087    if (src.hasExperimental())
088      tgt.setExperimentalElement(Boolean14_30.convertBoolean(src.getExperimentalElement()));
089    if (src.hasPublisher())
090      tgt.setPublisherElement(String14_30.convertString(src.getPublisherElement()));
091    for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact())
092      tgt.addContact(convertCodeSystemContactComponent(t));
093    if (src.hasDate())
094      tgt.setDateElement(DateTime14_30.convertDateTime(src.getDateElement()));
095    if (src.hasDescription())
096      tgt.setDescription(src.getDescription());
097    for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext())
098      if (t.hasValueCodeableConcept())
099        tgt.addUseContext(CodeableConcept14_30.convertCodeableConcept(t.getValueCodeableConcept()));
100    for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction())
101      tgt.addUseContext(CodeableConcept14_30.convertCodeableConcept(t));
102    if (src.hasPurpose())
103      tgt.setRequirements(src.getPurpose());
104    if (src.hasCopyright())
105      tgt.setCopyright(src.getCopyright());
106    if (src.hasCaseSensitive())
107      tgt.setCaseSensitiveElement(Boolean14_30.convertBoolean(src.getCaseSensitiveElement()));
108    if (src.hasValueSet())
109      tgt.setValueSetElement(Uri14_30.convertUri(src.getValueSetElement()));
110    if (src.hasCompositional())
111      tgt.setCompositionalElement(Boolean14_30.convertBoolean(src.getCompositionalElement()));
112    if (src.hasVersionNeeded())
113      tgt.setVersionNeededElement(Boolean14_30.convertBoolean(src.getVersionNeededElement()));
114    if (src.hasContent())
115      tgt.setContentElement(convertCodeSystemContentMode(src.getContentElement()));
116    if (src.hasCount())
117      tgt.setCountElement(UnsignedInt14_30.convertUnsignedInt(src.getCountElement()));
118    for (org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemFilterComponent t : src.getFilter())
119      tgt.addFilter(convertCodeSystemFilterComponent(t));
120    for (org.hl7.fhir.dstu3.model.CodeSystem.PropertyComponent t : src.getProperty())
121      tgt.addProperty(convertPropertyComponent(t));
122    for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept())
123      tgt.addConcept(convertConceptDefinitionComponent(t));
124    return tgt;
125  }
126
127  public static org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContactComponent convertCodeSystemContactComponent(org.hl7.fhir.dstu3.model.ContactDetail src) throws FHIRException {
128    if (src == null || src.isEmpty())
129      return null;
130    org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContactComponent tgt = new org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContactComponent();
131    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
132    if (src.hasName())
133      tgt.setNameElement(String14_30.convertString(src.getNameElement()));
134    for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom())
135      tgt.addTelecom(ContactPoint14_30.convertContactPoint(t));
136    return tgt;
137  }
138
139  public static org.hl7.fhir.dstu3.model.ContactDetail convertCodeSystemContactComponent(org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContactComponent src) throws FHIRException {
140    if (src == null || src.isEmpty())
141      return null;
142    org.hl7.fhir.dstu3.model.ContactDetail tgt = new org.hl7.fhir.dstu3.model.ContactDetail();
143    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
144    if (src.hasName())
145      tgt.setNameElement(String14_30.convertString(src.getNameElement()));
146    for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom())
147      tgt.addTelecom(ContactPoint14_30.convertContactPoint(t));
148    return tgt;
149  }
150
151  static public org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentMode> convertCodeSystemContentMode(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentMode> src) throws FHIRException {
152    if (src == null || src.isEmpty())
153      return null;
154    org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentMode> tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentModeEnumFactory());
155    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
156    switch (src.getValue()) {
157      case NOTPRESENT:
158        tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentMode.NOTPRESENT);
159        break;
160      case EXAMPLE:
161        tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentMode.EXAMPLAR);
162        break;
163      case FRAGMENT:
164        tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentMode.FRAGMENT);
165        break;
166      case COMPLETE:
167        tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentMode.COMPLETE);
168        break;
169      default:
170        tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentMode.NULL);
171        break;
172    }
173    return tgt;
174  }
175
176  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentMode> convertCodeSystemContentMode(org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemContentMode> src) throws FHIRException {
177    if (src == null || src.isEmpty())
178      return null;
179    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentMode> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentModeEnumFactory());
180    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
181    switch (src.getValue()) {
182      case NOTPRESENT:
183        tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentMode.NOTPRESENT);
184        break;
185      case EXAMPLAR:
186        tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentMode.EXAMPLE);
187        break;
188      case FRAGMENT:
189        tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentMode.FRAGMENT);
190        break;
191      case COMPLETE:
192        tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentMode.COMPLETE);
193        break;
194      default:
195        tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentMode.NULL);
196        break;
197    }
198    return tgt;
199  }
200
201  public static org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemFilterComponent convertCodeSystemFilterComponent(org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemFilterComponent src) throws FHIRException {
202    if (src == null || src.isEmpty())
203      return null;
204    org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemFilterComponent tgt = new org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemFilterComponent();
205    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
206    if (src.hasCodeElement())
207      tgt.setCodeElement(Code14_30.convertCode(src.getCodeElement()));
208    if (src.hasDescription())
209      tgt.setDescriptionElement(String14_30.convertString(src.getDescriptionElement()));
210    for (org.hl7.fhir.dstu2016may.model.CodeType t : src.getOperator())
211      try {
212        tgt.addOperator(CodeSystem.FilterOperator.fromCode(t.getValue()));
213      } catch (org.hl7.fhir.exceptions.FHIRException e) {
214        throw new FHIRException(e);
215      }
216    if (src.hasValueElement())
217      tgt.setValueElement(String14_30.convertString(src.getValueElement()));
218    return tgt;
219  }
220
221  public static org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemFilterComponent convertCodeSystemFilterComponent(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemFilterComponent src) throws FHIRException {
222    if (src == null || src.isEmpty())
223      return null;
224    org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemFilterComponent tgt = new org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemFilterComponent();
225    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
226    if (src.hasCodeElement())
227      tgt.setCodeElement(Code14_30.convertCode(src.getCodeElement()));
228    if (src.hasDescription())
229      tgt.setDescriptionElement(String14_30.convertString(src.getDescriptionElement()));
230    for (Enumeration<FilterOperator> t : src.getOperator()) tgt.addOperator(t.getValue().toCode());
231    if (src.hasValueElement())
232      tgt.setValueElement(String14_30.convertString(src.getValueElement()));
233    return tgt;
234  }
235
236  public static org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionComponent convertConceptDefinitionComponent(org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent src) throws FHIRException {
237    if (src == null || src.isEmpty())
238      return null;
239    org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionComponent tgt = new org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionComponent();
240    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
241    if (src.hasCodeElement())
242      tgt.setCodeElement(Code14_30.convertCode(src.getCodeElement()));
243    if (src.hasDisplay())
244      tgt.setDisplayElement(String14_30.convertString(src.getDisplayElement()));
245    if (src.hasDefinition())
246      tgt.setDefinitionElement(String14_30.convertString(src.getDefinitionElement()));
247    for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation())
248      tgt.addDesignation(convertConceptDefinitionDesignationComponent(t));
249    for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptPropertyComponent t : src.getProperty())
250      tgt.addProperty(convertConceptPropertyComponent(t));
251    for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept())
252      tgt.addConcept(convertConceptDefinitionComponent(t));
253    return tgt;
254  }
255
256  public static org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent convertConceptDefinitionComponent(org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionComponent src) throws FHIRException {
257    if (src == null || src.isEmpty())
258      return null;
259    org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent tgt = new org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent();
260    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
261    if (src.hasCodeElement())
262      tgt.setCodeElement(Code14_30.convertCode(src.getCodeElement()));
263    if (src.hasDisplay())
264      tgt.setDisplayElement(String14_30.convertString(src.getDisplayElement()));
265    if (src.hasDefinition())
266      tgt.setDefinitionElement(String14_30.convertString(src.getDefinitionElement()));
267    for (org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation())
268      tgt.addDesignation(convertConceptDefinitionDesignationComponent(t));
269    for (ConceptDefinitionPropertyComponent t : src.getProperty()) tgt.addProperty(convertConceptPropertyComponent(t));
270    for (org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept())
271      tgt.addConcept(convertConceptDefinitionComponent(t));
272    return tgt;
273  }
274
275  public static org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionDesignationComponent convertConceptDefinitionDesignationComponent(org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionDesignationComponent src) throws FHIRException {
276    if (src == null || src.isEmpty())
277      return null;
278    org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionDesignationComponent tgt = new org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionDesignationComponent();
279    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
280    if (src.hasLanguage())
281      tgt.setLanguageElement(Code14_30.convertCode(src.getLanguageElement()));
282    if (src.hasUse())
283      tgt.setUse(Code14_30.convertCoding(src.getUse()));
284    if (src.hasValueElement())
285      tgt.setValueElement(String14_30.convertString(src.getValueElement()));
286    return tgt;
287  }
288
289  public static org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionDesignationComponent convertConceptDefinitionDesignationComponent(org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionDesignationComponent src) throws FHIRException {
290    if (src == null || src.isEmpty())
291      return null;
292    org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionDesignationComponent tgt = new org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionDesignationComponent();
293    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
294    if (src.hasLanguage())
295      tgt.setLanguageElement(Code14_30.convertCode(src.getLanguageElement()));
296    if (src.hasUse())
297      tgt.setUse(Code14_30.convertCoding(src.getUse()));
298    if (src.hasValueElement())
299      tgt.setValueElement(String14_30.convertString(src.getValueElement()));
300    return tgt;
301  }
302
303  public static org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionPropertyComponent convertConceptPropertyComponent(org.hl7.fhir.dstu3.model.CodeSystem.ConceptPropertyComponent src) throws FHIRException {
304    if (src == null || src.isEmpty())
305      return null;
306    org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionPropertyComponent tgt = new org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionPropertyComponent();
307    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
308    if (src.hasCodeElement())
309      tgt.setCodeElement(Code14_30.convertCode(src.getCodeElement()));
310    if (src.hasValue())
311      tgt.setValue(ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().convertType(src.getValue()));
312    return tgt;
313  }
314
315  public static org.hl7.fhir.dstu3.model.CodeSystem.ConceptPropertyComponent convertConceptPropertyComponent(org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionPropertyComponent src) throws FHIRException {
316    if (src == null || src.isEmpty())
317      return null;
318    org.hl7.fhir.dstu3.model.CodeSystem.ConceptPropertyComponent tgt = new org.hl7.fhir.dstu3.model.CodeSystem.ConceptPropertyComponent();
319    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
320    if (src.hasCodeElement())
321      tgt.setCodeElement(Code14_30.convertCode(src.getCodeElement()));
322    if (src.hasValue())
323      tgt.setValue(ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().convertType(src.getValue()));
324    return tgt;
325  }
326
327  public static org.hl7.fhir.dstu3.model.CodeSystem.PropertyComponent convertPropertyComponent(org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemPropertyComponent src) throws FHIRException {
328    if (src == null || src.isEmpty())
329      return null;
330    org.hl7.fhir.dstu3.model.CodeSystem.PropertyComponent tgt = new org.hl7.fhir.dstu3.model.CodeSystem.PropertyComponent();
331    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
332    if (src.hasCodeElement())
333      tgt.setCodeElement(Code14_30.convertCode(src.getCodeElement()));
334    if (src.hasDescription())
335      tgt.setDescriptionElement(String14_30.convertString(src.getDescriptionElement()));
336    if (src.hasType())
337      tgt.setTypeElement(convertPropertyType(src.getTypeElement()));
338    return tgt;
339  }
340
341  public static org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemPropertyComponent convertPropertyComponent(org.hl7.fhir.dstu3.model.CodeSystem.PropertyComponent src) throws FHIRException {
342    if (src == null || src.isEmpty())
343      return null;
344    org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemPropertyComponent tgt = new org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemPropertyComponent();
345    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
346    if (src.hasCodeElement())
347      tgt.setCodeElement(Code14_30.convertCode(src.getCodeElement()));
348    if (src.hasDescription())
349      tgt.setDescriptionElement(String14_30.convertString(src.getDescriptionElement()));
350    if (src.hasType())
351      tgt.setTypeElement(convertPropertyType(src.getTypeElement()));
352    return tgt;
353  }
354
355  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CodeSystem.PropertyType> convertPropertyType(org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType> src) throws FHIRException {
356    if (src == null || src.isEmpty())
357      return null;
358    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CodeSystem.PropertyType> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CodeSystem.PropertyTypeEnumFactory());
359    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
360    switch (src.getValue()) {
361      case CODE:
362        tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.PropertyType.CODE);
363        break;
364      case CODING:
365        tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.PropertyType.CODING);
366        break;
367      case STRING:
368        tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.PropertyType.STRING);
369        break;
370      case INTEGER:
371        tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.PropertyType.INTEGER);
372        break;
373      case BOOLEAN:
374        tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.PropertyType.BOOLEAN);
375        break;
376      case DATETIME:
377        tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.PropertyType.DATETIME);
378        break;
379      default:
380        tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.PropertyType.NULL);
381        break;
382    }
383    return tgt;
384  }
385
386  static public org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType> convertPropertyType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CodeSystem.PropertyType> src) throws FHIRException {
387    if (src == null || src.isEmpty())
388      return null;
389    org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType> tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyTypeEnumFactory());
390    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
391    switch (src.getValue()) {
392      case CODE:
393        tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.CODE);
394        break;
395      case CODING:
396        tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.CODING);
397        break;
398      case STRING:
399        tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.STRING);
400        break;
401      case INTEGER:
402        tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.INTEGER);
403        break;
404      case BOOLEAN:
405        tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.BOOLEAN);
406        break;
407      case DATETIME:
408        tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.DATETIME);
409        break;
410      default:
411        tgt.setValue(org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType.NULL);
412        break;
413    }
414    return tgt;
415  }
416}