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