001package org.hl7.fhir.convertors.conv10_30.resources10_30;
002
003import org.hl7.fhir.convertors.context.ConversionContext10_30;
004import org.hl7.fhir.convertors.conv10_30.VersionConvertor_10_30;
005import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
006import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.CodeableConcept10_30;
007import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.ContactPoint10_30;
008import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.*;
009import org.hl7.fhir.exceptions.FHIRException;
010
011public class ImplementationGuide10_30 {
012
013  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ImplementationGuide.GuideDependencyType> convertGuideDependencyType(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ImplementationGuide.GuideDependencyType> src) throws FHIRException {
014    if (src == null || src.isEmpty())
015      return null;
016    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ImplementationGuide.GuideDependencyType> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ImplementationGuide.GuideDependencyTypeEnumFactory());
017    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
018    switch (src.getValue()) {
019      case REFERENCE:
020        tgt.setValue(org.hl7.fhir.dstu3.model.ImplementationGuide.GuideDependencyType.REFERENCE);
021        break;
022      case INCLUSION:
023        tgt.setValue(org.hl7.fhir.dstu3.model.ImplementationGuide.GuideDependencyType.INCLUSION);
024        break;
025      default:
026        tgt.setValue(org.hl7.fhir.dstu3.model.ImplementationGuide.GuideDependencyType.NULL);
027        break;
028    }
029    return tgt;
030  }
031
032  static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ImplementationGuide.GuideDependencyType> convertGuideDependencyType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ImplementationGuide.GuideDependencyType> src) throws FHIRException {
033    if (src == null || src.isEmpty())
034      return null;
035    org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ImplementationGuide.GuideDependencyType> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ImplementationGuide.GuideDependencyTypeEnumFactory());
036    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
037    switch (src.getValue()) {
038      case REFERENCE:
039        tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuideDependencyType.REFERENCE);
040        break;
041      case INCLUSION:
042        tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuideDependencyType.INCLUSION);
043        break;
044      default:
045        tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuideDependencyType.NULL);
046        break;
047    }
048    return tgt;
049  }
050
051  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ImplementationGuide.GuidePageKind> convertGuidePageKind(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind> src) throws FHIRException {
052    if (src == null || src.isEmpty())
053      return null;
054    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ImplementationGuide.GuidePageKind> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ImplementationGuide.GuidePageKindEnumFactory());
055    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
056    switch (src.getValue()) {
057      case PAGE:
058        tgt.setValue(org.hl7.fhir.dstu3.model.ImplementationGuide.GuidePageKind.PAGE);
059        break;
060      case EXAMPLE:
061        tgt.setValue(org.hl7.fhir.dstu3.model.ImplementationGuide.GuidePageKind.EXAMPLE);
062        break;
063      case LIST:
064        tgt.setValue(org.hl7.fhir.dstu3.model.ImplementationGuide.GuidePageKind.LIST);
065        break;
066      case INCLUDE:
067        tgt.setValue(org.hl7.fhir.dstu3.model.ImplementationGuide.GuidePageKind.INCLUDE);
068        break;
069      case DIRECTORY:
070        tgt.setValue(org.hl7.fhir.dstu3.model.ImplementationGuide.GuidePageKind.DIRECTORY);
071        break;
072      case DICTIONARY:
073        tgt.setValue(org.hl7.fhir.dstu3.model.ImplementationGuide.GuidePageKind.DICTIONARY);
074        break;
075      case TOC:
076        tgt.setValue(org.hl7.fhir.dstu3.model.ImplementationGuide.GuidePageKind.TOC);
077        break;
078      case RESOURCE:
079        tgt.setValue(org.hl7.fhir.dstu3.model.ImplementationGuide.GuidePageKind.RESOURCE);
080        break;
081      default:
082        tgt.setValue(org.hl7.fhir.dstu3.model.ImplementationGuide.GuidePageKind.NULL);
083        break;
084    }
085    return tgt;
086  }
087
088  static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind> convertGuidePageKind(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ImplementationGuide.GuidePageKind> src) throws FHIRException {
089    if (src == null || src.isEmpty())
090      return null;
091    org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKindEnumFactory());
092    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
093    switch (src.getValue()) {
094      case PAGE:
095        tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind.PAGE);
096        break;
097      case EXAMPLE:
098        tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind.EXAMPLE);
099        break;
100      case LIST:
101        tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind.LIST);
102        break;
103      case INCLUDE:
104        tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind.INCLUDE);
105        break;
106      case DIRECTORY:
107        tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind.DIRECTORY);
108        break;
109      case DICTIONARY:
110        tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind.DICTIONARY);
111        break;
112      case TOC:
113        tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind.TOC);
114        break;
115      case RESOURCE:
116        tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind.RESOURCE);
117        break;
118      default:
119        tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind.NULL);
120        break;
121    }
122    return tgt;
123  }
124
125  public static org.hl7.fhir.dstu3.model.ImplementationGuide convertImplementationGuide(org.hl7.fhir.dstu2.model.ImplementationGuide src) throws FHIRException {
126    if (src == null || src.isEmpty())
127      return null;
128    org.hl7.fhir.dstu3.model.ImplementationGuide tgt = new org.hl7.fhir.dstu3.model.ImplementationGuide();
129    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
130    if (src.hasUrlElement())
131      tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement()));
132    if (src.hasVersionElement())
133      tgt.setVersionElement(String10_30.convertString(src.getVersionElement()));
134    if (src.hasNameElement())
135      tgt.setNameElement(String10_30.convertString(src.getNameElement()));
136    if (src.hasStatus())
137      tgt.setStatusElement(Enumerations10_30.convertConformanceResourceStatus(src.getStatusElement()));
138    if (src.hasExperimental())
139      tgt.setExperimentalElement(Boolean10_30.convertBoolean(src.getExperimentalElement()));
140    if (src.hasPublisherElement())
141      tgt.setPublisherElement(String10_30.convertString(src.getPublisherElement()));
142    for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideContactComponent t : src.getContact())
143      tgt.addContact(convertImplementationGuideContactComponent(t));
144    if (src.hasDate())
145      tgt.setDateElement(DateTime10_30.convertDateTime(src.getDateElement()));
146    if (src.hasDescription())
147      tgt.setDescription(src.getDescription());
148    for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getUseContext())
149      if (VersionConvertor_10_30.isJurisdiction(t))
150        tgt.addJurisdiction(CodeableConcept10_30.convertCodeableConcept(t));
151      else
152        tgt.addUseContext(CodeableConcept10_30.convertCodeableConceptToUsageContext(t));
153    if (src.hasCopyright())
154      tgt.setCopyright(src.getCopyright());
155    if (src.hasFhirVersionElement())
156      tgt.setFhirVersionElement(Id10_30.convertId(src.getFhirVersionElement()));
157    for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideDependencyComponent t : src.getDependency())
158      tgt.addDependency(convertImplementationGuideDependencyComponent(t));
159    for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageComponent t : src.getPackage())
160      tgt.addPackage(convertImplementationGuidePackageComponent(t));
161    for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal())
162      tgt.addGlobal(convertImplementationGuideGlobalComponent(t));
163    for (org.hl7.fhir.dstu2.model.UriType t : src.getBinary()) tgt.addBinary(t.getValue());
164    if (src.hasPage())
165      tgt.setPage(convertImplementationGuidePageComponent(src.getPage()));
166    return tgt;
167  }
168
169  public static org.hl7.fhir.dstu2.model.ImplementationGuide convertImplementationGuide(org.hl7.fhir.dstu3.model.ImplementationGuide src) throws FHIRException {
170    if (src == null || src.isEmpty())
171      return null;
172    org.hl7.fhir.dstu2.model.ImplementationGuide tgt = new org.hl7.fhir.dstu2.model.ImplementationGuide();
173    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
174    if (src.hasUrlElement())
175      tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement()));
176    if (src.hasVersionElement())
177      tgt.setVersionElement(String10_30.convertString(src.getVersionElement()));
178    if (src.hasNameElement())
179      tgt.setNameElement(String10_30.convertString(src.getNameElement()));
180    if (src.hasStatus())
181      tgt.setStatusElement(Enumerations10_30.convertConformanceResourceStatus(src.getStatusElement()));
182    if (src.hasExperimental())
183      tgt.setExperimentalElement(Boolean10_30.convertBoolean(src.getExperimentalElement()));
184    if (src.hasPublisherElement())
185      tgt.setPublisherElement(String10_30.convertString(src.getPublisherElement()));
186    for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact())
187      tgt.addContact(convertImplementationGuideContactComponent(t));
188    if (src.hasDate())
189      tgt.setDateElement(DateTime10_30.convertDateTime(src.getDateElement()));
190    if (src.hasDescription())
191      tgt.setDescription(src.getDescription());
192    for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext())
193      if (t.hasValueCodeableConcept())
194        tgt.addUseContext(CodeableConcept10_30.convertCodeableConcept(t.getValueCodeableConcept()));
195    for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction())
196      tgt.addUseContext(CodeableConcept10_30.convertCodeableConcept(t));
197    if (src.hasCopyright())
198      tgt.setCopyright(src.getCopyright());
199    if (src.hasFhirVersionElement())
200      tgt.setFhirVersionElement(Id10_30.convertId(src.getFhirVersionElement()));
201    for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideDependencyComponent t : src.getDependency())
202      tgt.addDependency(convertImplementationGuideDependencyComponent(t));
203    for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageComponent t : src.getPackage())
204      tgt.addPackage(convertImplementationGuidePackageComponent(t));
205    for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal())
206      tgt.addGlobal(convertImplementationGuideGlobalComponent(t));
207    for (org.hl7.fhir.dstu3.model.UriType t : src.getBinary()) tgt.addBinary(t.getValue());
208    if (src.hasPage())
209      tgt.setPage(convertImplementationGuidePageComponent(src.getPage()));
210    return tgt;
211  }
212
213  public static org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideContactComponent convertImplementationGuideContactComponent(org.hl7.fhir.dstu3.model.ContactDetail src) throws FHIRException {
214    if (src == null || src.isEmpty())
215      return null;
216    org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideContactComponent tgt = new org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideContactComponent();
217    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
218    if (src.hasNameElement())
219      tgt.setNameElement(String10_30.convertString(src.getNameElement()));
220    for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom())
221      tgt.addTelecom(ContactPoint10_30.convertContactPoint(t));
222    return tgt;
223  }
224
225  public static org.hl7.fhir.dstu3.model.ContactDetail convertImplementationGuideContactComponent(org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideContactComponent src) throws FHIRException {
226    if (src == null || src.isEmpty())
227      return null;
228    org.hl7.fhir.dstu3.model.ContactDetail tgt = new org.hl7.fhir.dstu3.model.ContactDetail();
229    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
230    if (src.hasNameElement())
231      tgt.setNameElement(String10_30.convertString(src.getNameElement()));
232    for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom())
233      tgt.addTelecom(ContactPoint10_30.convertContactPoint(t));
234    return tgt;
235  }
236
237  public static org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideDependencyComponent convertImplementationGuideDependencyComponent(org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideDependencyComponent src) throws FHIRException {
238    if (src == null || src.isEmpty())
239      return null;
240    org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideDependencyComponent tgt = new org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideDependencyComponent();
241    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
242    if (src.hasType())
243      tgt.setTypeElement(convertGuideDependencyType(src.getTypeElement()));
244    if (src.hasUriElement())
245      tgt.setUriElement(Uri10_30.convertUri(src.getUriElement()));
246    return tgt;
247  }
248
249  public static org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideDependencyComponent convertImplementationGuideDependencyComponent(org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideDependencyComponent src) throws FHIRException {
250    if (src == null || src.isEmpty())
251      return null;
252    org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideDependencyComponent tgt = new org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideDependencyComponent();
253    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
254    if (src.hasType())
255      tgt.setTypeElement(convertGuideDependencyType(src.getTypeElement()));
256    if (src.hasUriElement())
257      tgt.setUriElement(Uri10_30.convertUri(src.getUriElement()));
258    return tgt;
259  }
260
261  public static org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideGlobalComponent convertImplementationGuideGlobalComponent(org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideGlobalComponent src) throws FHIRException {
262    if (src == null || src.isEmpty())
263      return null;
264    org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideGlobalComponent tgt = new org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideGlobalComponent();
265    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
266    if (src.hasTypeElement())
267      tgt.setTypeElement(Code10_30.convertCode(src.getTypeElement()));
268    if (src.hasProfile())
269      tgt.setProfile(Reference10_30.convertReference(src.getProfile()));
270    return tgt;
271  }
272
273  public static org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideGlobalComponent convertImplementationGuideGlobalComponent(org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideGlobalComponent src) throws FHIRException {
274    if (src == null || src.isEmpty())
275      return null;
276    org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideGlobalComponent tgt = new org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideGlobalComponent();
277    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
278    if (src.hasTypeElement())
279      tgt.setTypeElement(Code10_30.convertCode(src.getTypeElement()));
280    if (src.hasProfile())
281      tgt.setProfile(Reference10_30.convertReference(src.getProfile()));
282    return tgt;
283  }
284
285  public static org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageComponent convertImplementationGuidePackageComponent(org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageComponent src) throws FHIRException {
286    if (src == null || src.isEmpty())
287      return null;
288    org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageComponent tgt = new org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageComponent();
289    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
290    if (src.hasNameElement())
291      tgt.setNameElement(String10_30.convertString(src.getNameElement()));
292    if (src.hasDescriptionElement())
293      tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
294    for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageResourceComponent t : src.getResource())
295      tgt.addResource(convertImplementationGuidePackageResourceComponent(t));
296    return tgt;
297  }
298
299  public static org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageComponent convertImplementationGuidePackageComponent(org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageComponent src) throws FHIRException {
300    if (src == null || src.isEmpty())
301      return null;
302    org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageComponent tgt = new org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageComponent();
303    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
304    if (src.hasNameElement())
305      tgt.setNameElement(String10_30.convertString(src.getNameElement()));
306    if (src.hasDescriptionElement())
307      tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
308    for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageResourceComponent t : src.getResource())
309      tgt.addResource(convertImplementationGuidePackageResourceComponent(t));
310    return tgt;
311  }
312
313  public static org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageResourceComponent convertImplementationGuidePackageResourceComponent(org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageResourceComponent src) throws FHIRException {
314    if (src == null || src.isEmpty())
315      return null;
316    org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageResourceComponent tgt = new org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageResourceComponent();
317    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
318    tgt.setExample(src.getPurpose() == org.hl7.fhir.dstu2.model.ImplementationGuide.GuideResourcePurpose.EXAMPLE);
319    if (src.hasNameElement())
320      tgt.setNameElement(String10_30.convertString(src.getNameElement()));
321    if (src.hasDescriptionElement())
322      tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
323    if (src.hasAcronymElement())
324      tgt.setAcronymElement(String10_30.convertString(src.getAcronymElement()));
325    if (src.hasSource())
326      tgt.setSource(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getSource()));
327    if (src.hasExampleFor())
328      tgt.setExampleFor(Reference10_30.convertReference(src.getExampleFor()));
329    return tgt;
330  }
331
332  public static org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageResourceComponent convertImplementationGuidePackageResourceComponent(org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageResourceComponent src) throws FHIRException {
333    if (src == null || src.isEmpty())
334      return null;
335    org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageResourceComponent tgt = new org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageResourceComponent();
336    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
337    if (src.getExample())
338      tgt.setPurpose(org.hl7.fhir.dstu2.model.ImplementationGuide.GuideResourcePurpose.EXAMPLE);
339    else
340      tgt.setPurpose(org.hl7.fhir.dstu2.model.ImplementationGuide.GuideResourcePurpose.PROFILE);
341    if (src.hasNameElement())
342      tgt.setNameElement(String10_30.convertString(src.getNameElement()));
343    if (src.hasDescriptionElement())
344      tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
345    if (src.hasAcronymElement())
346      tgt.setAcronymElement(String10_30.convertString(src.getAcronymElement()));
347    if (src.hasSource())
348      tgt.setSource(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getSource()));
349    if (src.hasExampleFor())
350      tgt.setExampleFor(Reference10_30.convertReference(src.getExampleFor()));
351    return tgt;
352  }
353
354  public static org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePageComponent convertImplementationGuidePageComponent(org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePageComponent src) throws FHIRException {
355    if (src == null || src.isEmpty())
356      return null;
357    org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePageComponent tgt = new org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePageComponent();
358    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
359    if (src.hasSourceElement())
360      tgt.setSourceElement(Uri10_30.convertUri(src.getSourceElement()));
361    if (src.hasTitleElement())
362      tgt.setNameElement(String10_30.convertString(src.getTitleElement()));
363    if (src.hasKind())
364      tgt.setKindElement(convertGuidePageKind(src.getKindElement()));
365    for (org.hl7.fhir.dstu3.model.CodeType t : src.getType()) tgt.addType(t.getValue());
366    for (org.hl7.fhir.dstu3.model.StringType t : src.getPackage()) tgt.addPackage(t.getValue());
367    if (src.hasFormatElement())
368      tgt.setFormatElement(Code10_30.convertCode(src.getFormatElement()));
369    for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePageComponent t : src.getPage())
370      tgt.addPage(convertImplementationGuidePageComponent(t));
371    return tgt;
372  }
373
374  public static org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePageComponent convertImplementationGuidePageComponent(org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePageComponent src) throws FHIRException {
375    if (src == null || src.isEmpty())
376      return null;
377    org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePageComponent tgt = new org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePageComponent();
378    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
379    if (src.hasSourceElement())
380      tgt.setSourceElement(Uri10_30.convertUri(src.getSourceElement()));
381    if (src.hasNameElement())
382      tgt.setTitleElement(String10_30.convertString(src.getNameElement()));
383    if (src.hasKind())
384      tgt.setKindElement(convertGuidePageKind(src.getKindElement()));
385    for (org.hl7.fhir.dstu2.model.CodeType t : src.getType()) tgt.addType(t.getValue());
386    for (org.hl7.fhir.dstu2.model.StringType t : src.getPackage()) tgt.addPackage(t.getValue());
387    if (src.hasFormatElement())
388      tgt.setFormatElement(Code10_30.convertCode(src.getFormatElement()));
389    for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePageComponent t : src.getPage())
390      tgt.addPage(convertImplementationGuidePageComponent(t));
391    return tgt;
392  }
393}