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