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