001package org.hl7.fhir.convertors.conv43_50.resources43_50;
002
003import java.util.stream.Collectors;
004
005import org.hl7.fhir.convertors.context.ConversionContext43_50;
006import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50;
007import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Coding43_50;
008import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50;
009import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.ContactDetail43_50;
010import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.UsageContext43_50;
011import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50;
012import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Canonical43_50;
013import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Code43_50;
014import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50;
015import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.MarkDown43_50;
016import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50;
017import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.UnsignedInt43_50;
018import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50;
019import org.hl7.fhir.exceptions.FHIRException;
020
021/*
022  Copyright (c) 2011+, HL7, Inc.
023  All rights reserved.
024  
025  Redistribution and use in source and binary forms, with or without modification, 
026  are permitted provided that the following conditions are met:
027  
028   * Redistributions of source code must retain the above copyright notice, this 
029     list of conditions and the following disclaimer.
030   * Redistributions in binary form must reproduce the above copyright notice, 
031     this list of conditions and the following disclaimer in the documentation 
032     and/or other materials provided with the distribution.
033   * Neither the name of HL7 nor the names of its contributors may be used to 
034     endorse or promote products derived from this software without specific 
035     prior written permission.
036  
037  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
038  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
039  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
040  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
041  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
042  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
043  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
044  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
045  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
046  POSSIBILITY OF SUCH DAMAGE.
047  
048*/
049// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
050public class CodeSystem43_50 {
051
052  public static org.hl7.fhir.r5.model.CodeSystem convertCodeSystem(org.hl7.fhir.r4b.model.CodeSystem src) throws FHIRException {
053    if (src == null)
054      return null;
055    org.hl7.fhir.r5.model.CodeSystem tgt = new org.hl7.fhir.r5.model.CodeSystem();
056    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
057    if (src.hasUrl())
058      tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement()));
059    for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier())
060      tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
061    if (src.hasVersion())
062      tgt.setVersionElement(String43_50.convertString(src.getVersionElement()));
063    if (src.hasName())
064      tgt.setNameElement(String43_50.convertString(src.getNameElement()));
065    if (src.hasTitle())
066      tgt.setTitleElement(String43_50.convertString(src.getTitleElement()));
067    if (src.hasStatus())
068      tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement()));
069    if (src.hasExperimental())
070      tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement()));
071    if (src.hasDate())
072      tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement()));
073    if (src.hasPublisher())
074      tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement()));
075    for (org.hl7.fhir.r4b.model.ContactDetail t : src.getContact())
076      tgt.addContact(ContactDetail43_50.convertContactDetail(t));
077    if (src.hasDescription())
078      tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement()));
079    for (org.hl7.fhir.r4b.model.UsageContext t : src.getUseContext())
080      tgt.addUseContext(UsageContext43_50.convertUsageContext(t));
081    for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getJurisdiction())
082      tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t));
083    if (src.hasPurpose())
084      tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement()));
085    if (src.hasCopyright())
086      tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement()));
087    if (src.hasCaseSensitive())
088      tgt.setCaseSensitiveElement(Boolean43_50.convertBoolean(src.getCaseSensitiveElement()));
089    if (src.hasValueSet())
090      tgt.setValueSetElement(Canonical43_50.convertCanonical(src.getValueSetElement()));
091    if (src.hasHierarchyMeaning())
092      tgt.setHierarchyMeaningElement(convertCodeSystemHierarchyMeaning(src.getHierarchyMeaningElement()));
093    if (src.hasCompositional())
094      tgt.setCompositionalElement(Boolean43_50.convertBoolean(src.getCompositionalElement()));
095    if (src.hasVersionNeeded())
096      tgt.setVersionNeededElement(Boolean43_50.convertBoolean(src.getVersionNeededElement()));
097    if (src.hasContent())
098      tgt.setContentElement(convertCodeSystemContentMode(src.getContentElement()));
099    if (src.hasSupplements())
100      tgt.setSupplementsElement(Canonical43_50.convertCanonical(src.getSupplementsElement()));
101    if (src.hasCount())
102      tgt.setCountElement(UnsignedInt43_50.convertUnsignedInt(src.getCountElement()));
103    for (org.hl7.fhir.r4b.model.CodeSystem.CodeSystemFilterComponent t : src.getFilter())
104      tgt.addFilter(convertCodeSystemFilterComponent(t));
105    for (org.hl7.fhir.r4b.model.CodeSystem.PropertyComponent t : src.getProperty())
106      tgt.addProperty(convertPropertyComponent(t));
107    for (org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept())
108      tgt.addConcept(convertConceptDefinitionComponent(t));
109    return tgt;
110  }
111
112  public static org.hl7.fhir.r4b.model.CodeSystem convertCodeSystem(org.hl7.fhir.r5.model.CodeSystem src) throws FHIRException {
113    if (src == null)
114      return null;
115    org.hl7.fhir.r4b.model.CodeSystem tgt = new org.hl7.fhir.r4b.model.CodeSystem();
116    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
117    if (src.hasUrl())
118      tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement()));
119    for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
120      tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
121    if (src.hasVersion())
122      tgt.setVersionElement(String43_50.convertString(src.getVersionElement()));
123    if (src.hasName())
124      tgt.setNameElement(String43_50.convertString(src.getNameElement()));
125    if (src.hasTitle())
126      tgt.setTitleElement(String43_50.convertString(src.getTitleElement()));
127    if (src.hasStatus())
128      tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement()));
129    if (src.hasExperimental())
130      tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement()));
131    if (src.hasDate())
132      tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement()));
133    if (src.hasPublisher())
134      tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement()));
135    for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact())
136      tgt.addContact(ContactDetail43_50.convertContactDetail(t));
137    if (src.hasDescription())
138      tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement()));
139    for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext())
140      tgt.addUseContext(UsageContext43_50.convertUsageContext(t));
141    for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction())
142      tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t));
143    if (src.hasPurpose())
144      tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement()));
145    if (src.hasCopyright())
146      tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement()));
147    if (src.hasCaseSensitive())
148      tgt.setCaseSensitiveElement(Boolean43_50.convertBoolean(src.getCaseSensitiveElement()));
149    if (src.hasValueSet())
150      tgt.setValueSetElement(Canonical43_50.convertCanonical(src.getValueSetElement()));
151    if (src.hasHierarchyMeaning())
152      tgt.setHierarchyMeaningElement(convertCodeSystemHierarchyMeaning(src.getHierarchyMeaningElement()));
153    if (src.hasCompositional())
154      tgt.setCompositionalElement(Boolean43_50.convertBoolean(src.getCompositionalElement()));
155    if (src.hasVersionNeeded())
156      tgt.setVersionNeededElement(Boolean43_50.convertBoolean(src.getVersionNeededElement()));
157    if (src.hasContent())
158      tgt.setContentElement(convertCodeSystemContentMode(src.getContentElement()));
159    if (src.hasSupplements())
160      tgt.setSupplementsElement(Canonical43_50.convertCanonical(src.getSupplementsElement()));
161    if (src.hasCount())
162      tgt.setCountElement(UnsignedInt43_50.convertUnsignedInt(src.getCountElement()));
163    for (org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent t : src.getFilter())
164      tgt.addFilter(convertCodeSystemFilterComponent(t));
165    for (org.hl7.fhir.r5.model.CodeSystem.PropertyComponent t : src.getProperty())
166      tgt.addProperty(convertPropertyComponent(t));
167    for (org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept())
168      tgt.addConcept(convertConceptDefinitionComponent(t));
169    return tgt;
170  }
171
172  static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning> convertCodeSystemHierarchyMeaning(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CodeSystem.CodeSystemHierarchyMeaning> src) throws FHIRException {
173    if (src == null || src.isEmpty())
174      return null;
175    org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaningEnumFactory());
176    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
177    switch (src.getValue()) {
178      case GROUPEDBY:
179        tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.GROUPEDBY);
180        break;
181      case ISA:
182        tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.ISA);
183        break;
184      case PARTOF:
185        tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.PARTOF);
186        break;
187      case CLASSIFIEDWITH:
188        tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.CLASSIFIEDWITH);
189        break;
190      default:
191        tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.NULL);
192        break;
193    }
194    return tgt;
195  }
196
197  static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CodeSystem.CodeSystemHierarchyMeaning> convertCodeSystemHierarchyMeaning(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning> src) throws FHIRException {
198    if (src == null || src.isEmpty())
199      return null;
200    org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CodeSystem.CodeSystemHierarchyMeaning> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CodeSystem.CodeSystemHierarchyMeaningEnumFactory());
201    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
202    switch (src.getValue()) {
203      case GROUPEDBY:
204        tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemHierarchyMeaning.GROUPEDBY);
205        break;
206      case ISA:
207        tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemHierarchyMeaning.ISA);
208        break;
209      case PARTOF:
210        tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemHierarchyMeaning.PARTOF);
211        break;
212      case CLASSIFIEDWITH:
213        tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemHierarchyMeaning.CLASSIFIEDWITH);
214        break;
215      default:
216        tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemHierarchyMeaning.NULL);
217        break;
218    }
219    return tgt;
220  }
221
222  static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.CodeSystemContentMode> convertCodeSystemContentMode(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CodeSystem.CodeSystemContentMode> src) throws FHIRException {
223    if (src == null || src.isEmpty())
224      return null;
225    org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.CodeSystemContentMode> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.CodeSystemContentModeEnumFactory());
226    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
227    switch (src.getValue()) {
228      case NOTPRESENT:
229        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CodeSystemContentMode.NOTPRESENT);
230        break;
231      case EXAMPLE:
232        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CodeSystemContentMode.EXAMPLE);
233        break;
234      case FRAGMENT:
235        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CodeSystemContentMode.FRAGMENT);
236        break;
237      case COMPLETE:
238        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CodeSystemContentMode.COMPLETE);
239        break;
240      case SUPPLEMENT:
241        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CodeSystemContentMode.SUPPLEMENT);
242        break;
243      default:
244        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CodeSystemContentMode.NULL);
245        break;
246    }
247    return tgt;
248  }
249
250  static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CodeSystem.CodeSystemContentMode> convertCodeSystemContentMode(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.CodeSystemContentMode> src) throws FHIRException {
251    if (src == null || src.isEmpty())
252      return null;
253    org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CodeSystem.CodeSystemContentMode> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CodeSystem.CodeSystemContentModeEnumFactory());
254    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
255    switch (src.getValue()) {
256      case NOTPRESENT:
257        tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemContentMode.NOTPRESENT);
258        break;
259      case EXAMPLE:
260        tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemContentMode.EXAMPLE);
261        break;
262      case FRAGMENT:
263        tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemContentMode.FRAGMENT);
264        break;
265      case COMPLETE:
266        tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemContentMode.COMPLETE);
267        break;
268      case SUPPLEMENT:
269        tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemContentMode.SUPPLEMENT);
270        break;
271      default:
272        tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemContentMode.NULL);
273        break;
274    }
275    return tgt;
276  }
277
278  public static org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent convertCodeSystemFilterComponent(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemFilterComponent src) throws FHIRException {
279    if (src == null)
280      return null;
281    org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent tgt = new org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent();
282    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
283    if (src.hasCode())
284      tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement()));
285    if (src.hasDescription())
286      tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
287    tgt.setOperator(src.getOperator().stream()
288      .map(CodeSystem43_50::convertFilterOperator)
289      .collect(Collectors.toList()));
290    if (src.hasValue())
291      tgt.setValueElement(String43_50.convertString(src.getValueElement()));
292    return tgt;
293  }
294
295  public static org.hl7.fhir.r4b.model.CodeSystem.CodeSystemFilterComponent convertCodeSystemFilterComponent(org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent src) throws FHIRException {
296    if (src == null)
297      return null;
298    org.hl7.fhir.r4b.model.CodeSystem.CodeSystemFilterComponent tgt = new org.hl7.fhir.r4b.model.CodeSystem.CodeSystemFilterComponent();
299    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
300    if (src.hasCode())
301      tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement()));
302    if (src.hasDescription())
303      tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
304    tgt.setOperator(src.getOperator().stream()
305      .map(CodeSystem43_50::convertFilterOperator)
306      .collect(Collectors.toList()));
307    if (src.hasValue())
308      tgt.setValueElement(String43_50.convertString(src.getValueElement()));
309    return tgt;
310  }
311
312  static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.FilterOperator> convertFilterOperator(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.FilterOperator> src) throws FHIRException {
313    if (src == null || src.isEmpty())
314      return null;
315    org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.FilterOperator> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.FilterOperatorEnumFactory());
316    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
317    switch (src.getValue()) {
318      case EQUAL:
319        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.EQUAL);
320        break;
321      case ISA:
322        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.ISA);
323        break;
324      case DESCENDENTOF:
325        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.DESCENDENTOF);
326        break;
327      case ISNOTA:
328        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.ISNOTA);
329        break;
330      case REGEX:
331        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.REGEX);
332        break;
333      case IN:
334        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.IN);
335        break;
336      case NOTIN:
337        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.NOTIN);
338        break;
339      case GENERALIZES:
340        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.GENERALIZES);
341        break;
342      case EXISTS:
343        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.EXISTS);
344        break;
345      default:
346        tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.NULL);
347        break;
348    }
349    return tgt;
350  }
351
352  static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.FilterOperator> convertFilterOperator(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.FilterOperator> src) throws FHIRException {
353    if (src == null || src.isEmpty())
354      return null;
355    org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.FilterOperator> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.FilterOperatorEnumFactory());
356    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
357    switch (src.getValue()) {
358      case EQUAL:
359        tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.EQUAL);
360        break;
361      case ISA:
362        tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.ISA);
363        break;
364      case DESCENDENTOF:
365        tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.DESCENDENTOF);
366        break;
367      case ISNOTA:
368        tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.ISNOTA);
369        break;
370      case REGEX:
371        tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.REGEX);
372        break;
373      case IN:
374        tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.IN);
375        break;
376      case NOTIN:
377        tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.NOTIN);
378        break;
379      case GENERALIZES:
380        tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.GENERALIZES);
381        break;
382      case EXISTS:
383        tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.EXISTS);
384        break;
385      default:
386        tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.NULL);
387        break;
388    }
389    return tgt;
390  }
391
392  public static org.hl7.fhir.r5.model.CodeSystem.PropertyComponent convertPropertyComponent(org.hl7.fhir.r4b.model.CodeSystem.PropertyComponent src) throws FHIRException {
393    if (src == null)
394      return null;
395    org.hl7.fhir.r5.model.CodeSystem.PropertyComponent tgt = new org.hl7.fhir.r5.model.CodeSystem.PropertyComponent();
396    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
397    if (src.hasCode())
398      tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement()));
399    if (src.hasUri())
400      tgt.setUriElement(Uri43_50.convertUri(src.getUriElement()));
401    if (src.hasDescription())
402      tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
403    if (src.hasType())
404      tgt.setTypeElement(convertPropertyType(src.getTypeElement()));
405    return tgt;
406  }
407
408  public static org.hl7.fhir.r4b.model.CodeSystem.PropertyComponent convertPropertyComponent(org.hl7.fhir.r5.model.CodeSystem.PropertyComponent src) throws FHIRException {
409    if (src == null)
410      return null;
411    org.hl7.fhir.r4b.model.CodeSystem.PropertyComponent tgt = new org.hl7.fhir.r4b.model.CodeSystem.PropertyComponent();
412    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
413    if (src.hasCode())
414      tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement()));
415    if (src.hasUri())
416      tgt.setUriElement(Uri43_50.convertUri(src.getUriElement()));
417    if (src.hasDescription())
418      tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
419    if (src.hasType())
420      tgt.setTypeElement(convertPropertyType(src.getTypeElement()));
421    return tgt;
422  }
423
424  static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CodeSystem.PropertyType> convertPropertyType(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CodeSystem.PropertyType> src) throws FHIRException {
425    if (src == null || src.isEmpty())
426      return null;
427    org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CodeSystem.PropertyType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CodeSystem.PropertyTypeEnumFactory());
428    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
429    switch (src.getValue()) {
430      case CODE:
431        tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.CODE);
432        break;
433      case CODING:
434        tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.CODING);
435        break;
436      case STRING:
437        tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.STRING);
438        break;
439      case INTEGER:
440        tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.INTEGER);
441        break;
442      case BOOLEAN:
443        tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.BOOLEAN);
444        break;
445      case DATETIME:
446        tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.DATETIME);
447        break;
448      case DECIMAL:
449        tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.DECIMAL);
450        break;
451      default:
452        tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.NULL);
453        break;
454    }
455    return tgt;
456  }
457
458  static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CodeSystem.PropertyType> convertPropertyType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CodeSystem.PropertyType> src) throws FHIRException {
459    if (src == null || src.isEmpty())
460      return null;
461    org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CodeSystem.PropertyType> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CodeSystem.PropertyTypeEnumFactory());
462    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
463    switch (src.getValue()) {
464      case CODE:
465        tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.PropertyType.CODE);
466        break;
467      case CODING:
468        tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.PropertyType.CODING);
469        break;
470      case STRING:
471        tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.PropertyType.STRING);
472        break;
473      case INTEGER:
474        tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.PropertyType.INTEGER);
475        break;
476      case BOOLEAN:
477        tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.PropertyType.BOOLEAN);
478        break;
479      case DATETIME:
480        tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.PropertyType.DATETIME);
481        break;
482      case DECIMAL:
483        tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.PropertyType.DECIMAL);
484        break;
485      default:
486        tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.PropertyType.NULL);
487        break;
488    }
489    return tgt;
490  }
491
492  public static org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent convertConceptDefinitionComponent(org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionComponent src) throws FHIRException {
493    if (src == null)
494      return null;
495    org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent tgt = new org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent();
496    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
497    if (src.hasCode())
498      tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement()));
499    if (src.hasDisplay())
500      tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement()));
501    if (src.hasDefinition())
502      tgt.setDefinitionElement(String43_50.convertString(src.getDefinitionElement()));
503    for (org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation())
504      tgt.addDesignation(convertConceptDefinitionDesignationComponent(t));
505    for (org.hl7.fhir.r4b.model.CodeSystem.ConceptPropertyComponent t : src.getProperty())
506      tgt.addProperty(convertConceptPropertyComponent(t));
507    for (org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept())
508      tgt.addConcept(convertConceptDefinitionComponent(t));
509    return tgt;
510  }
511
512  public static org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionComponent convertConceptDefinitionComponent(org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent src) throws FHIRException {
513    if (src == null)
514      return null;
515    org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionComponent tgt = new org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionComponent();
516    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
517    if (src.hasCode())
518      tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement()));
519    if (src.hasDisplay())
520      tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement()));
521    if (src.hasDefinition())
522      tgt.setDefinitionElement(String43_50.convertString(src.getDefinitionElement()));
523    for (org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation())
524      tgt.addDesignation(convertConceptDefinitionDesignationComponent(t));
525    for (org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent t : src.getProperty())
526      tgt.addProperty(convertConceptPropertyComponent(t));
527    for (org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept())
528      tgt.addConcept(convertConceptDefinitionComponent(t));
529    return tgt;
530  }
531
532  public static org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent convertConceptDefinitionDesignationComponent(org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionDesignationComponent src) throws FHIRException {
533    if (src == null)
534      return null;
535    org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent tgt = new org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent();
536    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
537    if (src.hasLanguage())
538      tgt.setLanguageElement(Code43_50.convertCode(src.getLanguageElement()));
539    if (src.hasUse())
540      tgt.setUse(Coding43_50.convertCoding(src.getUse()));
541    if (src.hasValue())
542      tgt.setValueElement(String43_50.convertString(src.getValueElement()));
543    return tgt;
544  }
545
546  public static org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionDesignationComponent convertConceptDefinitionDesignationComponent(org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent src) throws FHIRException {
547    if (src == null)
548      return null;
549    org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionDesignationComponent tgt = new org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionDesignationComponent();
550    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
551    if (src.hasLanguage())
552      tgt.setLanguageElement(Code43_50.convertCode(src.getLanguageElement()));
553    if (src.hasUse())
554      tgt.setUse(Coding43_50.convertCoding(src.getUse()));
555    if (src.hasValue())
556      tgt.setValueElement(String43_50.convertString(src.getValueElement()));
557    return tgt;
558  }
559
560  public static org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent convertConceptPropertyComponent(org.hl7.fhir.r4b.model.CodeSystem.ConceptPropertyComponent src) throws FHIRException {
561    if (src == null)
562      return null;
563    org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent tgt = new org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent();
564    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
565    if (src.hasCode())
566      tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement()));
567    if (src.hasValue())
568      tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue()));
569    return tgt;
570  }
571
572  public static org.hl7.fhir.r4b.model.CodeSystem.ConceptPropertyComponent convertConceptPropertyComponent(org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent src) throws FHIRException {
573    if (src == null)
574      return null;
575    org.hl7.fhir.r4b.model.CodeSystem.ConceptPropertyComponent tgt = new org.hl7.fhir.r4b.model.CodeSystem.ConceptPropertyComponent();
576    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
577    if (src.hasCode())
578      tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement()));
579    if (src.hasValue())
580      tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue()));
581    return tgt;
582  }
583}