001package org.hl7.fhir.convertors.conv30_50.resources30_50;
002
003import org.hl7.fhir.convertors.context.ConversionContext30_50;
004import org.hl7.fhir.convertors.conv30_50.datatypes30_50.ContactDetail30_50;
005import org.hl7.fhir.convertors.conv30_50.datatypes30_50.UsageContext30_50;
006import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.CodeableConcept30_50;
007import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.Coding30_50;
008import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.Identifier30_50;
009import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Boolean30_50;
010import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Code30_50;
011import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Date30_50;
012import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.DateTime30_50;
013import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Integer30_50;
014import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.MarkDown30_50;
015import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50;
016import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Uri30_50;
017import org.hl7.fhir.exceptions.FHIRException;
018import org.hl7.fhir.r5.model.BooleanType;
019
020public class ValueSet30_50 {
021
022  public static final String EXTENSIBLE_EXTENSION_URL = "http://hl7.org/fhir/StructureDefinition/valueset-extensible";
023
024  private static final String[] IGNORED_EXTENSION_URLS = new String[]{
025    EXTENSIBLE_EXTENSION_URL
026  };
027  public static org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceComponent convertConceptReferenceComponent(org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent src) throws FHIRException {
028    if (src == null)
029      return null;
030    org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceComponent tgt = new org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceComponent();
031    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
032    if (src.hasCode())
033      tgt.setCodeElement(Code30_50.convertCode(src.getCodeElement()));
034    if (src.hasDisplay())
035      tgt.setDisplayElement(String30_50.convertString(src.getDisplayElement()));
036    for (org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation())
037      tgt.addDesignation(convertConceptReferenceDesignationComponent(t));
038    return tgt;
039  }
040
041  public static org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent convertConceptReferenceComponent(org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceComponent src) throws FHIRException {
042    if (src == null)
043      return null;
044    org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent();
045    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
046    if (src.hasCode())
047      tgt.setCodeElement(Code30_50.convertCode(src.getCodeElement()));
048    if (src.hasDisplay())
049      tgt.setDisplayElement(String30_50.convertString(src.getDisplayElement()));
050    for (org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation())
051      tgt.addDesignation(convertConceptReferenceDesignationComponent(t));
052    return tgt;
053  }
054
055  public static org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent convertConceptReferenceDesignationComponent(org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceDesignationComponent src) throws FHIRException {
056    if (src == null)
057      return null;
058    org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent();
059    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
060    if (src.hasLanguage())
061      tgt.setLanguageElement(Code30_50.convertCode(src.getLanguageElement()));
062    if (src.hasUse())
063      tgt.setUse(Coding30_50.convertCoding(src.getUse()));
064    if (src.hasValue())
065      tgt.setValueElement(String30_50.convertString(src.getValueElement()));
066    return tgt;
067  }
068
069  public static org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceDesignationComponent convertConceptReferenceDesignationComponent(org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent src) throws FHIRException {
070    if (src == null)
071      return null;
072    org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceDesignationComponent tgt = new org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceDesignationComponent();
073    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
074    if (src.hasLanguage())
075      tgt.setLanguageElement(Code30_50.convertCode(src.getLanguageElement()));
076    if (src.hasUse())
077      tgt.setUse(Coding30_50.convertCoding(src.getUse()));
078    if (src.hasValue())
079      tgt.setValueElement(String30_50.convertString(src.getValueElement()));
080    return tgt;
081  }
082
083  public static org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent convertConceptSetComponent(org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent src) throws FHIRException {
084    if (src == null)
085      return null;
086    org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent();
087    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
088    if (src.hasSystem())
089      tgt.setSystemElement(Uri30_50.convertUri(src.getSystemElement()));
090    if (src.hasVersion())
091      tgt.setVersionElement(String30_50.convertString(src.getVersionElement()));
092    for (org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceComponent t : src.getConcept())
093      tgt.addConcept(convertConceptReferenceComponent(t));
094    for (org.hl7.fhir.dstu3.model.ValueSet.ConceptSetFilterComponent t : src.getFilter())
095      tgt.addFilter(convertConceptSetFilterComponent(t));
096    for (org.hl7.fhir.dstu3.model.UriType t : src.getValueSet()) tgt.addValueSet(t.getValue());
097    return tgt;
098  }
099
100  public static org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent convertConceptSetComponent(org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent src) throws FHIRException {
101    if (src == null)
102      return null;
103    org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent tgt = new org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent();
104    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
105    if (src.hasSystem())
106      tgt.setSystemElement(Uri30_50.convertUri(src.getSystemElement()));
107    if (src.hasVersion())
108      tgt.setVersionElement(String30_50.convertString(src.getVersionElement()));
109    for (org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent t : src.getConcept())
110      tgt.addConcept(convertConceptReferenceComponent(t));
111    for (org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent t : src.getFilter())
112      tgt.addFilter(convertConceptSetFilterComponent(t));
113    for (org.hl7.fhir.r5.model.UriType t : src.getValueSet()) tgt.addValueSet(t.getValue());
114    return tgt;
115  }
116
117  public static org.hl7.fhir.dstu3.model.ValueSet.ConceptSetFilterComponent convertConceptSetFilterComponent(org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent src) throws FHIRException {
118    if (src == null)
119      return null;
120    org.hl7.fhir.dstu3.model.ValueSet.ConceptSetFilterComponent tgt = new org.hl7.fhir.dstu3.model.ValueSet.ConceptSetFilterComponent();
121    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
122    if (src.hasProperty())
123      tgt.setPropertyElement(Code30_50.convertCode(src.getPropertyElement()));
124    if (src.hasOp())
125      tgt.setOpElement(convertFilterOperator2(src.getOpElement()));
126    if (src.hasValue())
127      tgt.setValue(src.getValue());
128    return tgt;
129  }
130
131  public static org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent convertConceptSetFilterComponent(org.hl7.fhir.dstu3.model.ValueSet.ConceptSetFilterComponent src) throws FHIRException {
132    if (src == null)
133      return null;
134    org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent();
135    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
136    if (src.hasProperty())
137      tgt.setPropertyElement(Code30_50.convertCode(src.getPropertyElement()));
138    if (src.hasOp())
139      tgt.setOpElement(Enumerations30_50.convertFilterOperator(src.getOpElement()));
140    if (src.hasValue())
141      tgt.setValue(src.getValue());
142    return tgt;
143  }
144
145  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ValueSet.FilterOperator> convertFilterOperator2(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.FilterOperator> src) throws FHIRException {
146    if (src == null || src.isEmpty())
147      return null;
148    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ValueSet.FilterOperator> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ValueSet.FilterOperatorEnumFactory());
149    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
150    switch (src.getValue()) {
151      case EQUAL:
152        tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.EQUAL);
153        break;
154      case ISA:
155        tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.ISA);
156        break;
157      case DESCENDENTOF:
158        tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.DESCENDENTOF);
159        break;
160      case ISNOTA:
161        tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.ISNOTA);
162        break;
163      case REGEX:
164        tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.REGEX);
165        break;
166      case IN:
167        tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.IN);
168        break;
169      case NOTIN:
170        tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.NOTIN);
171        break;
172      case GENERALIZES:
173        tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.GENERALIZES);
174        break;
175      case EXISTS:
176        tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.EXISTS);
177        break;
178      default:
179        tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.NULL);
180        break;
181    }
182    return tgt;
183  }
184
185  public static org.hl7.fhir.r5.model.ValueSet convertValueSet(org.hl7.fhir.dstu3.model.ValueSet src) throws FHIRException {
186    if (src == null)
187      return null;
188    org.hl7.fhir.r5.model.ValueSet tgt = new org.hl7.fhir.r5.model.ValueSet();
189    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyDomainResource(src, tgt);
190    if (src.hasUrl())
191      tgt.setUrlElement(Uri30_50.convertUri(src.getUrlElement()));
192    for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())
193      tgt.addIdentifier(Identifier30_50.convertIdentifier(t));
194    if (src.hasVersion())
195      tgt.setVersionElement(String30_50.convertString(src.getVersionElement()));
196    if (src.hasName())
197      tgt.setNameElement(String30_50.convertString(src.getNameElement()));
198    if (src.hasTitle())
199      tgt.setTitleElement(String30_50.convertString(src.getTitleElement()));
200    if (src.hasStatus())
201      tgt.setStatusElement(Enumerations30_50.convertPublicationStatus(src.getStatusElement()));
202    if (src.hasExperimental())
203      tgt.setExperimentalElement(Boolean30_50.convertBoolean(src.getExperimentalElement()));
204    if (src.hasDate())
205      tgt.setDateElement(DateTime30_50.convertDateTime(src.getDateElement()));
206    if (src.hasPublisher())
207      tgt.setPublisherElement(String30_50.convertString(src.getPublisherElement()));
208    for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact())
209      tgt.addContact(ContactDetail30_50.convertContactDetail(t));
210    if (src.hasDescription())
211      tgt.setDescriptionElement(MarkDown30_50.convertMarkdown(src.getDescriptionElement()));
212    for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext())
213      tgt.addUseContext(UsageContext30_50.convertUsageContext(t));
214    for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction())
215      tgt.addJurisdiction(CodeableConcept30_50.convertCodeableConcept(t));
216    if (src.hasImmutable())
217      tgt.setImmutableElement(Boolean30_50.convertBoolean(src.getImmutableElement()));
218    if (src.hasPurpose())
219      tgt.setPurposeElement(MarkDown30_50.convertMarkdown(src.getPurposeElement()));
220    if (src.hasCopyright())
221      tgt.setCopyrightElement(MarkDown30_50.convertMarkdown(src.getCopyrightElement()));
222    if (src.hasExtensible())
223      tgt.addExtension(EXTENSIBLE_EXTENSION_URL, new BooleanType(src.getExtensible()));
224    if (src.hasCompose())
225      tgt.setCompose(convertValueSetComposeComponent(src.getCompose()));
226    if (src.hasExpansion())
227      tgt.setExpansion(convertValueSetExpansionComponent(src.getExpansion()));
228    return tgt;
229  }
230
231  public static org.hl7.fhir.dstu3.model.ValueSet convertValueSet(org.hl7.fhir.r5.model.ValueSet src) throws FHIRException {
232    if (src == null)
233      return null;
234    org.hl7.fhir.dstu3.model.ValueSet tgt = new org.hl7.fhir.dstu3.model.ValueSet();
235    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyDomainResource(src, tgt, IGNORED_EXTENSION_URLS);
236    if (src.hasUrl())
237      tgt.setUrlElement(Uri30_50.convertUri(src.getUrlElement()));
238    for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
239      tgt.addIdentifier(Identifier30_50.convertIdentifier(t));
240    if (src.hasVersion())
241      tgt.setVersionElement(String30_50.convertString(src.getVersionElement()));
242    if (src.hasName())
243      tgt.setNameElement(String30_50.convertString(src.getNameElement()));
244    if (src.hasTitle())
245      tgt.setTitleElement(String30_50.convertString(src.getTitleElement()));
246    if (src.hasStatus())
247      tgt.setStatusElement(Enumerations30_50.convertPublicationStatus(src.getStatusElement()));
248    if (src.hasExperimental())
249      tgt.setExperimentalElement(Boolean30_50.convertBoolean(src.getExperimentalElement()));
250    if (src.hasDate())
251      tgt.setDateElement(DateTime30_50.convertDateTime(src.getDateElement()));
252    if (src.hasPublisher())
253      tgt.setPublisherElement(String30_50.convertString(src.getPublisherElement()));
254    for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact())
255      tgt.addContact(ContactDetail30_50.convertContactDetail(t));
256    if (src.hasDescription())
257      tgt.setDescriptionElement(MarkDown30_50.convertMarkdown(src.getDescriptionElement()));
258    for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext())
259      tgt.addUseContext(UsageContext30_50.convertUsageContext(t));
260    for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction())
261      tgt.addJurisdiction(CodeableConcept30_50.convertCodeableConcept(t));
262    if (src.hasImmutable())
263      tgt.setImmutableElement(Boolean30_50.convertBoolean(src.getImmutableElement()));
264    if (src.hasPurpose())
265      tgt.setPurposeElement(MarkDown30_50.convertMarkdown(src.getPurposeElement()));
266    if (src.hasCopyright())
267      tgt.setCopyrightElement(MarkDown30_50.convertMarkdown(src.getCopyrightElement()));
268    if (src.hasExtension(EXTENSIBLE_EXTENSION_URL))
269      tgt.setExtensible(((BooleanType) src.getExtensionByUrl(EXTENSIBLE_EXTENSION_URL).getValue()).booleanValue());
270    if (src.hasCompose())
271      tgt.setCompose(convertValueSetComposeComponent(src.getCompose()));
272    if (src.hasExpansion())
273      tgt.setExpansion(convertValueSetExpansionComponent(src.getExpansion()));
274    return tgt;
275  }
276
277  public static org.hl7.fhir.r5.model.ValueSet.ValueSetComposeComponent convertValueSetComposeComponent(org.hl7.fhir.dstu3.model.ValueSet.ValueSetComposeComponent src) throws FHIRException {
278    if (src == null)
279      return null;
280    org.hl7.fhir.r5.model.ValueSet.ValueSetComposeComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ValueSetComposeComponent();
281    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
282    if (src.hasLockedDate())
283      tgt.setLockedDateElement(Date30_50.convertDate(src.getLockedDateElement()));
284    if (src.hasInactive())
285      tgt.setInactiveElement(Boolean30_50.convertBoolean(src.getInactiveElement()));
286    for (org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent t : src.getInclude())
287      tgt.addInclude(convertConceptSetComponent(t));
288    for (org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent t : src.getExclude())
289      tgt.addExclude(convertConceptSetComponent(t));
290    return tgt;
291  }
292
293  public static org.hl7.fhir.dstu3.model.ValueSet.ValueSetComposeComponent convertValueSetComposeComponent(org.hl7.fhir.r5.model.ValueSet.ValueSetComposeComponent src) throws FHIRException {
294    if (src == null)
295      return null;
296    org.hl7.fhir.dstu3.model.ValueSet.ValueSetComposeComponent tgt = new org.hl7.fhir.dstu3.model.ValueSet.ValueSetComposeComponent();
297    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
298    if (src.hasLockedDate())
299      tgt.setLockedDateElement(Date30_50.convertDate(src.getLockedDateElement()));
300    if (src.hasInactive())
301      tgt.setInactiveElement(Boolean30_50.convertBoolean(src.getInactiveElement()));
302    for (org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent t : src.getInclude())
303      tgt.addInclude(convertConceptSetComponent(t));
304    for (org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent t : src.getExclude())
305      tgt.addExclude(convertConceptSetComponent(t));
306    return tgt;
307  }
308
309  public static org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionComponent convertValueSetExpansionComponent(org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionComponent src) throws FHIRException {
310    if (src == null)
311      return null;
312    org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionComponent();
313    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
314    if (src.hasIdentifier())
315      tgt.setIdentifierElement(Uri30_50.convertUri(src.getIdentifierElement()));
316    if (src.hasTimestamp())
317      tgt.setTimestampElement(DateTime30_50.convertDateTime(src.getTimestampElement()));
318    if (src.hasTotal())
319      tgt.setTotalElement(Integer30_50.convertInteger(src.getTotalElement()));
320    if (src.hasOffset())
321      tgt.setOffsetElement(Integer30_50.convertInteger(src.getOffsetElement()));
322    for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter())
323      tgt.addParameter(convertValueSetExpansionParameterComponent(t));
324    for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains())
325      tgt.addContains(convertValueSetExpansionContainsComponent(t));
326    return tgt;
327  }
328
329  public static org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionComponent convertValueSetExpansionComponent(org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionComponent src) throws FHIRException {
330    if (src == null)
331      return null;
332    org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionComponent tgt = new org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionComponent();
333    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
334    if (src.hasIdentifier())
335      tgt.setIdentifierElement(Uri30_50.convertUri(src.getIdentifierElement()));
336    if (src.hasTimestamp())
337      tgt.setTimestampElement(DateTime30_50.convertDateTime(src.getTimestampElement()));
338    if (src.hasTotal())
339      tgt.setTotalElement(Integer30_50.convertInteger(src.getTotalElement()));
340    if (src.hasOffset())
341      tgt.setOffsetElement(Integer30_50.convertInteger(src.getOffsetElement()));
342    for (org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter())
343      tgt.addParameter(convertValueSetExpansionParameterComponent(t));
344    for (org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains())
345      tgt.addContains(convertValueSetExpansionContainsComponent(t));
346    return tgt;
347  }
348
349  public static org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent convertValueSetExpansionContainsComponent(org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent src) throws FHIRException {
350    if (src == null)
351      return null;
352    org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent();
353    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
354    if (src.hasSystem())
355      tgt.setSystemElement(Uri30_50.convertUri(src.getSystemElement()));
356    if (src.hasAbstract())
357      tgt.setAbstractElement(Boolean30_50.convertBoolean(src.getAbstractElement()));
358    if (src.hasInactive())
359      tgt.setInactiveElement(Boolean30_50.convertBoolean(src.getInactiveElement()));
360    if (src.hasVersion())
361      tgt.setVersionElement(String30_50.convertString(src.getVersionElement()));
362    if (src.hasCode())
363      tgt.setCodeElement(Code30_50.convertCode(src.getCodeElement()));
364    if (src.hasDisplay())
365      tgt.setDisplayElement(String30_50.convertString(src.getDisplayElement()));
366    for (org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation())
367      tgt.addDesignation(convertConceptReferenceDesignationComponent(t));
368    for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains())
369      tgt.addContains(convertValueSetExpansionContainsComponent(t));
370    return tgt;
371  }
372
373  public static org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent convertValueSetExpansionContainsComponent(org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent src) throws FHIRException {
374    if (src == null)
375      return null;
376    org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent tgt = new org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent();
377    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
378    if (src.hasSystem())
379      tgt.setSystemElement(Uri30_50.convertUri(src.getSystemElement()));
380    if (src.hasAbstract())
381      tgt.setAbstractElement(Boolean30_50.convertBoolean(src.getAbstractElement()));
382    if (src.hasInactive())
383      tgt.setInactiveElement(Boolean30_50.convertBoolean(src.getInactiveElement()));
384    if (src.hasVersion())
385      tgt.setVersionElement(String30_50.convertString(src.getVersionElement()));
386    if (src.hasCode())
387      tgt.setCodeElement(Code30_50.convertCode(src.getCodeElement()));
388    if (src.hasDisplay())
389      tgt.setDisplayElement(String30_50.convertString(src.getDisplayElement()));
390    for (org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation())
391      tgt.addDesignation(convertConceptReferenceDesignationComponent(t));
392    for (org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains())
393      tgt.addContains(convertValueSetExpansionContainsComponent(t));
394    return tgt;
395  }
396
397  public static org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionParameterComponent convertValueSetExpansionParameterComponent(org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent src) throws FHIRException {
398    if (src == null)
399      return null;
400    org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionParameterComponent tgt = new org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionParameterComponent();
401    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
402    if (src.hasName())
403      tgt.setNameElement(String30_50.convertString(src.getNameElement()));
404    if (src.hasValue())
405      tgt.setValue(ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().convertType(src.getValue()));
406    return tgt;
407  }
408
409  public static org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent convertValueSetExpansionParameterComponent(org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionParameterComponent src) throws FHIRException {
410    if (src == null)
411      return null;
412    org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent();
413    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
414    if (src.hasName())
415      tgt.setNameElement(String30_50.convertString(src.getNameElement()));
416    if (src.hasValue())
417      tgt.setValue(ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().convertType(src.getValue()));
418    return tgt;
419  }
420}