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