001package org.hl7.fhir.dstu2016may.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 Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0
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 ("Condition".equals(name))
043            return new Condition();
044        if ("DeviceComponent".equals(name))
045            return new DeviceComponent();
046        if ("Communication".equals(name))
047            return new Communication();
048        if ("PractitionerRole".equals(name))
049            return new PractitionerRole();
050        if ("Group".equals(name))
051            return new Group();
052        if ("ValueSet".equals(name))
053            return new ValueSet();
054        if ("Coverage".equals(name))
055            return new Coverage();
056        if ("Appointment".equals(name))
057            return new Appointment();
058        if ("Library".equals(name))
059            return new Library();
060        if ("Slot".equals(name))
061            return new Slot();
062        if ("DecisionSupportRule".equals(name))
063            return new DecisionSupportRule();
064        if ("Composition".equals(name))
065            return new Composition();
066        if ("EpisodeOfCare".equals(name))
067            return new EpisodeOfCare();
068        if ("Conformance".equals(name))
069            return new Conformance();
070        if ("NamingSystem".equals(name))
071            return new NamingSystem();
072        if ("HealthcareService".equals(name))
073            return new HealthcareService();
074        if ("Linkage".equals(name))
075            return new Linkage();
076        if ("OrderResponse".equals(name))
077            return new OrderResponse();
078        if ("Task".equals(name))
079            return new Task();
080        if ("ConceptMap".equals(name))
081            return new ConceptMap();
082        if ("Practitioner".equals(name))
083            return new Practitioner();
084        if ("CarePlan".equals(name))
085            return new CarePlan();
086        if ("Substance".equals(name))
087            return new Substance();
088        if ("QuestionnaireResponse".equals(name))
089            return new QuestionnaireResponse();
090        if ("DeviceUseRequest".equals(name))
091            return new DeviceUseRequest();
092        if ("Schedule".equals(name))
093            return new Schedule();
094        if ("SupplyDelivery".equals(name))
095            return new SupplyDelivery();
096        if ("EligibilityRequest".equals(name))
097            return new EligibilityRequest();
098        if ("PaymentReconciliation".equals(name))
099            return new PaymentReconciliation();
100        if ("TestScript".equals(name))
101            return new TestScript();
102        if ("OperationDefinition".equals(name))
103            return new OperationDefinition();
104        if ("ImagingObjectSelection".equals(name))
105            return new ImagingObjectSelection();
106        if ("ClaimResponse".equals(name))
107            return new ClaimResponse();
108        if ("BodySite".equals(name))
109            return new BodySite();
110        if ("Flag".equals(name))
111            return new Flag();
112        if ("CommunicationRequest".equals(name))
113            return new CommunicationRequest();
114        if ("Claim".equals(name))
115            return new Claim();
116        if ("RiskAssessment".equals(name))
117            return new RiskAssessment();
118        if ("ExpansionProfile".equals(name))
119            return new ExpansionProfile();
120        if ("ExplanationOfBenefit".equals(name))
121            return new ExplanationOfBenefit();
122        if ("AllergyIntolerance".equals(name))
123            return new AllergyIntolerance();
124        if ("Observation".equals(name))
125            return new Observation();
126        if ("RelatedPerson".equals(name))
127            return new RelatedPerson();
128        if ("ProcessResponse".equals(name))
129            return new ProcessResponse();
130        if ("AuditEvent".equals(name))
131            return new AuditEvent();
132        if ("EligibilityResponse".equals(name))
133            return new EligibilityResponse();
134        if ("MedicationOrder".equals(name))
135            return new MedicationOrder();
136        if ("Person".equals(name))
137            return new Person();
138        if ("Parameters".equals(name))
139            return new Parameters();
140        if ("ModuleDefinition".equals(name))
141            return new ModuleDefinition();
142        if ("ProcedureRequest".equals(name))
143            return new ProcedureRequest();
144        if ("DeviceMetric".equals(name))
145            return new DeviceMetric();
146        if ("Organization".equals(name))
147            return new Organization();
148        if ("Measure".equals(name))
149            return new Measure();
150        if ("ProcessRequest".equals(name))
151            return new ProcessRequest();
152        if ("ImmunizationRecommendation".equals(name))
153            return new ImmunizationRecommendation();
154        if ("MedicationDispense".equals(name))
155            return new MedicationDispense();
156        if ("DetectedIssue".equals(name))
157            return new DetectedIssue();
158        if ("PaymentNotice".equals(name))
159            return new PaymentNotice();
160        if ("MedicationStatement".equals(name))
161            return new MedicationStatement();
162        if ("AppointmentResponse".equals(name))
163            return new AppointmentResponse();
164        if ("Sequence".equals(name))
165            return new Sequence();
166        if ("ImplementationGuide".equals(name))
167            return new ImplementationGuide();
168        if ("Protocol".equals(name))
169            return new Protocol();
170        if ("Questionnaire".equals(name))
171            return new Questionnaire();
172        if ("OperationOutcome".equals(name))
173            return new OperationOutcome();
174        if ("DecisionSupportServiceModule".equals(name))
175            return new DecisionSupportServiceModule();
176        if ("FamilyMemberHistory".equals(name))
177            return new FamilyMemberHistory();
178        if ("Media".equals(name))
179            return new Media();
180        if ("ImagingExcerpt".equals(name))
181            return new ImagingExcerpt();
182        if ("Binary".equals(name))
183            return new Binary();
184        if ("VisionPrescription".equals(name))
185            return new VisionPrescription();
186        if ("DocumentReference".equals(name))
187            return new DocumentReference();
188        if ("Immunization".equals(name))
189            return new Immunization();
190        if ("CareTeam".equals(name))
191            return new CareTeam();
192        if ("Bundle".equals(name))
193            return new Bundle();
194        if ("Subscription".equals(name))
195            return new Subscription();
196        if ("MeasureReport".equals(name))
197            return new MeasureReport();
198        if ("ImagingStudy".equals(name))
199            return new ImagingStudy();
200        if ("Provenance".equals(name))
201            return new Provenance();
202        if ("Device".equals(name))
203            return new Device();
204        if ("StructureDefinition".equals(name))
205            return new StructureDefinition();
206        if ("Account".equals(name))
207            return new Account();
208        if ("Order".equals(name))
209            return new Order();
210        if ("Procedure".equals(name))
211            return new Procedure();
212        if ("OrderSet".equals(name))
213            return new OrderSet();
214        if ("DiagnosticReport".equals(name))
215            return new DiagnosticReport();
216        if ("Medication".equals(name))
217            return new Medication();
218        if ("MessageHeader".equals(name))
219            return new MessageHeader();
220        if ("DocumentManifest".equals(name))
221            return new DocumentManifest();
222        if ("DataElement".equals(name))
223            return new DataElement();
224        if ("MedicationAdministration".equals(name))
225            return new MedicationAdministration();
226        if ("StructureMap".equals(name))
227            return new StructureMap();
228        if ("CompartmentDefinition".equals(name))
229            return new CompartmentDefinition();
230        if ("Encounter".equals(name))
231            return new Encounter();
232        if ("List".equals(name))
233            return new ListResource();
234        if ("CodeSystem".equals(name))
235            return new CodeSystem();
236        if ("DeviceUseStatement".equals(name))
237            return new DeviceUseStatement();
238        if ("Goal".equals(name))
239            return new Goal();
240        if ("GuidanceResponse".equals(name))
241            return new GuidanceResponse();
242        if ("SearchParameter".equals(name))
243            return new SearchParameter();
244        if ("NutritionOrder".equals(name))
245            return new NutritionOrder();
246        if ("ReferralRequest".equals(name))
247            return new ReferralRequest();
248        if ("ClinicalImpression".equals(name))
249            return new ClinicalImpression();
250        if ("EnrollmentRequest".equals(name))
251            return new EnrollmentRequest();
252        if ("Location".equals(name))
253            return new Location();
254        if ("Contract".equals(name))
255            return new Contract();
256        if ("Basic".equals(name))
257            return new Basic();
258        if ("Specimen".equals(name))
259            return new Specimen();
260        if ("EnrollmentResponse".equals(name))
261            return new EnrollmentResponse();
262        if ("SupplyRequest".equals(name))
263            return new SupplyRequest();
264        if ("Patient".equals(name))
265            return new Patient();
266        if ("DiagnosticOrder".equals(name))
267            return new DiagnosticOrder();
268        else
269            throw new FHIRException("Unknown Resource Name '"+name+"'");
270    }
271
272    public static Element createType(String name) throws FHIRException {
273        if ("Period".equals(name))
274            return new Period();
275        if ("Age".equals(name))
276            return new Age();
277        if ("Attachment".equals(name))
278            return new Attachment();
279        if ("Count".equals(name))
280            return new Count();
281        if ("SimpleQuantity".equals(name))
282            return new SimpleQuantity();
283        if ("Signature".equals(name))
284            return new Signature();
285        if ("Extension".equals(name))
286            return new Extension();
287        if ("ModuleMetadata".equals(name))
288            return new ModuleMetadata();
289        if ("ActionDefinition".equals(name))
290            return new ActionDefinition();
291        if ("HumanName".equals(name))
292            return new HumanName();
293        if ("Ratio".equals(name))
294            return new Ratio();
295        if ("Duration".equals(name))
296            return new Duration();
297        if ("CodeableConcept".equals(name))
298            return new CodeableConcept();
299        if ("Identifier".equals(name))
300            return new Identifier();
301        if ("Timing".equals(name))
302            return new Timing();
303        if ("Coding".equals(name))
304            return new Coding();
305        if ("Range".equals(name))
306            return new Range();
307        if ("Quantity".equals(name))
308            return new Quantity();
309        if ("Money".equals(name))
310            return new Money();
311        if ("Distance".equals(name))
312            return new Distance();
313        if ("DataRequirement".equals(name))
314            return new DataRequirement();
315        if ("ParameterDefinition".equals(name))
316            return new ParameterDefinition();
317        if ("ContactPoint".equals(name))
318            return new ContactPoint();
319        if ("TriggerDefinition".equals(name))
320            return new TriggerDefinition();
321        if ("ElementDefinition".equals(name))
322            return new ElementDefinition();
323        if ("Address".equals(name))
324            return new Address();
325        if ("Annotation".equals(name))
326            return new Annotation();
327        if ("Meta".equals(name))
328            return new Meta();
329        if ("SampledData".equals(name))
330            return new SampledData();
331        if ("Reference".equals(name))
332            return new Reference();
333        if ("Narrative".equals(name))
334            return new Narrative();
335        else
336            throw new FHIRException("Unknown Type Name '"+name+"'");
337    }
338
339    public static Base createResourceOrType(String name) throws FHIRException {
340        if ("Condition".equals(name))
341            return new Condition();
342        if ("DeviceComponent".equals(name))
343            return new DeviceComponent();
344        if ("Communication".equals(name))
345            return new Communication();
346        if ("PractitionerRole".equals(name))
347            return new PractitionerRole();
348        if ("Group".equals(name))
349            return new Group();
350        if ("ValueSet".equals(name))
351            return new ValueSet();
352        if ("Coverage".equals(name))
353            return new Coverage();
354        if ("Appointment".equals(name))
355            return new Appointment();
356        if ("Library".equals(name))
357            return new Library();
358        if ("Slot".equals(name))
359            return new Slot();
360        if ("DecisionSupportRule".equals(name))
361            return new DecisionSupportRule();
362        if ("Composition".equals(name))
363            return new Composition();
364        if ("EpisodeOfCare".equals(name))
365            return new EpisodeOfCare();
366        if ("Conformance".equals(name))
367            return new Conformance();
368        if ("NamingSystem".equals(name))
369            return new NamingSystem();
370        if ("HealthcareService".equals(name))
371            return new HealthcareService();
372        if ("Linkage".equals(name))
373            return new Linkage();
374        if ("OrderResponse".equals(name))
375            return new OrderResponse();
376        if ("Task".equals(name))
377            return new Task();
378        if ("ConceptMap".equals(name))
379            return new ConceptMap();
380        if ("Practitioner".equals(name))
381            return new Practitioner();
382        if ("CarePlan".equals(name))
383            return new CarePlan();
384        if ("Substance".equals(name))
385            return new Substance();
386        if ("QuestionnaireResponse".equals(name))
387            return new QuestionnaireResponse();
388        if ("DeviceUseRequest".equals(name))
389            return new DeviceUseRequest();
390        if ("Schedule".equals(name))
391            return new Schedule();
392        if ("SupplyDelivery".equals(name))
393            return new SupplyDelivery();
394        if ("EligibilityRequest".equals(name))
395            return new EligibilityRequest();
396        if ("PaymentReconciliation".equals(name))
397            return new PaymentReconciliation();
398        if ("TestScript".equals(name))
399            return new TestScript();
400        if ("OperationDefinition".equals(name))
401            return new OperationDefinition();
402        if ("ImagingObjectSelection".equals(name))
403            return new ImagingObjectSelection();
404        if ("ClaimResponse".equals(name))
405            return new ClaimResponse();
406        if ("BodySite".equals(name))
407            return new BodySite();
408        if ("Flag".equals(name))
409            return new Flag();
410        if ("CommunicationRequest".equals(name))
411            return new CommunicationRequest();
412        if ("Claim".equals(name))
413            return new Claim();
414        if ("RiskAssessment".equals(name))
415            return new RiskAssessment();
416        if ("ExpansionProfile".equals(name))
417            return new ExpansionProfile();
418        if ("ExplanationOfBenefit".equals(name))
419            return new ExplanationOfBenefit();
420        if ("AllergyIntolerance".equals(name))
421            return new AllergyIntolerance();
422        if ("Observation".equals(name))
423            return new Observation();
424        if ("RelatedPerson".equals(name))
425            return new RelatedPerson();
426        if ("ProcessResponse".equals(name))
427            return new ProcessResponse();
428        if ("AuditEvent".equals(name))
429            return new AuditEvent();
430        if ("EligibilityResponse".equals(name))
431            return new EligibilityResponse();
432        if ("MedicationOrder".equals(name))
433            return new MedicationOrder();
434        if ("Person".equals(name))
435            return new Person();
436        if ("Parameters".equals(name))
437            return new Parameters();
438        if ("ModuleDefinition".equals(name))
439            return new ModuleDefinition();
440        if ("ProcedureRequest".equals(name))
441            return new ProcedureRequest();
442        if ("DeviceMetric".equals(name))
443            return new DeviceMetric();
444        if ("Organization".equals(name))
445            return new Organization();
446        if ("Measure".equals(name))
447            return new Measure();
448        if ("ProcessRequest".equals(name))
449            return new ProcessRequest();
450        if ("ImmunizationRecommendation".equals(name))
451            return new ImmunizationRecommendation();
452        if ("MedicationDispense".equals(name))
453            return new MedicationDispense();
454        if ("DetectedIssue".equals(name))
455            return new DetectedIssue();
456        if ("PaymentNotice".equals(name))
457            return new PaymentNotice();
458        if ("MedicationStatement".equals(name))
459            return new MedicationStatement();
460        if ("AppointmentResponse".equals(name))
461            return new AppointmentResponse();
462        if ("Sequence".equals(name))
463            return new Sequence();
464        if ("ImplementationGuide".equals(name))
465            return new ImplementationGuide();
466        if ("Protocol".equals(name))
467            return new Protocol();
468        if ("Questionnaire".equals(name))
469            return new Questionnaire();
470        if ("OperationOutcome".equals(name))
471            return new OperationOutcome();
472        if ("DecisionSupportServiceModule".equals(name))
473            return new DecisionSupportServiceModule();
474        if ("FamilyMemberHistory".equals(name))
475            return new FamilyMemberHistory();
476        if ("Media".equals(name))
477            return new Media();
478        if ("ImagingExcerpt".equals(name))
479            return new ImagingExcerpt();
480        if ("Binary".equals(name))
481            return new Binary();
482        if ("VisionPrescription".equals(name))
483            return new VisionPrescription();
484        if ("DocumentReference".equals(name))
485            return new DocumentReference();
486        if ("Immunization".equals(name))
487            return new Immunization();
488        if ("CareTeam".equals(name))
489            return new CareTeam();
490        if ("Bundle".equals(name))
491            return new Bundle();
492        if ("Subscription".equals(name))
493            return new Subscription();
494        if ("MeasureReport".equals(name))
495            return new MeasureReport();
496        if ("ImagingStudy".equals(name))
497            return new ImagingStudy();
498        if ("Provenance".equals(name))
499            return new Provenance();
500        if ("Device".equals(name))
501            return new Device();
502        if ("StructureDefinition".equals(name))
503            return new StructureDefinition();
504        if ("Account".equals(name))
505            return new Account();
506        if ("Order".equals(name))
507            return new Order();
508        if ("Procedure".equals(name))
509            return new Procedure();
510        if ("OrderSet".equals(name))
511            return new OrderSet();
512        if ("DiagnosticReport".equals(name))
513            return new DiagnosticReport();
514        if ("Medication".equals(name))
515            return new Medication();
516        if ("MessageHeader".equals(name))
517            return new MessageHeader();
518        if ("DocumentManifest".equals(name))
519            return new DocumentManifest();
520        if ("DataElement".equals(name))
521            return new DataElement();
522        if ("MedicationAdministration".equals(name))
523            return new MedicationAdministration();
524        if ("StructureMap".equals(name))
525            return new StructureMap();
526        if ("CompartmentDefinition".equals(name))
527            return new CompartmentDefinition();
528        if ("Encounter".equals(name))
529            return new Encounter();
530        if ("List".equals(name))
531            return new ListResource();
532        if ("CodeSystem".equals(name))
533            return new CodeSystem();
534        if ("DeviceUseStatement".equals(name))
535            return new DeviceUseStatement();
536        if ("Goal".equals(name))
537            return new Goal();
538        if ("GuidanceResponse".equals(name))
539            return new GuidanceResponse();
540        if ("SearchParameter".equals(name))
541            return new SearchParameter();
542        if ("NutritionOrder".equals(name))
543            return new NutritionOrder();
544        if ("ReferralRequest".equals(name))
545            return new ReferralRequest();
546        if ("ClinicalImpression".equals(name))
547            return new ClinicalImpression();
548        if ("EnrollmentRequest".equals(name))
549            return new EnrollmentRequest();
550        if ("Location".equals(name))
551            return new Location();
552        if ("Contract".equals(name))
553            return new Contract();
554        if ("Basic".equals(name))
555            return new Basic();
556        if ("Specimen".equals(name))
557            return new Specimen();
558        if ("EnrollmentResponse".equals(name))
559            return new EnrollmentResponse();
560        if ("SupplyRequest".equals(name))
561            return new SupplyRequest();
562        if ("Patient".equals(name))
563            return new Patient();
564        if ("DiagnosticOrder".equals(name))
565            return new DiagnosticOrder();
566        if ("Period".equals(name))
567            return new Period();
568        if ("Age".equals(name))
569            return new Age();
570        if ("Attachment".equals(name))
571            return new Attachment();
572        if ("Count".equals(name))
573            return new Count();
574        if ("SimpleQuantity".equals(name))
575            return new SimpleQuantity();
576        if ("Signature".equals(name))
577            return new Signature();
578        if ("Extension".equals(name))
579            return new Extension();
580        if ("ModuleMetadata".equals(name))
581            return new ModuleMetadata();
582        if ("ActionDefinition".equals(name))
583            return new ActionDefinition();
584        if ("HumanName".equals(name))
585            return new HumanName();
586        if ("Ratio".equals(name))
587            return new Ratio();
588        if ("Duration".equals(name))
589            return new Duration();
590        if ("CodeableConcept".equals(name))
591            return new CodeableConcept();
592        if ("Identifier".equals(name))
593            return new Identifier();
594        if ("Timing".equals(name))
595            return new Timing();
596        if ("Coding".equals(name))
597            return new Coding();
598        if ("Range".equals(name))
599            return new Range();
600        if ("Quantity".equals(name))
601            return new Quantity();
602        if ("Money".equals(name))
603            return new Money();
604        if ("Distance".equals(name))
605            return new Distance();
606        if ("DataRequirement".equals(name))
607            return new DataRequirement();
608        if ("ParameterDefinition".equals(name))
609            return new ParameterDefinition();
610        if ("ContactPoint".equals(name))
611            return new ContactPoint();
612        if ("TriggerDefinition".equals(name))
613            return new TriggerDefinition();
614        if ("ElementDefinition".equals(name))
615            return new ElementDefinition();
616        if ("Address".equals(name))
617            return new Address();
618        if ("Annotation".equals(name))
619            return new Annotation();
620        if ("Meta".equals(name))
621            return new Meta();
622        if ("SampledData".equals(name))
623            return new SampledData();
624        if ("Reference".equals(name))
625            return new Reference();
626        if ("Narrative".equals(name))
627            return new Narrative();
628        else
629            throw new FHIRException("Unknown Resource or Type Name '"+name+"'");
630    }
631
632
633}