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
011public class ConceptMap30_40 {
012
013  public static org.hl7.fhir.dstu3.model.ConceptMap convertConceptMap(org.hl7.fhir.r4.model.ConceptMap src) throws FHIRException {
014    if (src == null)
015      return null;
016    org.hl7.fhir.dstu3.model.ConceptMap tgt = new org.hl7.fhir.dstu3.model.ConceptMap();
017    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyDomainResource(src, tgt);
018    if (src.hasUrl())
019      tgt.setUrlElement(Uri30_40.convertUri(src.getUrlElement()));
020    if (src.hasIdentifier())
021      tgt.setIdentifier(Identifier30_40.convertIdentifier(src.getIdentifier()));
022    if (src.hasVersion())
023      tgt.setVersionElement(String30_40.convertString(src.getVersionElement()));
024    if (src.hasName())
025      tgt.setNameElement(String30_40.convertString(src.getNameElement()));
026    if (src.hasTitle())
027      tgt.setTitleElement(String30_40.convertString(src.getTitleElement()));
028    if (src.hasStatus())
029      tgt.setStatusElement(Enumerations30_40.convertPublicationStatus(src.getStatusElement()));
030    if (src.hasExperimental())
031      tgt.setExperimentalElement(Boolean30_40.convertBoolean(src.getExperimentalElement()));
032    if (src.hasDateElement())
033      tgt.setDateElement(DateTime30_40.convertDateTime(src.getDateElement()));
034    if (src.hasPublisher())
035      tgt.setPublisherElement(String30_40.convertString(src.getPublisherElement()));
036    for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact())
037      tgt.addContact(ContactDetail30_40.convertContactDetail(t));
038    if (src.hasDescription())
039      tgt.setDescriptionElement(MarkDown30_40.convertMarkdown(src.getDescriptionElement()));
040    for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext())
041      tgt.addUseContext(Timing30_40.convertUsageContext(t));
042    for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction())
043      tgt.addJurisdiction(CodeableConcept30_40.convertCodeableConcept(t));
044    if (src.hasPurpose())
045      tgt.setPurposeElement(MarkDown30_40.convertMarkdown(src.getPurposeElement()));
046    if (src.hasCopyright())
047      tgt.setCopyrightElement(MarkDown30_40.convertMarkdown(src.getCopyrightElement()));
048    if (src.hasSource())
049      tgt.setSource(ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().convertType(src.getSource()));
050    if (src.hasTarget())
051      tgt.setTarget(ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().convertType(src.getTarget()));
052    for (org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupComponent t : src.getGroup())
053      tgt.addGroup(convertConceptMapGroupComponent(t));
054    return tgt;
055  }
056
057  public static org.hl7.fhir.r4.model.ConceptMap convertConceptMap(org.hl7.fhir.dstu3.model.ConceptMap src) throws FHIRException {
058    if (src == null)
059      return null;
060    org.hl7.fhir.r4.model.ConceptMap tgt = new org.hl7.fhir.r4.model.ConceptMap();
061    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyDomainResource(src, tgt);
062    if (src.hasUrl())
063      tgt.setUrlElement(Uri30_40.convertUri(src.getUrlElement()));
064    if (src.hasIdentifier())
065      tgt.setIdentifier(Identifier30_40.convertIdentifier(src.getIdentifier()));
066    if (src.hasVersion())
067      tgt.setVersionElement(String30_40.convertString(src.getVersionElement()));
068    if (src.hasName())
069      tgt.setNameElement(String30_40.convertString(src.getNameElement()));
070    if (src.hasTitle())
071      tgt.setTitleElement(String30_40.convertString(src.getTitleElement()));
072    if (src.hasStatus())
073      tgt.setStatusElement(Enumerations30_40.convertPublicationStatus(src.getStatusElement()));
074    if (src.hasExperimental())
075      tgt.setExperimentalElement(Boolean30_40.convertBoolean(src.getExperimentalElement()));
076    if (src.hasDateElement())
077      tgt.setDateElement(DateTime30_40.convertDateTime(src.getDateElement()));
078    if (src.hasPublisher())
079      tgt.setPublisherElement(String30_40.convertString(src.getPublisherElement()));
080    for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact())
081      tgt.addContact(ContactDetail30_40.convertContactDetail(t));
082    if (src.hasDescription())
083      tgt.setDescriptionElement(MarkDown30_40.convertMarkdown(src.getDescriptionElement()));
084    for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext())
085      tgt.addUseContext(Timing30_40.convertUsageContext(t));
086    for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction())
087      tgt.addJurisdiction(CodeableConcept30_40.convertCodeableConcept(t));
088    if (src.hasPurpose())
089      tgt.setPurposeElement(MarkDown30_40.convertMarkdown(src.getPurposeElement()));
090    if (src.hasCopyright())
091      tgt.setCopyrightElement(MarkDown30_40.convertMarkdown(src.getCopyrightElement()));
092    if (src.hasSource()) {
093      org.hl7.fhir.r4.model.Type t = ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().convertType(src.getSource());
094      tgt.setSource(t instanceof org.hl7.fhir.r4.model.Reference ? new org.hl7.fhir.r4.model.CanonicalType(((org.hl7.fhir.r4.model.Reference) t).getReference()) : t);
095    }
096    if (src.hasTarget()) {
097      org.hl7.fhir.r4.model.Type t = ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().convertType(src.getTarget());
098      tgt.setTarget(t instanceof org.hl7.fhir.r4.model.Reference ? new org.hl7.fhir.r4.model.CanonicalType(((org.hl7.fhir.r4.model.Reference) t).getReference()) : t);
099    }
100    for (org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupComponent t : src.getGroup())
101      tgt.addGroup(convertConceptMapGroupComponent(t));
102    return tgt;
103  }
104
105  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence> convertConceptMapEquivalence(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence> src) throws FHIRException {
106    if (src == null || src.isEmpty())
107      return null;
108    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalenceEnumFactory());
109    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
110    switch (src.getValue()) {
111      case RELATEDTO:
112        tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.RELATEDTO);
113        break;
114      case EQUIVALENT:
115        tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.EQUIVALENT);
116        break;
117      case EQUAL:
118        tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.EQUAL);
119        break;
120      case WIDER:
121        tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.WIDER);
122        break;
123      case SUBSUMES:
124        tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.SUBSUMES);
125        break;
126      case NARROWER:
127        tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.NARROWER);
128        break;
129      case SPECIALIZES:
130        tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.SPECIALIZES);
131        break;
132      case INEXACT:
133        tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.INEXACT);
134        break;
135      case UNMATCHED:
136        tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.UNMATCHED);
137        break;
138      case DISJOINT:
139        tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.DISJOINT);
140        break;
141      default:
142        tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.NULL);
143        break;
144    }
145    return tgt;
146  }
147
148  static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence> convertConceptMapEquivalence(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence> src) throws FHIRException {
149    if (src == null || src.isEmpty())
150      return null;
151    org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalenceEnumFactory());
152    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
153    switch (src.getValue()) {
154      case RELATEDTO:
155        tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.RELATEDTO);
156        break;
157      case EQUIVALENT:
158        tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.EQUIVALENT);
159        break;
160      case EQUAL:
161        tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.EQUAL);
162        break;
163      case WIDER:
164        tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.WIDER);
165        break;
166      case SUBSUMES:
167        tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.SUBSUMES);
168        break;
169      case NARROWER:
170        tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.NARROWER);
171        break;
172      case SPECIALIZES:
173        tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.SPECIALIZES);
174        break;
175      case INEXACT:
176        tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.INEXACT);
177        break;
178      case UNMATCHED:
179        tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.UNMATCHED);
180        break;
181      case DISJOINT:
182        tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.DISJOINT);
183        break;
184      default:
185        tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.NULL);
186        break;
187    }
188    return tgt;
189  }
190
191  public static org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupComponent convertConceptMapGroupComponent(org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupComponent src) throws FHIRException {
192    if (src == null)
193      return null;
194    org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupComponent tgt = new org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupComponent();
195    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
196    if (src.hasSource())
197      tgt.setSourceElement(Uri30_40.convertUri(src.getSourceElement()));
198    if (src.hasSourceVersion())
199      tgt.setSourceVersionElement(String30_40.convertString(src.getSourceVersionElement()));
200    if (src.hasTarget())
201      tgt.setTarget(src.getTarget());
202    if (src.hasTargetVersion())
203      tgt.setTargetVersion(src.getTargetVersion());
204    for (org.hl7.fhir.dstu3.model.ConceptMap.SourceElementComponent t : src.getElement())
205      tgt.addElement(convertSourceElementComponent(t));
206    if (src.hasUnmapped())
207      tgt.setUnmapped(convertConceptMapGroupUnmappedComponent(src.getUnmapped()));
208    return tgt;
209  }
210
211  public static org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupComponent convertConceptMapGroupComponent(org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupComponent src) throws FHIRException {
212    if (src == null)
213      return null;
214    org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupComponent tgt = new org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupComponent();
215    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
216    if (src.hasSource())
217      tgt.setSourceElement(Uri30_40.convertUri(src.getSourceElement()));
218    if (src.hasSourceVersion())
219      tgt.setSourceVersionElement(String30_40.convertString(src.getSourceVersionElement()));
220    if (src.hasTarget())
221      tgt.setTarget(src.getTarget());
222    if (src.hasTargetVersion())
223      tgt.setTargetVersion(src.getTargetVersion());
224    for (org.hl7.fhir.r4.model.ConceptMap.SourceElementComponent t : src.getElement())
225      tgt.addElement(convertSourceElementComponent(t));
226    if (src.hasUnmapped())
227      tgt.setUnmapped(convertConceptMapGroupUnmappedComponent(src.getUnmapped()));
228    return tgt;
229  }
230
231  public static org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedComponent convertConceptMapGroupUnmappedComponent(org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedComponent src) throws FHIRException {
232    if (src == null)
233      return null;
234    org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedComponent tgt = new org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedComponent();
235    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
236    if (src.hasMode())
237      tgt.setModeElement(convertConceptMapGroupUnmappedMode(src.getModeElement()));
238    if (src.hasCode())
239      tgt.setCodeElement(Code30_40.convertCode(src.getCodeElement()));
240    if (src.hasDisplay())
241      tgt.setDisplayElement(String30_40.convertString(src.getDisplayElement()));
242    if (src.hasUrl())
243      tgt.setUrl(src.getUrl());
244    return tgt;
245  }
246
247  public static org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedComponent convertConceptMapGroupUnmappedComponent(org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedComponent src) throws FHIRException {
248    if (src == null)
249      return null;
250    org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedComponent tgt = new org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedComponent();
251    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
252    if (src.hasMode())
253      tgt.setModeElement(convertConceptMapGroupUnmappedMode(src.getModeElement()));
254    if (src.hasCode())
255      tgt.setCodeElement(Code30_40.convertCode(src.getCodeElement()));
256    if (src.hasDisplay())
257      tgt.setDisplayElement(String30_40.convertString(src.getDisplayElement()));
258    if (src.hasUrl())
259      tgt.setUrl(src.getUrl());
260    return tgt;
261  }
262
263  static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode> convertConceptMapGroupUnmappedMode(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedMode> src) throws FHIRException {
264    if (src == null || src.isEmpty())
265      return null;
266    org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedModeEnumFactory());
267    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
268    switch (src.getValue()) {
269      case PROVIDED:
270        tgt.setValue(org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode.PROVIDED);
271        break;
272      case FIXED:
273        tgt.setValue(org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode.FIXED);
274        break;
275      case OTHERMAP:
276        tgt.setValue(org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode.OTHERMAP);
277        break;
278      default:
279        tgt.setValue(org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode.NULL);
280        break;
281    }
282    return tgt;
283  }
284
285  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedMode> convertConceptMapGroupUnmappedMode(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode> src) throws FHIRException {
286    if (src == null || src.isEmpty())
287      return null;
288    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedMode> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedModeEnumFactory());
289    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
290    switch (src.getValue()) {
291      case PROVIDED:
292        tgt.setValue(org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedMode.PROVIDED);
293        break;
294      case FIXED:
295        tgt.setValue(org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedMode.FIXED);
296        break;
297      case OTHERMAP:
298        tgt.setValue(org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedMode.OTHERMAP);
299        break;
300      default:
301        tgt.setValue(org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedMode.NULL);
302        break;
303    }
304    return tgt;
305  }
306
307  public static org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent convertOtherElementComponent(org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent src) throws FHIRException {
308    if (src == null)
309      return null;
310    org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent tgt = new org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent();
311    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
312    if (src.hasProperty())
313      tgt.setPropertyElement(Uri30_40.convertUri(src.getPropertyElement()));
314    if (src.hasSystem())
315      tgt.setSystem(src.getSystem());
316    if (src.hasValue())
317      tgt.setCodeElement(String30_40.convertString(src.getValueElement()));
318    if (src.hasDisplay())
319      tgt.setDisplayElement(String30_40.convertString(src.getDisplayElement()));
320    return tgt;
321  }
322
323  public static org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent convertOtherElementComponent(org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent src) throws FHIRException {
324    if (src == null)
325      return null;
326    org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent tgt = new org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent();
327    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
328    if (src.hasProperty())
329      tgt.setPropertyElement(Uri30_40.convertUri(src.getPropertyElement()));
330    if (src.hasSystem())
331      tgt.setSystem(src.getSystem());
332    if (src.hasCode())
333      tgt.setValueElement(String30_40.convertString(src.getCodeElement()));
334    if (src.hasDisplay())
335      tgt.setDisplayElement(String30_40.convertString(src.getDisplayElement()));
336    return tgt;
337  }
338
339  public static org.hl7.fhir.dstu3.model.ConceptMap.SourceElementComponent convertSourceElementComponent(org.hl7.fhir.r4.model.ConceptMap.SourceElementComponent src) throws FHIRException {
340    if (src == null)
341      return null;
342    org.hl7.fhir.dstu3.model.ConceptMap.SourceElementComponent tgt = new org.hl7.fhir.dstu3.model.ConceptMap.SourceElementComponent();
343    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
344    if (src.hasCode())
345      tgt.setCodeElement(Code30_40.convertCode(src.getCodeElement()));
346    if (src.hasDisplay())
347      tgt.setDisplayElement(String30_40.convertString(src.getDisplayElement()));
348    for (org.hl7.fhir.r4.model.ConceptMap.TargetElementComponent t : src.getTarget())
349      tgt.addTarget(convertTargetElementComponent(t));
350    return tgt;
351  }
352
353  public static org.hl7.fhir.r4.model.ConceptMap.SourceElementComponent convertSourceElementComponent(org.hl7.fhir.dstu3.model.ConceptMap.SourceElementComponent src) throws FHIRException {
354    if (src == null)
355      return null;
356    org.hl7.fhir.r4.model.ConceptMap.SourceElementComponent tgt = new org.hl7.fhir.r4.model.ConceptMap.SourceElementComponent();
357    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
358    if (src.hasCode())
359      tgt.setCodeElement(Code30_40.convertCode(src.getCodeElement()));
360    if (src.hasDisplay())
361      tgt.setDisplayElement(String30_40.convertString(src.getDisplayElement()));
362    for (org.hl7.fhir.dstu3.model.ConceptMap.TargetElementComponent t : src.getTarget())
363      tgt.addTarget(convertTargetElementComponent(t));
364    return tgt;
365  }
366
367  public static org.hl7.fhir.dstu3.model.ConceptMap.TargetElementComponent convertTargetElementComponent(org.hl7.fhir.r4.model.ConceptMap.TargetElementComponent src) throws FHIRException {
368    if (src == null)
369      return null;
370    org.hl7.fhir.dstu3.model.ConceptMap.TargetElementComponent tgt = new org.hl7.fhir.dstu3.model.ConceptMap.TargetElementComponent();
371    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
372    if (src.hasCode())
373      tgt.setCodeElement(Code30_40.convertCode(src.getCodeElement()));
374    if (src.hasDisplay())
375      tgt.setDisplayElement(String30_40.convertString(src.getDisplayElement()));
376    if (src.hasEquivalence())
377      tgt.setEquivalenceElement(convertConceptMapEquivalence(src.getEquivalenceElement()));
378    if (src.hasComment())
379      tgt.setCommentElement(String30_40.convertString(src.getCommentElement()));
380    for (org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent t : src.getDependsOn())
381      tgt.addDependsOn(convertOtherElementComponent(t));
382    for (org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent t : src.getProduct())
383      tgt.addProduct(convertOtherElementComponent(t));
384    return tgt;
385  }
386
387  public static org.hl7.fhir.r4.model.ConceptMap.TargetElementComponent convertTargetElementComponent(org.hl7.fhir.dstu3.model.ConceptMap.TargetElementComponent src) throws FHIRException {
388    if (src == null)
389      return null;
390    org.hl7.fhir.r4.model.ConceptMap.TargetElementComponent tgt = new org.hl7.fhir.r4.model.ConceptMap.TargetElementComponent();
391    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
392    if (src.hasCode())
393      tgt.setCodeElement(Code30_40.convertCode(src.getCodeElement()));
394    if (src.hasDisplay())
395      tgt.setDisplayElement(String30_40.convertString(src.getDisplayElement()));
396    if (src.hasEquivalence())
397      tgt.setEquivalenceElement(convertConceptMapEquivalence(src.getEquivalenceElement()));
398    if (src.hasComment())
399      tgt.setCommentElement(String30_40.convertString(src.getCommentElement()));
400    for (org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent t : src.getDependsOn())
401      tgt.addDependsOn(convertOtherElementComponent(t));
402    for (org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent t : src.getProduct())
403      tgt.addProduct(convertOtherElementComponent(t));
404    return tgt;
405  }
406}