001package org.hl7.fhir.convertors.conv10_30.resources10_30; 002 003import org.hl7.fhir.convertors.context.ConversionContext10_30; 004import org.hl7.fhir.convertors.conv10_30.VersionConvertor_10_30; 005import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30; 006import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.CodeableConcept10_30; 007import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Coding10_30; 008import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.ContactPoint10_30; 009import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identifier10_30; 010import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Boolean10_30; 011import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Code10_30; 012import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.DateTime10_30; 013import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Id10_30; 014import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Integer10_30; 015import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; 016import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Uri10_30; 017import org.hl7.fhir.exceptions.FHIRException; 018 019public class TestScript10_30 { 020 021 static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.TestScript.AssertionDirectionType> convertAssertionDirectionType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType> src) throws FHIRException { 022 if (src == null || src.isEmpty()) 023 return null; 024 org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.TestScript.AssertionDirectionType> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.TestScript.AssertionDirectionTypeEnumFactory()); 025 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); 026 switch (src.getValue()) { 027 case RESPONSE: 028 tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionDirectionType.RESPONSE); 029 break; 030 case REQUEST: 031 tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionDirectionType.REQUEST); 032 break; 033 default: 034 tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionDirectionType.NULL); 035 break; 036 } 037 return tgt; 038 } 039 040 static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType> convertAssertionDirectionType(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.TestScript.AssertionDirectionType> src) throws FHIRException { 041 if (src == null || src.isEmpty()) 042 return null; 043 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()); 044 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); 045 switch (src.getValue()) { 046 case RESPONSE: 047 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.RESPONSE); 048 break; 049 case REQUEST: 050 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.REQUEST); 051 break; 052 default: 053 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.NULL); 054 break; 055 } 056 return tgt; 057 } 058 059 static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType> convertAssertionOperatorType(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType> src) throws FHIRException { 060 if (src == null || src.isEmpty()) 061 return null; 062 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()); 063 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); 064 switch (src.getValue()) { 065 case EQUALS: 066 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.EQUALS); 067 break; 068 case NOTEQUALS: 069 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTEQUALS); 070 break; 071 case IN: 072 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.IN); 073 break; 074 case NOTIN: 075 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTIN); 076 break; 077 case GREATERTHAN: 078 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.GREATERTHAN); 079 break; 080 case LESSTHAN: 081 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.LESSTHAN); 082 break; 083 case EMPTY: 084 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.EMPTY); 085 break; 086 case NOTEMPTY: 087 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTEMPTY); 088 break; 089 case CONTAINS: 090 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.CONTAINS); 091 break; 092 case NOTCONTAINS: 093 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTCONTAINS); 094 break; 095 default: 096 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NULL); 097 break; 098 } 099 return tgt; 100 } 101 102 static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType> convertAssertionOperatorType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType> src) throws FHIRException { 103 if (src == null || src.isEmpty()) 104 return null; 105 org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorTypeEnumFactory()); 106 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); 107 switch (src.getValue()) { 108 case EQUALS: 109 tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.EQUALS); 110 break; 111 case NOTEQUALS: 112 tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.NOTEQUALS); 113 break; 114 case IN: 115 tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.IN); 116 break; 117 case NOTIN: 118 tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.NOTIN); 119 break; 120 case GREATERTHAN: 121 tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.GREATERTHAN); 122 break; 123 case LESSTHAN: 124 tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.LESSTHAN); 125 break; 126 case EMPTY: 127 tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.EMPTY); 128 break; 129 case NOTEMPTY: 130 tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.NOTEMPTY); 131 break; 132 case CONTAINS: 133 tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.CONTAINS); 134 break; 135 case NOTCONTAINS: 136 tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.NOTCONTAINS); 137 break; 138 default: 139 tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.NULL); 140 break; 141 } 142 return tgt; 143 } 144 145 static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes> convertAssertionResponseTypes(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes> src) throws FHIRException { 146 if (src == null || src.isEmpty()) 147 return null; 148 org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypesEnumFactory()); 149 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); 150 switch (src.getValue()) { 151 case OKAY: 152 tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.OKAY); 153 break; 154 case CREATED: 155 tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.CREATED); 156 break; 157 case NOCONTENT: 158 tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.NOCONTENT); 159 break; 160 case NOTMODIFIED: 161 tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.NOTMODIFIED); 162 break; 163 case BAD: 164 tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.BAD); 165 break; 166 case FORBIDDEN: 167 tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.FORBIDDEN); 168 break; 169 case NOTFOUND: 170 tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.NOTFOUND); 171 break; 172 case METHODNOTALLOWED: 173 tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.METHODNOTALLOWED); 174 break; 175 case CONFLICT: 176 tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.CONFLICT); 177 break; 178 case GONE: 179 tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.GONE); 180 break; 181 case PRECONDITIONFAILED: 182 tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.PRECONDITIONFAILED); 183 break; 184 case UNPROCESSABLE: 185 tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.UNPROCESSABLE); 186 break; 187 default: 188 tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.NULL); 189 break; 190 } 191 return tgt; 192 } 193 194 static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes> convertAssertionResponseTypes(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes> src) throws FHIRException { 195 if (src == null || src.isEmpty()) 196 return null; 197 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()); 198 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); 199 switch (src.getValue()) { 200 case OKAY: 201 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.OKAY); 202 break; 203 case CREATED: 204 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.CREATED); 205 break; 206 case NOCONTENT: 207 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NOCONTENT); 208 break; 209 case NOTMODIFIED: 210 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NOTMODIFIED); 211 break; 212 case BAD: 213 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.BAD); 214 break; 215 case FORBIDDEN: 216 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.FORBIDDEN); 217 break; 218 case NOTFOUND: 219 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NOTFOUND); 220 break; 221 case METHODNOTALLOWED: 222 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.METHODNOTALLOWED); 223 break; 224 case CONFLICT: 225 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.CONFLICT); 226 break; 227 case GONE: 228 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.GONE); 229 break; 230 case PRECONDITIONFAILED: 231 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.PRECONDITIONFAILED); 232 break; 233 case UNPROCESSABLE: 234 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.UNPROCESSABLE); 235 break; 236 default: 237 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NULL); 238 break; 239 } 240 return tgt; 241 } 242 243 static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.TestScript.ContentType> convertContentType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.ContentType> src) throws FHIRException { 244 if (src == null || src.isEmpty()) 245 return null; 246 org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.TestScript.ContentType> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.TestScript.ContentTypeEnumFactory()); 247 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); 248 switch (src.getValue()) { 249 case XML: 250 tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.ContentType.XML); 251 break; 252 case JSON: 253 tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.ContentType.JSON); 254 break; 255 default: 256 tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.ContentType.NULL); 257 break; 258 } 259 return tgt; 260 } 261 262 static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.ContentType> convertContentType(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.TestScript.ContentType> src) throws FHIRException { 263 if (src == null || src.isEmpty()) 264 return null; 265 org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.ContentType> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestScript.ContentTypeEnumFactory()); 266 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); 267 switch (src.getValue()) { 268 case XML: 269 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.ContentType.XML); 270 break; 271 case JSON: 272 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.ContentType.JSON); 273 break; 274 default: 275 tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.ContentType.NULL); 276 break; 277 } 278 return tgt; 279 } 280 281 public static org.hl7.fhir.dstu3.model.TestScript.SetupActionAssertComponent convertSetupActionAssertComponent(org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionAssertComponent src) throws FHIRException { 282 if (src == null || src.isEmpty()) 283 return null; 284 org.hl7.fhir.dstu3.model.TestScript.SetupActionAssertComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.SetupActionAssertComponent(); 285 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 286 if (src.hasLabelElement()) 287 tgt.setLabelElement(String10_30.convertString(src.getLabelElement())); 288 if (src.hasDescriptionElement()) 289 tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement())); 290 if (src.hasDirection()) 291 tgt.setDirectionElement(convertAssertionDirectionType(src.getDirectionElement())); 292 if (src.hasCompareToSourceIdElement()) 293 tgt.setCompareToSourceIdElement(String10_30.convertString(src.getCompareToSourceIdElement())); 294 if (src.hasCompareToSourcePathElement()) 295 tgt.setCompareToSourcePathElement(String10_30.convertString(src.getCompareToSourcePathElement())); 296 if (src.hasContentType()) 297 tgt.setContentTypeElement(convertContentType(src.getContentTypeElement())); 298 if (src.hasHeaderFieldElement()) 299 tgt.setHeaderFieldElement(String10_30.convertString(src.getHeaderFieldElement())); 300 if (src.hasMinimumIdElement()) 301 tgt.setMinimumIdElement(String10_30.convertString(src.getMinimumIdElement())); 302 if (src.hasNavigationLinksElement()) 303 tgt.setNavigationLinksElement(Boolean10_30.convertBoolean(src.getNavigationLinksElement())); 304 if (src.hasOperator()) 305 tgt.setOperatorElement(convertAssertionOperatorType(src.getOperatorElement())); 306 if (src.hasPathElement()) 307 tgt.setPathElement(String10_30.convertString(src.getPathElement())); 308 if (src.hasResourceElement()) 309 tgt.setResourceElement(Code10_30.convertCode(src.getResourceElement())); 310 if (src.hasResponse()) 311 tgt.setResponseElement(convertAssertionResponseTypes(src.getResponseElement())); 312 if (src.hasResponseCodeElement()) 313 tgt.setResponseCodeElement(String10_30.convertString(src.getResponseCodeElement())); 314 if (src.hasSourceIdElement()) 315 tgt.setSourceIdElement(Id10_30.convertId(src.getSourceIdElement())); 316 if (src.hasValidateProfileIdElement()) 317 tgt.setValidateProfileIdElement(Id10_30.convertId(src.getValidateProfileIdElement())); 318 if (src.hasValueElement()) 319 tgt.setValueElement(String10_30.convertString(src.getValueElement())); 320 if (src.hasWarningOnlyElement()) 321 tgt.setWarningOnlyElement(Boolean10_30.convertBoolean(src.getWarningOnlyElement())); 322 return tgt; 323 } 324 325 public static org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionAssertComponent convertSetupActionAssertComponent(org.hl7.fhir.dstu3.model.TestScript.SetupActionAssertComponent src) throws FHIRException { 326 if (src == null || src.isEmpty()) 327 return null; 328 org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionAssertComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionAssertComponent(); 329 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 330 if (src.hasLabelElement()) 331 tgt.setLabelElement(String10_30.convertString(src.getLabelElement())); 332 if (src.hasDescriptionElement()) 333 tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement())); 334 if (src.hasDirection()) 335 tgt.setDirectionElement(convertAssertionDirectionType(src.getDirectionElement())); 336 if (src.hasCompareToSourceIdElement()) 337 tgt.setCompareToSourceIdElement(String10_30.convertString(src.getCompareToSourceIdElement())); 338 if (src.hasCompareToSourcePathElement()) 339 tgt.setCompareToSourcePathElement(String10_30.convertString(src.getCompareToSourcePathElement())); 340 if (src.hasContentType()) 341 tgt.setContentTypeElement(convertContentType(src.getContentTypeElement())); 342 if (src.hasHeaderFieldElement()) 343 tgt.setHeaderFieldElement(String10_30.convertString(src.getHeaderFieldElement())); 344 if (src.hasMinimumIdElement()) 345 tgt.setMinimumIdElement(String10_30.convertString(src.getMinimumIdElement())); 346 if (src.hasNavigationLinksElement()) 347 tgt.setNavigationLinksElement(Boolean10_30.convertBoolean(src.getNavigationLinksElement())); 348 if (src.hasOperator()) 349 tgt.setOperatorElement(convertAssertionOperatorType(src.getOperatorElement())); 350 if (src.hasPathElement()) 351 tgt.setPathElement(String10_30.convertString(src.getPathElement())); 352 if (src.hasResourceElement()) 353 tgt.setResourceElement(Code10_30.convertCode(src.getResourceElement())); 354 if (src.hasResponse()) 355 tgt.setResponseElement(convertAssertionResponseTypes(src.getResponseElement())); 356 if (src.hasResponseCodeElement()) 357 tgt.setResponseCodeElement(String10_30.convertString(src.getResponseCodeElement())); 358 if (src.hasSourceIdElement()) 359 tgt.setSourceIdElement(Id10_30.convertId(src.getSourceIdElement())); 360 if (src.hasValidateProfileIdElement()) 361 tgt.setValidateProfileIdElement(Id10_30.convertId(src.getValidateProfileIdElement())); 362 if (src.hasValueElement()) 363 tgt.setValueElement(String10_30.convertString(src.getValueElement())); 364 if (src.hasWarningOnlyElement()) 365 tgt.setWarningOnlyElement(Boolean10_30.convertBoolean(src.getWarningOnlyElement())); 366 return tgt; 367 } 368 369 public static org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent convertSetupActionComponent(org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionComponent src) throws FHIRException { 370 if (src == null || src.isEmpty()) 371 return null; 372 org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent(); 373 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 374 if (src.hasOperation()) 375 tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); 376 if (src.hasAssert()) 377 tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); 378 return tgt; 379 } 380 381 public static org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionComponent convertSetupActionComponent(org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent src) throws FHIRException { 382 if (src == null || src.isEmpty()) 383 return null; 384 org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionComponent(); 385 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 386 if (src.hasOperation()) 387 tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); 388 if (src.hasAssert()) 389 tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); 390 return tgt; 391 } 392 393 public static org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionOperationComponent convertSetupActionOperationComponent(org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationComponent src) throws FHIRException { 394 if (src == null || src.isEmpty()) 395 return null; 396 org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionOperationComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionOperationComponent(); 397 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 398 if (src.hasType()) 399 tgt.setType(Coding10_30.convertCoding(src.getType())); 400 if (src.hasResourceElement()) 401 tgt.setResourceElement(Code10_30.convertCode(src.getResourceElement())); 402 if (src.hasLabelElement()) 403 tgt.setLabelElement(String10_30.convertString(src.getLabelElement())); 404 if (src.hasDescriptionElement()) 405 tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement())); 406 if (src.hasAccept()) 407 tgt.setAcceptElement(convertContentType(src.getAcceptElement())); 408 if (src.hasContentType()) 409 tgt.setContentTypeElement(convertContentType(src.getContentTypeElement())); 410 if (src.hasDestinationElement()) 411 tgt.setDestinationElement(Integer10_30.convertInteger(src.getDestinationElement())); 412 if (src.hasEncodeRequestUrlElement()) 413 tgt.setEncodeRequestUrlElement(Boolean10_30.convertBoolean(src.getEncodeRequestUrlElement())); 414 if (src.hasParamsElement()) 415 tgt.setParamsElement(String10_30.convertString(src.getParamsElement())); 416 for (org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationRequestHeaderComponent t : src.getRequestHeader()) 417 tgt.addRequestHeader(convertSetupActionOperationRequestHeaderComponent(t)); 418 if (src.hasResponseIdElement()) 419 tgt.setResponseIdElement(Id10_30.convertId(src.getResponseIdElement())); 420 if (src.hasSourceIdElement()) 421 tgt.setSourceIdElement(Id10_30.convertId(src.getSourceIdElement())); 422 if (src.hasTargetId()) 423 tgt.setTargetId(src.getTargetId()); 424 if (src.hasUrlElement()) 425 tgt.setUrlElement(String10_30.convertString(src.getUrlElement())); 426 return tgt; 427 } 428 429 public static org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationComponent convertSetupActionOperationComponent(org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionOperationComponent src) throws FHIRException { 430 if (src == null || src.isEmpty()) 431 return null; 432 org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationComponent(); 433 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 434 if (src.hasType()) 435 tgt.setType(Coding10_30.convertCoding(src.getType())); 436 if (src.hasResourceElement()) 437 tgt.setResourceElement(Code10_30.convertCode(src.getResourceElement())); 438 if (src.hasLabelElement()) 439 tgt.setLabelElement(String10_30.convertString(src.getLabelElement())); 440 if (src.hasDescriptionElement()) 441 tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement())); 442 if (src.hasAccept()) 443 tgt.setAcceptElement(convertContentType(src.getAcceptElement())); 444 if (src.hasContentType()) 445 tgt.setContentTypeElement(convertContentType(src.getContentTypeElement())); 446 if (src.hasDestinationElement()) 447 tgt.setDestinationElement(Integer10_30.convertInteger(src.getDestinationElement())); 448 if (src.hasEncodeRequestUrlElement()) 449 tgt.setEncodeRequestUrlElement(Boolean10_30.convertBoolean(src.getEncodeRequestUrlElement())); 450 if (src.hasParamsElement()) 451 tgt.setParamsElement(String10_30.convertString(src.getParamsElement())); 452 for (org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionOperationRequestHeaderComponent t : src.getRequestHeader()) 453 tgt.addRequestHeader(convertSetupActionOperationRequestHeaderComponent(t)); 454 if (src.hasResponseIdElement()) 455 tgt.setResponseIdElement(Id10_30.convertId(src.getResponseIdElement())); 456 if (src.hasSourceIdElement()) 457 tgt.setSourceIdElement(Id10_30.convertId(src.getSourceIdElement())); 458 if (src.hasTargetId()) 459 tgt.setTargetId(src.getTargetId()); 460 if (src.hasUrlElement()) 461 tgt.setUrlElement(String10_30.convertString(src.getUrlElement())); 462 return tgt; 463 } 464 465 public static org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationRequestHeaderComponent convertSetupActionOperationRequestHeaderComponent(org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionOperationRequestHeaderComponent src) throws FHIRException { 466 if (src == null || src.isEmpty()) 467 return null; 468 org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationRequestHeaderComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationRequestHeaderComponent(); 469 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 470 if (src.hasFieldElement()) 471 tgt.setFieldElement(String10_30.convertString(src.getFieldElement())); 472 if (src.hasValueElement()) 473 tgt.setValueElement(String10_30.convertString(src.getValueElement())); 474 return tgt; 475 } 476 477 public static org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionOperationRequestHeaderComponent convertSetupActionOperationRequestHeaderComponent(org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationRequestHeaderComponent src) throws FHIRException { 478 if (src == null || src.isEmpty()) 479 return null; 480 org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionOperationRequestHeaderComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionOperationRequestHeaderComponent(); 481 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 482 if (src.hasFieldElement()) 483 tgt.setFieldElement(String10_30.convertString(src.getFieldElement())); 484 if (src.hasValueElement()) 485 tgt.setValueElement(String10_30.convertString(src.getValueElement())); 486 return tgt; 487 } 488 489 public static org.hl7.fhir.dstu2.model.TestScript.TestScriptTeardownActionComponent convertTeardownActionComponent(org.hl7.fhir.dstu3.model.TestScript.TeardownActionComponent src) throws FHIRException { 490 if (src == null || src.isEmpty()) 491 return null; 492 org.hl7.fhir.dstu2.model.TestScript.TestScriptTeardownActionComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptTeardownActionComponent(); 493 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 494 if (src.hasOperation()) 495 tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); 496 return tgt; 497 } 498 499 public static org.hl7.fhir.dstu3.model.TestScript.TeardownActionComponent convertTeardownActionComponent(org.hl7.fhir.dstu2.model.TestScript.TestScriptTeardownActionComponent src) throws FHIRException { 500 if (src == null || src.isEmpty()) 501 return null; 502 org.hl7.fhir.dstu3.model.TestScript.TeardownActionComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TeardownActionComponent(); 503 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 504 if (src.hasOperation()) 505 tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); 506 return tgt; 507 } 508 509 public static org.hl7.fhir.dstu3.model.TestScript.TestActionComponent convertTestActionComponent(org.hl7.fhir.dstu2.model.TestScript.TestScriptTestActionComponent src) throws FHIRException { 510 if (src == null || src.isEmpty()) 511 return null; 512 org.hl7.fhir.dstu3.model.TestScript.TestActionComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestActionComponent(); 513 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 514 if (src.hasOperation()) 515 tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); 516 if (src.hasAssert()) 517 tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); 518 return tgt; 519 } 520 521 public static org.hl7.fhir.dstu2.model.TestScript.TestScriptTestActionComponent convertTestActionComponent(org.hl7.fhir.dstu3.model.TestScript.TestActionComponent src) throws FHIRException { 522 if (src == null || src.isEmpty()) 523 return null; 524 org.hl7.fhir.dstu2.model.TestScript.TestScriptTestActionComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptTestActionComponent(); 525 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 526 if (src.hasOperation()) 527 tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); 528 if (src.hasAssert()) 529 tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); 530 return tgt; 531 } 532 533 public static org.hl7.fhir.dstu2.model.TestScript convertTestScript(org.hl7.fhir.dstu3.model.TestScript src) throws FHIRException { 534 if (src == null || src.isEmpty()) 535 return null; 536 org.hl7.fhir.dstu2.model.TestScript tgt = new org.hl7.fhir.dstu2.model.TestScript(); 537 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt); 538 if (src.hasUrlElement()) 539 tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement())); 540 if (src.hasVersionElement()) 541 tgt.setVersionElement(String10_30.convertString(src.getVersionElement())); 542 if (src.hasNameElement()) 543 tgt.setNameElement(String10_30.convertString(src.getNameElement())); 544 if (src.hasStatus()) 545 tgt.setStatusElement(Enumerations10_30.convertConformanceResourceStatus(src.getStatusElement())); 546 if (src.hasIdentifier()) 547 tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier())); 548 if (src.hasExperimental()) 549 tgt.setExperimentalElement(Boolean10_30.convertBoolean(src.getExperimentalElement())); 550 if (src.hasPublisherElement()) 551 tgt.setPublisherElement(String10_30.convertString(src.getPublisherElement())); 552 for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) 553 tgt.addContact(convertTestScriptContactComponent(t)); 554 if (src.hasDate()) 555 tgt.setDateElement(DateTime10_30.convertDateTime(src.getDateElement())); 556 if (src.hasDescription()) 557 tgt.setDescription(src.getDescription()); 558 for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) 559 if (t.hasValueCodeableConcept()) 560 tgt.addUseContext(CodeableConcept10_30.convertCodeableConcept(t.getValueCodeableConcept())); 561 for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) 562 tgt.addUseContext(CodeableConcept10_30.convertCodeableConcept(t)); 563 if (src.hasPurpose()) 564 tgt.setRequirements(src.getPurpose()); 565 if (src.hasCopyright()) 566 tgt.setCopyright(src.getCopyright()); 567 if (src.hasMetadata()) 568 tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata())); 569 for (org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent t : src.getFixture()) 570 tgt.addFixture(convertTestScriptFixtureComponent(t)); 571 for (org.hl7.fhir.dstu3.model.Reference t : src.getProfile()) tgt.addProfile(Reference10_30.convertReference(t)); 572 for (org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent t : src.getVariable()) 573 tgt.addVariable(convertTestScriptVariableComponent(t)); 574 if (src.hasSetup()) 575 tgt.setSetup(convertTestScriptSetupComponent(src.getSetup())); 576 for (org.hl7.fhir.dstu3.model.TestScript.TestScriptTestComponent t : src.getTest()) 577 tgt.addTest(convertTestScriptTestComponent(t)); 578 if (src.hasTeardown()) 579 tgt.setTeardown(convertTestScriptTeardownComponent(src.getTeardown())); 580 return tgt; 581 } 582 583 public static org.hl7.fhir.dstu3.model.TestScript convertTestScript(org.hl7.fhir.dstu2.model.TestScript src) throws FHIRException { 584 if (src == null || src.isEmpty()) 585 return null; 586 org.hl7.fhir.dstu3.model.TestScript tgt = new org.hl7.fhir.dstu3.model.TestScript(); 587 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt); 588 if (src.hasUrlElement()) 589 tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement())); 590 if (src.hasVersionElement()) 591 tgt.setVersionElement(String10_30.convertString(src.getVersionElement())); 592 if (src.hasNameElement()) 593 tgt.setNameElement(String10_30.convertString(src.getNameElement())); 594 if (src.hasStatus()) 595 tgt.setStatusElement(Enumerations10_30.convertConformanceResourceStatus(src.getStatusElement())); 596 if (src.hasIdentifier()) 597 tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier())); 598 if (src.hasExperimental()) 599 tgt.setExperimentalElement(Boolean10_30.convertBoolean(src.getExperimentalElement())); 600 if (src.hasPublisherElement()) 601 tgt.setPublisherElement(String10_30.convertString(src.getPublisherElement())); 602 for (org.hl7.fhir.dstu2.model.TestScript.TestScriptContactComponent t : src.getContact()) 603 tgt.addContact(convertTestScriptContactComponent(t)); 604 if (src.hasDate()) 605 tgt.setDateElement(DateTime10_30.convertDateTime(src.getDateElement())); 606 if (src.hasDescription()) 607 tgt.setDescription(src.getDescription()); 608 for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getUseContext()) 609 if (VersionConvertor_10_30.isJurisdiction(t)) 610 tgt.addJurisdiction(CodeableConcept10_30.convertCodeableConcept(t)); 611 else 612 tgt.addUseContext(CodeableConcept10_30.convertCodeableConceptToUsageContext(t)); 613 if (src.hasRequirements()) 614 tgt.setPurpose(src.getRequirements()); 615 if (src.hasCopyright()) 616 tgt.setCopyright(src.getCopyright()); 617 if (src.hasMetadata()) 618 tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata())); 619 for (org.hl7.fhir.dstu2.model.TestScript.TestScriptFixtureComponent t : src.getFixture()) 620 tgt.addFixture(convertTestScriptFixtureComponent(t)); 621 for (org.hl7.fhir.dstu2.model.Reference t : src.getProfile()) tgt.addProfile(Reference10_30.convertReference(t)); 622 for (org.hl7.fhir.dstu2.model.TestScript.TestScriptVariableComponent t : src.getVariable()) 623 tgt.addVariable(convertTestScriptVariableComponent(t)); 624 if (src.hasSetup()) 625 tgt.setSetup(convertTestScriptSetupComponent(src.getSetup())); 626 for (org.hl7.fhir.dstu2.model.TestScript.TestScriptTestComponent t : src.getTest()) 627 tgt.addTest(convertTestScriptTestComponent(t)); 628 if (src.hasTeardown()) 629 tgt.setTeardown(convertTestScriptTeardownComponent(src.getTeardown())); 630 return tgt; 631 } 632 633 public static org.hl7.fhir.dstu3.model.ContactDetail convertTestScriptContactComponent(org.hl7.fhir.dstu2.model.TestScript.TestScriptContactComponent src) throws FHIRException { 634 if (src == null || src.isEmpty()) 635 return null; 636 org.hl7.fhir.dstu3.model.ContactDetail tgt = new org.hl7.fhir.dstu3.model.ContactDetail(); 637 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); 638 if (src.hasNameElement()) 639 tgt.setNameElement(String10_30.convertString(src.getNameElement())); 640 for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) 641 tgt.addTelecom(ContactPoint10_30.convertContactPoint(t)); 642 return tgt; 643 } 644 645 public static org.hl7.fhir.dstu2.model.TestScript.TestScriptContactComponent convertTestScriptContactComponent(org.hl7.fhir.dstu3.model.ContactDetail src) throws FHIRException { 646 if (src == null || src.isEmpty()) 647 return null; 648 org.hl7.fhir.dstu2.model.TestScript.TestScriptContactComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptContactComponent(); 649 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); 650 if (src.hasNameElement()) 651 tgt.setNameElement(String10_30.convertString(src.getNameElement())); 652 for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) 653 tgt.addTelecom(ContactPoint10_30.convertContactPoint(t)); 654 return tgt; 655 } 656 657 public static org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent convertTestScriptFixtureComponent(org.hl7.fhir.dstu2.model.TestScript.TestScriptFixtureComponent src) throws FHIRException { 658 if (src == null || src.isEmpty()) 659 return null; 660 org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent(); 661 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 662 if (src.hasAutocreateElement()) 663 tgt.setAutocreateElement(Boolean10_30.convertBoolean(src.getAutocreateElement())); 664 if (src.hasAutodeleteElement()) 665 tgt.setAutodeleteElement(Boolean10_30.convertBoolean(src.getAutodeleteElement())); 666 if (src.hasResource()) 667 tgt.setResource(Reference10_30.convertReference(src.getResource())); 668 return tgt; 669 } 670 671 public static org.hl7.fhir.dstu2.model.TestScript.TestScriptFixtureComponent convertTestScriptFixtureComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent src) throws FHIRException { 672 if (src == null || src.isEmpty()) 673 return null; 674 org.hl7.fhir.dstu2.model.TestScript.TestScriptFixtureComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptFixtureComponent(); 675 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 676 if (src.hasAutocreateElement()) 677 tgt.setAutocreateElement(Boolean10_30.convertBoolean(src.getAutocreateElement())); 678 if (src.hasAutodeleteElement()) 679 tgt.setAutodeleteElement(Boolean10_30.convertBoolean(src.getAutodeleteElement())); 680 if (src.hasResource()) 681 tgt.setResource(Reference10_30.convertReference(src.getResource())); 682 return tgt; 683 } 684 685 public static org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataCapabilityComponent convertTestScriptMetadataCapabilityComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent src) throws FHIRException { 686 if (src == null || src.isEmpty()) 687 return null; 688 org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataCapabilityComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataCapabilityComponent(); 689 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 690 if (src.hasRequiredElement()) 691 tgt.setRequiredElement(Boolean10_30.convertBoolean(src.getRequiredElement())); 692 if (src.hasValidatedElement()) 693 tgt.setValidatedElement(Boolean10_30.convertBoolean(src.getValidatedElement())); 694 if (src.hasDescriptionElement()) 695 tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement())); 696 if (src.hasDestinationElement()) 697 tgt.setDestinationElement(Integer10_30.convertInteger(src.getDestinationElement())); 698 for (org.hl7.fhir.dstu3.model.UriType t : src.getLink()) tgt.addLink(t.getValue()); 699 if (src.hasCapabilities()) 700 tgt.setConformance(Reference10_30.convertReference(src.getCapabilities())); 701 return tgt; 702 } 703 704 public static org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent convertTestScriptMetadataCapabilityComponent(org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataCapabilityComponent src) throws FHIRException { 705 if (src == null || src.isEmpty()) 706 return null; 707 org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent(); 708 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 709 if (src.hasRequiredElement()) 710 tgt.setRequiredElement(Boolean10_30.convertBoolean(src.getRequiredElement())); 711 if (src.hasValidatedElement()) 712 tgt.setValidatedElement(Boolean10_30.convertBoolean(src.getValidatedElement())); 713 if (src.hasDescriptionElement()) 714 tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement())); 715 if (src.hasDestinationElement()) 716 tgt.setDestinationElement(Integer10_30.convertInteger(src.getDestinationElement())); 717 for (org.hl7.fhir.dstu2.model.UriType t : src.getLink()) tgt.addLink(t.getValue()); 718 if (src.hasConformance()) 719 tgt.setCapabilities(Reference10_30.convertReference(src.getConformance())); 720 return tgt; 721 } 722 723 public static org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataComponent convertTestScriptMetadataComponent(org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataComponent src) throws FHIRException { 724 if (src == null || src.isEmpty()) 725 return null; 726 org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataComponent(); 727 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 728 for (org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink()) 729 tgt.addLink(convertTestScriptMetadataLinkComponent(t)); 730 for (org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability()) 731 tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t)); 732 return tgt; 733 } 734 735 public static org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataComponent convertTestScriptMetadataComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataComponent src) throws FHIRException { 736 if (src == null || src.isEmpty()) 737 return null; 738 org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataComponent(); 739 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 740 for (org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink()) 741 tgt.addLink(convertTestScriptMetadataLinkComponent(t)); 742 for (org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability()) 743 tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t)); 744 return tgt; 745 } 746 747 public static org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent convertTestScriptMetadataLinkComponent(org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataLinkComponent src) throws FHIRException { 748 if (src == null || src.isEmpty()) 749 return null; 750 org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent(); 751 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 752 if (src.hasUrlElement()) 753 tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement())); 754 if (src.hasDescriptionElement()) 755 tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement())); 756 return tgt; 757 } 758 759 public static org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataLinkComponent convertTestScriptMetadataLinkComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent src) throws FHIRException { 760 if (src == null || src.isEmpty()) 761 return null; 762 org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataLinkComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataLinkComponent(); 763 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 764 if (src.hasUrlElement()) 765 tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement())); 766 if (src.hasDescriptionElement()) 767 tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement())); 768 return tgt; 769 } 770 771 public static org.hl7.fhir.dstu3.model.TestScript.TestScriptSetupComponent convertTestScriptSetupComponent(org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupComponent src) throws FHIRException { 772 if (src == null || src.isEmpty()) 773 return null; 774 org.hl7.fhir.dstu3.model.TestScript.TestScriptSetupComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptSetupComponent(); 775 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 776 for (org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionComponent t : src.getAction()) 777 tgt.addAction(convertSetupActionComponent(t)); 778 return tgt; 779 } 780 781 public static org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupComponent convertTestScriptSetupComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptSetupComponent src) throws FHIRException { 782 if (src == null || src.isEmpty()) 783 return null; 784 org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupComponent(); 785 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 786 for (org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent t : src.getAction()) 787 tgt.addAction(convertSetupActionComponent(t)); 788 return tgt; 789 } 790 791 public static org.hl7.fhir.dstu3.model.TestScript.TestScriptTeardownComponent convertTestScriptTeardownComponent(org.hl7.fhir.dstu2.model.TestScript.TestScriptTeardownComponent src) throws FHIRException { 792 if (src == null || src.isEmpty()) 793 return null; 794 org.hl7.fhir.dstu3.model.TestScript.TestScriptTeardownComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptTeardownComponent(); 795 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 796 for (org.hl7.fhir.dstu2.model.TestScript.TestScriptTeardownActionComponent t : src.getAction()) 797 tgt.addAction(convertTeardownActionComponent(t)); 798 return tgt; 799 } 800 801 public static org.hl7.fhir.dstu2.model.TestScript.TestScriptTeardownComponent convertTestScriptTeardownComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptTeardownComponent src) throws FHIRException { 802 if (src == null || src.isEmpty()) 803 return null; 804 org.hl7.fhir.dstu2.model.TestScript.TestScriptTeardownComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptTeardownComponent(); 805 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 806 for (org.hl7.fhir.dstu3.model.TestScript.TeardownActionComponent t : src.getAction()) 807 tgt.addAction(convertTeardownActionComponent(t)); 808 return tgt; 809 } 810 811 public static org.hl7.fhir.dstu3.model.TestScript.TestScriptTestComponent convertTestScriptTestComponent(org.hl7.fhir.dstu2.model.TestScript.TestScriptTestComponent src) throws FHIRException { 812 if (src == null || src.isEmpty()) 813 return null; 814 org.hl7.fhir.dstu3.model.TestScript.TestScriptTestComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptTestComponent(); 815 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 816 if (src.hasNameElement()) 817 tgt.setNameElement(String10_30.convertString(src.getNameElement())); 818 if (src.hasDescriptionElement()) 819 tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement())); 820 for (org.hl7.fhir.dstu2.model.TestScript.TestScriptTestActionComponent t : src.getAction()) 821 tgt.addAction(convertTestActionComponent(t)); 822 return tgt; 823 } 824 825 public static org.hl7.fhir.dstu2.model.TestScript.TestScriptTestComponent convertTestScriptTestComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptTestComponent src) throws FHIRException { 826 if (src == null || src.isEmpty()) 827 return null; 828 org.hl7.fhir.dstu2.model.TestScript.TestScriptTestComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptTestComponent(); 829 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 830 if (src.hasNameElement()) 831 tgt.setNameElement(String10_30.convertString(src.getNameElement())); 832 if (src.hasDescriptionElement()) 833 tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement())); 834 for (org.hl7.fhir.dstu3.model.TestScript.TestActionComponent t : src.getAction()) 835 tgt.addAction(convertTestActionComponent(t)); 836 return tgt; 837 } 838 839 public static org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent convertTestScriptVariableComponent(org.hl7.fhir.dstu2.model.TestScript.TestScriptVariableComponent src) throws FHIRException { 840 if (src == null || src.isEmpty()) 841 return null; 842 org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent(); 843 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 844 if (src.hasNameElement()) 845 tgt.setNameElement(String10_30.convertString(src.getNameElement())); 846 if (src.hasHeaderFieldElement()) 847 tgt.setHeaderFieldElement(String10_30.convertString(src.getHeaderFieldElement())); 848 if (src.hasPathElement()) 849 tgt.setPathElement(String10_30.convertString(src.getPathElement())); 850 if (src.hasSourceIdElement()) 851 tgt.setSourceIdElement(Id10_30.convertId(src.getSourceIdElement())); 852 return tgt; 853 } 854 855 public static org.hl7.fhir.dstu2.model.TestScript.TestScriptVariableComponent convertTestScriptVariableComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent src) throws FHIRException { 856 if (src == null || src.isEmpty()) 857 return null; 858 org.hl7.fhir.dstu2.model.TestScript.TestScriptVariableComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptVariableComponent(); 859 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 860 if (src.hasNameElement()) 861 tgt.setNameElement(String10_30.convertString(src.getNameElement())); 862 if (src.hasHeaderFieldElement()) 863 tgt.setHeaderFieldElement(String10_30.convertString(src.getHeaderFieldElement())); 864 if (src.hasPathElement()) 865 tgt.setPathElement(String10_30.convertString(src.getPathElement())); 866 if (src.hasSourceIdElement()) 867 tgt.setSourceIdElement(Id10_30.convertId(src.getSourceIdElement())); 868 return tgt; 869 } 870}