
001package org.hl7.fhir.convertors.conv30_40.resources30_40; 002 003import org.hl7.fhir.convertors.context.ConversionContext30_40; 004import org.hl7.fhir.convertors.conv30_40.datatypes30_40.ContactDetail30_40; 005import org.hl7.fhir.convertors.conv30_40.datatypes30_40.Reference30_40; 006import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.CodeableConcept30_40; 007import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.Coding30_40; 008import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.Identifier30_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.Boolean30_40; 011import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Code30_40; 012import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.DateTime30_40; 013import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Id30_40; 014import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Integer30_40; 015import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.MarkDown30_40; 016import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; 017import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Uri30_40; 018import org.hl7.fhir.exceptions.FHIRException; 019import org.hl7.fhir.r4.model.TestScript; 020 021public class TestScript30_40 { 022 023 public static org.hl7.fhir.r4.model.TestScript convertTestScript(org.hl7.fhir.dstu3.model.TestScript src) throws FHIRException { 024 if (src == null) 025 return null; 026 org.hl7.fhir.r4.model.TestScript tgt = new org.hl7.fhir.r4.model.TestScript(); 027 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyDomainResource(src, tgt); 028 if (src.hasUrl()) 029 tgt.setUrlElement(Uri30_40.convertUri(src.getUrlElement())); 030 if (src.hasIdentifier()) 031 tgt.setIdentifier(Identifier30_40.convertIdentifier(src.getIdentifier())); 032 if (src.hasVersion()) 033 tgt.setVersionElement(String30_40.convertString(src.getVersionElement())); 034 if (src.hasName()) 035 tgt.setNameElement(String30_40.convertString(src.getNameElement())); 036 if (src.hasTitle()) 037 tgt.setTitleElement(String30_40.convertString(src.getTitleElement())); 038 if (src.hasStatus()) 039 tgt.setStatusElement(Enumerations30_40.convertPublicationStatus(src.getStatusElement())); 040 if (src.hasExperimental()) 041 tgt.setExperimentalElement(Boolean30_40.convertBoolean(src.getExperimentalElement())); 042 if (src.hasDateElement()) 043 tgt.setDateElement(DateTime30_40.convertDateTime(src.getDateElement())); 044 if (src.hasPublisher()) 045 tgt.setPublisherElement(String30_40.convertString(src.getPublisherElement())); 046 for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) 047 tgt.addContact(ContactDetail30_40.convertContactDetail(t)); 048 if (src.hasDescription()) 049 tgt.setDescriptionElement(MarkDown30_40.convertMarkdown(src.getDescriptionElement())); 050 for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) 051 tgt.addUseContext(Timing30_40.convertUsageContext(t)); 052 for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) 053 tgt.addJurisdiction(CodeableConcept30_40.convertCodeableConcept(t)); 054 if (src.hasPurpose()) 055 tgt.setPurposeElement(MarkDown30_40.convertMarkdown(src.getPurposeElement())); 056 if (src.hasCopyright()) 057 tgt.setCopyrightElement(MarkDown30_40.convertMarkdown(src.getCopyrightElement())); 058 for (org.hl7.fhir.dstu3.model.TestScript.TestScriptOriginComponent t : src.getOrigin()) 059 tgt.addOrigin(convertTestScriptOriginComponent(t)); 060 for (org.hl7.fhir.dstu3.model.TestScript.TestScriptDestinationComponent t : src.getDestination()) 061 tgt.addDestination(convertTestScriptDestinationComponent(t)); 062 if (src.hasMetadata()) 063 tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata())); 064 for (org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent t : src.getFixture()) 065 tgt.addFixture(convertTestScriptFixtureComponent(t)); 066 for (org.hl7.fhir.dstu3.model.Reference t : src.getProfile()) tgt.addProfile(Reference30_40.convertReference(t)); 067 for (org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent t : src.getVariable()) 068 tgt.addVariable(convertTestScriptVariableComponent(t)); 069 if (src.hasSetup()) 070 tgt.setSetup(convertTestScriptSetupComponent(src.getSetup())); 071 for (org.hl7.fhir.dstu3.model.TestScript.TestScriptTestComponent t : src.getTest()) 072 tgt.addTest(convertTestScriptTestComponent(t)); 073 if (src.hasTeardown()) 074 tgt.setTeardown(convertTestScriptTeardownComponent(src.getTeardown())); 075 return tgt; 076 } 077 078 public static org.hl7.fhir.dstu3.model.TestScript convertTestScript(org.hl7.fhir.r4.model.TestScript src) throws FHIRException { 079 if (src == null) 080 return null; 081 org.hl7.fhir.dstu3.model.TestScript tgt = new org.hl7.fhir.dstu3.model.TestScript(); 082 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyDomainResource(src, tgt); 083 if (src.hasUrl()) 084 tgt.setUrlElement(Uri30_40.convertUri(src.getUrlElement())); 085 if (src.hasIdentifier()) 086 tgt.setIdentifier(Identifier30_40.convertIdentifier(src.getIdentifier())); 087 if (src.hasVersion()) 088 tgt.setVersionElement(String30_40.convertString(src.getVersionElement())); 089 if (src.hasName()) 090 tgt.setNameElement(String30_40.convertString(src.getNameElement())); 091 if (src.hasTitle()) 092 tgt.setTitleElement(String30_40.convertString(src.getTitleElement())); 093 if (src.hasStatus()) 094 tgt.setStatusElement(Enumerations30_40.convertPublicationStatus(src.getStatusElement())); 095 if (src.hasExperimental()) 096 tgt.setExperimentalElement(Boolean30_40.convertBoolean(src.getExperimentalElement())); 097 if (src.hasDateElement()) 098 tgt.setDateElement(DateTime30_40.convertDateTime(src.getDateElement())); 099 if (src.hasPublisher()) 100 tgt.setPublisherElement(String30_40.convertString(src.getPublisherElement())); 101 for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) 102 tgt.addContact(ContactDetail30_40.convertContactDetail(t)); 103 if (src.hasDescription()) 104 tgt.setDescriptionElement(MarkDown30_40.convertMarkdown(src.getDescriptionElement())); 105 for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) 106 tgt.addUseContext(Timing30_40.convertUsageContext(t)); 107 for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) 108 tgt.addJurisdiction(CodeableConcept30_40.convertCodeableConcept(t)); 109 if (src.hasPurpose()) 110 tgt.setPurposeElement(MarkDown30_40.convertMarkdown(src.getPurposeElement())); 111 if (src.hasCopyright()) 112 tgt.setCopyrightElement(MarkDown30_40.convertMarkdown(src.getCopyrightElement())); 113 for (org.hl7.fhir.r4.model.TestScript.TestScriptOriginComponent t : src.getOrigin()) 114 tgt.addOrigin(convertTestScriptOriginComponent(t)); 115 for (org.hl7.fhir.r4.model.TestScript.TestScriptDestinationComponent t : src.getDestination()) 116 tgt.addDestination(convertTestScriptDestinationComponent(t)); 117 if (src.hasMetadata()) 118 tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata())); 119 for (org.hl7.fhir.r4.model.TestScript.TestScriptFixtureComponent t : src.getFixture()) 120 tgt.addFixture(convertTestScriptFixtureComponent(t)); 121 for (org.hl7.fhir.r4.model.Reference t : src.getProfile()) tgt.addProfile(Reference30_40.convertReference(t)); 122 for (org.hl7.fhir.r4.model.TestScript.TestScriptVariableComponent t : src.getVariable()) 123 tgt.addVariable(convertTestScriptVariableComponent(t)); 124 if (src.hasSetup()) 125 tgt.setSetup(convertTestScriptSetupComponent(src.getSetup())); 126 for (org.hl7.fhir.r4.model.TestScript.TestScriptTestComponent t : src.getTest()) 127 tgt.addTest(convertTestScriptTestComponent(t)); 128 if (src.hasTeardown()) 129 tgt.setTeardown(convertTestScriptTeardownComponent(src.getTeardown())); 130 return tgt; 131 } 132 133 public static org.hl7.fhir.r4.model.TestScript.TestScriptDestinationComponent convertTestScriptDestinationComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptDestinationComponent src) throws FHIRException { 134 if (src == null) 135 return null; 136 org.hl7.fhir.r4.model.TestScript.TestScriptDestinationComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptDestinationComponent(); 137 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 138 if (src.hasIndex()) 139 tgt.setIndexElement(Integer30_40.convertInteger(src.getIndexElement())); 140 if (src.hasProfile()) 141 tgt.setProfile(Coding30_40.convertCoding(src.getProfile())); 142 return tgt; 143 } 144 145 public static org.hl7.fhir.dstu3.model.TestScript.TestScriptDestinationComponent convertTestScriptDestinationComponent(org.hl7.fhir.r4.model.TestScript.TestScriptDestinationComponent src) throws FHIRException { 146 if (src == null) 147 return null; 148 org.hl7.fhir.dstu3.model.TestScript.TestScriptDestinationComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptDestinationComponent(); 149 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 150 if (src.hasIndex()) 151 tgt.setIndexElement(Integer30_40.convertInteger(src.getIndexElement())); 152 if (src.hasProfile()) 153 tgt.setProfile(Coding30_40.convertCoding(src.getProfile())); 154 return tgt; 155 } 156 157 public static org.hl7.fhir.r4.model.TestScript.TestScriptFixtureComponent convertTestScriptFixtureComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent src) throws FHIRException { 158 if (src == null) 159 return null; 160 org.hl7.fhir.r4.model.TestScript.TestScriptFixtureComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptFixtureComponent(); 161 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 162 if (src.hasAutocreate()) 163 tgt.setAutocreateElement(Boolean30_40.convertBoolean(src.getAutocreateElement())); 164 if (src.hasAutodelete()) 165 tgt.setAutodeleteElement(Boolean30_40.convertBoolean(src.getAutodeleteElement())); 166 if (src.hasResource()) 167 tgt.setResource(Reference30_40.convertReference(src.getResource())); 168 return tgt; 169 } 170 171 public static org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent convertTestScriptFixtureComponent(org.hl7.fhir.r4.model.TestScript.TestScriptFixtureComponent src) throws FHIRException { 172 if (src == null) 173 return null; 174 org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent(); 175 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 176 if (src.hasAutocreate()) 177 tgt.setAutocreateElement(Boolean30_40.convertBoolean(src.getAutocreateElement())); 178 if (src.hasAutodelete()) 179 tgt.setAutodeleteElement(Boolean30_40.convertBoolean(src.getAutodeleteElement())); 180 if (src.hasResource()) 181 tgt.setResource(Reference30_40.convertReference(src.getResource())); 182 return tgt; 183 } 184 185 public static org.hl7.fhir.r4.model.TestScript.TestScriptMetadataCapabilityComponent convertTestScriptMetadataCapabilityComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent src) throws FHIRException { 186 if (src == null) 187 return null; 188 org.hl7.fhir.r4.model.TestScript.TestScriptMetadataCapabilityComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptMetadataCapabilityComponent(); 189 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 190 if (src.hasRequired()) 191 tgt.setRequiredElement(Boolean30_40.convertBoolean(src.getRequiredElement())); 192 if (src.hasValidated()) 193 tgt.setValidatedElement(Boolean30_40.convertBoolean(src.getValidatedElement())); 194 if (src.hasDescription()) 195 tgt.setDescriptionElement(String30_40.convertString(src.getDescriptionElement())); 196 for (org.hl7.fhir.dstu3.model.IntegerType t : src.getOrigin()) tgt.addOrigin(t.getValue()); 197 if (src.hasDestination()) 198 tgt.setDestinationElement(Integer30_40.convertInteger(src.getDestinationElement())); 199 for (org.hl7.fhir.dstu3.model.UriType t : src.getLink()) tgt.addLink(t.getValue()); 200 if (src.hasCapabilities()) 201 tgt.setCapabilitiesElement(Reference30_40.convertReferenceToCanonical(src.getCapabilities())); 202 return tgt; 203 } 204 205 public static org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent convertTestScriptMetadataCapabilityComponent(org.hl7.fhir.r4.model.TestScript.TestScriptMetadataCapabilityComponent src) throws FHIRException { 206 if (src == null) 207 return null; 208 org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent(); 209 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 210 if (src.hasRequired()) 211 tgt.setRequiredElement(Boolean30_40.convertBoolean(src.getRequiredElement())); 212 if (src.hasValidated()) 213 tgt.setValidatedElement(Boolean30_40.convertBoolean(src.getValidatedElement())); 214 if (src.hasDescription()) 215 tgt.setDescriptionElement(String30_40.convertString(src.getDescriptionElement())); 216 for (org.hl7.fhir.r4.model.IntegerType t : src.getOrigin()) tgt.addOrigin(t.getValue()); 217 if (src.hasDestination()) 218 tgt.setDestinationElement(Integer30_40.convertInteger(src.getDestinationElement())); 219 for (org.hl7.fhir.r4.model.UriType t : src.getLink()) tgt.addLink(t.getValue()); 220 if (src.hasCapabilities()) 221 tgt.setCapabilities(Reference30_40.convertCanonicalToReference(src.getCapabilitiesElement())); 222 return tgt; 223 } 224 225 public static org.hl7.fhir.r4.model.TestScript.TestScriptMetadataComponent convertTestScriptMetadataComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataComponent src) throws FHIRException { 226 if (src == null) 227 return null; 228 org.hl7.fhir.r4.model.TestScript.TestScriptMetadataComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptMetadataComponent(); 229 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 230 for (org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink()) 231 tgt.addLink(convertTestScriptMetadataLinkComponent(t)); 232 for (org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability()) 233 tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t)); 234 return tgt; 235 } 236 237 public static org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataComponent convertTestScriptMetadataComponent(org.hl7.fhir.r4.model.TestScript.TestScriptMetadataComponent src) throws FHIRException { 238 if (src == null) 239 return null; 240 org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataComponent(); 241 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 242 for (org.hl7.fhir.r4.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink()) 243 tgt.addLink(convertTestScriptMetadataLinkComponent(t)); 244 for (org.hl7.fhir.r4.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability()) 245 tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t)); 246 return tgt; 247 } 248 249 public static org.hl7.fhir.r4.model.TestScript.TestScriptMetadataLinkComponent convertTestScriptMetadataLinkComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent src) throws FHIRException { 250 if (src == null) 251 return null; 252 org.hl7.fhir.r4.model.TestScript.TestScriptMetadataLinkComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptMetadataLinkComponent(); 253 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 254 if (src.hasUrl()) 255 tgt.setUrlElement(Uri30_40.convertUri(src.getUrlElement())); 256 if (src.hasDescription()) 257 tgt.setDescriptionElement(String30_40.convertString(src.getDescriptionElement())); 258 return tgt; 259 } 260 261 public static org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent convertTestScriptMetadataLinkComponent(org.hl7.fhir.r4.model.TestScript.TestScriptMetadataLinkComponent src) throws FHIRException { 262 if (src == null) 263 return null; 264 org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent(); 265 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 266 if (src.hasUrl()) 267 tgt.setUrlElement(Uri30_40.convertUri(src.getUrlElement())); 268 if (src.hasDescription()) 269 tgt.setDescriptionElement(String30_40.convertString(src.getDescriptionElement())); 270 return tgt; 271 } 272 273 public static org.hl7.fhir.dstu3.model.TestScript.TestScriptOriginComponent convertTestScriptOriginComponent(org.hl7.fhir.r4.model.TestScript.TestScriptOriginComponent src) throws FHIRException { 274 if (src == null) 275 return null; 276 org.hl7.fhir.dstu3.model.TestScript.TestScriptOriginComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptOriginComponent(); 277 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 278 if (src.hasIndex()) 279 tgt.setIndexElement(Integer30_40.convertInteger(src.getIndexElement())); 280 if (src.hasProfile()) 281 tgt.setProfile(Coding30_40.convertCoding(src.getProfile())); 282 return tgt; 283 } 284 285 public static org.hl7.fhir.r4.model.TestScript.TestScriptOriginComponent convertTestScriptOriginComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptOriginComponent src) throws FHIRException { 286 if (src == null) 287 return null; 288 org.hl7.fhir.r4.model.TestScript.TestScriptOriginComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptOriginComponent(); 289 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 290 if (src.hasIndex()) 291 tgt.setIndexElement(Integer30_40.convertInteger(src.getIndexElement())); 292 if (src.hasProfile()) 293 tgt.setProfile(Coding30_40.convertCoding(src.getProfile())); 294 return tgt; 295 } 296 297 public static org.hl7.fhir.r4.model.TestScript.TestScriptSetupComponent convertTestScriptSetupComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptSetupComponent src) throws FHIRException { 298 if (src == null) 299 return null; 300 org.hl7.fhir.r4.model.TestScript.TestScriptSetupComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptSetupComponent(); 301 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 302 for (org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent t : src.getAction()) 303 tgt.addAction(convertSetupActionComponent(t)); 304 return tgt; 305 } 306 307 public static org.hl7.fhir.dstu3.model.TestScript.TestScriptSetupComponent convertTestScriptSetupComponent(org.hl7.fhir.r4.model.TestScript.TestScriptSetupComponent src) throws FHIRException { 308 if (src == null) 309 return null; 310 org.hl7.fhir.dstu3.model.TestScript.TestScriptSetupComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptSetupComponent(); 311 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 312 for (org.hl7.fhir.r4.model.TestScript.SetupActionComponent t : src.getAction()) 313 tgt.addAction(convertSetupActionComponent(t)); 314 return tgt; 315 } 316 317 public static org.hl7.fhir.dstu3.model.TestScript.TestScriptTeardownComponent convertTestScriptTeardownComponent(org.hl7.fhir.r4.model.TestScript.TestScriptTeardownComponent src) throws FHIRException { 318 if (src == null) 319 return null; 320 org.hl7.fhir.dstu3.model.TestScript.TestScriptTeardownComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptTeardownComponent(); 321 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 322 for (org.hl7.fhir.r4.model.TestScript.TeardownActionComponent t : src.getAction()) 323 tgt.addAction(convertTeardownActionComponent(t)); 324 return tgt; 325 } 326 327 public static org.hl7.fhir.r4.model.TestScript.TestScriptTeardownComponent convertTestScriptTeardownComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptTeardownComponent src) throws FHIRException { 328 if (src == null) 329 return null; 330 org.hl7.fhir.r4.model.TestScript.TestScriptTeardownComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptTeardownComponent(); 331 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 332 for (org.hl7.fhir.dstu3.model.TestScript.TeardownActionComponent t : src.getAction()) 333 tgt.addAction(convertTeardownActionComponent(t)); 334 return tgt; 335 } 336 337 public static org.hl7.fhir.dstu3.model.TestScript.TestScriptTestComponent convertTestScriptTestComponent(org.hl7.fhir.r4.model.TestScript.TestScriptTestComponent src) throws FHIRException { 338 if (src == null) 339 return null; 340 org.hl7.fhir.dstu3.model.TestScript.TestScriptTestComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptTestComponent(); 341 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 342 if (src.hasName()) 343 tgt.setNameElement(String30_40.convertString(src.getNameElement())); 344 if (src.hasDescription()) 345 tgt.setDescriptionElement(String30_40.convertString(src.getDescriptionElement())); 346 for (org.hl7.fhir.r4.model.TestScript.TestActionComponent t : src.getAction()) 347 tgt.addAction(convertTestActionComponent(t)); 348 return tgt; 349 } 350 351 public static org.hl7.fhir.r4.model.TestScript.TestScriptTestComponent convertTestScriptTestComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptTestComponent src) throws FHIRException { 352 if (src == null) 353 return null; 354 org.hl7.fhir.r4.model.TestScript.TestScriptTestComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptTestComponent(); 355 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 356 if (src.hasName()) 357 tgt.setNameElement(String30_40.convertString(src.getNameElement())); 358 if (src.hasDescription()) 359 tgt.setDescriptionElement(String30_40.convertString(src.getDescriptionElement())); 360 for (org.hl7.fhir.dstu3.model.TestScript.TestActionComponent t : src.getAction()) 361 tgt.addAction(convertTestActionComponent(t)); 362 return tgt; 363 } 364 365 public static org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent convertTestScriptVariableComponent(org.hl7.fhir.r4.model.TestScript.TestScriptVariableComponent src) throws FHIRException { 366 if (src == null) 367 return null; 368 org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent(); 369 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 370 if (src.hasName()) 371 tgt.setNameElement(String30_40.convertString(src.getNameElement())); 372 if (src.hasDefaultValue()) 373 tgt.setDefaultValueElement(String30_40.convertString(src.getDefaultValueElement())); 374 if (src.hasDescription()) 375 tgt.setDescriptionElement(String30_40.convertString(src.getDescriptionElement())); 376 if (src.hasExpression()) 377 tgt.setExpressionElement(String30_40.convertString(src.getExpressionElement())); 378 if (src.hasHeaderField()) 379 tgt.setHeaderFieldElement(String30_40.convertString(src.getHeaderFieldElement())); 380 if (src.hasHint()) 381 tgt.setHintElement(String30_40.convertString(src.getHintElement())); 382 if (src.hasPath()) 383 tgt.setPathElement(String30_40.convertString(src.getPathElement())); 384 if (src.hasSourceId()) 385 tgt.setSourceIdElement(Id30_40.convertId(src.getSourceIdElement())); 386 return tgt; 387 } 388 389 public static org.hl7.fhir.r4.model.TestScript.TestScriptVariableComponent convertTestScriptVariableComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent src) throws FHIRException { 390 if (src == null) 391 return null; 392 org.hl7.fhir.r4.model.TestScript.TestScriptVariableComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestScriptVariableComponent(); 393 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 394 if (src.hasName()) 395 tgt.setNameElement(String30_40.convertString(src.getNameElement())); 396 if (src.hasDefaultValue()) 397 tgt.setDefaultValueElement(String30_40.convertString(src.getDefaultValueElement())); 398 if (src.hasDescription()) 399 tgt.setDescriptionElement(String30_40.convertString(src.getDescriptionElement())); 400 if (src.hasExpression()) 401 tgt.setExpressionElement(String30_40.convertString(src.getExpressionElement())); 402 if (src.hasHeaderField()) 403 tgt.setHeaderFieldElement(String30_40.convertString(src.getHeaderFieldElement())); 404 if (src.hasHint()) 405 tgt.setHintElement(String30_40.convertString(src.getHintElement())); 406 if (src.hasPath()) 407 tgt.setPathElement(String30_40.convertString(src.getPathElement())); 408 if (src.hasSourceId()) 409 tgt.setSourceIdElement(Id30_40.convertId(src.getSourceIdElement())); 410 return tgt; 411 } 412 413 public static org.hl7.fhir.r4.model.TestScript.SetupActionComponent convertSetupActionComponent(org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent src) throws FHIRException { 414 if (src == null) return null; 415 org.hl7.fhir.r4.model.TestScript.SetupActionComponent tgt = new org.hl7.fhir.r4.model.TestScript.SetupActionComponent(); 416 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 417 if (src.hasOperation()) tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); 418 if (src.hasAssert()) tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); 419 return tgt; 420 } 421 422 public static org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent convertSetupActionComponent(org.hl7.fhir.r4.model.TestScript.SetupActionComponent src) throws FHIRException { 423 if (src == null) return null; 424 org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent(); 425 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 426 if (src.hasOperation()) tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); 427 if (src.hasAssert()) tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); 428 return tgt; 429 } 430 431 public static org.hl7.fhir.r4.model.TestScript.SetupActionOperationComponent convertSetupActionOperationComponent(org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationComponent src) throws FHIRException { 432 if (src == null) return null; 433 org.hl7.fhir.r4.model.TestScript.SetupActionOperationComponent tgt = new org.hl7.fhir.r4.model.TestScript.SetupActionOperationComponent(); 434 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 435 if (src.hasType()) tgt.setType(Coding30_40.convertCoding(src.getType())); 436 if (src.hasResource()) tgt.setResourceElement(Code30_40.convertCode(src.getResourceElement())); 437 if (src.hasLabel()) tgt.setLabelElement(String30_40.convertString(src.getLabelElement())); 438 if (src.hasDescription()) tgt.setDescriptionElement(String30_40.convertString(src.getDescriptionElement())); 439 if (src.hasAccept()) tgt.setAccept(convertContentType(src.getAccept())); 440 if (src.hasContentType()) tgt.setContentType(convertContentType(src.getContentType())); 441 if (src.hasDestination()) tgt.setDestinationElement(Integer30_40.convertInteger(src.getDestinationElement())); 442 if (src.hasEncodeRequestUrl()) 443 tgt.setEncodeRequestUrlElement(Boolean30_40.convertBoolean(src.getEncodeRequestUrlElement())); 444 if (src.hasOrigin()) tgt.setOriginElement(Integer30_40.convertInteger(src.getOriginElement())); 445 if (src.hasParams()) tgt.setParamsElement(String30_40.convertString(src.getParamsElement())); 446 for (org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationRequestHeaderComponent t : src.getRequestHeader()) 447 tgt.addRequestHeader(convertSetupActionOperationRequestHeaderComponent(t)); 448 if (src.hasRequestId()) tgt.setRequestIdElement(Id30_40.convertId(src.getRequestIdElement())); 449 if (src.hasResponseId()) tgt.setResponseIdElement(Id30_40.convertId(src.getResponseIdElement())); 450 if (src.hasSourceId()) tgt.setSourceIdElement(Id30_40.convertId(src.getSourceIdElement())); 451 if (src.hasTargetId()) tgt.setTargetId(src.getTargetId()); 452 if (src.hasUrl()) tgt.setUrlElement(String30_40.convertString(src.getUrlElement())); 453 return tgt; 454 } 455 456 public static org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationComponent convertSetupActionOperationComponent(org.hl7.fhir.r4.model.TestScript.SetupActionOperationComponent src) throws FHIRException { 457 if (src == null) return null; 458 org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationComponent(); 459 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 460 if (src.hasType()) tgt.setType(Coding30_40.convertCoding(src.getType())); 461 if (src.hasResource()) tgt.setResourceElement(Code30_40.convertCode(src.getResourceElement())); 462 if (src.hasLabel()) tgt.setLabelElement(String30_40.convertString(src.getLabelElement())); 463 if (src.hasDescription()) tgt.setDescriptionElement(String30_40.convertString(src.getDescriptionElement())); 464 if (src.hasAccept()) tgt.setAccept(convertContentType(src.getAccept())); 465 if (src.hasContentType()) tgt.setContentType(convertContentType(src.getContentType())); 466 if (src.hasDestination()) tgt.setDestinationElement(Integer30_40.convertInteger(src.getDestinationElement())); 467 if (src.hasEncodeRequestUrl()) 468 tgt.setEncodeRequestUrlElement(Boolean30_40.convertBoolean(src.getEncodeRequestUrlElement())); 469 if (src.hasOrigin()) tgt.setOriginElement(Integer30_40.convertInteger(src.getOriginElement())); 470 if (src.hasParams()) tgt.setParamsElement(String30_40.convertString(src.getParamsElement())); 471 for (org.hl7.fhir.r4.model.TestScript.SetupActionOperationRequestHeaderComponent t : src.getRequestHeader()) 472 tgt.addRequestHeader(convertSetupActionOperationRequestHeaderComponent(t)); 473 if (src.hasRequestId()) tgt.setRequestIdElement(Id30_40.convertId(src.getRequestIdElement())); 474 if (src.hasResponseId()) tgt.setResponseIdElement(Id30_40.convertId(src.getResponseIdElement())); 475 if (src.hasSourceId()) tgt.setSourceIdElement(Id30_40.convertId(src.getSourceIdElement())); 476 if (src.hasTargetId()) tgt.setTargetId(src.getTargetId()); 477 if (src.hasUrl()) tgt.setUrlElement(String30_40.convertString(src.getUrlElement())); 478 return tgt; 479 } 480 481 static public String convertContentType(org.hl7.fhir.dstu3.model.TestScript.ContentType src) throws FHIRException { 482 if (src == null) return null; 483 switch (src) { 484 case XML: 485 return "application/fhir+xml"; 486 case JSON: 487 return "application/fhir+json"; 488 case TTL: 489 return "text/turtle"; 490 case NONE: 491 return null; 492 default: 493 return null; 494 } 495 } 496 497 static public org.hl7.fhir.dstu3.model.TestScript.ContentType convertContentType(String src) throws FHIRException { 498 if (src == null) return null; 499 if (src.contains("xml")) return org.hl7.fhir.dstu3.model.TestScript.ContentType.XML; 500 if (src.contains("json")) return org.hl7.fhir.dstu3.model.TestScript.ContentType.JSON; 501 if (src.contains("tu")) return org.hl7.fhir.dstu3.model.TestScript.ContentType.TTL; 502 return org.hl7.fhir.dstu3.model.TestScript.ContentType.NONE; 503 } 504 505 public static org.hl7.fhir.r4.model.TestScript.SetupActionOperationRequestHeaderComponent convertSetupActionOperationRequestHeaderComponent(org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationRequestHeaderComponent src) throws FHIRException { 506 if (src == null) return null; 507 org.hl7.fhir.r4.model.TestScript.SetupActionOperationRequestHeaderComponent tgt = new org.hl7.fhir.r4.model.TestScript.SetupActionOperationRequestHeaderComponent(); 508 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 509 if (src.hasField()) tgt.setFieldElement(String30_40.convertString(src.getFieldElement())); 510 if (src.hasValue()) tgt.setValueElement(String30_40.convertString(src.getValueElement())); 511 return tgt; 512 } 513 514 public static org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationRequestHeaderComponent convertSetupActionOperationRequestHeaderComponent(org.hl7.fhir.r4.model.TestScript.SetupActionOperationRequestHeaderComponent src) throws FHIRException { 515 if (src == null) return null; 516 org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationRequestHeaderComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationRequestHeaderComponent(); 517 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 518 if (src.hasField()) tgt.setFieldElement(String30_40.convertString(src.getFieldElement())); 519 if (src.hasValue()) tgt.setValueElement(String30_40.convertString(src.getValueElement())); 520 return tgt; 521 } 522 523 public static org.hl7.fhir.r4.model.TestScript.SetupActionAssertComponent convertSetupActionAssertComponent(org.hl7.fhir.dstu3.model.TestScript.SetupActionAssertComponent src) throws FHIRException { 524 if (src == null) return null; 525 org.hl7.fhir.r4.model.TestScript.SetupActionAssertComponent tgt = new org.hl7.fhir.r4.model.TestScript.SetupActionAssertComponent(); 526 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 527 if (src.hasLabel()) tgt.setLabelElement(String30_40.convertString(src.getLabelElement())); 528 if (src.hasDescription()) tgt.setDescriptionElement(String30_40.convertString(src.getDescriptionElement())); 529 if (src.hasDirection()) tgt.setDirectionElement(convertAssertionDirectionType(src.getDirectionElement())); 530 if (src.hasCompareToSourceId()) 531 tgt.setCompareToSourceIdElement(String30_40.convertString(src.getCompareToSourceIdElement())); 532 if (src.hasCompareToSourceExpression()) 533 tgt.setCompareToSourceExpressionElement(String30_40.convertString(src.getCompareToSourceExpressionElement())); 534 if (src.hasCompareToSourcePath()) 535 tgt.setCompareToSourcePathElement(String30_40.convertString(src.getCompareToSourcePathElement())); 536 if (src.hasContentType()) tgt.setContentType(convertContentType(src.getContentType())); 537 if (src.hasExpression()) tgt.setExpressionElement(String30_40.convertString(src.getExpressionElement())); 538 if (src.hasHeaderField()) tgt.setHeaderFieldElement(String30_40.convertString(src.getHeaderFieldElement())); 539 if (src.hasMinimumId()) tgt.setMinimumIdElement(String30_40.convertString(src.getMinimumIdElement())); 540 if (src.hasNavigationLinks()) 541 tgt.setNavigationLinksElement(Boolean30_40.convertBoolean(src.getNavigationLinksElement())); 542 if (src.hasOperator()) tgt.setOperatorElement(convertAssertionOperatorType(src.getOperatorElement())); 543 if (src.hasPath()) tgt.setPathElement(String30_40.convertString(src.getPathElement())); 544 if (src.hasRequestMethod()) 545 tgt.setRequestMethodElement(convertTestScriptRequestMethodCode(src.getRequestMethodElement())); 546 if (src.hasRequestURL()) tgt.setRequestURLElement(String30_40.convertString(src.getRequestURLElement())); 547 if (src.hasResource()) tgt.setResourceElement(Code30_40.convertCode(src.getResourceElement())); 548 if (src.hasResponse()) tgt.setResponseElement(convertAssertionResponseTypes(src.getResponseElement())); 549 if (src.hasResponseCode()) tgt.setResponseCodeElement(String30_40.convertString(src.getResponseCodeElement())); 550 if (src.hasSourceId()) tgt.setSourceIdElement(Id30_40.convertId(src.getSourceIdElement())); 551 if (src.hasValidateProfileId()) 552 tgt.setValidateProfileIdElement(Id30_40.convertId(src.getValidateProfileIdElement())); 553 if (src.hasValue()) tgt.setValueElement(String30_40.convertString(src.getValueElement())); 554 if (src.hasWarningOnly()) tgt.setWarningOnlyElement(Boolean30_40.convertBoolean(src.getWarningOnlyElement())); 555 return tgt; 556 } 557 558 public static org.hl7.fhir.dstu3.model.TestScript.SetupActionAssertComponent convertSetupActionAssertComponent(org.hl7.fhir.r4.model.TestScript.SetupActionAssertComponent src) throws FHIRException { 559 if (src == null) return null; 560 org.hl7.fhir.dstu3.model.TestScript.SetupActionAssertComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.SetupActionAssertComponent(); 561 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 562 if (src.hasLabel()) tgt.setLabelElement(String30_40.convertString(src.getLabelElement())); 563 if (src.hasDescription()) tgt.setDescriptionElement(String30_40.convertString(src.getDescriptionElement())); 564 if (src.hasDirection()) tgt.setDirectionElement(convertAssertionDirectionType(src.getDirectionElement())); 565 if (src.hasCompareToSourceId()) 566 tgt.setCompareToSourceIdElement(String30_40.convertString(src.getCompareToSourceIdElement())); 567 if (src.hasCompareToSourceExpression()) 568 tgt.setCompareToSourceExpressionElement(String30_40.convertString(src.getCompareToSourceExpressionElement())); 569 if (src.hasCompareToSourcePath()) 570 tgt.setCompareToSourcePathElement(String30_40.convertString(src.getCompareToSourcePathElement())); 571 if (src.hasContentType()) tgt.setContentType(convertContentType(src.getContentType())); 572 if (src.hasExpression()) tgt.setExpressionElement(String30_40.convertString(src.getExpressionElement())); 573 if (src.hasHeaderField()) tgt.setHeaderFieldElement(String30_40.convertString(src.getHeaderFieldElement())); 574 if (src.hasMinimumId()) tgt.setMinimumIdElement(String30_40.convertString(src.getMinimumIdElement())); 575 if (src.hasNavigationLinks()) 576 tgt.setNavigationLinksElement(Boolean30_40.convertBoolean(src.getNavigationLinksElement())); 577 if (src.hasOperator()) tgt.setOperatorElement(convertAssertionOperatorType(src.getOperatorElement())); 578 if (src.hasPath()) tgt.setPathElement(String30_40.convertString(src.getPathElement())); 579 if (src.hasRequestMethod()) 580 tgt.setRequestMethodElement(convertTestScriptRequestMethodCode(src.getRequestMethodElement())); 581 if (src.hasRequestURL()) tgt.setRequestURLElement(String30_40.convertString(src.getRequestURLElement())); 582 if (src.hasResource()) tgt.setResourceElement(Code30_40.convertCode(src.getResourceElement())); 583 if (src.hasResponse()) tgt.setResponseElement(convertAssertionResponseTypes(src.getResponseElement())); 584 if (src.hasResponseCode()) tgt.setResponseCodeElement(String30_40.convertString(src.getResponseCodeElement())); 585 if (src.hasSourceId()) tgt.setSourceIdElement(Id30_40.convertId(src.getSourceIdElement())); 586 if (src.hasValidateProfileId()) 587 tgt.setValidateProfileIdElement(Id30_40.convertId(src.getValidateProfileIdElement())); 588 if (src.hasValue()) tgt.setValueElement(String30_40.convertString(src.getValueElement())); 589 if (src.hasWarningOnly()) tgt.setWarningOnlyElement(Boolean30_40.convertBoolean(src.getWarningOnlyElement())); 590 return tgt; 591 } 592 593 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.TestScript.AssertionDirectionType> convertAssertionDirectionType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType> src) throws FHIRException { 594 if (src == null || src.isEmpty()) return null; 595 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.TestScript.AssertionDirectionType> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestScript.AssertionDirectionTypeEnumFactory()); 596 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 597 if (src.getValue() == null) { 598 tgt.setValue(null); 599} else { 600 switch(src.getValue()) { 601 case RESPONSE: 602 tgt.setValue(TestScript.AssertionDirectionType.RESPONSE); 603 break; 604 case REQUEST: 605 tgt.setValue(TestScript.AssertionDirectionType.REQUEST); 606 break; 607 default: 608 tgt.setValue(TestScript.AssertionDirectionType.NULL); 609 break; 610 } 611} 612 return tgt; 613 } 614 615 static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType> convertAssertionDirectionType(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.TestScript.AssertionDirectionType> src) throws FHIRException { 616 if (src == null || src.isEmpty()) return null; 617 org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionTypeEnumFactory()); 618 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 619 if (src.getValue() == null) { 620 tgt.setValue(null); 621} else { 622 switch(src.getValue()) { 623 case RESPONSE: 624 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.RESPONSE); 625 break; 626 case REQUEST: 627 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.REQUEST); 628 break; 629 default: 630 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.NULL); 631 break; 632 } 633} 634 return tgt; 635 } 636 637 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.TestScript.AssertionOperatorType> convertAssertionOperatorType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType> src) throws FHIRException { 638 if (src == null || src.isEmpty()) return null; 639 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.TestScript.AssertionOperatorType> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestScript.AssertionOperatorTypeEnumFactory()); 640 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 641 if (src.getValue() == null) { 642 tgt.setValue(null); 643} else { 644 switch(src.getValue()) { 645 case EQUALS: 646 tgt.setValue(TestScript.AssertionOperatorType.EQUALS); 647 break; 648 case NOTEQUALS: 649 tgt.setValue(TestScript.AssertionOperatorType.NOTEQUALS); 650 break; 651 case IN: 652 tgt.setValue(TestScript.AssertionOperatorType.IN); 653 break; 654 case NOTIN: 655 tgt.setValue(TestScript.AssertionOperatorType.NOTIN); 656 break; 657 case GREATERTHAN: 658 tgt.setValue(TestScript.AssertionOperatorType.GREATERTHAN); 659 break; 660 case LESSTHAN: 661 tgt.setValue(TestScript.AssertionOperatorType.LESSTHAN); 662 break; 663 case EMPTY: 664 tgt.setValue(TestScript.AssertionOperatorType.EMPTY); 665 break; 666 case NOTEMPTY: 667 tgt.setValue(TestScript.AssertionOperatorType.NOTEMPTY); 668 break; 669 case CONTAINS: 670 tgt.setValue(TestScript.AssertionOperatorType.CONTAINS); 671 break; 672 case NOTCONTAINS: 673 tgt.setValue(TestScript.AssertionOperatorType.NOTCONTAINS); 674 break; 675 case EVAL: 676 tgt.setValue(TestScript.AssertionOperatorType.EVAL); 677 break; 678 default: 679 tgt.setValue(TestScript.AssertionOperatorType.NULL); 680 break; 681 } 682} 683 return tgt; 684 } 685 686 static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType> convertAssertionOperatorType(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.TestScript.AssertionOperatorType> src) throws FHIRException { 687 if (src == null || src.isEmpty()) return null; 688 org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorTypeEnumFactory()); 689 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 690 if (src.getValue() == null) { 691 tgt.setValue(null); 692} else { 693 switch(src.getValue()) { 694 case EQUALS: 695 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.EQUALS); 696 break; 697 case NOTEQUALS: 698 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTEQUALS); 699 break; 700 case IN: 701 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.IN); 702 break; 703 case NOTIN: 704 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTIN); 705 break; 706 case GREATERTHAN: 707 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.GREATERTHAN); 708 break; 709 case LESSTHAN: 710 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.LESSTHAN); 711 break; 712 case EMPTY: 713 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.EMPTY); 714 break; 715 case NOTEMPTY: 716 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTEMPTY); 717 break; 718 case CONTAINS: 719 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.CONTAINS); 720 break; 721 case NOTCONTAINS: 722 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTCONTAINS); 723 break; 724 case EVAL: 725 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.EVAL); 726 break; 727 default: 728 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NULL); 729 break; 730 } 731} 732 return tgt; 733 } 734 735 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode> convertTestScriptRequestMethodCode(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode> src) throws FHIRException { 736 if (src == null || src.isEmpty()) return null; 737 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCodeEnumFactory()); 738 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 739 if (src.getValue() == null) { 740 tgt.setValue(null); 741} else { 742 switch(src.getValue()) { 743 case DELETE: 744 tgt.setValue(TestScript.TestScriptRequestMethodCode.DELETE); 745 break; 746 case GET: 747 tgt.setValue(TestScript.TestScriptRequestMethodCode.GET); 748 break; 749 case OPTIONS: 750 tgt.setValue(TestScript.TestScriptRequestMethodCode.OPTIONS); 751 break; 752 case PATCH: 753 tgt.setValue(TestScript.TestScriptRequestMethodCode.PATCH); 754 break; 755 case POST: 756 tgt.setValue(TestScript.TestScriptRequestMethodCode.POST); 757 break; 758 case PUT: 759 tgt.setValue(TestScript.TestScriptRequestMethodCode.PUT); 760 break; 761 default: 762 tgt.setValue(TestScript.TestScriptRequestMethodCode.NULL); 763 break; 764 } 765} 766 return tgt; 767 } 768 769 static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode> convertTestScriptRequestMethodCode(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.TestScript.TestScriptRequestMethodCode> src) throws FHIRException { 770 if (src == null || src.isEmpty()) return null; 771 org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCodeEnumFactory()); 772 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 773 if (src.getValue() == null) { 774 tgt.setValue(null); 775} else { 776 switch(src.getValue()) { 777 case DELETE: 778 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.DELETE); 779 break; 780 case GET: 781 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.GET); 782 break; 783 case OPTIONS: 784 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.OPTIONS); 785 break; 786 case PATCH: 787 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.PATCH); 788 break; 789 case POST: 790 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.POST); 791 break; 792 case PUT: 793 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.PUT); 794 break; 795 default: 796 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.NULL); 797 break; 798 } 799} 800 return tgt; 801 } 802 803 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes> convertAssertionResponseTypes(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes> src) throws FHIRException { 804 if (src == null || src.isEmpty()) return null; 805 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestScript.AssertionResponseTypesEnumFactory()); 806 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 807 if (src.getValue() == null) { 808 tgt.setValue(null); 809} else { 810 switch(src.getValue()) { 811 case OKAY: 812 tgt.setValue(TestScript.AssertionResponseTypes.OKAY); 813 break; 814 case CREATED: 815 tgt.setValue(TestScript.AssertionResponseTypes.CREATED); 816 break; 817 case NOCONTENT: 818 tgt.setValue(TestScript.AssertionResponseTypes.NOCONTENT); 819 break; 820 case NOTMODIFIED: 821 tgt.setValue(TestScript.AssertionResponseTypes.NOTMODIFIED); 822 break; 823 case BAD: 824 tgt.setValue(TestScript.AssertionResponseTypes.BAD); 825 break; 826 case FORBIDDEN: 827 tgt.setValue(TestScript.AssertionResponseTypes.FORBIDDEN); 828 break; 829 case NOTFOUND: 830 tgt.setValue(TestScript.AssertionResponseTypes.NOTFOUND); 831 break; 832 case METHODNOTALLOWED: 833 tgt.setValue(TestScript.AssertionResponseTypes.METHODNOTALLOWED); 834 break; 835 case CONFLICT: 836 tgt.setValue(TestScript.AssertionResponseTypes.CONFLICT); 837 break; 838 case GONE: 839 tgt.setValue(TestScript.AssertionResponseTypes.GONE); 840 break; 841 case PRECONDITIONFAILED: 842 tgt.setValue(TestScript.AssertionResponseTypes.PRECONDITIONFAILED); 843 break; 844 case UNPROCESSABLE: 845 tgt.setValue(TestScript.AssertionResponseTypes.UNPROCESSABLE); 846 break; 847 default: 848 tgt.setValue(TestScript.AssertionResponseTypes.NULL); 849 break; 850 } 851} 852 return tgt; 853 } 854 855 static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes> convertAssertionResponseTypes(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.TestScript.AssertionResponseTypes> src) throws FHIRException { 856 if (src == null || src.isEmpty()) return null; 857 org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypesEnumFactory()); 858 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 859 if (src.getValue() == null) { 860 tgt.setValue(null); 861} else { 862 switch(src.getValue()) { 863 case OKAY: 864 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.OKAY); 865 break; 866 case CREATED: 867 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.CREATED); 868 break; 869 case NOCONTENT: 870 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NOCONTENT); 871 break; 872 case NOTMODIFIED: 873 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NOTMODIFIED); 874 break; 875 case BAD: 876 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.BAD); 877 break; 878 case FORBIDDEN: 879 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.FORBIDDEN); 880 break; 881 case NOTFOUND: 882 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NOTFOUND); 883 break; 884 case METHODNOTALLOWED: 885 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.METHODNOTALLOWED); 886 break; 887 case CONFLICT: 888 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.CONFLICT); 889 break; 890 case GONE: 891 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.GONE); 892 break; 893 case PRECONDITIONFAILED: 894 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.PRECONDITIONFAILED); 895 break; 896 case UNPROCESSABLE: 897 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.UNPROCESSABLE); 898 break; 899 default: 900 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NULL); 901 break; 902 } 903} 904 return tgt; 905 } 906 907 public static org.hl7.fhir.r4.model.TestScript.TestActionComponent convertTestActionComponent(org.hl7.fhir.dstu3.model.TestScript.TestActionComponent src) throws FHIRException { 908 if (src == null) return null; 909 org.hl7.fhir.r4.model.TestScript.TestActionComponent tgt = new org.hl7.fhir.r4.model.TestScript.TestActionComponent(); 910 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 911 if (src.hasOperation()) tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); 912 if (src.hasAssert()) tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); 913 return tgt; 914 } 915 916 public static org.hl7.fhir.dstu3.model.TestScript.TestActionComponent convertTestActionComponent(org.hl7.fhir.r4.model.TestScript.TestActionComponent src) throws FHIRException { 917 if (src == null) return null; 918 org.hl7.fhir.dstu3.model.TestScript.TestActionComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestActionComponent(); 919 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 920 if (src.hasOperation()) tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); 921 if (src.hasAssert()) tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); 922 return tgt; 923 } 924 925 public static org.hl7.fhir.r4.model.TestScript.TeardownActionComponent convertTeardownActionComponent(org.hl7.fhir.dstu3.model.TestScript.TeardownActionComponent src) throws FHIRException { 926 if (src == null) return null; 927 org.hl7.fhir.r4.model.TestScript.TeardownActionComponent tgt = new org.hl7.fhir.r4.model.TestScript.TeardownActionComponent(); 928 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 929 if (src.hasOperation()) tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); 930 return tgt; 931 } 932 933 public static org.hl7.fhir.dstu3.model.TestScript.TeardownActionComponent convertTeardownActionComponent(org.hl7.fhir.r4.model.TestScript.TeardownActionComponent src) throws FHIRException { 934 if (src == null) return null; 935 org.hl7.fhir.dstu3.model.TestScript.TeardownActionComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TeardownActionComponent(); 936 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 937 if (src.hasOperation()) tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); 938 return tgt; 939 } 940}