001package org.hl7.fhir.dstu2.model;
002
003/*-
004 * #%L
005 * org.hl7.fhir.dstu2
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 Wed, Jul 13, 2016 05:32+1000 for FHIR v1.0.2
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 ("Provenance".equals(name))
067            return new Provenance();
068        if ("Questionnaire".equals(name))
069            return new Questionnaire();
070        if ("ExplanationOfBenefit".equals(name))
071            return new ExplanationOfBenefit();
072        if ("DocumentManifest".equals(name))
073            return new DocumentManifest();
074        if ("Specimen".equals(name))
075            return new Specimen();
076        if ("AllergyIntolerance".equals(name))
077            return new AllergyIntolerance();
078        if ("CarePlan".equals(name))
079            return new CarePlan();
080        if ("Goal".equals(name))
081            return new Goal();
082        if ("StructureDefinition".equals(name))
083            return new StructureDefinition();
084        if ("EnrollmentRequest".equals(name))
085            return new EnrollmentRequest();
086        if ("EpisodeOfCare".equals(name))
087            return new EpisodeOfCare();
088        if ("OperationOutcome".equals(name))
089            return new OperationOutcome();
090        if ("Medication".equals(name))
091            return new Medication();
092        if ("Procedure".equals(name))
093            return new Procedure();
094        if ("List".equals(name))
095            return new List_();
096        if ("ConceptMap".equals(name))
097            return new ConceptMap();
098        if ("Subscription".equals(name))
099            return new Subscription();
100        if ("ValueSet".equals(name))
101            return new ValueSet();
102        if ("OperationDefinition".equals(name))
103            return new OperationDefinition();
104        if ("DocumentReference".equals(name))
105            return new DocumentReference();
106        if ("Order".equals(name))
107            return new Order();
108        if ("Immunization".equals(name))
109            return new Immunization();
110        if ("Parameters".equals(name))
111            return new Parameters();
112        if ("Device".equals(name))
113            return new Device();
114        if ("VisionPrescription".equals(name))
115            return new VisionPrescription();
116        if ("Media".equals(name))
117            return new Media();
118        if ("Conformance".equals(name))
119            return new Conformance();
120        if ("ProcedureRequest".equals(name))
121            return new ProcedureRequest();
122        if ("EligibilityResponse".equals(name))
123            return new EligibilityResponse();
124        if ("DeviceUseRequest".equals(name))
125            return new DeviceUseRequest();
126        if ("DeviceMetric".equals(name))
127            return new DeviceMetric();
128        if ("Flag".equals(name))
129            return new Flag();
130        if ("RelatedPerson".equals(name))
131            return new RelatedPerson();
132        if ("SupplyRequest".equals(name))
133            return new SupplyRequest();
134        if ("Practitioner".equals(name))
135            return new Practitioner();
136        if ("AppointmentResponse".equals(name))
137            return new AppointmentResponse();
138        if ("Observation".equals(name))
139            return new Observation();
140        if ("MedicationAdministration".equals(name))
141            return new MedicationAdministration();
142        if ("Slot".equals(name))
143            return new Slot();
144        if ("EnrollmentResponse".equals(name))
145            return new EnrollmentResponse();
146        if ("Binary".equals(name))
147            return new Binary();
148        if ("MedicationStatement".equals(name))
149            return new MedicationStatement();
150        if ("Person".equals(name))
151            return new Person();
152        if ("Contract".equals(name))
153            return new Contract();
154        if ("CommunicationRequest".equals(name))
155            return new CommunicationRequest();
156        if ("RiskAssessment".equals(name))
157            return new RiskAssessment();
158        if ("TestScript".equals(name))
159            return new TestScript();
160        if ("Basic".equals(name))
161            return new Basic();
162        if ("Group".equals(name))
163            return new Group();
164        if ("PaymentNotice".equals(name))
165            return new PaymentNotice();
166        if ("Organization".equals(name))
167            return new Organization();
168        if ("ImplementationGuide".equals(name))
169            return new ImplementationGuide();
170        if ("ClaimResponse".equals(name))
171            return new ClaimResponse();
172        if ("EligibilityRequest".equals(name))
173            return new EligibilityRequest();
174        if ("ProcessRequest".equals(name))
175            return new ProcessRequest();
176        if ("MedicationDispense".equals(name))
177            return new MedicationDispense();
178        if ("DiagnosticReport".equals(name))
179            return new DiagnosticReport();
180        if ("ImagingStudy".equals(name))
181            return new ImagingStudy();
182        if ("ImagingObjectSelection".equals(name))
183            return new ImagingObjectSelection();
184        if ("HealthcareService".equals(name))
185            return new HealthcareService();
186        if ("DataElement".equals(name))
187            return new DataElement();
188        if ("DeviceComponent".equals(name))
189            return new DeviceComponent();
190        if ("FamilyMemberHistory".equals(name))
191            return new FamilyMemberHistory();
192        if ("NutritionOrder".equals(name))
193            return new NutritionOrder();
194        if ("Encounter".equals(name))
195            return new Encounter();
196        if ("Substance".equals(name))
197            return new Substance();
198        if ("AuditEvent".equals(name))
199            return new AuditEvent();
200        if ("MedicationOrder".equals(name))
201            return new MedicationOrder();
202        if ("SearchParameter".equals(name))
203            return new SearchParameter();
204        if ("PaymentReconciliation".equals(name))
205            return new PaymentReconciliation();
206        if ("Communication".equals(name))
207            return new Communication();
208        if ("Condition".equals(name))
209            return new Condition();
210        if ("Composition".equals(name))
211            return new Composition();
212        if ("DetectedIssue".equals(name))
213            return new DetectedIssue();
214        if ("Bundle".equals(name))
215            return new Bundle();
216        if ("DiagnosticOrder".equals(name))
217            return new DiagnosticOrder();
218        if ("Patient".equals(name))
219            return new Patient();
220        if ("OrderResponse".equals(name))
221            return new OrderResponse();
222        if ("Coverage".equals(name))
223            return new Coverage();
224        if ("QuestionnaireResponse".equals(name))
225            return new QuestionnaireResponse();
226        if ("DeviceUseStatement".equals(name))
227            return new DeviceUseStatement();
228        if ("ProcessResponse".equals(name))
229            return new ProcessResponse();
230        if ("NamingSystem".equals(name))
231            return new NamingSystem();
232        if ("Schedule".equals(name))
233            return new Schedule();
234        if ("SupplyDelivery".equals(name))
235            return new SupplyDelivery();
236        if ("ClinicalImpression".equals(name))
237            return new ClinicalImpression();
238        if ("MessageHeader".equals(name))
239            return new MessageHeader();
240        if ("Claim".equals(name))
241            return new Claim();
242        if ("ImmunizationRecommendation".equals(name))
243            return new ImmunizationRecommendation();
244        if ("Location".equals(name))
245            return new Location();
246        if ("BodySite".equals(name))
247            return new BodySite();
248        else
249            throw new FHIRException("Unknown Resource Name '"+name+"'");
250    }
251
252    public static Element createType(String name) throws FHIRException {
253        if ("Meta".equals(name))
254            return new Meta();
255        if ("Address".equals(name))
256            return new Address();
257        if ("Attachment".equals(name))
258            return new Attachment();
259        if ("Count".equals(name))
260            return new Count();
261        if ("Money".equals(name))
262            return new Money();
263        if ("HumanName".equals(name))
264            return new HumanName();
265        if ("ContactPoint".equals(name))
266            return new ContactPoint();
267        if ("Identifier".equals(name))
268            return new Identifier();
269        if ("Narrative".equals(name))
270            return new Narrative();
271        if ("Coding".equals(name))
272            return new Coding();
273        if ("SampledData".equals(name))
274            return new SampledData();
275        if ("Ratio".equals(name))
276            return new Ratio();
277        if ("ElementDefinition".equals(name))
278            return new ElementDefinition();
279        if ("Distance".equals(name))
280            return new Distance();
281        if ("Age".equals(name))
282            return new Age();
283        if ("Reference".equals(name))
284            return new Reference();
285        if ("SimpleQuantity".equals(name))
286            return new SimpleQuantity();
287        if ("Quantity".equals(name))
288            return new Quantity();
289        if ("Period".equals(name))
290            return new Period();
291        if ("Duration".equals(name))
292            return new Duration();
293        if ("Range".equals(name))
294            return new Range();
295        if ("Annotation".equals(name))
296            return new Annotation();
297        if ("Extension".equals(name))
298            return new Extension();
299        if ("Signature".equals(name))
300            return new Signature();
301        if ("Timing".equals(name))
302            return new Timing();
303        if ("CodeableConcept".equals(name))
304            return new CodeableConcept();
305        else
306            throw new FHIRException("Unknown Type Name '"+name+"'");
307    }
308
309}
310