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