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