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