001package org.hl7.fhir.convertors.conv30_40.resources30_40;
002
003import org.hl7.fhir.convertors.VersionConvertorConstants;
004import org.hl7.fhir.convertors.context.ConversionContext30_40;
005import org.hl7.fhir.convertors.conv30_40.datatypes30_40.ContactDetail30_40;
006import org.hl7.fhir.convertors.conv30_40.datatypes30_40.Reference30_40;
007import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.CodeableConcept30_40;
008import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.Coding30_40;
009import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.Timing30_40;
010import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.*;
011import org.hl7.fhir.exceptions.FHIRException;
012
013import java.util.stream.Collectors;
014
015public class CapabilityStatement30_40 {
016
017  public static org.hl7.fhir.dstu3.model.CapabilityStatement convertCapabilityStatement(org.hl7.fhir.r4.model.CapabilityStatement src) throws FHIRException {
018    if (src == null)
019      return null;
020    org.hl7.fhir.dstu3.model.CapabilityStatement tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement();
021    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyDomainResource(src, tgt);
022    if (src.hasUrl())
023      tgt.setUrlElement(Uri30_40.convertUri(src.getUrlElement()));
024    if (src.hasVersion())
025      tgt.setVersionElement(String30_40.convertString(src.getVersionElement()));
026    if (src.hasName())
027      tgt.setNameElement(String30_40.convertString(src.getNameElement()));
028    if (src.hasTitle())
029      tgt.setTitleElement(String30_40.convertString(src.getTitleElement()));
030    if (src.hasStatus())
031      tgt.setStatusElement(Enumerations30_40.convertPublicationStatus(src.getStatusElement()));
032    if (src.hasExperimental())
033      tgt.setExperimentalElement(Boolean30_40.convertBoolean(src.getExperimentalElement()));
034    if (src.hasDateElement())
035      tgt.setDateElement(DateTime30_40.convertDateTime(src.getDateElement()));
036    if (src.hasPublisher())
037      tgt.setPublisherElement(String30_40.convertString(src.getPublisherElement()));
038    for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact())
039      tgt.addContact(ContactDetail30_40.convertContactDetail(t));
040    if (src.hasDescription())
041      tgt.setDescriptionElement(MarkDown30_40.convertMarkdown(src.getDescriptionElement()));
042    for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext())
043      tgt.addUseContext(Timing30_40.convertUsageContext(t));
044    for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction())
045      tgt.addJurisdiction(CodeableConcept30_40.convertCodeableConcept(t));
046    if (src.hasPurpose())
047      tgt.setPurposeElement(MarkDown30_40.convertMarkdown(src.getPurposeElement()));
048    if (src.hasCopyright())
049      tgt.setCopyrightElement(MarkDown30_40.convertMarkdown(src.getCopyrightElement()));
050    if (src.hasKind())
051      tgt.setKindElement(convertCapabilityStatementKind(src.getKindElement()));
052    for (org.hl7.fhir.r4.model.UriType t : src.getInstantiates()) tgt.addInstantiates(t.getValue());
053    if (src.hasSoftware())
054      tgt.setSoftware(convertCapabilityStatementSoftwareComponent(src.getSoftware()));
055    if (src.hasImplementation())
056      tgt.setImplementation(convertCapabilityStatementImplementationComponent(src.getImplementation()));
057    if (src.hasFhirVersion())
058      tgt.setFhirVersion(src.getFhirVersion().toCode());
059    if (src.hasExtension("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown"))
060      tgt.setAcceptUnknown(org.hl7.fhir.dstu3.model.CapabilityStatement.UnknownContentCode.fromCode(src.getExtensionByUrl("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown").getValue().primitiveValue()));
061    for (org.hl7.fhir.r4.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue());
062    for (org.hl7.fhir.r4.model.CodeType t : src.getPatchFormat()) tgt.addPatchFormat(t.getValue());
063    for (org.hl7.fhir.r4.model.UriType t : src.getImplementationGuide()) tgt.addImplementationGuide(t.getValue());
064    for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestComponent r : src.getRest())
065      for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent rr : r.getResource())
066        for (org.hl7.fhir.r4.model.CanonicalType t : rr.getSupportedProfile())
067          tgt.addProfile(Reference30_40.convertCanonicalToReference(t));
068    for (org.hl7.fhir.r4.model.Extension ext : src.getExtension()) {
069      if ("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.profile".equals(ext.getUrl())) {
070        tgt.addProfile(Reference30_40.convertReference((org.hl7.fhir.r4.model.Reference) ext.getValue()));
071      }
072    }
073    for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestComponent t : src.getRest())
074      tgt.addRest(convertCapabilityStatementRestComponent(t));
075    for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingComponent t : src.getMessaging())
076      tgt.addMessaging(convertCapabilityStatementMessagingComponent(t));
077    for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementDocumentComponent t : src.getDocument())
078      tgt.addDocument(convertCapabilityStatementDocumentComponent(t));
079    return tgt;
080  }
081
082  public static org.hl7.fhir.r4.model.CapabilityStatement convertCapabilityStatement(org.hl7.fhir.dstu3.model.CapabilityStatement src) throws FHIRException {
083    if (src == null)
084      return null;
085    org.hl7.fhir.r4.model.CapabilityStatement tgt = new org.hl7.fhir.r4.model.CapabilityStatement();
086    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyDomainResource(src, tgt);
087    if (src.hasUrl())
088      tgt.setUrlElement(Uri30_40.convertUri(src.getUrlElement()));
089    if (src.hasVersion())
090      tgt.setVersionElement(String30_40.convertString(src.getVersionElement()));
091    if (src.hasName())
092      tgt.setNameElement(String30_40.convertString(src.getNameElement()));
093    if (src.hasTitle())
094      tgt.setTitleElement(String30_40.convertString(src.getTitleElement()));
095    if (src.hasStatus())
096      tgt.setStatusElement(Enumerations30_40.convertPublicationStatus(src.getStatusElement()));
097    if (src.hasExperimental())
098      tgt.setExperimentalElement(Boolean30_40.convertBoolean(src.getExperimentalElement()));
099    if (src.hasDateElement())
100      tgt.setDateElement(DateTime30_40.convertDateTime(src.getDateElement()));
101    if (src.hasPublisher())
102      tgt.setPublisherElement(String30_40.convertString(src.getPublisherElement()));
103    for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact())
104      tgt.addContact(ContactDetail30_40.convertContactDetail(t));
105    if (src.hasDescription())
106      tgt.setDescriptionElement(MarkDown30_40.convertMarkdown(src.getDescriptionElement()));
107    for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext())
108      tgt.addUseContext(Timing30_40.convertUsageContext(t));
109    for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction())
110      tgt.addJurisdiction(CodeableConcept30_40.convertCodeableConcept(t));
111    if (src.hasPurpose())
112      tgt.setPurposeElement(MarkDown30_40.convertMarkdown(src.getPurposeElement()));
113    if (src.hasCopyright())
114      tgt.setCopyrightElement(MarkDown30_40.convertMarkdown(src.getCopyrightElement()));
115    if (src.hasKind())
116      tgt.setKindElement(convertCapabilityStatementKind(src.getKindElement()));
117    for (org.hl7.fhir.dstu3.model.UriType t : src.getInstantiates()) tgt.addInstantiates(t.getValue());
118    if (src.hasSoftware())
119      tgt.setSoftware(convertCapabilityStatementSoftwareComponent(src.getSoftware()));
120    if (src.hasImplementation())
121      tgt.setImplementation(convertCapabilityStatementImplementationComponent(src.getImplementation()));
122    if (src.hasFhirVersion())
123      tgt.setFhirVersion(org.hl7.fhir.r4.model.Enumerations.FHIRVersion.fromCode(src.getFhirVersion()));
124    if (src.hasAcceptUnknown())
125      tgt.addExtension().setUrl("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown").setValue(new org.hl7.fhir.r4.model.CodeType(src.getAcceptUnknownElement().asStringValue()));
126    for (org.hl7.fhir.dstu3.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue());
127    for (org.hl7.fhir.dstu3.model.CodeType t : src.getPatchFormat()) tgt.addPatchFormat(t.getValue());
128    for (org.hl7.fhir.dstu3.model.UriType t : src.getImplementationGuide()) tgt.addImplementationGuide(t.getValue());
129    for (org.hl7.fhir.dstu3.model.Reference t : src.getProfile())
130      tgt.addExtension("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.profile", Reference30_40.convertReference(t));
131    for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestComponent t : src.getRest())
132      tgt.addRest(convertCapabilityStatementRestComponent(t));
133    for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingComponent t : src.getMessaging())
134      tgt.addMessaging(convertCapabilityStatementMessagingComponent(t));
135    for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementDocumentComponent t : src.getDocument())
136      tgt.addDocument(convertCapabilityStatementDocumentComponent(t));
137    return tgt;
138  }
139
140  public static org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementDocumentComponent convertCapabilityStatementDocumentComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementDocumentComponent src) throws FHIRException {
141    if (src == null)
142      return null;
143    org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementDocumentComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementDocumentComponent();
144    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
145    if (src.hasMode())
146      tgt.setModeElement(convertDocumentMode(src.getModeElement()));
147    if (src.hasDocumentation())
148      tgt.setDocumentation(src.getDocumentation());
149    if (src.hasProfile())
150      tgt.setProfile(Reference30_40.convertCanonicalToReference(src.getProfileElement()));
151    return tgt;
152  }
153
154  public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementDocumentComponent convertCapabilityStatementDocumentComponent(org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementDocumentComponent src) throws FHIRException {
155    if (src == null)
156      return null;
157    org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementDocumentComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementDocumentComponent();
158    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
159    if (src.hasMode())
160      tgt.setModeElement(convertDocumentMode(src.getModeElement()));
161    if (src.hasDocumentation())
162      tgt.setDocumentation(src.getDocumentation());
163    if (src.hasProfile())
164      tgt.setProfileElement(Reference30_40.convertReferenceToCanonical(src.getProfile()));
165    return tgt;
166  }
167
168  public static org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementImplementationComponent convertCapabilityStatementImplementationComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementImplementationComponent src) throws FHIRException {
169    if (src == null)
170      return null;
171    org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementImplementationComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementImplementationComponent();
172    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
173    if (src.hasDescription())
174      tgt.setDescriptionElement(String30_40.convertString(src.getDescriptionElement()));
175    if (src.hasUrl())
176      tgt.setUrl(src.getUrl());
177    return tgt;
178  }
179
180  public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementImplementationComponent convertCapabilityStatementImplementationComponent(org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementImplementationComponent src) throws FHIRException {
181    if (src == null)
182      return null;
183    org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementImplementationComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementImplementationComponent();
184    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
185    if (src.hasDescription())
186      tgt.setDescriptionElement(String30_40.convertString(src.getDescriptionElement()));
187    if (src.hasUrl())
188      tgt.setUrl(src.getUrl());
189    return tgt;
190  }
191
192  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementKind> convertCapabilityStatementKind(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind> src) throws FHIRException {
193    if (src == null || src.isEmpty())
194      return null;
195    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementKind> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementKindEnumFactory());
196    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
197    switch (src.getValue()) {
198      case INSTANCE:
199        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementKind.INSTANCE);
200        break;
201      case CAPABILITY:
202        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementKind.CAPABILITY);
203        break;
204      case REQUIREMENTS:
205        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementKind.REQUIREMENTS);
206        break;
207      default:
208        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementKind.NULL);
209        break;
210    }
211    return tgt;
212  }
213
214  static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind> convertCapabilityStatementKind(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementKind> src) throws FHIRException {
215    if (src == null || src.isEmpty())
216      return null;
217    org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKindEnumFactory());
218    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
219    switch (src.getValue()) {
220      case INSTANCE:
221        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind.INSTANCE);
222        break;
223      case CAPABILITY:
224        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind.CAPABILITY);
225        break;
226      case REQUIREMENTS:
227        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind.REQUIREMENTS);
228        break;
229      default:
230        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind.NULL);
231        break;
232    }
233    return tgt;
234  }
235
236  public static org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingComponent convertCapabilityStatementMessagingComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingComponent src) throws FHIRException {
237    if (src == null)
238      return null;
239    org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingComponent();
240    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
241    for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent t : src.getEndpoint())
242      tgt.addEndpoint(convertCapabilityStatementMessagingEndpointComponent(t));
243    if (src.hasReliableCache())
244      tgt.setReliableCacheElement(UnsignedInt30_40.convertUnsignedInt(src.getReliableCacheElement()));
245    if (src.hasDocumentation())
246      tgt.setDocumentation(src.getDocumentation());
247    for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent t : src.getSupportedMessage())
248      tgt.addSupportedMessage(convertCapabilityStatementMessagingSupportedMessageComponent(t));
249    for (org.hl7.fhir.r4.model.Extension e : src.getExtensionsByUrl(VersionConvertorConstants.IG_CONFORMANCE_MESSAGE_EVENT)) {
250      org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEventComponent event = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEventComponent();
251      tgt.addEvent(event);
252      event.setCode(Coding30_40.convertCoding((org.hl7.fhir.r4.model.Coding) e.getExtensionByUrl("code").getValue()));
253      if (e.hasExtension("category"))
254        event.setCategory(org.hl7.fhir.dstu3.model.CapabilityStatement.MessageSignificanceCategory.fromCode(e.getExtensionByUrl("category").getValue().toString()));
255      event.setMode(org.hl7.fhir.dstu3.model.CapabilityStatement.EventCapabilityMode.fromCode(e.getExtensionByUrl("mode").getValue().toString()));
256      event.setCode(Coding30_40.convertCoding((org.hl7.fhir.r4.model.Coding) e.getExtensionByUrl("code").getValue()));
257      if (e.hasExtension("category"))
258        event.setCategory(org.hl7.fhir.dstu3.model.CapabilityStatement.MessageSignificanceCategory.fromCode(e.getExtensionByUrl("category").getValue().toString()));
259      event.setMode(org.hl7.fhir.dstu3.model.CapabilityStatement.EventCapabilityMode.fromCode(e.getExtensionByUrl("mode").getValue().toString()));
260      org.hl7.fhir.r4.model.Extension focusE = e.getExtensionByUrl("focus");
261      if (focusE.getValue().hasPrimitiveValue())
262        event.setFocus(focusE.getValue().toString());
263      else {
264        event.setFocusElement(new org.hl7.fhir.dstu3.model.CodeType());
265        ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(focusE.getValue(), event.getFocusElement());
266      }
267      event.setRequest(Reference30_40.convertReference((org.hl7.fhir.r4.model.Reference) e.getExtensionByUrl("request").getValue()));
268      event.setResponse(Reference30_40.convertReference((org.hl7.fhir.r4.model.Reference) e.getExtensionByUrl("response").getValue()));
269      if (e.hasExtension("documentation"))
270        event.setDocumentation(e.getExtensionByUrl("documentation").getValue().toString());
271    }
272    return tgt;
273  }
274
275  public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingComponent convertCapabilityStatementMessagingComponent(org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingComponent src) throws FHIRException {
276    if (src == null)
277      return null;
278    org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingComponent();
279    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
280    for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent t : src.getEndpoint())
281      tgt.addEndpoint(convertCapabilityStatementMessagingEndpointComponent(t));
282    if (src.hasReliableCache())
283      tgt.setReliableCacheElement(UnsignedInt30_40.convertUnsignedInt(src.getReliableCacheElement()));
284    if (src.hasDocumentation())
285      tgt.setDocumentation(src.getDocumentation());
286    for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent t : src.getSupportedMessage())
287      tgt.addSupportedMessage(convertCapabilityStatementMessagingSupportedMessageComponent(t));
288    for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEventComponent t : src.getEvent()) {
289      org.hl7.fhir.r4.model.Extension e = new org.hl7.fhir.r4.model.Extension(VersionConvertorConstants.IG_CONFORMANCE_MESSAGE_EVENT);
290      e.addExtension(new org.hl7.fhir.r4.model.Extension("code", Coding30_40.convertCoding(t.getCode())));
291      if (t.hasCategory())
292        e.addExtension(new org.hl7.fhir.r4.model.Extension("category", new org.hl7.fhir.r4.model.CodeType(t.getCategory().toCode())));
293      e.addExtension(new org.hl7.fhir.r4.model.Extension("mode", new org.hl7.fhir.r4.model.CodeType(t.getMode().toCode())));
294      if (t.getFocusElement().hasValue())
295        e.addExtension(new org.hl7.fhir.r4.model.Extension("focus", new org.hl7.fhir.r4.model.StringType(t.getFocus())));
296      else {
297        org.hl7.fhir.r4.model.CodeType focus = new org.hl7.fhir.r4.model.CodeType();
298        org.hl7.fhir.r4.model.Extension focusE = new org.hl7.fhir.r4.model.Extension("focus", focus);
299        ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(t.getFocusElement(), focus);
300        e.addExtension(focusE);
301      }
302      e.addExtension(new org.hl7.fhir.r4.model.Extension("request", Reference30_40.convertReference(t.getRequest())));
303      e.addExtension(new org.hl7.fhir.r4.model.Extension("response", Reference30_40.convertReference(t.getResponse())));
304      if (t.hasDocumentation())
305        e.addExtension(new org.hl7.fhir.r4.model.Extension("documentation", new org.hl7.fhir.r4.model.StringType(t.getDocumentation())));
306      tgt.addExtension(e);
307    }
308    return tgt;
309  }
310
311  public static org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent convertCapabilityStatementMessagingEndpointComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent src) throws FHIRException {
312    if (src == null)
313      return null;
314    org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent();
315    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
316    if (src.hasProtocol())
317      tgt.setProtocol(Coding30_40.convertCoding(src.getProtocol()));
318    if (src.hasAddress())
319      tgt.setAddress(src.getAddress());
320    return tgt;
321  }
322
323  public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent convertCapabilityStatementMessagingEndpointComponent(org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent src) throws FHIRException {
324    if (src == null)
325      return null;
326    org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent();
327    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
328    if (src.hasProtocol())
329      tgt.setProtocol(Coding30_40.convertCoding(src.getProtocol()));
330    if (src.hasAddress())
331      tgt.setAddress(src.getAddress());
332    return tgt;
333  }
334
335  public static org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent convertCapabilityStatementMessagingSupportedMessageComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent src) throws FHIRException {
336    if (src == null)
337      return null;
338    org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent();
339    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
340    if (src.hasMode())
341      tgt.setModeElement(convertEventCapabilityMode(src.getModeElement()));
342    if (src.hasDefinition())
343      tgt.setDefinition(Reference30_40.convertCanonicalToReference(src.getDefinitionElement()));
344    return tgt;
345  }
346
347  public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent convertCapabilityStatementMessagingSupportedMessageComponent(org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent src) throws FHIRException {
348    if (src == null)
349      return null;
350    org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent();
351    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
352    if (src.hasMode())
353      tgt.setModeElement(convertEventCapabilityMode(src.getModeElement()));
354    if (src.hasDefinition())
355      tgt.setDefinitionElement(Reference30_40.convertReferenceToCanonical(src.getDefinition()));
356    return tgt;
357  }
358
359  public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestComponent convertCapabilityStatementRestComponent(org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestComponent src) throws FHIRException {
360    if (src == null)
361      return null;
362    org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestComponent();
363    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
364    if (src.hasMode())
365      tgt.setModeElement(convertRestfulCapabilityMode(src.getModeElement()));
366    if (src.hasDocumentation())
367      tgt.setDocumentation(src.getDocumentation());
368    if (src.hasSecurity())
369      tgt.setSecurity(convertCapabilityStatementRestSecurityComponent(src.getSecurity()));
370    for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceComponent t : src.getResource())
371      tgt.addResource(convertCapabilityStatementRestResourceComponent(t));
372    for (org.hl7.fhir.dstu3.model.CapabilityStatement.SystemInteractionComponent t : src.getInteraction())
373      tgt.addInteraction(convertSystemInteractionComponent(t));
374    for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam())
375      tgt.addSearchParam(convertCapabilityStatementRestResourceSearchParamComponent(t));
376    for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestOperationComponent t : src.getOperation())
377      tgt.addOperation(convertCapabilityStatementRestOperationComponent(t));
378    for (org.hl7.fhir.dstu3.model.UriType t : src.getCompartment()) tgt.addCompartment(t.getValue());
379    return tgt;
380  }
381
382  public static org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestComponent convertCapabilityStatementRestComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestComponent src) throws FHIRException {
383    if (src == null)
384      return null;
385    org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestComponent();
386    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
387    if (src.hasMode())
388      tgt.setModeElement(convertRestfulCapabilityMode(src.getModeElement()));
389    if (src.hasDocumentation())
390      tgt.setDocumentation(src.getDocumentation());
391    if (src.hasSecurity())
392      tgt.setSecurity(convertCapabilityStatementRestSecurityComponent(src.getSecurity()));
393    for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent t : src.getResource())
394      tgt.addResource(convertCapabilityStatementRestResourceComponent(t));
395    for (org.hl7.fhir.r4.model.CapabilityStatement.SystemInteractionComponent t : src.getInteraction())
396      tgt.addInteraction(convertSystemInteractionComponent(t));
397    for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam())
398      tgt.addSearchParam(convertCapabilityStatementRestResourceSearchParamComponent(t));
399    for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent t : src.getOperation())
400      tgt.addOperation(convertCapabilityStatementRestOperationComponent(t));
401    for (org.hl7.fhir.r4.model.UriType t : src.getCompartment()) tgt.addCompartment(t.getValue());
402    return tgt;
403  }
404
405  public static org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestOperationComponent convertCapabilityStatementRestOperationComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent src) throws FHIRException {
406    if (src == null)
407      return null;
408    org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestOperationComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestOperationComponent();
409    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
410    if (src.hasName())
411      tgt.setNameElement(String30_40.convertString(src.getNameElement()));
412    if (src.hasDefinition())
413      tgt.setDefinition(Reference30_40.convertCanonicalToReference(src.getDefinitionElement()));
414    return tgt;
415  }
416
417  public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent convertCapabilityStatementRestOperationComponent(org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestOperationComponent src) throws FHIRException {
418    if (src == null)
419      return null;
420    org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent();
421    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
422    if (src.hasName())
423      tgt.setNameElement(String30_40.convertString(src.getNameElement()));
424    if (src.hasDefinition())
425      tgt.setDefinitionElement(Reference30_40.convertReferenceToCanonical(src.getDefinition()));
426    return tgt;
427  }
428
429  public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent convertCapabilityStatementRestResourceComponent(org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceComponent src) throws FHIRException {
430    if (src == null)
431      return null;
432    org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent();
433    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
434    if (src.hasType())
435      tgt.setTypeElement(Code30_40.convertCode(src.getTypeElement()));
436    if (src.hasProfile())
437      tgt.setProfileElement(Reference30_40.convertReferenceToCanonical(src.getProfile()));
438    if (src.hasDocumentation())
439      tgt.setDocumentationElement(MarkDown30_40.convertMarkdown(src.getDocumentationElement()));
440    for (org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceInteractionComponent t : src.getInteraction())
441      tgt.addInteraction(convertResourceInteractionComponent(t));
442    if (src.hasVersioning())
443      tgt.setVersioningElement(convertResourceVersionPolicy(src.getVersioningElement()));
444    if (src.hasReadHistory())
445      tgt.setReadHistoryElement(Boolean30_40.convertBoolean(src.getReadHistoryElement()));
446    if (src.hasUpdateCreate())
447      tgt.setUpdateCreateElement(Boolean30_40.convertBoolean(src.getUpdateCreateElement()));
448    if (src.hasConditionalCreate())
449      tgt.setConditionalCreateElement(Boolean30_40.convertBoolean(src.getConditionalCreateElement()));
450    if (src.hasConditionalRead())
451      tgt.setConditionalReadElement(convertConditionalReadStatus(src.getConditionalReadElement()));
452    if (src.hasConditionalUpdate())
453      tgt.setConditionalUpdateElement(Boolean30_40.convertBoolean(src.getConditionalUpdateElement()));
454    if (src.hasConditionalDelete())
455      tgt.setConditionalDeleteElement(convertConditionalDeleteStatus(src.getConditionalDeleteElement()));
456    tgt.setReferencePolicy(src.getReferencePolicy().stream()
457      .map(CapabilityStatement30_40::convertReferenceHandlingPolicy)
458      .collect(Collectors.toList()));
459    for (org.hl7.fhir.dstu3.model.StringType t : src.getSearchInclude()) tgt.addSearchInclude(t.getValue());
460    for (org.hl7.fhir.dstu3.model.StringType t : src.getSearchRevInclude()) tgt.addSearchRevInclude(t.getValue());
461    for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam())
462      tgt.addSearchParam(convertCapabilityStatementRestResourceSearchParamComponent(t));
463    return tgt;
464  }
465
466  public static org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceComponent convertCapabilityStatementRestResourceComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent src) throws FHIRException {
467    if (src == null)
468      return null;
469    org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceComponent();
470    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
471    if (src.hasType())
472      tgt.setTypeElement(Code30_40.convertCode(src.getTypeElement()));
473    if (src.hasProfile())
474      tgt.setProfile(Reference30_40.convertCanonicalToReference(src.getProfileElement()));
475    if (src.hasDocumentation())
476      tgt.setDocumentationElement(MarkDown30_40.convertMarkdown(src.getDocumentationElement()));
477    for (org.hl7.fhir.r4.model.CapabilityStatement.ResourceInteractionComponent t : src.getInteraction())
478      tgt.addInteraction(convertResourceInteractionComponent(t));
479    if (src.hasVersioning())
480      tgt.setVersioningElement(convertResourceVersionPolicy(src.getVersioningElement()));
481    if (src.hasReadHistory())
482      tgt.setReadHistoryElement(Boolean30_40.convertBoolean(src.getReadHistoryElement()));
483    if (src.hasUpdateCreate())
484      tgt.setUpdateCreateElement(Boolean30_40.convertBoolean(src.getUpdateCreateElement()));
485    if (src.hasConditionalCreate())
486      tgt.setConditionalCreateElement(Boolean30_40.convertBoolean(src.getConditionalCreateElement()));
487    if (src.hasConditionalRead())
488      tgt.setConditionalReadElement(convertConditionalReadStatus(src.getConditionalReadElement()));
489    if (src.hasConditionalUpdate())
490      tgt.setConditionalUpdateElement(Boolean30_40.convertBoolean(src.getConditionalUpdateElement()));
491    if (src.hasConditionalDelete())
492      tgt.setConditionalDeleteElement(convertConditionalDeleteStatus(src.getConditionalDeleteElement()));
493    tgt.setReferencePolicy(src.getReferencePolicy().stream()
494      .map(CapabilityStatement30_40::convertReferenceHandlingPolicy)
495      .collect(Collectors.toList()));
496    for (org.hl7.fhir.r4.model.StringType t : src.getSearchInclude()) tgt.addSearchInclude(t.getValue());
497    for (org.hl7.fhir.r4.model.StringType t : src.getSearchRevInclude()) tgt.addSearchRevInclude(t.getValue());
498    for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam())
499      tgt.addSearchParam(convertCapabilityStatementRestResourceSearchParamComponent(t));
500    return tgt;
501  }
502
503  public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent convertCapabilityStatementRestResourceSearchParamComponent(org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent src) throws FHIRException {
504    if (src == null)
505      return null;
506    org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent();
507    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
508    if (src.hasName())
509      tgt.setNameElement(String30_40.convertString(src.getNameElement()));
510    if (src.hasDefinition())
511      tgt.setDefinition(src.getDefinition());
512    if (src.hasType())
513      tgt.setTypeElement(Enumerations30_40.convertSearchParamType(src.getTypeElement()));
514    if (src.hasDocumentation())
515      tgt.setDocumentation(src.getDocumentation());
516    return tgt;
517  }
518
519  public static org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent convertCapabilityStatementRestResourceSearchParamComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent src) throws FHIRException {
520    if (src == null)
521      return null;
522    org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent();
523    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
524    if (src.hasName())
525      tgt.setNameElement(String30_40.convertString(src.getNameElement()));
526    if (src.hasDefinition())
527      tgt.setDefinition(src.getDefinition());
528    if (src.hasType())
529      tgt.setTypeElement(Enumerations30_40.convertSearchParamType(src.getTypeElement()));
530    if (src.hasDocumentation())
531      tgt.setDocumentation(src.getDocumentation());
532    return tgt;
533  }
534
535  public static org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestSecurityComponent convertCapabilityStatementRestSecurityComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestSecurityComponent src) throws FHIRException {
536    if (src == null)
537      return null;
538    org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestSecurityComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestSecurityComponent();
539    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
540    if (src.hasCors())
541      tgt.setCorsElement(Boolean30_40.convertBoolean(src.getCorsElement()));
542    for (org.hl7.fhir.r4.model.CodeableConcept t : src.getService())
543      tgt.addService(CodeableConcept30_40.convertCodeableConcept(t));
544    if (src.hasDescription())
545      tgt.setDescription(src.getDescription());
546    return tgt;
547  }
548
549  public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestSecurityComponent convertCapabilityStatementRestSecurityComponent(org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestSecurityComponent src) throws FHIRException {
550    if (src == null)
551      return null;
552    org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestSecurityComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestSecurityComponent();
553    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
554    if (src.hasCors())
555      tgt.setCorsElement(Boolean30_40.convertBoolean(src.getCorsElement()));
556    for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getService())
557      tgt.addService(CodeableConcept30_40.convertCodeableConcept(t));
558    if (src.hasDescription())
559      tgt.setDescription(src.getDescription());
560    return tgt;
561  }
562
563  public static org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementSoftwareComponent convertCapabilityStatementSoftwareComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementSoftwareComponent src) throws FHIRException {
564    if (src == null)
565      return null;
566    org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementSoftwareComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementSoftwareComponent();
567    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
568    if (src.hasName())
569      tgt.setNameElement(String30_40.convertString(src.getNameElement()));
570    if (src.hasVersion())
571      tgt.setVersionElement(String30_40.convertString(src.getVersionElement()));
572    if (src.hasReleaseDate())
573      tgt.setReleaseDateElement(DateTime30_40.convertDateTime(src.getReleaseDateElement()));
574    return tgt;
575  }
576
577  public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementSoftwareComponent convertCapabilityStatementSoftwareComponent(org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementSoftwareComponent src) throws FHIRException {
578    if (src == null)
579      return null;
580    org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementSoftwareComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementSoftwareComponent();
581    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
582    if (src.hasName())
583      tgt.setNameElement(String30_40.convertString(src.getNameElement()));
584    if (src.hasVersion())
585      tgt.setVersionElement(String30_40.convertString(src.getVersionElement()));
586    if (src.hasReleaseDate())
587      tgt.setReleaseDateElement(DateTime30_40.convertDateTime(src.getReleaseDateElement()));
588    return tgt;
589  }
590
591  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalDeleteStatus> convertConditionalDeleteStatus(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus> src) throws FHIRException {
592    if (src == null || src.isEmpty())
593      return null;
594    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalDeleteStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalDeleteStatusEnumFactory());
595    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
596    switch (src.getValue()) {
597      case NOTSUPPORTED:
598        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalDeleteStatus.NOTSUPPORTED);
599        break;
600      case SINGLE:
601        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalDeleteStatus.SINGLE);
602        break;
603      case MULTIPLE:
604        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalDeleteStatus.MULTIPLE);
605        break;
606      default:
607        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalDeleteStatus.NULL);
608        break;
609    }
610    return tgt;
611  }
612
613  static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus> convertConditionalDeleteStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalDeleteStatus> src) throws FHIRException {
614    if (src == null || src.isEmpty())
615      return null;
616    org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatusEnumFactory());
617    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
618    switch (src.getValue()) {
619      case NOTSUPPORTED:
620        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus.NOTSUPPORTED);
621        break;
622      case SINGLE:
623        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus.SINGLE);
624        break;
625      case MULTIPLE:
626        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus.MULTIPLE);
627        break;
628      default:
629        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus.NULL);
630        break;
631    }
632    return tgt;
633  }
634
635  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalReadStatus> convertConditionalReadStatus(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus> src) throws FHIRException {
636    if (src == null || src.isEmpty())
637      return null;
638    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalReadStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalReadStatusEnumFactory());
639    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
640    switch (src.getValue()) {
641      case NOTSUPPORTED:
642        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalReadStatus.NOTSUPPORTED);
643        break;
644      case MODIFIEDSINCE:
645        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalReadStatus.MODIFIEDSINCE);
646        break;
647      case NOTMATCH:
648        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalReadStatus.NOTMATCH);
649        break;
650      case FULLSUPPORT:
651        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalReadStatus.FULLSUPPORT);
652        break;
653      default:
654        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalReadStatus.NULL);
655        break;
656    }
657    return tgt;
658  }
659
660  static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus> convertConditionalReadStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CapabilityStatement.ConditionalReadStatus> src) throws FHIRException {
661    if (src == null || src.isEmpty())
662      return null;
663    org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatusEnumFactory());
664    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
665    switch (src.getValue()) {
666      case NOTSUPPORTED:
667        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus.NOTSUPPORTED);
668        break;
669      case MODIFIEDSINCE:
670        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus.MODIFIEDSINCE);
671        break;
672      case NOTMATCH:
673        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus.NOTMATCH);
674        break;
675      case FULLSUPPORT:
676        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus.FULLSUPPORT);
677        break;
678      default:
679        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus.NULL);
680        break;
681    }
682    return tgt;
683  }
684
685  static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CapabilityStatement.DocumentMode> convertDocumentMode(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CapabilityStatement.DocumentMode> src) throws FHIRException {
686    if (src == null || src.isEmpty())
687      return null;
688    org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CapabilityStatement.DocumentMode> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.DocumentModeEnumFactory());
689    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
690    switch (src.getValue()) {
691      case PRODUCER:
692        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.DocumentMode.PRODUCER);
693        break;
694      case CONSUMER:
695        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.DocumentMode.CONSUMER);
696        break;
697      default:
698        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.DocumentMode.NULL);
699        break;
700    }
701    return tgt;
702  }
703
704  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CapabilityStatement.DocumentMode> convertDocumentMode(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CapabilityStatement.DocumentMode> src) throws FHIRException {
705    if (src == null || src.isEmpty())
706      return null;
707    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CapabilityStatement.DocumentMode> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.DocumentModeEnumFactory());
708    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
709    switch (src.getValue()) {
710      case PRODUCER:
711        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.DocumentMode.PRODUCER);
712        break;
713      case CONSUMER:
714        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.DocumentMode.CONSUMER);
715        break;
716      default:
717        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.DocumentMode.NULL);
718        break;
719    }
720    return tgt;
721  }
722
723  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CapabilityStatement.EventCapabilityMode> convertEventCapabilityMode(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityMode> src) throws FHIRException {
724    if (src == null || src.isEmpty())
725      return null;
726    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CapabilityStatement.EventCapabilityMode> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.EventCapabilityModeEnumFactory());
727    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
728    switch (src.getValue()) {
729      case SENDER:
730        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.EventCapabilityMode.SENDER);
731        break;
732      case RECEIVER:
733        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.EventCapabilityMode.RECEIVER);
734        break;
735      default:
736        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.EventCapabilityMode.NULL);
737        break;
738    }
739    return tgt;
740  }
741
742  static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityMode> convertEventCapabilityMode(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CapabilityStatement.EventCapabilityMode> src) throws FHIRException {
743    if (src == null || src.isEmpty())
744      return null;
745    org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityMode> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityModeEnumFactory());
746    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
747    switch (src.getValue()) {
748      case SENDER:
749        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityMode.SENDER);
750        break;
751      case RECEIVER:
752        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityMode.RECEIVER);
753        break;
754      default:
755        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityMode.NULL);
756        break;
757    }
758    return tgt;
759  }
760
761  static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy> convertReferenceHandlingPolicy(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CapabilityStatement.ReferenceHandlingPolicy> src) throws FHIRException {
762    if (src == null || src.isEmpty())
763      return null;
764    org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicyEnumFactory());
765    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
766    switch (src.getValue()) {
767      case LITERAL:
768        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.LITERAL);
769        break;
770      case LOGICAL:
771        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.LOGICAL);
772        break;
773      case RESOLVES:
774        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.RESOLVES);
775        break;
776      case ENFORCED:
777        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.ENFORCED);
778        break;
779      case LOCAL:
780        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.LOCAL);
781        break;
782      default:
783        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.NULL);
784        break;
785    }
786    return tgt;
787  }
788
789  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CapabilityStatement.ReferenceHandlingPolicy> convertReferenceHandlingPolicy(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy> src) throws FHIRException {
790    if (src == null || src.isEmpty())
791      return null;
792    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CapabilityStatement.ReferenceHandlingPolicy> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.ReferenceHandlingPolicyEnumFactory());
793    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
794    switch (src.getValue()) {
795      case LITERAL:
796        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ReferenceHandlingPolicy.LITERAL);
797        break;
798      case LOGICAL:
799        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ReferenceHandlingPolicy.LOGICAL);
800        break;
801      case RESOLVES:
802        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ReferenceHandlingPolicy.RESOLVES);
803        break;
804      case ENFORCED:
805        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ReferenceHandlingPolicy.ENFORCED);
806        break;
807      case LOCAL:
808        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ReferenceHandlingPolicy.LOCAL);
809        break;
810      default:
811        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ReferenceHandlingPolicy.NULL);
812        break;
813    }
814    return tgt;
815  }
816
817  public static org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceInteractionComponent convertResourceInteractionComponent(org.hl7.fhir.r4.model.CapabilityStatement.ResourceInteractionComponent src) throws FHIRException {
818    if (src == null)
819      return null;
820    org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceInteractionComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceInteractionComponent();
821    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
822    if (src.hasCode())
823      tgt.setCodeElement(convertTypeRestfulInteraction(src.getCodeElement()));
824    if (src.hasDocumentation())
825      tgt.setDocumentation(src.getDocumentation());
826    return tgt;
827  }
828
829  public static org.hl7.fhir.r4.model.CapabilityStatement.ResourceInteractionComponent convertResourceInteractionComponent(org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceInteractionComponent src) throws FHIRException {
830    if (src == null)
831      return null;
832    org.hl7.fhir.r4.model.CapabilityStatement.ResourceInteractionComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.ResourceInteractionComponent();
833    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
834    if (src.hasCode())
835      tgt.setCodeElement(convertTypeRestfulInteraction(src.getCodeElement()));
836    if (src.hasDocumentation())
837      tgt.setDocumentation(src.getDocumentation());
838    return tgt;
839  }
840
841  static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy> convertResourceVersionPolicy(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceVersionPolicy> src) throws FHIRException {
842    if (src == null || src.isEmpty())
843      return null;
844    org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicyEnumFactory());
845    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
846    switch (src.getValue()) {
847      case NOVERSION:
848        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy.NOVERSION);
849        break;
850      case VERSIONED:
851        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy.VERSIONED);
852        break;
853      case VERSIONEDUPDATE:
854        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy.VERSIONEDUPDATE);
855        break;
856      default:
857        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy.NULL);
858        break;
859    }
860    return tgt;
861  }
862
863  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceVersionPolicy> convertResourceVersionPolicy(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy> src) throws FHIRException {
864    if (src == null || src.isEmpty())
865      return null;
866    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceVersionPolicy> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceVersionPolicyEnumFactory());
867    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
868    switch (src.getValue()) {
869      case NOVERSION:
870        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceVersionPolicy.NOVERSION);
871        break;
872      case VERSIONED:
873        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceVersionPolicy.VERSIONED);
874        break;
875      case VERSIONEDUPDATE:
876        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceVersionPolicy.VERSIONEDUPDATE);
877        break;
878      default:
879        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.ResourceVersionPolicy.NULL);
880        break;
881    }
882    return tgt;
883  }
884
885  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CapabilityStatement.RestfulCapabilityMode> convertRestfulCapabilityMode(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityMode> src) throws FHIRException {
886    if (src == null || src.isEmpty())
887      return null;
888    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CapabilityStatement.RestfulCapabilityMode> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.RestfulCapabilityModeEnumFactory());
889    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
890    switch (src.getValue()) {
891      case CLIENT:
892        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.RestfulCapabilityMode.CLIENT);
893        break;
894      case SERVER:
895        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.RestfulCapabilityMode.SERVER);
896        break;
897      default:
898        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.RestfulCapabilityMode.NULL);
899        break;
900    }
901    return tgt;
902  }
903
904  static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityMode> convertRestfulCapabilityMode(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CapabilityStatement.RestfulCapabilityMode> src) throws FHIRException {
905    if (src == null || src.isEmpty())
906      return null;
907    org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityMode> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityModeEnumFactory());
908    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
909    switch (src.getValue()) {
910      case CLIENT:
911        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityMode.CLIENT);
912        break;
913      case SERVER:
914        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityMode.SERVER);
915        break;
916      default:
917        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityMode.NULL);
918        break;
919    }
920    return tgt;
921  }
922
923  public static org.hl7.fhir.dstu3.model.CapabilityStatement.SystemInteractionComponent convertSystemInteractionComponent(org.hl7.fhir.r4.model.CapabilityStatement.SystemInteractionComponent src) throws FHIRException {
924    if (src == null)
925      return null;
926    org.hl7.fhir.dstu3.model.CapabilityStatement.SystemInteractionComponent tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement.SystemInteractionComponent();
927    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
928    if (src.hasCode())
929      tgt.setCodeElement(convertSystemRestfulInteraction(src.getCodeElement()));
930    if (src.hasDocumentation())
931      tgt.setDocumentation(src.getDocumentation());
932    return tgt;
933  }
934
935  public static org.hl7.fhir.r4.model.CapabilityStatement.SystemInteractionComponent convertSystemInteractionComponent(org.hl7.fhir.dstu3.model.CapabilityStatement.SystemInteractionComponent src) throws FHIRException {
936    if (src == null)
937      return null;
938    org.hl7.fhir.r4.model.CapabilityStatement.SystemInteractionComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.SystemInteractionComponent();
939    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
940    if (src.hasCode())
941      tgt.setCodeElement(convertSystemRestfulInteraction(src.getCodeElement()));
942    if (src.hasDocumentation())
943      tgt.setDocumentation(src.getDocumentation());
944    return tgt;
945  }
946
947  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CapabilityStatement.SystemRestfulInteraction> convertSystemRestfulInteraction(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction> src) throws FHIRException {
948    if (src == null || src.isEmpty())
949      return null;
950    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CapabilityStatement.SystemRestfulInteraction> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.SystemRestfulInteractionEnumFactory());
951    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
952    switch (src.getValue()) {
953      case TRANSACTION:
954        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.SystemRestfulInteraction.TRANSACTION);
955        break;
956      case BATCH:
957        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.SystemRestfulInteraction.BATCH);
958        break;
959      case SEARCHSYSTEM:
960        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.SystemRestfulInteraction.SEARCHSYSTEM);
961        break;
962      case HISTORYSYSTEM:
963        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.SystemRestfulInteraction.HISTORYSYSTEM);
964        break;
965      default:
966        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.SystemRestfulInteraction.NULL);
967        break;
968    }
969    return tgt;
970  }
971
972  static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction> convertSystemRestfulInteraction(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CapabilityStatement.SystemRestfulInteraction> src) throws FHIRException {
973    if (src == null || src.isEmpty())
974      return null;
975    org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteractionEnumFactory());
976    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
977    switch (src.getValue()) {
978      case TRANSACTION:
979        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.TRANSACTION);
980        break;
981      case BATCH:
982        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.BATCH);
983        break;
984      case SEARCHSYSTEM:
985        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.SEARCHSYSTEM);
986        break;
987      case HISTORYSYSTEM:
988        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.HISTORYSYSTEM);
989        break;
990      default:
991        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.NULL);
992        break;
993    }
994    return tgt;
995  }
996
997  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction> convertTypeRestfulInteraction(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction> src) throws FHIRException {
998    if (src == null || src.isEmpty())
999      return null;
1000    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteractionEnumFactory());
1001    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
1002    switch (src.getValue()) {
1003      case READ:
1004        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.READ);
1005        break;
1006      case VREAD:
1007        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.VREAD);
1008        break;
1009      case UPDATE:
1010        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.UPDATE);
1011        break;
1012      case PATCH:
1013        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.PATCH);
1014        break;
1015      case DELETE:
1016        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.DELETE);
1017        break;
1018      case HISTORYINSTANCE:
1019        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.HISTORYINSTANCE);
1020        break;
1021      case HISTORYTYPE:
1022        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.HISTORYTYPE);
1023        break;
1024      case CREATE:
1025        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.CREATE);
1026        break;
1027      case SEARCHTYPE:
1028        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.SEARCHTYPE);
1029        break;
1030      default:
1031        tgt.setValue(org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction.NULL);
1032        break;
1033    }
1034    return tgt;
1035  }
1036
1037  static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction> convertTypeRestfulInteraction(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CapabilityStatement.TypeRestfulInteraction> src) throws FHIRException {
1038    if (src == null || src.isEmpty())
1039      return null;
1040    org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteractionEnumFactory());
1041    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
1042    switch (src.getValue()) {
1043      case READ:
1044        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.READ);
1045        break;
1046      case VREAD:
1047        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.VREAD);
1048        break;
1049      case UPDATE:
1050        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.UPDATE);
1051        break;
1052      case PATCH:
1053        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.PATCH);
1054        break;
1055      case DELETE:
1056        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.DELETE);
1057        break;
1058      case HISTORYINSTANCE:
1059        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.HISTORYINSTANCE);
1060        break;
1061      case HISTORYTYPE:
1062        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.HISTORYTYPE);
1063        break;
1064      case CREATE:
1065        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.CREATE);
1066        break;
1067      case SEARCHTYPE:
1068        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.SEARCHTYPE);
1069        break;
1070      default:
1071        tgt.setValue(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.NULL);
1072        break;
1073    }
1074    return tgt;
1075  }
1076}