001package org.hl7.fhir.convertors.conv30_40;
002
003import org.hl7.fhir.convertors.VersionConvertor_30_40;
004import org.hl7.fhir.exceptions.FHIRException;
005
006import java.util.stream.Collectors;
007
008public class CodeSystem30_40 {
009
010    public static org.hl7.fhir.r4.model.CodeSystem convertCodeSystem(org.hl7.fhir.dstu3.model.CodeSystem src) throws FHIRException {
011        if (src == null)
012            return null;
013        org.hl7.fhir.r4.model.CodeSystem tgt = new org.hl7.fhir.r4.model.CodeSystem();
014        VersionConvertor_30_40.copyDomainResource(src, tgt);
015        if (src.hasUrl())
016            tgt.setUrlElement(VersionConvertor_30_40.convertUri(src.getUrlElement()));
017        if (src.hasIdentifier())
018            tgt.addIdentifier(VersionConvertor_30_40.convertIdentifier(src.getIdentifier()));
019        if (src.hasVersion())
020            tgt.setVersionElement(VersionConvertor_30_40.convertString(src.getVersionElement()));
021        if (src.hasName())
022            tgt.setNameElement(VersionConvertor_30_40.convertString(src.getNameElement()));
023        if (src.hasTitle())
024            tgt.setTitleElement(VersionConvertor_30_40.convertString(src.getTitleElement()));
025        if (src.hasStatus())
026            tgt.setStatusElement(VersionConvertor_30_40.convertPublicationStatus(src.getStatusElement()));
027        if (src.hasExperimental())
028            tgt.setExperimentalElement(VersionConvertor_30_40.convertBoolean(src.getExperimentalElement()));
029        if (src.hasDateElement())
030            tgt.setDateElement(VersionConvertor_30_40.convertDateTime(src.getDateElement()));
031        if (src.hasPublisher())
032            tgt.setPublisherElement(VersionConvertor_30_40.convertString(src.getPublisherElement()));
033        for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t));
034        if (src.hasDescription())
035            tgt.setDescriptionElement(VersionConvertor_30_40.convertMarkdown(src.getDescriptionElement()));
036        for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t));
037        for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t));
038        if (src.hasPurpose())
039            tgt.setPurposeElement(VersionConvertor_30_40.convertMarkdown(src.getPurposeElement()));
040        if (src.hasCopyright())
041            tgt.setCopyrightElement(VersionConvertor_30_40.convertMarkdown(src.getCopyrightElement()));
042        if (src.hasCaseSensitive())
043            tgt.setCaseSensitiveElement(VersionConvertor_30_40.convertBoolean(src.getCaseSensitiveElement()));
044        if (src.hasValueSet())
045            tgt.setValueSet(src.getValueSet());
046        if (src.hasHierarchyMeaning())
047            tgt.setHierarchyMeaningElement(convertCodeSystemHierarchyMeaning(src.getHierarchyMeaningElement()));
048        if (src.hasCompositional())
049            tgt.setCompositionalElement(VersionConvertor_30_40.convertBoolean(src.getCompositionalElement()));
050        if (src.hasVersionNeeded())
051            tgt.setVersionNeededElement(VersionConvertor_30_40.convertBoolean(src.getVersionNeededElement()));
052        if (src.hasContent())
053            tgt.setContentElement(convertCodeSystemContentMode(src.getContentElement()));
054        if (src.hasCount())
055            tgt.setCountElement(VersionConvertor_30_40.convertUnsignedInt(src.getCountElement()));
056        for (org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemFilterComponent t : src.getFilter()) tgt.addFilter(convertCodeSystemFilterComponent(t));
057        for (org.hl7.fhir.dstu3.model.CodeSystem.PropertyComponent t : src.getProperty()) tgt.addProperty(convertPropertyComponent(t));
058        for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t));
059        return tgt;
060    }
061
062    public static org.hl7.fhir.dstu3.model.CodeSystem convertCodeSystem(org.hl7.fhir.r4.model.CodeSystem src) throws FHIRException {
063        if (src == null)
064            return null;
065        org.hl7.fhir.dstu3.model.CodeSystem tgt = new org.hl7.fhir.dstu3.model.CodeSystem();
066        VersionConvertor_30_40.copyDomainResource(src, tgt);
067        if (src.hasUrl())
068            tgt.setUrlElement(VersionConvertor_30_40.convertUri(src.getUrlElement()));
069        if (src.hasIdentifier())
070            tgt.setIdentifier(VersionConvertor_30_40.convertIdentifier(src.getIdentifierFirstRep()));
071        if (src.hasVersion())
072            tgt.setVersionElement(VersionConvertor_30_40.convertString(src.getVersionElement()));
073        if (src.hasName())
074            tgt.setNameElement(VersionConvertor_30_40.convertString(src.getNameElement()));
075        if (src.hasTitle())
076            tgt.setTitleElement(VersionConvertor_30_40.convertString(src.getTitleElement()));
077        if (src.hasStatus())
078            tgt.setStatusElement(VersionConvertor_30_40.convertPublicationStatus(src.getStatusElement()));
079        if (src.hasExperimental())
080            tgt.setExperimentalElement(VersionConvertor_30_40.convertBoolean(src.getExperimentalElement()));
081        if (src.hasDateElement())
082            tgt.setDateElement(VersionConvertor_30_40.convertDateTime(src.getDateElement()));
083        if (src.hasPublisher())
084            tgt.setPublisherElement(VersionConvertor_30_40.convertString(src.getPublisherElement()));
085        for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(VersionConvertor_30_40.convertContactDetail(t));
086        if (src.hasDescription())
087            tgt.setDescriptionElement(VersionConvertor_30_40.convertMarkdown(src.getDescriptionElement()));
088        for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(VersionConvertor_30_40.convertUsageContext(t));
089        for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(VersionConvertor_30_40.convertCodeableConcept(t));
090        if (src.hasPurpose())
091            tgt.setPurposeElement(VersionConvertor_30_40.convertMarkdown(src.getPurposeElement()));
092        if (src.hasCopyright())
093            tgt.setCopyrightElement(VersionConvertor_30_40.convertMarkdown(src.getCopyrightElement()));
094        if (src.hasCaseSensitive())
095            tgt.setCaseSensitiveElement(VersionConvertor_30_40.convertBoolean(src.getCaseSensitiveElement()));
096        if (src.hasValueSet())
097            tgt.setValueSet(src.getValueSet());
098        if (src.hasHierarchyMeaning())
099            tgt.setHierarchyMeaningElement(convertCodeSystemHierarchyMeaning(src.getHierarchyMeaningElement()));
100        if (src.hasCompositional())
101            tgt.setCompositionalElement(VersionConvertor_30_40.convertBoolean(src.getCompositionalElement()));
102        if (src.hasVersionNeeded())
103            tgt.setVersionNeededElement(VersionConvertor_30_40.convertBoolean(src.getVersionNeededElement()));
104        if (src.hasContent())
105            tgt.setContentElement(convertCodeSystemContentMode(src.getContentElement()));
106        if (src.hasCount())
107            tgt.setCountElement(VersionConvertor_30_40.convertUnsignedInt(src.getCountElement()));
108        for (org.hl7.fhir.r4.model.CodeSystem.CodeSystemFilterComponent t : src.getFilter()) tgt.addFilter(convertCodeSystemFilterComponent(t));
109        for (org.hl7.fhir.r4.model.CodeSystem.PropertyComponent t : src.getProperty()) tgt.addProperty(convertPropertyComponent(t));
110        for (org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t));
111        return tgt;
112    }
113
114    static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentMode> convertCodeSystemContentMode(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode> src) throws FHIRException {
115        if (src == null || src.isEmpty())
116            return null;
117        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());
118        VersionConvertor_30_40.copyElement(src, tgt);
119        switch(src.getValue()) {
120            case NOTPRESENT:
121                tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentMode.NOTPRESENT);
122                break;
123            case EXAMPLE:
124                tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentMode.EXAMPLE);
125                break;
126            case FRAGMENT:
127                tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentMode.FRAGMENT);
128                break;
129            case COMPLETE:
130                tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentMode.COMPLETE);
131                break;
132            default:
133                tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentMode.NULL);
134                break;
135        }
136        return tgt;
137    }
138
139    static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode> convertCodeSystemContentMode(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemContentMode> src) throws FHIRException {
140        if (src == null || src.isEmpty())
141            return null;
142        org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentModeEnumFactory());
143        VersionConvertor_30_40.copyElement(src, tgt);
144        switch(src.getValue()) {
145            case NOTPRESENT:
146                tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.NOTPRESENT);
147                break;
148            case EXAMPLE:
149                tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.EXAMPLE);
150                break;
151            case FRAGMENT:
152                tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.FRAGMENT);
153                break;
154            case COMPLETE:
155                tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.COMPLETE);
156                break;
157            default:
158                tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.NULL);
159                break;
160        }
161        return tgt;
162    }
163
164    public static org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemFilterComponent convertCodeSystemFilterComponent(org.hl7.fhir.r4.model.CodeSystem.CodeSystemFilterComponent src) throws FHIRException {
165        if (src == null)
166            return null;
167        org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemFilterComponent tgt = new org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemFilterComponent();
168        VersionConvertor_30_40.copyElement(src, tgt);
169        if (src.hasCode())
170            tgt.setCodeElement(VersionConvertor_30_40.convertCode(src.getCodeElement()));
171        if (src.hasDescription())
172            tgt.setDescriptionElement(VersionConvertor_30_40.convertString(src.getDescriptionElement()));
173        tgt.setOperator(src.getOperator().stream()
174                .map(CodeSystem30_40::convertFilterOperator)
175                .collect(Collectors.toList()));
176        if (src.hasValue())
177            tgt.setValueElement(VersionConvertor_30_40.convertString(src.getValueElement()));
178        return tgt;
179    }
180
181    public static org.hl7.fhir.r4.model.CodeSystem.CodeSystemFilterComponent convertCodeSystemFilterComponent(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemFilterComponent src) throws FHIRException {
182        if (src == null)
183            return null;
184        org.hl7.fhir.r4.model.CodeSystem.CodeSystemFilterComponent tgt = new org.hl7.fhir.r4.model.CodeSystem.CodeSystemFilterComponent();
185        VersionConvertor_30_40.copyElement(src, tgt);
186        if (src.hasCode())
187            tgt.setCodeElement(VersionConvertor_30_40.convertCode(src.getCodeElement()));
188        if (src.hasDescription())
189            tgt.setDescriptionElement(VersionConvertor_30_40.convertString(src.getDescriptionElement()));
190        tgt.setOperator(src.getOperator().stream()
191                .map(CodeSystem30_40::convertFilterOperator)
192                .collect(Collectors.toList()));
193        if (src.hasValue())
194            tgt.setValueElement(VersionConvertor_30_40.convertString(src.getValueElement()));
195        return tgt;
196    }
197
198    static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemHierarchyMeaning> convertCodeSystemHierarchyMeaning(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning> src) throws FHIRException {
199        if (src == null || src.isEmpty())
200            return null;
201        org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemHierarchyMeaning> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemHierarchyMeaningEnumFactory());
202        VersionConvertor_30_40.copyElement(src, tgt);
203        switch(src.getValue()) {
204            case GROUPEDBY:
205                tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemHierarchyMeaning.GROUPEDBY);
206                break;
207            case ISA:
208                tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemHierarchyMeaning.ISA);
209                break;
210            case PARTOF:
211                tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemHierarchyMeaning.PARTOF);
212                break;
213            case CLASSIFIEDWITH:
214                tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemHierarchyMeaning.CLASSIFIEDWITH);
215                break;
216            default:
217                tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemHierarchyMeaning.NULL);
218                break;
219        }
220        return tgt;
221    }
222
223    static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning> convertCodeSystemHierarchyMeaning(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemHierarchyMeaning> src) throws FHIRException {
224        if (src == null || src.isEmpty())
225            return null;
226        org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaningEnumFactory());
227        VersionConvertor_30_40.copyElement(src, tgt);
228        switch(src.getValue()) {
229            case GROUPEDBY:
230                tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.GROUPEDBY);
231                break;
232            case ISA:
233                tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.ISA);
234                break;
235            case PARTOF:
236                tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.PARTOF);
237                break;
238            case CLASSIFIEDWITH:
239                tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.CLASSIFIEDWITH);
240                break;
241            default:
242                tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.NULL);
243                break;
244        }
245        return tgt;
246    }
247
248    public static org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent convertConceptDefinitionComponent(org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent src) throws FHIRException {
249        if (src == null)
250            return null;
251        org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent tgt = new org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent();
252        VersionConvertor_30_40.copyElement(src, tgt);
253        if (src.hasCode())
254            tgt.setCodeElement(VersionConvertor_30_40.convertCode(src.getCodeElement()));
255        if (src.hasDisplay())
256            tgt.setDisplayElement(VersionConvertor_30_40.convertString(src.getDisplayElement()));
257        if (src.hasDefinition())
258            tgt.setDefinitionElement(VersionConvertor_30_40.convertString(src.getDefinitionElement()));
259        for (org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptDefinitionDesignationComponent(t));
260        for (org.hl7.fhir.r4.model.CodeSystem.ConceptPropertyComponent t : src.getProperty()) tgt.addProperty(convertConceptPropertyComponent(t));
261        for (org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t));
262        return tgt;
263    }
264
265    public static org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent convertConceptDefinitionComponent(org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent src) throws FHIRException {
266        if (src == null)
267            return null;
268        org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent tgt = new org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent();
269        VersionConvertor_30_40.copyElement(src, tgt);
270        if (src.hasCode())
271            tgt.setCodeElement(VersionConvertor_30_40.convertCode(src.getCodeElement()));
272        if (src.hasDisplay())
273            tgt.setDisplayElement(VersionConvertor_30_40.convertString(src.getDisplayElement()));
274        if (src.hasDefinition())
275            tgt.setDefinitionElement(VersionConvertor_30_40.convertString(src.getDefinitionElement()));
276        for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptDefinitionDesignationComponent(t));
277        for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptPropertyComponent t : src.getProperty()) tgt.addProperty(convertConceptPropertyComponent(t));
278        for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) tgt.addConcept(convertConceptDefinitionComponent(t));
279        return tgt;
280    }
281
282    public static org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionDesignationComponent convertConceptDefinitionDesignationComponent(org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionDesignationComponent src) throws FHIRException {
283        if (src == null)
284            return null;
285        org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionDesignationComponent tgt = new org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionDesignationComponent();
286        VersionConvertor_30_40.copyElement(src, tgt);
287        if (src.hasLanguage())
288            tgt.setLanguageElement(VersionConvertor_30_40.convertCode(src.getLanguageElement()));
289        if (src.hasUse())
290            tgt.setUse(VersionConvertor_30_40.convertCoding(src.getUse()));
291        if (src.hasValue())
292            tgt.setValueElement(VersionConvertor_30_40.convertString(src.getValueElement()));
293        return tgt;
294    }
295
296    public static org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionDesignationComponent convertConceptDefinitionDesignationComponent(org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionDesignationComponent src) throws FHIRException {
297        if (src == null)
298            return null;
299        org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionDesignationComponent tgt = new org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionDesignationComponent();
300        VersionConvertor_30_40.copyElement(src, tgt);
301        if (src.hasLanguage())
302            tgt.setLanguageElement(VersionConvertor_30_40.convertCode(src.getLanguageElement()));
303        if (src.hasUse())
304            tgt.setUse(VersionConvertor_30_40.convertCoding(src.getUse()));
305        if (src.hasValue())
306            tgt.setValueElement(VersionConvertor_30_40.convertString(src.getValueElement()));
307        return tgt;
308    }
309
310    public static org.hl7.fhir.dstu3.model.CodeSystem.ConceptPropertyComponent convertConceptPropertyComponent(org.hl7.fhir.r4.model.CodeSystem.ConceptPropertyComponent src) throws FHIRException {
311        if (src == null)
312            return null;
313        org.hl7.fhir.dstu3.model.CodeSystem.ConceptPropertyComponent tgt = new org.hl7.fhir.dstu3.model.CodeSystem.ConceptPropertyComponent();
314        VersionConvertor_30_40.copyElement(src, tgt);
315        if (src.hasCode())
316            tgt.setCodeElement(VersionConvertor_30_40.convertCode(src.getCodeElement()));
317        if (src.hasValue())
318            tgt.setValue(VersionConvertor_30_40.convertType(src.getValue()));
319        return tgt;
320    }
321
322    public static org.hl7.fhir.r4.model.CodeSystem.ConceptPropertyComponent convertConceptPropertyComponent(org.hl7.fhir.dstu3.model.CodeSystem.ConceptPropertyComponent src) throws FHIRException {
323        if (src == null)
324            return null;
325        org.hl7.fhir.r4.model.CodeSystem.ConceptPropertyComponent tgt = new org.hl7.fhir.r4.model.CodeSystem.ConceptPropertyComponent();
326        VersionConvertor_30_40.copyElement(src, tgt);
327        if (src.hasCode())
328            tgt.setCodeElement(VersionConvertor_30_40.convertCode(src.getCodeElement()));
329        if (src.hasValue())
330            tgt.setValue(VersionConvertor_30_40.convertType(src.getValue()));
331        return tgt;
332    }
333
334    public static org.hl7.fhir.r4.model.CodeSystem.PropertyComponent convertPropertyComponent(org.hl7.fhir.dstu3.model.CodeSystem.PropertyComponent src) throws FHIRException {
335        if (src == null)
336            return null;
337        org.hl7.fhir.r4.model.CodeSystem.PropertyComponent tgt = new org.hl7.fhir.r4.model.CodeSystem.PropertyComponent();
338        VersionConvertor_30_40.copyElement(src, tgt);
339        if (src.hasCode())
340            tgt.setCodeElement(VersionConvertor_30_40.convertCode(src.getCodeElement()));
341        if (src.hasUri())
342            tgt.setUriElement(VersionConvertor_30_40.convertUri(src.getUriElement()));
343        if (src.hasDescription())
344            tgt.setDescriptionElement(VersionConvertor_30_40.convertString(src.getDescriptionElement()));
345        if (src.hasType())
346            tgt.setTypeElement(convertPropertyType(src.getTypeElement()));
347        return tgt;
348    }
349
350    public static org.hl7.fhir.dstu3.model.CodeSystem.PropertyComponent convertPropertyComponent(org.hl7.fhir.r4.model.CodeSystem.PropertyComponent src) throws FHIRException {
351        if (src == null)
352            return null;
353        org.hl7.fhir.dstu3.model.CodeSystem.PropertyComponent tgt = new org.hl7.fhir.dstu3.model.CodeSystem.PropertyComponent();
354        VersionConvertor_30_40.copyElement(src, tgt);
355        if (src.hasCode())
356            tgt.setCodeElement(VersionConvertor_30_40.convertCode(src.getCodeElement()));
357        if (src.hasUri())
358            tgt.setUriElement(VersionConvertor_30_40.convertUri(src.getUriElement()));
359        if (src.hasDescription())
360            tgt.setDescriptionElement(VersionConvertor_30_40.convertString(src.getDescriptionElement()));
361        if (src.hasType())
362            tgt.setTypeElement(convertPropertyType(src.getTypeElement()));
363        return tgt;
364    }
365
366    static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CodeSystem.PropertyType> convertPropertyType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CodeSystem.PropertyType> src) throws FHIRException {
367        if (src == null || src.isEmpty())
368            return null;
369        org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CodeSystem.PropertyType> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CodeSystem.PropertyTypeEnumFactory());
370        VersionConvertor_30_40.copyElement(src, tgt);
371        switch(src.getValue()) {
372            case CODE:
373                tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.CODE);
374                break;
375            case CODING:
376                tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.CODING);
377                break;
378            case STRING:
379                tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.STRING);
380                break;
381            case INTEGER:
382                tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.INTEGER);
383                break;
384            case BOOLEAN:
385                tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.BOOLEAN);
386                break;
387            case DATETIME:
388                tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.DATETIME);
389                break;
390            default:
391                tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.PropertyType.NULL);
392                break;
393        }
394        return tgt;
395    }
396
397    static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CodeSystem.PropertyType> convertPropertyType(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CodeSystem.PropertyType> src) throws FHIRException {
398        if (src == null || src.isEmpty())
399            return null;
400        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());
401        VersionConvertor_30_40.copyElement(src, tgt);
402        switch(src.getValue()) {
403            case CODE:
404                tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.PropertyType.CODE);
405                break;
406            case CODING:
407                tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.PropertyType.CODING);
408                break;
409            case STRING:
410                tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.PropertyType.STRING);
411                break;
412            case INTEGER:
413                tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.PropertyType.INTEGER);
414                break;
415            case BOOLEAN:
416                tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.PropertyType.BOOLEAN);
417                break;
418            case DATETIME:
419                tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.PropertyType.DATETIME);
420                break;
421            default:
422                tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.PropertyType.NULL);
423                break;
424        }
425        return tgt;
426    }
427
428    static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CodeSystem.FilterOperator> convertFilterOperator(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CodeSystem.FilterOperator> src) {
429        if (src == null || src.isEmpty())
430            return null;
431        org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CodeSystem.FilterOperator> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CodeSystem.FilterOperatorEnumFactory());
432        VersionConvertor_30_40.copyElement(src, tgt);
433        switch (src.getValue()) {
434            case EQUAL:
435                tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.EQUAL);
436                break;
437            case ISA:
438                tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.ISA);
439                break;
440            case DESCENDENTOF:
441                tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.DESCENDENTOF);
442                break;
443            case ISNOTA:
444                tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.ISNOTA);
445                break;
446            case REGEX:
447                tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.REGEX);
448                break;
449            case IN:
450                tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.IN);
451                break;
452            case NOTIN:
453                tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.NOTIN);
454                break;
455            case GENERALIZES:
456                tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.GENERALIZES);
457                break;
458            case EXISTS:
459                tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.EXISTS);
460                break;
461            default:
462                tgt.setValue(org.hl7.fhir.r4.model.CodeSystem.FilterOperator.NULL);
463                break;
464        }
465        return tgt;
466    }
467
468    static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CodeSystem.FilterOperator> convertFilterOperator(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CodeSystem.FilterOperator> src) {
469            if (src == null || src.isEmpty())
470            return null;
471        org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CodeSystem.FilterOperator> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CodeSystem.FilterOperatorEnumFactory());
472        VersionConvertor_30_40.copyElement(src, tgt);
473        switch (src.getValue()) {
474            case EQUAL:
475                tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.FilterOperator.EQUAL);
476                break;
477            case ISA:
478                tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.FilterOperator.ISA);
479                break;
480            case DESCENDENTOF:
481                tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.FilterOperator.DESCENDENTOF);
482                break;
483            case ISNOTA:
484                tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.FilterOperator.ISNOTA);
485                break;
486            case REGEX:
487                tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.FilterOperator.REGEX);
488                break;
489            case IN:
490                tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.FilterOperator.IN);
491                break;
492            case NOTIN:
493                tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.FilterOperator.NOTIN);
494                break;
495            case GENERALIZES:
496                tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.FilterOperator.GENERALIZES);
497                break;
498            case EXISTS:
499                tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.FilterOperator.EXISTS);
500                break;
501            default:
502                tgt.setValue(org.hl7.fhir.dstu3.model.CodeSystem.FilterOperator.NULL);
503                break;
504        }
505        return tgt;
506    }
507}