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