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