001package org.hl7.fhir.dstu2016may.model; 002 003/* 004 Copyright (c) 2011+, HL7, Inc. 005 All rights reserved. 006 007 Redistribution and use in source and binary forms, with or without modification, 008 are permitted provided that the following conditions are met: 009 010 * Redistributions of source code must retain the above copyright notice, this 011 list of conditions and the following disclaimer. 012 * Redistributions in binary form must reproduce the above copyright notice, 013 this list of conditions and the following disclaimer in the documentation 014 and/or other materials provided with the distribution. 015 * Neither the name of HL7 nor the names of its contributors may be used to 016 endorse or promote products derived from this software without specific 017 prior written permission. 018 019 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 020 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 021 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 022 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 023 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 024 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 025 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 026 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 027 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 028 POSSIBILITY OF SUCH DAMAGE. 029 030*/ 031 032// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 033 034import org.hl7.fhir.exceptions.FHIRException; 035 036public class ResourceFactory extends Factory { 037 038 public static Resource createResource(String name) throws FHIRException { 039 if ("Condition".equals(name)) 040 return new Condition(); 041 if ("DeviceComponent".equals(name)) 042 return new DeviceComponent(); 043 if ("Communication".equals(name)) 044 return new Communication(); 045 if ("PractitionerRole".equals(name)) 046 return new PractitionerRole(); 047 if ("Group".equals(name)) 048 return new Group(); 049 if ("ValueSet".equals(name)) 050 return new ValueSet(); 051 if ("Coverage".equals(name)) 052 return new Coverage(); 053 if ("Appointment".equals(name)) 054 return new Appointment(); 055 if ("Library".equals(name)) 056 return new Library(); 057 if ("Slot".equals(name)) 058 return new Slot(); 059 if ("DecisionSupportRule".equals(name)) 060 return new DecisionSupportRule(); 061 if ("Composition".equals(name)) 062 return new Composition(); 063 if ("EpisodeOfCare".equals(name)) 064 return new EpisodeOfCare(); 065 if ("Conformance".equals(name)) 066 return new Conformance(); 067 if ("NamingSystem".equals(name)) 068 return new NamingSystem(); 069 if ("HealthcareService".equals(name)) 070 return new HealthcareService(); 071 if ("Linkage".equals(name)) 072 return new Linkage(); 073 if ("OrderResponse".equals(name)) 074 return new OrderResponse(); 075 if ("Task".equals(name)) 076 return new Task(); 077 if ("ConceptMap".equals(name)) 078 return new ConceptMap(); 079 if ("Practitioner".equals(name)) 080 return new Practitioner(); 081 if ("CarePlan".equals(name)) 082 return new CarePlan(); 083 if ("Substance".equals(name)) 084 return new Substance(); 085 if ("QuestionnaireResponse".equals(name)) 086 return new QuestionnaireResponse(); 087 if ("DeviceUseRequest".equals(name)) 088 return new DeviceUseRequest(); 089 if ("Schedule".equals(name)) 090 return new Schedule(); 091 if ("SupplyDelivery".equals(name)) 092 return new SupplyDelivery(); 093 if ("EligibilityRequest".equals(name)) 094 return new EligibilityRequest(); 095 if ("PaymentReconciliation".equals(name)) 096 return new PaymentReconciliation(); 097 if ("TestScript".equals(name)) 098 return new TestScript(); 099 if ("OperationDefinition".equals(name)) 100 return new OperationDefinition(); 101 if ("ImagingObjectSelection".equals(name)) 102 return new ImagingObjectSelection(); 103 if ("ClaimResponse".equals(name)) 104 return new ClaimResponse(); 105 if ("BodySite".equals(name)) 106 return new BodySite(); 107 if ("Flag".equals(name)) 108 return new Flag(); 109 if ("CommunicationRequest".equals(name)) 110 return new CommunicationRequest(); 111 if ("Claim".equals(name)) 112 return new Claim(); 113 if ("RiskAssessment".equals(name)) 114 return new RiskAssessment(); 115 if ("ExpansionProfile".equals(name)) 116 return new ExpansionProfile(); 117 if ("ExplanationOfBenefit".equals(name)) 118 return new ExplanationOfBenefit(); 119 if ("AllergyIntolerance".equals(name)) 120 return new AllergyIntolerance(); 121 if ("Observation".equals(name)) 122 return new Observation(); 123 if ("RelatedPerson".equals(name)) 124 return new RelatedPerson(); 125 if ("ProcessResponse".equals(name)) 126 return new ProcessResponse(); 127 if ("AuditEvent".equals(name)) 128 return new AuditEvent(); 129 if ("EligibilityResponse".equals(name)) 130 return new EligibilityResponse(); 131 if ("MedicationOrder".equals(name)) 132 return new MedicationOrder(); 133 if ("Person".equals(name)) 134 return new Person(); 135 if ("Parameters".equals(name)) 136 return new Parameters(); 137 if ("ModuleDefinition".equals(name)) 138 return new ModuleDefinition(); 139 if ("ProcedureRequest".equals(name)) 140 return new ProcedureRequest(); 141 if ("DeviceMetric".equals(name)) 142 return new DeviceMetric(); 143 if ("Organization".equals(name)) 144 return new Organization(); 145 if ("Measure".equals(name)) 146 return new Measure(); 147 if ("ProcessRequest".equals(name)) 148 return new ProcessRequest(); 149 if ("ImmunizationRecommendation".equals(name)) 150 return new ImmunizationRecommendation(); 151 if ("MedicationDispense".equals(name)) 152 return new MedicationDispense(); 153 if ("DetectedIssue".equals(name)) 154 return new DetectedIssue(); 155 if ("PaymentNotice".equals(name)) 156 return new PaymentNotice(); 157 if ("MedicationStatement".equals(name)) 158 return new MedicationStatement(); 159 if ("AppointmentResponse".equals(name)) 160 return new AppointmentResponse(); 161 if ("Sequence".equals(name)) 162 return new Sequence(); 163 if ("ImplementationGuide".equals(name)) 164 return new ImplementationGuide(); 165 if ("Protocol".equals(name)) 166 return new Protocol(); 167 if ("Questionnaire".equals(name)) 168 return new Questionnaire(); 169 if ("OperationOutcome".equals(name)) 170 return new OperationOutcome(); 171 if ("DecisionSupportServiceModule".equals(name)) 172 return new DecisionSupportServiceModule(); 173 if ("FamilyMemberHistory".equals(name)) 174 return new FamilyMemberHistory(); 175 if ("Media".equals(name)) 176 return new Media(); 177 if ("ImagingExcerpt".equals(name)) 178 return new ImagingExcerpt(); 179 if ("Binary".equals(name)) 180 return new Binary(); 181 if ("VisionPrescription".equals(name)) 182 return new VisionPrescription(); 183 if ("DocumentReference".equals(name)) 184 return new DocumentReference(); 185 if ("Immunization".equals(name)) 186 return new Immunization(); 187 if ("CareTeam".equals(name)) 188 return new CareTeam(); 189 if ("Bundle".equals(name)) 190 return new Bundle(); 191 if ("Subscription".equals(name)) 192 return new Subscription(); 193 if ("MeasureReport".equals(name)) 194 return new MeasureReport(); 195 if ("ImagingStudy".equals(name)) 196 return new ImagingStudy(); 197 if ("Provenance".equals(name)) 198 return new Provenance(); 199 if ("Device".equals(name)) 200 return new Device(); 201 if ("StructureDefinition".equals(name)) 202 return new StructureDefinition(); 203 if ("Account".equals(name)) 204 return new Account(); 205 if ("Order".equals(name)) 206 return new Order(); 207 if ("Procedure".equals(name)) 208 return new Procedure(); 209 if ("OrderSet".equals(name)) 210 return new OrderSet(); 211 if ("DiagnosticReport".equals(name)) 212 return new DiagnosticReport(); 213 if ("Medication".equals(name)) 214 return new Medication(); 215 if ("MessageHeader".equals(name)) 216 return new MessageHeader(); 217 if ("DocumentManifest".equals(name)) 218 return new DocumentManifest(); 219 if ("DataElement".equals(name)) 220 return new DataElement(); 221 if ("MedicationAdministration".equals(name)) 222 return new MedicationAdministration(); 223 if ("StructureMap".equals(name)) 224 return new StructureMap(); 225 if ("CompartmentDefinition".equals(name)) 226 return new CompartmentDefinition(); 227 if ("Encounter".equals(name)) 228 return new Encounter(); 229 if ("List".equals(name)) 230 return new ListResource(); 231 if ("CodeSystem".equals(name)) 232 return new CodeSystem(); 233 if ("DeviceUseStatement".equals(name)) 234 return new DeviceUseStatement(); 235 if ("Goal".equals(name)) 236 return new Goal(); 237 if ("GuidanceResponse".equals(name)) 238 return new GuidanceResponse(); 239 if ("SearchParameter".equals(name)) 240 return new SearchParameter(); 241 if ("NutritionOrder".equals(name)) 242 return new NutritionOrder(); 243 if ("ReferralRequest".equals(name)) 244 return new ReferralRequest(); 245 if ("ClinicalImpression".equals(name)) 246 return new ClinicalImpression(); 247 if ("EnrollmentRequest".equals(name)) 248 return new EnrollmentRequest(); 249 if ("Location".equals(name)) 250 return new Location(); 251 if ("Contract".equals(name)) 252 return new Contract(); 253 if ("Basic".equals(name)) 254 return new Basic(); 255 if ("Specimen".equals(name)) 256 return new Specimen(); 257 if ("EnrollmentResponse".equals(name)) 258 return new EnrollmentResponse(); 259 if ("SupplyRequest".equals(name)) 260 return new SupplyRequest(); 261 if ("Patient".equals(name)) 262 return new Patient(); 263 if ("DiagnosticOrder".equals(name)) 264 return new DiagnosticOrder(); 265 else 266 throw new FHIRException("Unknown Resource Name '"+name+"'"); 267 } 268 269 public static Element createType(String name) throws FHIRException { 270 if ("Period".equals(name)) 271 return new Period(); 272 if ("Age".equals(name)) 273 return new Age(); 274 if ("Attachment".equals(name)) 275 return new Attachment(); 276 if ("Count".equals(name)) 277 return new Count(); 278 if ("SimpleQuantity".equals(name)) 279 return new SimpleQuantity(); 280 if ("Signature".equals(name)) 281 return new Signature(); 282 if ("Extension".equals(name)) 283 return new Extension(); 284 if ("ModuleMetadata".equals(name)) 285 return new ModuleMetadata(); 286 if ("ActionDefinition".equals(name)) 287 return new ActionDefinition(); 288 if ("HumanName".equals(name)) 289 return new HumanName(); 290 if ("Ratio".equals(name)) 291 return new Ratio(); 292 if ("Duration".equals(name)) 293 return new Duration(); 294 if ("CodeableConcept".equals(name)) 295 return new CodeableConcept(); 296 if ("Identifier".equals(name)) 297 return new Identifier(); 298 if ("Timing".equals(name)) 299 return new Timing(); 300 if ("Coding".equals(name)) 301 return new Coding(); 302 if ("Range".equals(name)) 303 return new Range(); 304 if ("Quantity".equals(name)) 305 return new Quantity(); 306 if ("Money".equals(name)) 307 return new Money(); 308 if ("Distance".equals(name)) 309 return new Distance(); 310 if ("DataRequirement".equals(name)) 311 return new DataRequirement(); 312 if ("ParameterDefinition".equals(name)) 313 return new ParameterDefinition(); 314 if ("ContactPoint".equals(name)) 315 return new ContactPoint(); 316 if ("TriggerDefinition".equals(name)) 317 return new TriggerDefinition(); 318 if ("ElementDefinition".equals(name)) 319 return new ElementDefinition(); 320 if ("Address".equals(name)) 321 return new Address(); 322 if ("Annotation".equals(name)) 323 return new Annotation(); 324 if ("Meta".equals(name)) 325 return new Meta(); 326 if ("SampledData".equals(name)) 327 return new SampledData(); 328 if ("Reference".equals(name)) 329 return new Reference(); 330 if ("Narrative".equals(name)) 331 return new Narrative(); 332 else 333 throw new FHIRException("Unknown Type Name '"+name+"'"); 334 } 335 336 public static Base createResourceOrType(String name) throws FHIRException { 337 if ("Condition".equals(name)) 338 return new Condition(); 339 if ("DeviceComponent".equals(name)) 340 return new DeviceComponent(); 341 if ("Communication".equals(name)) 342 return new Communication(); 343 if ("PractitionerRole".equals(name)) 344 return new PractitionerRole(); 345 if ("Group".equals(name)) 346 return new Group(); 347 if ("ValueSet".equals(name)) 348 return new ValueSet(); 349 if ("Coverage".equals(name)) 350 return new Coverage(); 351 if ("Appointment".equals(name)) 352 return new Appointment(); 353 if ("Library".equals(name)) 354 return new Library(); 355 if ("Slot".equals(name)) 356 return new Slot(); 357 if ("DecisionSupportRule".equals(name)) 358 return new DecisionSupportRule(); 359 if ("Composition".equals(name)) 360 return new Composition(); 361 if ("EpisodeOfCare".equals(name)) 362 return new EpisodeOfCare(); 363 if ("Conformance".equals(name)) 364 return new Conformance(); 365 if ("NamingSystem".equals(name)) 366 return new NamingSystem(); 367 if ("HealthcareService".equals(name)) 368 return new HealthcareService(); 369 if ("Linkage".equals(name)) 370 return new Linkage(); 371 if ("OrderResponse".equals(name)) 372 return new OrderResponse(); 373 if ("Task".equals(name)) 374 return new Task(); 375 if ("ConceptMap".equals(name)) 376 return new ConceptMap(); 377 if ("Practitioner".equals(name)) 378 return new Practitioner(); 379 if ("CarePlan".equals(name)) 380 return new CarePlan(); 381 if ("Substance".equals(name)) 382 return new Substance(); 383 if ("QuestionnaireResponse".equals(name)) 384 return new QuestionnaireResponse(); 385 if ("DeviceUseRequest".equals(name)) 386 return new DeviceUseRequest(); 387 if ("Schedule".equals(name)) 388 return new Schedule(); 389 if ("SupplyDelivery".equals(name)) 390 return new SupplyDelivery(); 391 if ("EligibilityRequest".equals(name)) 392 return new EligibilityRequest(); 393 if ("PaymentReconciliation".equals(name)) 394 return new PaymentReconciliation(); 395 if ("TestScript".equals(name)) 396 return new TestScript(); 397 if ("OperationDefinition".equals(name)) 398 return new OperationDefinition(); 399 if ("ImagingObjectSelection".equals(name)) 400 return new ImagingObjectSelection(); 401 if ("ClaimResponse".equals(name)) 402 return new ClaimResponse(); 403 if ("BodySite".equals(name)) 404 return new BodySite(); 405 if ("Flag".equals(name)) 406 return new Flag(); 407 if ("CommunicationRequest".equals(name)) 408 return new CommunicationRequest(); 409 if ("Claim".equals(name)) 410 return new Claim(); 411 if ("RiskAssessment".equals(name)) 412 return new RiskAssessment(); 413 if ("ExpansionProfile".equals(name)) 414 return new ExpansionProfile(); 415 if ("ExplanationOfBenefit".equals(name)) 416 return new ExplanationOfBenefit(); 417 if ("AllergyIntolerance".equals(name)) 418 return new AllergyIntolerance(); 419 if ("Observation".equals(name)) 420 return new Observation(); 421 if ("RelatedPerson".equals(name)) 422 return new RelatedPerson(); 423 if ("ProcessResponse".equals(name)) 424 return new ProcessResponse(); 425 if ("AuditEvent".equals(name)) 426 return new AuditEvent(); 427 if ("EligibilityResponse".equals(name)) 428 return new EligibilityResponse(); 429 if ("MedicationOrder".equals(name)) 430 return new MedicationOrder(); 431 if ("Person".equals(name)) 432 return new Person(); 433 if ("Parameters".equals(name)) 434 return new Parameters(); 435 if ("ModuleDefinition".equals(name)) 436 return new ModuleDefinition(); 437 if ("ProcedureRequest".equals(name)) 438 return new ProcedureRequest(); 439 if ("DeviceMetric".equals(name)) 440 return new DeviceMetric(); 441 if ("Organization".equals(name)) 442 return new Organization(); 443 if ("Measure".equals(name)) 444 return new Measure(); 445 if ("ProcessRequest".equals(name)) 446 return new ProcessRequest(); 447 if ("ImmunizationRecommendation".equals(name)) 448 return new ImmunizationRecommendation(); 449 if ("MedicationDispense".equals(name)) 450 return new MedicationDispense(); 451 if ("DetectedIssue".equals(name)) 452 return new DetectedIssue(); 453 if ("PaymentNotice".equals(name)) 454 return new PaymentNotice(); 455 if ("MedicationStatement".equals(name)) 456 return new MedicationStatement(); 457 if ("AppointmentResponse".equals(name)) 458 return new AppointmentResponse(); 459 if ("Sequence".equals(name)) 460 return new Sequence(); 461 if ("ImplementationGuide".equals(name)) 462 return new ImplementationGuide(); 463 if ("Protocol".equals(name)) 464 return new Protocol(); 465 if ("Questionnaire".equals(name)) 466 return new Questionnaire(); 467 if ("OperationOutcome".equals(name)) 468 return new OperationOutcome(); 469 if ("DecisionSupportServiceModule".equals(name)) 470 return new DecisionSupportServiceModule(); 471 if ("FamilyMemberHistory".equals(name)) 472 return new FamilyMemberHistory(); 473 if ("Media".equals(name)) 474 return new Media(); 475 if ("ImagingExcerpt".equals(name)) 476 return new ImagingExcerpt(); 477 if ("Binary".equals(name)) 478 return new Binary(); 479 if ("VisionPrescription".equals(name)) 480 return new VisionPrescription(); 481 if ("DocumentReference".equals(name)) 482 return new DocumentReference(); 483 if ("Immunization".equals(name)) 484 return new Immunization(); 485 if ("CareTeam".equals(name)) 486 return new CareTeam(); 487 if ("Bundle".equals(name)) 488 return new Bundle(); 489 if ("Subscription".equals(name)) 490 return new Subscription(); 491 if ("MeasureReport".equals(name)) 492 return new MeasureReport(); 493 if ("ImagingStudy".equals(name)) 494 return new ImagingStudy(); 495 if ("Provenance".equals(name)) 496 return new Provenance(); 497 if ("Device".equals(name)) 498 return new Device(); 499 if ("StructureDefinition".equals(name)) 500 return new StructureDefinition(); 501 if ("Account".equals(name)) 502 return new Account(); 503 if ("Order".equals(name)) 504 return new Order(); 505 if ("Procedure".equals(name)) 506 return new Procedure(); 507 if ("OrderSet".equals(name)) 508 return new OrderSet(); 509 if ("DiagnosticReport".equals(name)) 510 return new DiagnosticReport(); 511 if ("Medication".equals(name)) 512 return new Medication(); 513 if ("MessageHeader".equals(name)) 514 return new MessageHeader(); 515 if ("DocumentManifest".equals(name)) 516 return new DocumentManifest(); 517 if ("DataElement".equals(name)) 518 return new DataElement(); 519 if ("MedicationAdministration".equals(name)) 520 return new MedicationAdministration(); 521 if ("StructureMap".equals(name)) 522 return new StructureMap(); 523 if ("CompartmentDefinition".equals(name)) 524 return new CompartmentDefinition(); 525 if ("Encounter".equals(name)) 526 return new Encounter(); 527 if ("List".equals(name)) 528 return new ListResource(); 529 if ("CodeSystem".equals(name)) 530 return new CodeSystem(); 531 if ("DeviceUseStatement".equals(name)) 532 return new DeviceUseStatement(); 533 if ("Goal".equals(name)) 534 return new Goal(); 535 if ("GuidanceResponse".equals(name)) 536 return new GuidanceResponse(); 537 if ("SearchParameter".equals(name)) 538 return new SearchParameter(); 539 if ("NutritionOrder".equals(name)) 540 return new NutritionOrder(); 541 if ("ReferralRequest".equals(name)) 542 return new ReferralRequest(); 543 if ("ClinicalImpression".equals(name)) 544 return new ClinicalImpression(); 545 if ("EnrollmentRequest".equals(name)) 546 return new EnrollmentRequest(); 547 if ("Location".equals(name)) 548 return new Location(); 549 if ("Contract".equals(name)) 550 return new Contract(); 551 if ("Basic".equals(name)) 552 return new Basic(); 553 if ("Specimen".equals(name)) 554 return new Specimen(); 555 if ("EnrollmentResponse".equals(name)) 556 return new EnrollmentResponse(); 557 if ("SupplyRequest".equals(name)) 558 return new SupplyRequest(); 559 if ("Patient".equals(name)) 560 return new Patient(); 561 if ("DiagnosticOrder".equals(name)) 562 return new DiagnosticOrder(); 563 if ("Period".equals(name)) 564 return new Period(); 565 if ("Age".equals(name)) 566 return new Age(); 567 if ("Attachment".equals(name)) 568 return new Attachment(); 569 if ("Count".equals(name)) 570 return new Count(); 571 if ("SimpleQuantity".equals(name)) 572 return new SimpleQuantity(); 573 if ("Signature".equals(name)) 574 return new Signature(); 575 if ("Extension".equals(name)) 576 return new Extension(); 577 if ("ModuleMetadata".equals(name)) 578 return new ModuleMetadata(); 579 if ("ActionDefinition".equals(name)) 580 return new ActionDefinition(); 581 if ("HumanName".equals(name)) 582 return new HumanName(); 583 if ("Ratio".equals(name)) 584 return new Ratio(); 585 if ("Duration".equals(name)) 586 return new Duration(); 587 if ("CodeableConcept".equals(name)) 588 return new CodeableConcept(); 589 if ("Identifier".equals(name)) 590 return new Identifier(); 591 if ("Timing".equals(name)) 592 return new Timing(); 593 if ("Coding".equals(name)) 594 return new Coding(); 595 if ("Range".equals(name)) 596 return new Range(); 597 if ("Quantity".equals(name)) 598 return new Quantity(); 599 if ("Money".equals(name)) 600 return new Money(); 601 if ("Distance".equals(name)) 602 return new Distance(); 603 if ("DataRequirement".equals(name)) 604 return new DataRequirement(); 605 if ("ParameterDefinition".equals(name)) 606 return new ParameterDefinition(); 607 if ("ContactPoint".equals(name)) 608 return new ContactPoint(); 609 if ("TriggerDefinition".equals(name)) 610 return new TriggerDefinition(); 611 if ("ElementDefinition".equals(name)) 612 return new ElementDefinition(); 613 if ("Address".equals(name)) 614 return new Address(); 615 if ("Annotation".equals(name)) 616 return new Annotation(); 617 if ("Meta".equals(name)) 618 return new Meta(); 619 if ("SampledData".equals(name)) 620 return new SampledData(); 621 if ("Reference".equals(name)) 622 return new Reference(); 623 if ("Narrative".equals(name)) 624 return new Narrative(); 625 else 626 throw new FHIRException("Unknown Resource or Type Name '"+name+"'"); 627 } 628 629 630} 631