001package org.hl7.fhir.dstu3.model; 002 003/*- 004 * #%L 005 * org.hl7.fhir.dstu3 006 * %% 007 * Copyright (C) 2014 - 2019 Health Level 7 008 * %% 009 * Licensed under the Apache License, Version 2.0 (the "License"); 010 * you may not use this file except in compliance with the License. 011 * You may obtain a copy of the License at 012 * 013 * http://www.apache.org/licenses/LICENSE-2.0 014 * 015 * Unless required by applicable law or agreed to in writing, software 016 * distributed under the License is distributed on an "AS IS" BASIS, 017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 018 * See the License for the specific language governing permissions and 019 * limitations under the License. 020 * #L% 021 */ 022 023 024/* 025 Copyright (c) 2011+, HL7, Inc. 026 All rights reserved. 027 028 Redistribution and use in source and binary forms, with or without modification, 029 are permitted provided that the following conditions are met: 030 031 * Redistributions of source code must retain the above copyright notice, this 032 list of conditions and the following disclaimer. 033 * Redistributions in binary form must reproduce the above copyright notice, 034 this list of conditions and the following disclaimer in the documentation 035 and/or other materials provided with the distribution. 036 * Neither the name of HL7 nor the names of its contributors may be used to 037 endorse or promote products derived from this software without specific 038 prior written permission. 039 040 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 041 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 042 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 043 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 044 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 045 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 046 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 047 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 048 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 049 POSSIBILITY OF SUCH DAMAGE. 050 051*/ 052 053// Generated on Fri, Mar 16, 2018 15:21+1100 for FHIR v3.0.x 054 055import org.hl7.fhir.exceptions.FHIRException; 056 057public class ResourceFactory extends Factory { 058 059 public static Resource createResource(String name) throws FHIRException { 060 if ("Appointment".equals(name)) 061 return new Appointment(); 062 if ("ReferralRequest".equals(name)) 063 return new ReferralRequest(); 064 if ("Account".equals(name)) 065 return new Account(); 066 if ("DocumentManifest".equals(name)) 067 return new DocumentManifest(); 068 if ("MessageDefinition".equals(name)) 069 return new MessageDefinition(); 070 if ("Goal".equals(name)) 071 return new Goal(); 072 if ("Endpoint".equals(name)) 073 return new Endpoint(); 074 if ("EnrollmentRequest".equals(name)) 075 return new EnrollmentRequest(); 076 if ("Consent".equals(name)) 077 return new Consent(); 078 if ("CapabilityStatement".equals(name)) 079 return new CapabilityStatement(); 080 if ("Medication".equals(name)) 081 return new Medication(); 082 if ("Measure".equals(name)) 083 return new Measure(); 084 if ("ResearchSubject".equals(name)) 085 return new ResearchSubject(); 086 if ("Subscription".equals(name)) 087 return new Subscription(); 088 if ("DocumentReference".equals(name)) 089 return new DocumentReference(); 090 if ("GraphDefinition".equals(name)) 091 return new GraphDefinition(); 092 if ("ImagingManifest".equals(name)) 093 return new ImagingManifest(); 094 if ("Parameters".equals(name)) 095 return new Parameters(); 096 if ("MeasureReport".equals(name)) 097 return new MeasureReport(); 098 if ("PractitionerRole".equals(name)) 099 return new PractitionerRole(); 100 if ("RelatedPerson".equals(name)) 101 return new RelatedPerson(); 102 if ("SupplyRequest".equals(name)) 103 return new SupplyRequest(); 104 if ("Practitioner".equals(name)) 105 return new Practitioner(); 106 if ("ExpansionProfile".equals(name)) 107 return new ExpansionProfile(); 108 if ("Slot".equals(name)) 109 return new Slot(); 110 if ("Person".equals(name)) 111 return new Person(); 112 if ("Contract".equals(name)) 113 return new Contract(); 114 if ("RiskAssessment".equals(name)) 115 return new RiskAssessment(); 116 if ("Group".equals(name)) 117 return new Group(); 118 if ("PaymentNotice".equals(name)) 119 return new PaymentNotice(); 120 if ("Organization".equals(name)) 121 return new Organization(); 122 if ("CareTeam".equals(name)) 123 return new CareTeam(); 124 if ("ImplementationGuide".equals(name)) 125 return new ImplementationGuide(); 126 if ("ImagingStudy".equals(name)) 127 return new ImagingStudy(); 128 if ("DeviceComponent".equals(name)) 129 return new DeviceComponent(); 130 if ("FamilyMemberHistory".equals(name)) 131 return new FamilyMemberHistory(); 132 if ("ChargeItem".equals(name)) 133 return new ChargeItem(); 134 if ("Encounter".equals(name)) 135 return new Encounter(); 136 if ("Substance".equals(name)) 137 return new Substance(); 138 if ("SearchParameter".equals(name)) 139 return new SearchParameter(); 140 if ("ServiceDefinition".equals(name)) 141 return new ServiceDefinition(); 142 if ("Communication".equals(name)) 143 return new Communication(); 144 if ("ActivityDefinition".equals(name)) 145 return new ActivityDefinition(); 146 if ("Linkage".equals(name)) 147 return new Linkage(); 148 if ("DeviceUseStatement".equals(name)) 149 return new DeviceUseStatement(); 150 if ("RequestGroup".equals(name)) 151 return new RequestGroup(); 152 if ("DeviceRequest".equals(name)) 153 return new DeviceRequest(); 154 if ("MessageHeader".equals(name)) 155 return new MessageHeader(); 156 if ("ImmunizationRecommendation".equals(name)) 157 return new ImmunizationRecommendation(); 158 if ("BodySite".equals(name)) 159 return new BodySite(); 160 if ("Provenance".equals(name)) 161 return new Provenance(); 162 if ("Task".equals(name)) 163 return new Task(); 164 if ("Questionnaire".equals(name)) 165 return new Questionnaire(); 166 if ("ExplanationOfBenefit".equals(name)) 167 return new ExplanationOfBenefit(); 168 if ("ResearchStudy".equals(name)) 169 return new ResearchStudy(); 170 if ("Specimen".equals(name)) 171 return new Specimen(); 172 if ("AllergyIntolerance".equals(name)) 173 return new AllergyIntolerance(); 174 if ("CarePlan".equals(name)) 175 return new CarePlan(); 176 if ("StructureDefinition".equals(name)) 177 return new StructureDefinition(); 178 if ("EpisodeOfCare".equals(name)) 179 return new EpisodeOfCare(); 180 if ("OperationOutcome".equals(name)) 181 return new OperationOutcome(); 182 if ("Procedure".equals(name)) 183 return new Procedure(); 184 if ("List".equals(name)) 185 return new ListResource(); 186 if ("ConceptMap".equals(name)) 187 return new ConceptMap(); 188 if ("ValueSet".equals(name)) 189 return new ValueSet(); 190 if ("OperationDefinition".equals(name)) 191 return new OperationDefinition(); 192 if ("Immunization".equals(name)) 193 return new Immunization(); 194 if ("MedicationRequest".equals(name)) 195 return new MedicationRequest(); 196 if ("Device".equals(name)) 197 return new Device(); 198 if ("VisionPrescription".equals(name)) 199 return new VisionPrescription(); 200 if ("Media".equals(name)) 201 return new Media(); 202 if ("ProcedureRequest".equals(name)) 203 return new ProcedureRequest(); 204 if ("EligibilityResponse".equals(name)) 205 return new EligibilityResponse(); 206 if ("Sequence".equals(name)) 207 return new Sequence(); 208 if ("DeviceMetric".equals(name)) 209 return new DeviceMetric(); 210 if ("Flag".equals(name)) 211 return new Flag(); 212 if ("CodeSystem".equals(name)) 213 return new CodeSystem(); 214 if ("AppointmentResponse".equals(name)) 215 return new AppointmentResponse(); 216 if ("StructureMap".equals(name)) 217 return new StructureMap(); 218 if ("AdverseEvent".equals(name)) 219 return new AdverseEvent(); 220 if ("GuidanceResponse".equals(name)) 221 return new GuidanceResponse(); 222 if ("Observation".equals(name)) 223 return new Observation(); 224 if ("MedicationAdministration".equals(name)) 225 return new MedicationAdministration(); 226 if ("EnrollmentResponse".equals(name)) 227 return new EnrollmentResponse(); 228 if ("Binary".equals(name)) 229 return new Binary(); 230 if ("Library".equals(name)) 231 return new Library(); 232 if ("MedicationStatement".equals(name)) 233 return new MedicationStatement(); 234 if ("CommunicationRequest".equals(name)) 235 return new CommunicationRequest(); 236 if ("TestScript".equals(name)) 237 return new TestScript(); 238 if ("Basic".equals(name)) 239 return new Basic(); 240 if ("TestReport".equals(name)) 241 return new TestReport(); 242 if ("ClaimResponse".equals(name)) 243 return new ClaimResponse(); 244 if ("EligibilityRequest".equals(name)) 245 return new EligibilityRequest(); 246 if ("ProcessRequest".equals(name)) 247 return new ProcessRequest(); 248 if ("MedicationDispense".equals(name)) 249 return new MedicationDispense(); 250 if ("DiagnosticReport".equals(name)) 251 return new DiagnosticReport(); 252 if ("HealthcareService".equals(name)) 253 return new HealthcareService(); 254 if ("DataElement".equals(name)) 255 return new DataElement(); 256 if ("NutritionOrder".equals(name)) 257 return new NutritionOrder(); 258 if ("AuditEvent".equals(name)) 259 return new AuditEvent(); 260 if ("PaymentReconciliation".equals(name)) 261 return new PaymentReconciliation(); 262 if ("Condition".equals(name)) 263 return new Condition(); 264 if ("Composition".equals(name)) 265 return new Composition(); 266 if ("DetectedIssue".equals(name)) 267 return new DetectedIssue(); 268 if ("Bundle".equals(name)) 269 return new Bundle(); 270 if ("CompartmentDefinition".equals(name)) 271 return new CompartmentDefinition(); 272 if ("Patient".equals(name)) 273 return new Patient(); 274 if ("Coverage".equals(name)) 275 return new Coverage(); 276 if ("QuestionnaireResponse".equals(name)) 277 return new QuestionnaireResponse(); 278 if ("ProcessResponse".equals(name)) 279 return new ProcessResponse(); 280 if ("NamingSystem".equals(name)) 281 return new NamingSystem(); 282 if ("Schedule".equals(name)) 283 return new Schedule(); 284 if ("SupplyDelivery".equals(name)) 285 return new SupplyDelivery(); 286 if ("ClinicalImpression".equals(name)) 287 return new ClinicalImpression(); 288 if ("PlanDefinition".equals(name)) 289 return new PlanDefinition(); 290 if ("Claim".equals(name)) 291 return new Claim(); 292 if ("Location".equals(name)) 293 return new Location(); 294 else 295 throw new FHIRException("Unknown Resource Name '"+name+"'"); 296 } 297 298 public static Element createType(String name) throws FHIRException { 299 if ("date".equals(name)) 300 return new DateType(); 301 if ("Meta".equals(name)) 302 return new Meta(); 303 if ("Address".equals(name)) 304 return new Address(); 305 if ("Attachment".equals(name)) 306 return new Attachment(); 307 if ("integer".equals(name)) 308 return new IntegerType(); 309 if ("Count".equals(name)) 310 return new Count(); 311 if ("DataRequirement".equals(name)) 312 return new DataRequirement(); 313 if ("Dosage".equals(name)) 314 return new Dosage(); 315 if ("uuid".equals(name)) 316 return new UuidType(); 317 if ("Identifier".equals(name)) 318 return new Identifier(); 319 if ("Narrative".equals(name)) 320 return new Narrative(); 321 if ("Coding".equals(name)) 322 return new Coding(); 323 if ("SampledData".equals(name)) 324 return new SampledData(); 325 if ("id".equals(name)) 326 return new IdType(); 327 if ("positiveInt".equals(name)) 328 return new PositiveIntType(); 329 if ("ElementDefinition".equals(name)) 330 return new ElementDefinition(); 331 if ("Distance".equals(name)) 332 return new Distance(); 333 if ("Period".equals(name)) 334 return new Period(); 335 if ("Duration".equals(name)) 336 return new Duration(); 337 if ("Range".equals(name)) 338 return new Range(); 339 if ("RelatedArtifact".equals(name)) 340 return new RelatedArtifact(); 341 if ("base64Binary".equals(name)) 342 return new Base64BinaryType(); 343 if ("UsageContext".equals(name)) 344 return new UsageContext(); 345 if ("Timing".equals(name)) 346 return new Timing(); 347 if ("decimal".equals(name)) 348 return new DecimalType(); 349 if ("CodeableConcept".equals(name)) 350 return new CodeableConcept(); 351 if ("ParameterDefinition".equals(name)) 352 return new ParameterDefinition(); 353 if ("dateTime".equals(name)) 354 return new DateTimeType(); 355 if ("code".equals(name)) 356 return new CodeType(); 357 if ("string".equals(name)) 358 return new StringType(); 359 if ("Contributor".equals(name)) 360 return new Contributor(); 361 if ("oid".equals(name)) 362 return new OidType(); 363 if ("instant".equals(name)) 364 return new InstantType(); 365 if ("Money".equals(name)) 366 return new Money(); 367 if ("HumanName".equals(name)) 368 return new HumanName(); 369 if ("ContactPoint".equals(name)) 370 return new ContactPoint(); 371 if ("markdown".equals(name)) 372 return new MarkdownType(); 373 if ("Ratio".equals(name)) 374 return new Ratio(); 375 if ("Age".equals(name)) 376 return new Age(); 377 if ("Reference".equals(name)) 378 return new Reference(); 379 if ("TriggerDefinition".equals(name)) 380 return new TriggerDefinition(); 381 if ("SimpleQuantity".equals(name)) 382 return new SimpleQuantity(); 383 if ("Quantity".equals(name)) 384 return new Quantity(); 385 if ("uri".equals(name)) 386 return new UriType(); 387 if ("Annotation".equals(name)) 388 return new Annotation(); 389 if ("Extension".equals(name)) 390 return new Extension(); 391 if ("ContactDetail".equals(name)) 392 return new ContactDetail(); 393 if ("boolean".equals(name)) 394 return new BooleanType(); 395 if ("Signature".equals(name)) 396 return new Signature(); 397 if ("unsignedInt".equals(name)) 398 return new UnsignedIntType(); 399 if ("time".equals(name)) 400 return new TimeType(); 401 else 402 throw new FHIRException("Unknown Type Name '"+name+"'"); 403 } 404 405 public static Base createResourceOrType(String name) throws FHIRException { 406 switch (name.hashCode()) { 407 case 487334413: return new Account(); 408 case 851278306: return new ActivityDefinition(); 409 case 516961236: return new Address(); 410 case -329624856: return new AdverseEvent(); 411 case 65759: return new Age(); 412 case 1721380104: return new AllergyIntolerance(); 413 case 438421327: return new Annotation(); 414 case 192873343: return new Appointment(); 415 case 1733332192: return new AppointmentResponse(); 416 case 29963587: return new Attachment(); 417 case -632949857: return new AuditEvent(); 418 case 63955982: return new Basic(); 419 case 1989867553: return new Binary(); 420 case 1767264297: return new BodySite(); 421 case 2000952482: return new Bundle(); 422 case -871422185: return new CapabilityStatement(); 423 case 57208314: return new CarePlan(); 424 case 57320750: return new CareTeam(); 425 case -883723257: return new ChargeItem(); 426 case 65189916: return new Claim(); 427 case 1488475261: return new ClaimResponse(); 428 case -1268501092: return new ClinicalImpression(); 429 case 1076953756: return new CodeSystem(); 430 case -1153521791: return new CodeableConcept(); 431 case 2023747466: return new Coding(); 432 case -236322890: return new Communication(); 433 case -1874423303: return new CommunicationRequest(); 434 case 1287805733: return new CompartmentDefinition(); 435 case 828944778: return new Composition(); 436 case 57185780: return new ConceptMap(); 437 case 1142656251: return new Condition(); 438 case -1678813190: return new Consent(); 439 case 973193329: return new ContactDetail(); 440 case 1428236656: return new ContactPoint(); 441 case -502303438: return new Contract(); 442 case -227407685: return new Contributor(); 443 case 65298671: return new Count(); 444 case -287122936: return new Coverage(); 445 case -1476174894: return new DataElement(); 446 case -367870439: return new DataRequirement(); 447 case 850563927: return new DetectedIssue(); 448 case 2043677302: return new Device(); 449 case 745969447: return new DeviceComponent(); 450 case -949306426: return new DeviceMetric(); 451 case 776138553: return new DeviceRequest(); 452 case 491858238: return new DeviceUseStatement(); 453 case -1122842661: return new DiagnosticReport(); 454 case 353103893: return new Distance(); 455 case 1922784394: return new DocumentManifest(); 456 case -1202791344: return new DocumentReference(); 457 case 2052815575: return new Dosage(); 458 case -1927368268: return new Duration(); 459 case -1605049009: return new ElementDefinition(); 460 case -1197000094: return new EligibilityRequest(); 461 case 1600636622: return new EligibilityResponse(); 462 case -766867181: return new Encounter(); 463 case 1805746613: return new Endpoint(); 464 case -1377846581: return new EnrollmentRequest(); 465 case 289362821: return new EnrollmentResponse(); 466 case -1093178557: return new EpisodeOfCare(); 467 case -1136815094: return new ExpansionProfile(); 468 case -1001676601: return new ExplanationOfBenefit(); 469 case 1391410207: return new Extension(); 470 case 1260711798: return new FamilyMemberHistory(); 471 case 2192268: return new Flag(); 472 case 2224947: return new Goal(); 473 case -180371167: return new GraphDefinition(); 474 case 69076575: return new Group(); 475 case 997117913: return new GuidanceResponse(); 476 case 933423720: return new HealthcareService(); 477 case 1592332600: return new HumanName(); 478 case 375032009: return new Identifier(); 479 case -5812857: return new ImagingManifest(); 480 case -650580623: return new ImagingStudy(); 481 case -2004863454: return new Immunization(); 482 case 1728372347: return new ImmunizationRecommendation(); 483 case 1410262602: return new ImplementationGuide(); 484 case 1830861979: return new Library(); 485 case 1841735333: return new Linkage(); 486 case 2368702: return new ListResource(); 487 case 1965687765: return new Location(); 488 case -1691992770: return new Measure(); 489 case 1681397778: return new MeasureReport(); 490 case 74219460: return new Media(); 491 case -302536977: return new Medication(); 492 case -342579923: return new MedicationAdministration(); 493 case -408244884: return new MedicationDispense(); 494 case 1627523232: return new MedicationRequest(); 495 case -2097348800: return new MedicationStatement(); 496 case -2037697382: return new MessageDefinition(); 497 case -1087398572: return new MessageHeader(); 498 case 2394661: return new Meta(); 499 case 74526880: return new Money(); 500 case 369315063: return new NamingSystem(); 501 case -540546990: return new Narrative(); 502 case 1247831734: return new NutritionOrder(); 503 case 1790214156: return new Observation(); 504 case -2140710406: return new OperationDefinition(); 505 case -526550005: return new OperationOutcome(); 506 case 1343242579: return new Organization(); 507 case 671337916: return new ParameterDefinition(); 508 case -1842766326: return new Parameters(); 509 case 873235173: return new Patient(); 510 case 2082457694: return new PaymentNotice(); 511 case 28778089: return new PaymentReconciliation(); 512 case -1907858975: return new Period(); 513 case -1907849355: return new Person(); 514 case 1401244028: return new PlanDefinition(); 515 case 738893626: return new Practitioner(); 516 case -621058352: return new PractitionerRole(); 517 case 908763827: return new Procedure(); 518 case 737478748: return new ProcedureRequest(); 519 case 8777024: return new ProcessRequest(); 520 case 325021616: return new ProcessResponse(); 521 case 2093211201: return new Provenance(); 522 case -1220360021: return new Quantity(); 523 case -218088061: return new Questionnaire(); 524 case 269058788: return new QuestionnaireResponse(); 525 case 78727453: return new Range(); 526 case 78733291: return new Ratio(); 527 case 1078812459: return new Reference(); 528 case -1307317230: return new ReferralRequest(); 529 case -330210563: return new RelatedArtifact(); 530 case 846088000: return new RelatedPerson(); 531 case 1445374288: return new RequestGroup(); 532 case 1312904398: return new ResearchStudy(); 533 case -1008013583: return new ResearchSubject(); 534 case -766422255: return new RiskAssessment(); 535 case 1824308900: return new SampledData(); 536 case -633276745: return new Schedule(); 537 case -912457023: return new SearchParameter(); 538 case 1414192097: return new Sequence(); 539 case 194378184: return new ServiceDefinition(); 540 case -1217415016: return new Signature(); 541 case -1097468803: return new SimpleQuantity(); 542 case 2579998: return new Slot(); 543 case -2068224216: return new Specimen(); 544 case 1133777670: return new StructureDefinition(); 545 case 1958247177: return new StructureMap(); 546 case 505523517: return new Subscription(); 547 case -1760959152: return new Substance(); 548 case 383030819: return new SupplyDelivery(); 549 case 665843328: return new SupplyRequest(); 550 case 2599333: return new Task(); 551 case -616289146: return new TestReport(); 552 case -589453283: return new TestScript(); 553 case -1789797270: return new Timing(); 554 case 770498827: return new TriggerDefinition(); 555 case 1071332590: return new UsageContext(); 556 case -1345530543: return new ValueSet(); 557 case -555387838: return new VisionPrescription(); 558 case -1216012752: return new Base64BinaryType(); 559 case 64711720: return new BooleanType(); 560 case 3059181: return new CodeType(); 561 case 3076014: return new DateType(); 562 case 1792749467: return new DateTimeType(); 563 case 1542263633: return new DecimalType(); 564 case 3355: return new IdType(); 565 case 1957570017: return new InstantType(); 566 case 1958052158: return new IntegerType(); 567 case 246938863: return new MarkdownType(); 568 case 110026: return new OidType(); 569 case -131262666: return new PositiveIntType(); 570 case -891985903: return new StringType(); 571 case 3560141: return new TimeType(); 572 case 1145198778: return new UnsignedIntType(); 573 case 116076: return new UriType(); 574 case 3601339: return new UuidType(); 575 default: 576 throw new FHIRException("Unknown Resource or Type Name '"+name+"'"); 577 } 578 } 579 580 581} 582