001package org.hl7.fhir.convertors.conv30_40.resources30_40;
002
003import java.util.stream.Collectors;
004
005import org.hl7.fhir.convertors.context.ConversionContext30_40;
006import org.hl7.fhir.convertors.conv30_40.datatypes30_40.ContactDetail30_40;
007import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.CodeableConcept30_40;
008import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.Identifier30_40;
009import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.Timing30_40;
010import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Boolean30_40;
011import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.DateTime30_40;
012import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Id30_40;
013import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Integer30_40;
014import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.MarkDown30_40;
015import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40;
016import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Uri30_40;
017import org.hl7.fhir.exceptions.FHIRException;
018
019public class StructureMap30_40 {
020
021  public static org.hl7.fhir.dstu3.model.StructureMap convertStructureMap(org.hl7.fhir.r4.model.StructureMap src) throws FHIRException {
022    if (src == null)
023      return null;
024    org.hl7.fhir.dstu3.model.StructureMap tgt = new org.hl7.fhir.dstu3.model.StructureMap();
025    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyDomainResource(src, tgt);
026    if (src.hasUrl())
027      tgt.setUrlElement(Uri30_40.convertUri(src.getUrlElement()));
028    for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
029      tgt.addIdentifier(Identifier30_40.convertIdentifier(t));
030    if (src.hasVersion())
031      tgt.setVersionElement(String30_40.convertString(src.getVersionElement()));
032    if (src.hasName())
033      tgt.setNameElement(String30_40.convertString(src.getNameElement()));
034    if (src.hasTitle())
035      tgt.setTitleElement(String30_40.convertString(src.getTitleElement()));
036    if (src.hasStatus())
037      tgt.setStatusElement(Enumerations30_40.convertPublicationStatus(src.getStatusElement()));
038    if (src.hasExperimental())
039      tgt.setExperimentalElement(Boolean30_40.convertBoolean(src.getExperimentalElement()));
040    if (src.hasDateElement())
041      tgt.setDateElement(DateTime30_40.convertDateTime(src.getDateElement()));
042    if (src.hasPublisher())
043      tgt.setPublisherElement(String30_40.convertString(src.getPublisherElement()));
044    for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact())
045      tgt.addContact(ContactDetail30_40.convertContactDetail(t));
046    if (src.hasDescription())
047      tgt.setDescriptionElement(MarkDown30_40.convertMarkdown(src.getDescriptionElement()));
048    for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext())
049      tgt.addUseContext(Timing30_40.convertUsageContext(t));
050    for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction())
051      tgt.addJurisdiction(CodeableConcept30_40.convertCodeableConcept(t));
052    if (src.hasPurpose())
053      tgt.setPurposeElement(MarkDown30_40.convertMarkdown(src.getPurposeElement()));
054    if (src.hasCopyright())
055      tgt.setCopyrightElement(MarkDown30_40.convertMarkdown(src.getCopyrightElement()));
056    for (org.hl7.fhir.r4.model.StructureMap.StructureMapStructureComponent t : src.getStructure())
057      tgt.addStructure(convertStructureMapStructureComponent(t));
058    for (org.hl7.fhir.r4.model.UriType t : src.getImport()) tgt.addImport(t.getValue());
059    for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupComponent t : src.getGroup())
060      tgt.addGroup(convertStructureMapGroupComponent(t));
061    return tgt;
062  }
063
064  public static org.hl7.fhir.r4.model.StructureMap convertStructureMap(org.hl7.fhir.dstu3.model.StructureMap src) throws FHIRException {
065    if (src == null)
066      return null;
067    org.hl7.fhir.r4.model.StructureMap tgt = new org.hl7.fhir.r4.model.StructureMap();
068    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyDomainResource(src, tgt);
069    if (src.hasUrl())
070      tgt.setUrlElement(Uri30_40.convertUri(src.getUrlElement()));
071    for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())
072      tgt.addIdentifier(Identifier30_40.convertIdentifier(t));
073    if (src.hasVersion())
074      tgt.setVersionElement(String30_40.convertString(src.getVersionElement()));
075    if (src.hasName())
076      tgt.setNameElement(String30_40.convertString(src.getNameElement()));
077    if (src.hasTitle())
078      tgt.setTitleElement(String30_40.convertString(src.getTitleElement()));
079    if (src.hasStatus())
080      tgt.setStatusElement(Enumerations30_40.convertPublicationStatus(src.getStatusElement()));
081    if (src.hasExperimental())
082      tgt.setExperimentalElement(Boolean30_40.convertBoolean(src.getExperimentalElement()));
083    if (src.hasDateElement())
084      tgt.setDateElement(DateTime30_40.convertDateTime(src.getDateElement()));
085    if (src.hasPublisher())
086      tgt.setPublisherElement(String30_40.convertString(src.getPublisherElement()));
087    for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact())
088      tgt.addContact(ContactDetail30_40.convertContactDetail(t));
089    if (src.hasDescription())
090      tgt.setDescriptionElement(MarkDown30_40.convertMarkdown(src.getDescriptionElement()));
091    for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext())
092      tgt.addUseContext(Timing30_40.convertUsageContext(t));
093    for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction())
094      tgt.addJurisdiction(CodeableConcept30_40.convertCodeableConcept(t));
095    if (src.hasPurpose())
096      tgt.setPurposeElement(MarkDown30_40.convertMarkdown(src.getPurposeElement()));
097    if (src.hasCopyright())
098      tgt.setCopyrightElement(MarkDown30_40.convertMarkdown(src.getCopyrightElement()));
099    for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapStructureComponent t : src.getStructure())
100      tgt.addStructure(convertStructureMapStructureComponent(t));
101    for (org.hl7.fhir.dstu3.model.UriType t : src.getImport()) tgt.addImport(t.getValue());
102    for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupComponent t : src.getGroup())
103      tgt.addGroup(convertStructureMapGroupComponent(t));
104    return tgt;
105  }
106
107  static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.StructureMap.StructureMapContextType> convertStructureMapContextType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.StructureMap.StructureMapContextType> src) throws FHIRException {
108    if (src == null || src.isEmpty())
109      return null;
110    org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.StructureMap.StructureMapContextType> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureMap.StructureMapContextTypeEnumFactory());
111    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
112    switch (src.getValue()) {
113      case TYPE:
114        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapContextType.TYPE);
115        break;
116      case VARIABLE:
117        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapContextType.VARIABLE);
118        break;
119      default:
120        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapContextType.NULL);
121        break;
122    }
123    return tgt;
124  }
125
126  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.StructureMap.StructureMapContextType> convertStructureMapContextType(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.StructureMap.StructureMapContextType> src) throws FHIRException {
127    if (src == null || src.isEmpty())
128      return null;
129    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.StructureMap.StructureMapContextType> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureMap.StructureMapContextTypeEnumFactory());
130    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
131    switch (src.getValue()) {
132      case TYPE:
133        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapContextType.TYPE);
134        break;
135      case VARIABLE:
136        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapContextType.VARIABLE);
137        break;
138      default:
139        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapContextType.NULL);
140        break;
141    }
142    return tgt;
143  }
144
145  public static org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupComponent convertStructureMapGroupComponent(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupComponent src) throws FHIRException {
146    if (src == null)
147      return null;
148    org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupComponent tgt = new org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupComponent();
149    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt);
150    if (src.hasName())
151      tgt.setNameElement(Id30_40.convertId(src.getNameElement()));
152    if (src.hasExtends())
153      tgt.setExtendsElement(Id30_40.convertId(src.getExtendsElement()));
154    if (src.hasTypeMode())
155      tgt.setTypeModeElement(convertStructureMapGroupTypeMode(src.getTypeModeElement()));
156    if (src.hasDocumentation())
157      tgt.setDocumentationElement(String30_40.convertString(src.getDocumentationElement()));
158    for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupInputComponent t : src.getInput())
159      tgt.addInput(convertStructureMapGroupInputComponent(t));
160    for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule())
161      tgt.addRule(convertStructureMapGroupRuleComponent(t));
162    return tgt;
163  }
164
165  public static org.hl7.fhir.r4.model.StructureMap.StructureMapGroupComponent convertStructureMapGroupComponent(org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupComponent src) throws FHIRException {
166    if (src == null)
167      return null;
168    org.hl7.fhir.r4.model.StructureMap.StructureMapGroupComponent tgt = new org.hl7.fhir.r4.model.StructureMap.StructureMapGroupComponent();
169    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt);
170    if (src.hasName())
171      tgt.setNameElement(Id30_40.convertId(src.getNameElement()));
172    if (src.hasExtends())
173      tgt.setExtendsElement(Id30_40.convertId(src.getExtendsElement()));
174    if (src.hasTypeMode())
175      tgt.setTypeModeElement(convertStructureMapGroupTypeMode(src.getTypeModeElement()));
176    if (src.hasDocumentation())
177      tgt.setDocumentationElement(String30_40.convertString(src.getDocumentationElement()));
178    for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupInputComponent t : src.getInput())
179      tgt.addInput(convertStructureMapGroupInputComponent(t));
180    for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule())
181      tgt.addRule(convertStructureMapGroupRuleComponent(t));
182    return tgt;
183  }
184
185  public static org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupInputComponent convertStructureMapGroupInputComponent(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupInputComponent src) throws FHIRException {
186    if (src == null)
187      return null;
188    org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupInputComponent tgt = new org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupInputComponent();
189    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt);
190    if (src.hasName())
191      tgt.setNameElement(Id30_40.convertId(src.getNameElement()));
192    if (src.hasType())
193      tgt.setTypeElement(String30_40.convertString(src.getTypeElement()));
194    if (src.hasMode())
195      tgt.setModeElement(convertStructureMapInputMode(src.getModeElement()));
196    if (src.hasDocumentation())
197      tgt.setDocumentationElement(String30_40.convertString(src.getDocumentationElement()));
198    return tgt;
199  }
200
201  public static org.hl7.fhir.r4.model.StructureMap.StructureMapGroupInputComponent convertStructureMapGroupInputComponent(org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupInputComponent src) throws FHIRException {
202    if (src == null)
203      return null;
204    org.hl7.fhir.r4.model.StructureMap.StructureMapGroupInputComponent tgt = new org.hl7.fhir.r4.model.StructureMap.StructureMapGroupInputComponent();
205    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt);
206    if (src.hasName())
207      tgt.setNameElement(Id30_40.convertId(src.getNameElement()));
208    if (src.hasType())
209      tgt.setTypeElement(String30_40.convertString(src.getTypeElement()));
210    if (src.hasMode())
211      tgt.setModeElement(convertStructureMapInputMode(src.getModeElement()));
212    if (src.hasDocumentation())
213      tgt.setDocumentationElement(String30_40.convertString(src.getDocumentationElement()));
214    return tgt;
215  }
216
217  public static org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleComponent convertStructureMapGroupRuleComponent(org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleComponent src) throws FHIRException {
218    if (src == null)
219      return null;
220    org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleComponent tgt = new org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleComponent();
221    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt);
222    if (src.hasName())
223      tgt.setNameElement(Id30_40.convertId(src.getNameElement()));
224    for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleSourceComponent t : src.getSource())
225      tgt.addSource(convertStructureMapGroupRuleSourceComponent(t));
226    for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleTargetComponent t : src.getTarget())
227      tgt.addTarget(convertStructureMapGroupRuleTargetComponent(t));
228    for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule())
229      tgt.addRule(convertStructureMapGroupRuleComponent(t));
230    for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleDependentComponent t : src.getDependent())
231      tgt.addDependent(convertStructureMapGroupRuleDependentComponent(t));
232    if (src.hasDocumentation())
233      tgt.setDocumentationElement(String30_40.convertString(src.getDocumentationElement()));
234    return tgt;
235  }
236
237  public static org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleComponent convertStructureMapGroupRuleComponent(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleComponent src) throws FHIRException {
238    if (src == null)
239      return null;
240    org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleComponent tgt = new org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleComponent();
241    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt);
242    if (src.hasName())
243      tgt.setNameElement(Id30_40.convertId(src.getNameElement()));
244    for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleSourceComponent t : src.getSource())
245      tgt.addSource(convertStructureMapGroupRuleSourceComponent(t));
246    for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetComponent t : src.getTarget())
247      tgt.addTarget(convertStructureMapGroupRuleTargetComponent(t));
248    for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule())
249      tgt.addRule(convertStructureMapGroupRuleComponent(t));
250    for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleDependentComponent t : src.getDependent())
251      tgt.addDependent(convertStructureMapGroupRuleDependentComponent(t));
252    if (src.hasDocumentation())
253      tgt.setDocumentationElement(String30_40.convertString(src.getDocumentationElement()));
254    return tgt;
255  }
256
257  public static org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleDependentComponent convertStructureMapGroupRuleDependentComponent(org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleDependentComponent src) throws FHIRException {
258    if (src == null)
259      return null;
260    org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleDependentComponent tgt = new org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleDependentComponent();
261    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt);
262    if (src.hasName())
263      tgt.setNameElement(Id30_40.convertId(src.getNameElement()));
264    for (org.hl7.fhir.dstu3.model.StringType t : src.getVariable()) tgt.addVariable(t.getValue());
265    return tgt;
266  }
267
268  public static org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleDependentComponent convertStructureMapGroupRuleDependentComponent(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleDependentComponent src) throws FHIRException {
269    if (src == null)
270      return null;
271    org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleDependentComponent tgt = new org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleDependentComponent();
272    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt);
273    if (src.hasName())
274      tgt.setNameElement(Id30_40.convertId(src.getNameElement()));
275    for (org.hl7.fhir.r4.model.StringType t : src.getVariable()) tgt.addVariable(t.getValue());
276    return tgt;
277  }
278
279  public static org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleSourceComponent convertStructureMapGroupRuleSourceComponent(org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleSourceComponent src) throws FHIRException {
280    if (src == null)
281      return null;
282    org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleSourceComponent tgt = new org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleSourceComponent();
283    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt);
284    if (src.hasContext())
285      tgt.setContextElement(Id30_40.convertId(src.getContextElement()));
286    if (src.hasMin())
287      tgt.setMinElement(Integer30_40.convertInteger(src.getMinElement()));
288    if (src.hasMax())
289      tgt.setMaxElement(String30_40.convertString(src.getMaxElement()));
290    if (src.hasType())
291      tgt.setTypeElement(String30_40.convertString(src.getTypeElement()));
292    if (src.hasDefaultValue())
293      tgt.setDefaultValue(ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().convertType(src.getDefaultValue()));
294    if (src.hasElement())
295      tgt.setElementElement(String30_40.convertString(src.getElementElement()));
296    if (src.hasListMode())
297      tgt.setListModeElement(convertStructureMapSourceListMode(src.getListModeElement()));
298    if (src.hasVariable())
299      tgt.setVariableElement(Id30_40.convertId(src.getVariableElement()));
300    if (src.hasCondition())
301      tgt.setConditionElement(String30_40.convertString(src.getConditionElement()));
302    if (src.hasCheck())
303      tgt.setCheckElement(String30_40.convertString(src.getCheckElement()));
304    return tgt;
305  }
306
307  public static org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleSourceComponent convertStructureMapGroupRuleSourceComponent(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleSourceComponent src) throws FHIRException {
308    if (src == null)
309      return null;
310    org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleSourceComponent tgt = new org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleSourceComponent();
311    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt);
312    if (src.hasContext())
313      tgt.setContextElement(Id30_40.convertId(src.getContextElement()));
314    if (src.hasMin())
315      tgt.setMinElement(Integer30_40.convertInteger(src.getMinElement()));
316    if (src.hasMax())
317      tgt.setMaxElement(String30_40.convertString(src.getMaxElement()));
318    if (src.hasType())
319      tgt.setTypeElement(String30_40.convertString(src.getTypeElement()));
320    if (src.hasDefaultValue())
321      tgt.setDefaultValue(ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().convertType(src.getDefaultValue()));
322    if (src.hasElement())
323      tgt.setElementElement(String30_40.convertString(src.getElementElement()));
324    if (src.hasListMode())
325      tgt.setListModeElement(convertStructureMapSourceListMode(src.getListModeElement()));
326    if (src.hasVariable())
327      tgt.setVariableElement(Id30_40.convertId(src.getVariableElement()));
328    if (src.hasCondition())
329      tgt.setConditionElement(String30_40.convertString(src.getConditionElement()));
330    if (src.hasCheck())
331      tgt.setCheckElement(String30_40.convertString(src.getCheckElement()));
332    return tgt;
333  }
334
335  public static org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetComponent convertStructureMapGroupRuleTargetComponent(org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleTargetComponent src) throws FHIRException {
336    if (src == null)
337      return null;
338    org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetComponent tgt = new org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetComponent();
339    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt);
340    if (src.hasContext())
341      tgt.setContextElement(Id30_40.convertId(src.getContextElement()));
342    if (src.hasContextType())
343      tgt.setContextTypeElement(convertStructureMapContextType(src.getContextTypeElement()));
344    if (src.hasElement())
345      tgt.setElementElement(String30_40.convertString(src.getElementElement()));
346    if (src.hasVariable())
347      tgt.setVariableElement(Id30_40.convertId(src.getVariableElement()));
348    tgt.setListMode(src.getListMode().stream()
349      .map(StructureMap30_40::convertStructureMapTargetListMode)
350      .collect(Collectors.toList()));
351    if (src.hasListRuleId())
352      tgt.setListRuleIdElement(Id30_40.convertId(src.getListRuleIdElement()));
353    if (src.hasTransform())
354      tgt.setTransformElement(convertStructureMapTransform(src.getTransformElement()));
355    for (org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleTargetParameterComponent t : src.getParameter())
356      tgt.addParameter(convertStructureMapGroupRuleTargetParameterComponent(t));
357    return tgt;
358  }
359
360  public static org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleTargetComponent convertStructureMapGroupRuleTargetComponent(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetComponent src) throws FHIRException {
361    if (src == null)
362      return null;
363    org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleTargetComponent tgt = new org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleTargetComponent();
364    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt);
365    if (src.hasContext())
366      tgt.setContextElement(Id30_40.convertId(src.getContextElement()));
367    if (src.hasContextType())
368      tgt.setContextTypeElement(convertStructureMapContextType(src.getContextTypeElement()));
369    if (src.hasElement())
370      tgt.setElementElement(String30_40.convertString(src.getElementElement()));
371    if (src.hasVariable())
372      tgt.setVariableElement(Id30_40.convertId(src.getVariableElement()));
373    tgt.setListMode(src.getListMode().stream()
374      .map(StructureMap30_40::convertStructureMapTargetListMode)
375      .collect(Collectors.toList()));
376    if (src.hasListRuleId())
377      tgt.setListRuleIdElement(Id30_40.convertId(src.getListRuleIdElement()));
378    if (src.hasTransform())
379      tgt.setTransformElement(convertStructureMapTransform(src.getTransformElement()));
380    for (org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetParameterComponent t : src.getParameter())
381      tgt.addParameter(convertStructureMapGroupRuleTargetParameterComponent(t));
382    return tgt;
383  }
384
385  public static org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetParameterComponent convertStructureMapGroupRuleTargetParameterComponent(org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleTargetParameterComponent src) throws FHIRException {
386    if (src == null)
387      return null;
388    org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetParameterComponent tgt = new org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetParameterComponent();
389    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt);
390    if (src.hasValue())
391      tgt.setValue(ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().convertType(src.getValue()));
392    return tgt;
393  }
394
395  public static org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleTargetParameterComponent convertStructureMapGroupRuleTargetParameterComponent(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupRuleTargetParameterComponent src) throws FHIRException {
396    if (src == null)
397      return null;
398    org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleTargetParameterComponent tgt = new org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupRuleTargetParameterComponent();
399    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt);
400    if (src.hasValue())
401      tgt.setValue(ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().convertType(src.getValue()));
402    return tgt;
403  }
404
405  static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.StructureMap.StructureMapGroupTypeMode> convertStructureMapGroupTypeMode(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupTypeMode> src) throws FHIRException {
406    if (src == null || src.isEmpty())
407      return null;
408    org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.StructureMap.StructureMapGroupTypeMode> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureMap.StructureMapGroupTypeModeEnumFactory());
409    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
410    switch (src.getValue()) {
411      case NONE:
412        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupTypeMode.NONE);
413        break;
414      case TYPES:
415        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupTypeMode.TYPES);
416        break;
417      case TYPEANDTYPES:
418        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupTypeMode.TYPEANDTYPES);
419        break;
420      default:
421        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapGroupTypeMode.NULL);
422        break;
423    }
424    return tgt;
425  }
426
427  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupTypeMode> convertStructureMapGroupTypeMode(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.StructureMap.StructureMapGroupTypeMode> src) throws FHIRException {
428    if (src == null || src.isEmpty())
429      return null;
430    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupTypeMode> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupTypeModeEnumFactory());
431    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
432    switch (src.getValue()) {
433      case NONE:
434        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupTypeMode.NONE);
435        break;
436      case TYPES:
437        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupTypeMode.TYPES);
438        break;
439      case TYPEANDTYPES:
440        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupTypeMode.TYPEANDTYPES);
441        break;
442      default:
443        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapGroupTypeMode.NULL);
444        break;
445    }
446    return tgt;
447  }
448
449  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.StructureMap.StructureMapInputMode> convertStructureMapInputMode(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.StructureMap.StructureMapInputMode> src) throws FHIRException {
450    if (src == null || src.isEmpty())
451      return null;
452    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.StructureMap.StructureMapInputMode> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureMap.StructureMapInputModeEnumFactory());
453    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
454    switch (src.getValue()) {
455      case SOURCE:
456        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapInputMode.SOURCE);
457        break;
458      case TARGET:
459        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapInputMode.TARGET);
460        break;
461      default:
462        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapInputMode.NULL);
463        break;
464    }
465    return tgt;
466  }
467
468  static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.StructureMap.StructureMapInputMode> convertStructureMapInputMode(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.StructureMap.StructureMapInputMode> src) throws FHIRException {
469    if (src == null || src.isEmpty())
470      return null;
471    org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.StructureMap.StructureMapInputMode> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureMap.StructureMapInputModeEnumFactory());
472    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
473    switch (src.getValue()) {
474      case SOURCE:
475        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapInputMode.SOURCE);
476        break;
477      case TARGET:
478        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapInputMode.TARGET);
479        break;
480      default:
481        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapInputMode.NULL);
482        break;
483    }
484    return tgt;
485  }
486
487  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.StructureMap.StructureMapModelMode> convertStructureMapModelMode(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode> src) throws FHIRException {
488    if (src == null || src.isEmpty())
489      return null;
490    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.StructureMap.StructureMapModelMode> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureMap.StructureMapModelModeEnumFactory());
491    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
492    switch (src.getValue()) {
493      case SOURCE:
494        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapModelMode.SOURCE);
495        break;
496      case QUERIED:
497        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapModelMode.QUERIED);
498        break;
499      case TARGET:
500        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapModelMode.TARGET);
501        break;
502      case PRODUCED:
503        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapModelMode.PRODUCED);
504        break;
505      default:
506        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapModelMode.NULL);
507        break;
508    }
509    return tgt;
510  }
511
512  static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode> convertStructureMapModelMode(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.StructureMap.StructureMapModelMode> src) throws FHIRException {
513    if (src == null || src.isEmpty())
514      return null;
515    org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureMap.StructureMapModelModeEnumFactory());
516    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
517    switch (src.getValue()) {
518      case SOURCE:
519        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.SOURCE);
520        break;
521      case QUERIED:
522        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.QUERIED);
523        break;
524      case TARGET:
525        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.TARGET);
526        break;
527      case PRODUCED:
528        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.PRODUCED);
529        break;
530      default:
531        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapModelMode.NULL);
532        break;
533    }
534    return tgt;
535  }
536
537  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.StructureMap.StructureMapSourceListMode> convertStructureMapSourceListMode(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode> src) throws FHIRException {
538    if (src == null || src.isEmpty())
539      return null;
540    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.StructureMap.StructureMapSourceListMode> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureMap.StructureMapSourceListModeEnumFactory());
541    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
542    switch (src.getValue()) {
543      case FIRST:
544        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapSourceListMode.FIRST);
545        break;
546      case NOTFIRST:
547        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapSourceListMode.NOTFIRST);
548        break;
549      case LAST:
550        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapSourceListMode.LAST);
551        break;
552      case NOTLAST:
553        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapSourceListMode.NOTLAST);
554        break;
555      case ONLYONE:
556        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapSourceListMode.ONLYONE);
557        break;
558      default:
559        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapSourceListMode.NULL);
560        break;
561    }
562    return tgt;
563  }
564
565  static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode> convertStructureMapSourceListMode(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.StructureMap.StructureMapSourceListMode> src) throws FHIRException {
566    if (src == null || src.isEmpty())
567      return null;
568    org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListModeEnumFactory());
569    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
570    switch (src.getValue()) {
571      case FIRST:
572        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.FIRST);
573        break;
574      case NOTFIRST:
575        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.NOTFIRST);
576        break;
577      case LAST:
578        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.LAST);
579        break;
580      case NOTLAST:
581        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.NOTLAST);
582        break;
583      case ONLYONE:
584        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.ONLYONE);
585        break;
586      default:
587        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapSourceListMode.NULL);
588        break;
589    }
590    return tgt;
591  }
592
593  public static org.hl7.fhir.dstu3.model.StructureMap.StructureMapStructureComponent convertStructureMapStructureComponent(org.hl7.fhir.r4.model.StructureMap.StructureMapStructureComponent src) throws FHIRException {
594    if (src == null)
595      return null;
596    org.hl7.fhir.dstu3.model.StructureMap.StructureMapStructureComponent tgt = new org.hl7.fhir.dstu3.model.StructureMap.StructureMapStructureComponent();
597    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt);
598    if (src.hasUrl())
599      tgt.setUrl(src.getUrl());
600    if (src.hasMode())
601      tgt.setModeElement(convertStructureMapModelMode(src.getModeElement()));
602    if (src.hasAlias())
603      tgt.setAliasElement(String30_40.convertString(src.getAliasElement()));
604    if (src.hasDocumentation())
605      tgt.setDocumentationElement(String30_40.convertString(src.getDocumentationElement()));
606    return tgt;
607  }
608
609  public static org.hl7.fhir.r4.model.StructureMap.StructureMapStructureComponent convertStructureMapStructureComponent(org.hl7.fhir.dstu3.model.StructureMap.StructureMapStructureComponent src) throws FHIRException {
610    if (src == null)
611      return null;
612    org.hl7.fhir.r4.model.StructureMap.StructureMapStructureComponent tgt = new org.hl7.fhir.r4.model.StructureMap.StructureMapStructureComponent();
613    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt);
614    if (src.hasUrl())
615      tgt.setUrl(src.getUrl());
616    if (src.hasMode())
617      tgt.setModeElement(convertStructureMapModelMode(src.getModeElement()));
618    if (src.hasAlias())
619      tgt.setAliasElement(String30_40.convertString(src.getAliasElement()));
620    if (src.hasDocumentation())
621      tgt.setDocumentationElement(String30_40.convertString(src.getDocumentationElement()));
622    return tgt;
623  }
624
625  static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode> convertStructureMapTargetListMode(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.StructureMap.StructureMapTargetListMode> src) throws FHIRException {
626    if (src == null || src.isEmpty())
627      return null;
628    org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListModeEnumFactory());
629    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
630    switch (src.getValue()) {
631      case FIRST:
632        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode.FIRST);
633        break;
634      case SHARE:
635        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode.SHARE);
636        break;
637      case LAST:
638        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode.LAST);
639        break;
640      case COLLATE:
641        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode.COLLATE);
642        break;
643      default:
644        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode.NULL);
645        break;
646    }
647    return tgt;
648  }
649
650  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.StructureMap.StructureMapTargetListMode> convertStructureMapTargetListMode(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.StructureMap.StructureMapTargetListMode> src) throws FHIRException {
651    if (src == null || src.isEmpty())
652      return null;
653    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.StructureMap.StructureMapTargetListMode> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureMap.StructureMapTargetListModeEnumFactory());
654    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
655    switch (src.getValue()) {
656      case FIRST:
657        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTargetListMode.FIRST);
658        break;
659      case SHARE:
660        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTargetListMode.SHARE);
661        break;
662      case LAST:
663        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTargetListMode.LAST);
664        break;
665      case COLLATE:
666        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTargetListMode.COLLATE);
667        break;
668      default:
669        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTargetListMode.NULL);
670        break;
671    }
672    return tgt;
673  }
674
675  static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.StructureMap.StructureMapTransform> convertStructureMapTransform(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform> src) throws FHIRException {
676    if (src == null || src.isEmpty())
677      return null;
678    org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.StructureMap.StructureMapTransform> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureMap.StructureMapTransformEnumFactory());
679    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
680    switch (src.getValue()) {
681      case CREATE:
682        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.CREATE);
683        break;
684      case COPY:
685        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.COPY);
686        break;
687      case TRUNCATE:
688        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.TRUNCATE);
689        break;
690      case ESCAPE:
691        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.ESCAPE);
692        break;
693      case CAST:
694        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.CAST);
695        break;
696      case APPEND:
697        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.APPEND);
698        break;
699      case TRANSLATE:
700        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.TRANSLATE);
701        break;
702      case REFERENCE:
703        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.REFERENCE);
704        break;
705      case DATEOP:
706        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.DATEOP);
707        break;
708      case UUID:
709        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.UUID);
710        break;
711      case POINTER:
712        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.POINTER);
713        break;
714      case EVALUATE:
715        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.EVALUATE);
716        break;
717      case CC:
718        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.CC);
719        break;
720      case C:
721        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.C);
722        break;
723      case QTY:
724        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.QTY);
725        break;
726      case ID:
727        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.ID);
728        break;
729      case CP:
730        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.CP);
731        break;
732      default:
733        tgt.setValue(org.hl7.fhir.r4.model.StructureMap.StructureMapTransform.NULL);
734        break;
735    }
736    return tgt;
737  }
738
739  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform> convertStructureMapTransform(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.StructureMap.StructureMapTransform> src) throws FHIRException {
740    if (src == null || src.isEmpty())
741      return null;
742    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransformEnumFactory());
743    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
744    switch (src.getValue()) {
745      case CREATE:
746        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.CREATE);
747        break;
748      case COPY:
749        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.COPY);
750        break;
751      case TRUNCATE:
752        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.TRUNCATE);
753        break;
754      case ESCAPE:
755        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.ESCAPE);
756        break;
757      case CAST:
758        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.CAST);
759        break;
760      case APPEND:
761        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.APPEND);
762        break;
763      case TRANSLATE:
764        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.TRANSLATE);
765        break;
766      case REFERENCE:
767        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.REFERENCE);
768        break;
769      case DATEOP:
770        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.DATEOP);
771        break;
772      case UUID:
773        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.UUID);
774        break;
775      case POINTER:
776        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.POINTER);
777        break;
778      case EVALUATE:
779        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.EVALUATE);
780        break;
781      case CC:
782        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.CC);
783        break;
784      case C:
785        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.C);
786        break;
787      case QTY:
788        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.QTY);
789        break;
790      case ID:
791        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.ID);
792        break;
793      case CP:
794        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.CP);
795        break;
796      default:
797        tgt.setValue(org.hl7.fhir.dstu3.model.StructureMap.StructureMapTransform.NULL);
798        break;
799    }
800    return tgt;
801  }
802}