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