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