001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Thu, Mar 23, 2023 19:59+1100 for FHIR v5.0.0
033
034
035import org.hl7.fhir.instance.model.api.*;
036import org.hl7.fhir.utilities.Utilities;
037import org.hl7.fhir.exceptions.FHIRException;
038
039public class Enumerations {
040
041// In here: 
042//   ActionCardinalityBehavior: Defines behavior for an action or a group for how many times that item may be repeated.[PlanDefinition, RequestOrchestration]
043//   ActionConditionKind: Defines the kinds of conditions that can appear on actions.[PlanDefinition, RequestOrchestration]
044//   ActionGroupingBehavior: Defines organization behavior of a group.[PlanDefinition, RequestOrchestration]
045//   ActionParticipantType: The type of participant for the action.[ActivityDefinition, PlanDefinition, RequestOrchestration]
046//   ActionPrecheckBehavior: Defines selection frequency behavior for an action or group.[PlanDefinition, RequestOrchestration]
047//   ActionRelationshipType: Defines the types of relationships between actions.[PlanDefinition, RequestOrchestration]
048//   ActionRequiredBehavior: Defines expectations around whether an action or action group is required.[PlanDefinition, RequestOrchestration]
049//   ActionSelectionBehavior: Defines selection behavior of a group.[PlanDefinition, RequestOrchestration]
050//   AdministrativeGender: The gender of a person used for administrative purposes.[ObservationDefinition, Patient, Person, Practitioner, RelatedPerson]
051//   AllLanguages: This value set includes all possible codes from BCP-47 (see http://tools.ietf.org/html/bcp47)[Account, ActivityDefinition, ActorDefinition, AdministrableProductDefinition, AdverseEvent, AllergyIntolerance, Appointment, AppointmentResponse, ArtifactAssessment, Attachment, AuditEvent, Basic, Binary, BiologicallyDerivedProduct, BiologicallyDerivedProductDispense, BodyStructure, Bundle, CanonicalResource, CapabilityStatement, CarePlan, CareTeam, ChargeItem, ChargeItemDefinition, Citation, Claim, ClaimResponse, ClinicalImpression, ClinicalUseDefinition, CodeSystem, Communication, CommunicationRequest, CompartmentDefinition, Composition, ConceptMap, Condition, ConditionDefinition, Consent, Contract, Coverage, CoverageEligibilityRequest, CoverageEligibilityResponse, DetectedIssue, Device, DeviceAssociation, DeviceDefinition, DeviceDispense, DeviceMetric, DeviceRequest, DeviceUsage, DiagnosticReport, DocumentReference, DomainResource, Encounter, EncounterHistory, Endpoint, EnrollmentRequest, EnrollmentResponse, EpisodeOfCare, EventDefinition, Evidence, EvidenceReport, EvidenceVariable, ExampleScenario, ExplanationOfBenefit, FamilyMemberHistory, Flag, FormularyItem, GenomicStudy, Goal, GraphDefinition, Group, GuidanceResponse, HealthcareService, ImagingSelection, ImagingStudy, Immunization, ImmunizationEvaluation, ImmunizationRecommendation, ImplementationGuide, Ingredient, InsurancePlan, InventoryItem, InventoryReport, Invoice, Library, Linkage, List, Location, ManufacturedItemDefinition, Measure, MeasureReport, Medication, MedicationAdministration, MedicationDispense, MedicationKnowledge, MedicationRequest, MedicationStatement, MedicinalProductDefinition, MessageDefinition, MessageHeader, MetadataResource, MolecularSequence, NamingSystem, NutritionIntake, NutritionOrder, NutritionProduct, Observation, ObservationDefinition, OperationDefinition, OperationOutcome, Organization, OrganizationAffiliation, PackagedProductDefinition, Parameters, Patient, PaymentNotice, PaymentReconciliation, Permission, Person, PlanDefinition, Practitioner, PractitionerRole, Procedure, Provenance, Questionnaire, QuestionnaireResponse, RegulatedAuthorization, RelatedPerson, RequestOrchestration, Requirements, ResearchStudy, ResearchSubject, Resource, RiskAssessment, Schedule, SearchParameter, ServiceRequest, Slot, Specimen, SpecimenDefinition, StructureDefinition, StructureMap, Subscription, SubscriptionStatus, SubscriptionTopic, Substance, SubstanceDefinition, SubstanceNucleicAcid, SubstancePolymer, SubstanceProtein, SubstanceReferenceInformation, SubstanceSourceMaterial, SupplyDelivery, SupplyRequest, Task, TerminologyCapabilities, TestPlan, TestReport, TestScript, Transport, ValueSet, VerificationResult, VisionPrescription]
052//   BindingStrength: Indication of the degree of conformance expectations associated with a binding.[ElementDefinition, OperationDefinition]
053//   CapabilityStatementKind: How a capability statement is intended to be used.[CapabilityStatement, TerminologyCapabilities]
054//   ClaimProcessingCodes: This value set includes Claim Processing Outcome codes.[ClaimResponse, ExplanationOfBenefit]
055//   CodeSystemContentMode: The extent of the content of the code system (the concepts and codes it defines) are represented in a code system resource.[CodeSystem, TerminologyCapabilities]
056//   CommonLanguages: This value set includes common codes from BCP-47 (see http://tools.ietf.org/html/bcp47)[InventoryItem, TerminologyCapabilities]
057//   CompartmentType: Which type a compartment definition describes.[CompartmentDefinition, GraphDefinition]
058//   CompositionStatus: The workflow/clinical status of the composition.[Composition, DocumentReference]
059//   ConceptMapRelationship: The relationship between concepts.[ConceptMap]
060//   ConsentDataMeaning: How a resource reference is interpreted when testing consent restrictions.[Consent, Permission]
061//   ConsentProvisionType: How a rule statement is applied, such as adding additional consent or removing consent.[Consent, Permission]
062//   Currencies: Currency codes from ISO 4217 (see https://www.iso.org/iso-4217-currency-codes.html)[Account, Money]
063//   DaysOfWeek: The days of the week.[Appointment, Availability, Timing]
064//   DeviceNameType: The type of name the device is referred by.[Device, DeviceDefinition]
065//   EncounterStatus: Current state of the encounter.[Encounter, EncounterHistory]
066//   EventStatus: Codes identifying the lifecycle stage of an event.[ClinicalImpression, Communication, NutritionIntake, Procedure]
067//   EvidenceVariableHandling: The handling of the variable in statistical analysis for exposures or outcomes (E.g. Dichotomous, Continuous, Descriptive).[Evidence, EvidenceVariable]
068//   ExampleScenarioActorType: The type of actor - system or human.[ActorDefinition, ExampleScenario]
069//   FHIRTypes: All FHIR types[DataRequirement, Measure, OperationDefinition, ParameterDefinition]
070//   FHIRVersion: All published FHIR Versions.[CapabilityStatement, ImplementationGuide, StructureDefinition]
071//   FilterOperator: The kind of operation to perform as a part of a property based filter.[CodeSystem, ValueSet]
072//   FinancialResourceStatusCodes: This value set includes Status codes.[Claim, ClaimResponse, Coverage, CoverageEligibilityRequest, CoverageEligibilityResponse, EnrollmentRequest, EnrollmentResponse, PaymentNotice, PaymentReconciliation, VisionPrescription]
073//   ListMode: The processing mode that applies to this list.[EvidenceReport, List]
074//   MeasureImprovementNotation: Observation values that indicate what change in a measurement value or score is indicative of an improvement in the measured item or scored issue.[Measure, MeasureReport]
075//   MimeTypes: This value set includes all possible codes from BCP-13 (see http://tools.ietf.org/html/bcp13)[Attachment, Binary, CapabilityStatement, ElementDefinition, Endpoint, Signature, Subscription, TestScript]
076//   ObservationStatus: Codes providing the status of an observation.[Observation, RiskAssessment]
077//   OperationParameterUse: Whether an operation parameter is an input or an output parameter.[OperationDefinition, ParameterDefinition]
078//   PublicationStatus: The lifecycle status of an artifact.[ActivityDefinition, ActorDefinition, AdministrableProductDefinition, CanonicalResource, CapabilityStatement, ChargeItemDefinition, Citation, CodeSystem, CompartmentDefinition, ConceptMap, ConditionDefinition, EventDefinition, Evidence, EvidenceReport, EvidenceVariable, ExampleScenario, GraphDefinition, ImplementationGuide, Ingredient, InsurancePlan, Library, ManufacturedItemDefinition, Measure, MessageDefinition, MetadataResource, NamingSystem, ObservationDefinition, OperationDefinition, PlanDefinition, Questionnaire, RelatedArtifact, Requirements, ResearchStudy, ResearchSubject, SearchParameter, SpecimenDefinition, StructureDefinition, StructureMap, SubscriptionTopic, TerminologyCapabilities, TestPlan, TestScript, ValueSet]
079//   QuantityComparator: How the Quantity should be understood and represented.[Age, Count, Distance, Duration, Quantity]
080//   RequestIntent: Codes indicating the degree of authority/intentionality associated with a request.[ActivityDefinition, CommunicationRequest, DeviceRequest, NutritionOrder, RequestOrchestration, ServiceRequest]
081//   RequestPriority: Identifies the level of importance to be assigned to actioning the request.[ActivityDefinition, Communication, CommunicationRequest, DeviceRequest, MedicationRequest, NutritionOrder, PlanDefinition, RequestOrchestration, ServiceRequest, SupplyRequest, Task, Transport]
082//   RequestStatus: Codes identifying the lifecycle stage of a request.[CarePlan, CommunicationRequest, DeviceRequest, NutritionOrder, RequestOrchestration, ServiceRequest]
083//   ResourceTypeEnum: Concrete FHIR Resource Types[CapabilityStatement, CompartmentDefinition, ImplementationGuide, MessageDefinition, Questionnaire]
084//   SearchComparator: What Search Comparator Codes are supported in search.[SearchParameter, Subscription, SubscriptionTopic]
085//   SearchModifierCode: A supported modifier for a search parameter.[SearchParameter, Subscription, SubscriptionTopic]
086//   SearchParamType: Data types allowed to be used for search parameters.[CapabilityStatement, OperationDefinition, SearchParameter]
087//   SubscriptionStatusCodes: State values for FHIR Subscriptions.[Subscription, SubscriptionStatus]
088//   Use: The purpose of the Claim: predetermination, preauthorization, claim.[Claim, ClaimResponse, ExplanationOfBenefit]
089//   VersionIndependentResourceTypesAll: Current and past FHIR resource types (deleted or renamed), including abstract types[GraphDefinition, OperationDefinition, SearchParameter]
090
091
092    public enum ActionCardinalityBehavior {
093        /**
094         * The action may only be selected one time.
095         */
096        SINGLE, 
097        /**
098         * The action may be selected multiple times.
099         */
100        MULTIPLE, 
101        /**
102         * added to help the parsers
103         */
104        NULL;
105        public static ActionCardinalityBehavior fromCode(String codeString) throws FHIRException {
106            if (codeString == null || "".equals(codeString))
107                return null;
108        if ("single".equals(codeString))
109          return SINGLE;
110        if ("multiple".equals(codeString))
111          return MULTIPLE;
112        throw new FHIRException("Unknown ActionCardinalityBehavior code '"+codeString+"'");
113        }
114        public static boolean isValidCode(String codeString) {
115            if (codeString == null || "".equals(codeString))
116                return false;
117          return Utilities.existsInList(codeString, "single", "multiple");
118        }
119        public String toCode() {
120          switch (this) {
121            case SINGLE: return "single";
122            case MULTIPLE: return "multiple";
123            case NULL: return null;
124            default: return "?";
125          }
126        }
127        public String getSystem() {
128          switch (this) {
129            case SINGLE: return "http://hl7.org/fhir/action-cardinality-behavior";
130            case MULTIPLE: return "http://hl7.org/fhir/action-cardinality-behavior";
131            case NULL: return null;
132            default: return "?";
133          }
134        }
135        public String getDefinition() {
136          switch (this) {
137            case SINGLE: return "The action may only be selected one time.";
138            case MULTIPLE: return "The action may be selected multiple times.";
139            case NULL: return null;
140            default: return "?";
141          }
142        }
143        public String getDisplay() {
144          switch (this) {
145            case SINGLE: return "Single";
146            case MULTIPLE: return "Multiple";
147            case NULL: return null;
148            default: return "?";
149          }
150        }
151    }
152
153  public static class ActionCardinalityBehaviorEnumFactory implements EnumFactory<ActionCardinalityBehavior> {
154    public ActionCardinalityBehavior fromCode(String codeString) throws IllegalArgumentException {
155      if (codeString == null || "".equals(codeString))
156            if (codeString == null || "".equals(codeString))
157                return null;
158        if ("single".equals(codeString))
159          return ActionCardinalityBehavior.SINGLE;
160        if ("multiple".equals(codeString))
161          return ActionCardinalityBehavior.MULTIPLE;
162        throw new IllegalArgumentException("Unknown ActionCardinalityBehavior code '"+codeString+"'");
163        }
164
165        public Enumeration<ActionCardinalityBehavior> fromType(PrimitiveType<?> code) throws FHIRException {
166          if (code == null)
167            return null;
168          if (code.isEmpty())
169            return new Enumeration<ActionCardinalityBehavior>(this, ActionCardinalityBehavior.NULL, code);
170          String codeString = ((PrimitiveType) code).asStringValue();
171          if (codeString == null || "".equals(codeString))
172            return new Enumeration<ActionCardinalityBehavior>(this, ActionCardinalityBehavior.NULL, code);
173        if ("single".equals(codeString))
174          return new Enumeration<ActionCardinalityBehavior>(this, ActionCardinalityBehavior.SINGLE, code);
175        if ("multiple".equals(codeString))
176          return new Enumeration<ActionCardinalityBehavior>(this, ActionCardinalityBehavior.MULTIPLE, code);
177        throw new FHIRException("Unknown ActionCardinalityBehavior code '"+codeString+"'");
178        }
179    public String toCode(ActionCardinalityBehavior code) {
180      if (code == ActionCardinalityBehavior.SINGLE)
181        return "single";
182      if (code == ActionCardinalityBehavior.MULTIPLE)
183        return "multiple";
184      return "?";
185      }
186    public String toSystem(ActionCardinalityBehavior code) {
187      return code.getSystem();
188      }
189    }
190
191    public enum ActionConditionKind {
192        /**
193         * The condition describes whether or not a given action is applicable.
194         */
195        APPLICABILITY, 
196        /**
197         * The condition is a starting condition for the action.
198         */
199        START, 
200        /**
201         * The condition is a stop, or exit condition for the action.
202         */
203        STOP, 
204        /**
205         * added to help the parsers
206         */
207        NULL;
208        public static ActionConditionKind fromCode(String codeString) throws FHIRException {
209            if (codeString == null || "".equals(codeString))
210                return null;
211        if ("applicability".equals(codeString))
212          return APPLICABILITY;
213        if ("start".equals(codeString))
214          return START;
215        if ("stop".equals(codeString))
216          return STOP;
217        throw new FHIRException("Unknown ActionConditionKind code '"+codeString+"'");
218        }
219        public static boolean isValidCode(String codeString) {
220            if (codeString == null || "".equals(codeString))
221                return false;
222          return Utilities.existsInList(codeString, "applicability", "start", "stop");
223        }
224        public String toCode() {
225          switch (this) {
226            case APPLICABILITY: return "applicability";
227            case START: return "start";
228            case STOP: return "stop";
229            case NULL: return null;
230            default: return "?";
231          }
232        }
233        public String getSystem() {
234          switch (this) {
235            case APPLICABILITY: return "http://hl7.org/fhir/action-condition-kind";
236            case START: return "http://hl7.org/fhir/action-condition-kind";
237            case STOP: return "http://hl7.org/fhir/action-condition-kind";
238            case NULL: return null;
239            default: return "?";
240          }
241        }
242        public String getDefinition() {
243          switch (this) {
244            case APPLICABILITY: return "The condition describes whether or not a given action is applicable.";
245            case START: return "The condition is a starting condition for the action.";
246            case STOP: return "The condition is a stop, or exit condition for the action.";
247            case NULL: return null;
248            default: return "?";
249          }
250        }
251        public String getDisplay() {
252          switch (this) {
253            case APPLICABILITY: return "Applicability";
254            case START: return "Start";
255            case STOP: return "Stop";
256            case NULL: return null;
257            default: return "?";
258          }
259        }
260    }
261
262  public static class ActionConditionKindEnumFactory implements EnumFactory<ActionConditionKind> {
263    public ActionConditionKind fromCode(String codeString) throws IllegalArgumentException {
264      if (codeString == null || "".equals(codeString))
265            if (codeString == null || "".equals(codeString))
266                return null;
267        if ("applicability".equals(codeString))
268          return ActionConditionKind.APPLICABILITY;
269        if ("start".equals(codeString))
270          return ActionConditionKind.START;
271        if ("stop".equals(codeString))
272          return ActionConditionKind.STOP;
273        throw new IllegalArgumentException("Unknown ActionConditionKind code '"+codeString+"'");
274        }
275
276        public Enumeration<ActionConditionKind> fromType(PrimitiveType<?> code) throws FHIRException {
277          if (code == null)
278            return null;
279          if (code.isEmpty())
280            return new Enumeration<ActionConditionKind>(this, ActionConditionKind.NULL, code);
281          String codeString = ((PrimitiveType) code).asStringValue();
282          if (codeString == null || "".equals(codeString))
283            return new Enumeration<ActionConditionKind>(this, ActionConditionKind.NULL, code);
284        if ("applicability".equals(codeString))
285          return new Enumeration<ActionConditionKind>(this, ActionConditionKind.APPLICABILITY, code);
286        if ("start".equals(codeString))
287          return new Enumeration<ActionConditionKind>(this, ActionConditionKind.START, code);
288        if ("stop".equals(codeString))
289          return new Enumeration<ActionConditionKind>(this, ActionConditionKind.STOP, code);
290        throw new FHIRException("Unknown ActionConditionKind code '"+codeString+"'");
291        }
292    public String toCode(ActionConditionKind code) {
293      if (code == ActionConditionKind.APPLICABILITY)
294        return "applicability";
295      if (code == ActionConditionKind.START)
296        return "start";
297      if (code == ActionConditionKind.STOP)
298        return "stop";
299      return "?";
300      }
301    public String toSystem(ActionConditionKind code) {
302      return code.getSystem();
303      }
304    }
305
306    public enum ActionGroupingBehavior {
307        /**
308         * Any group marked with this behavior should be displayed as a visual group to the end user.
309         */
310        VISUALGROUP, 
311        /**
312         * A group with this behavior logically groups its sub-elements, and may be shown as a visual group to the end user, but it is not required to do so.
313         */
314        LOGICALGROUP, 
315        /**
316         * A group of related alternative actions is a sentence group if the target referenced by the action is the same in all the actions and each action simply constitutes a different variation on how to specify the details for the target. For example, two actions that could be in a SentenceGroup are "aspirin, 500 mg, 2 times per day" and "aspirin, 300 mg, 3 times per day". In both cases, aspirin is the target referenced by the action, and the two actions represent different options for how aspirin might be ordered for the patient. Note that a SentenceGroup would almost always have an associated selection behavior of "AtMostOne", unless it's a required action, in which case, it would be "ExactlyOne".
317         */
318        SENTENCEGROUP, 
319        /**
320         * added to help the parsers
321         */
322        NULL;
323        public static ActionGroupingBehavior fromCode(String codeString) throws FHIRException {
324            if (codeString == null || "".equals(codeString))
325                return null;
326        if ("visual-group".equals(codeString))
327          return VISUALGROUP;
328        if ("logical-group".equals(codeString))
329          return LOGICALGROUP;
330        if ("sentence-group".equals(codeString))
331          return SENTENCEGROUP;
332        throw new FHIRException("Unknown ActionGroupingBehavior code '"+codeString+"'");
333        }
334        public static boolean isValidCode(String codeString) {
335            if (codeString == null || "".equals(codeString))
336                return false;
337          return Utilities.existsInList(codeString, "visual-group", "logical-group", "sentence-group");
338        }
339        public String toCode() {
340          switch (this) {
341            case VISUALGROUP: return "visual-group";
342            case LOGICALGROUP: return "logical-group";
343            case SENTENCEGROUP: return "sentence-group";
344            case NULL: return null;
345            default: return "?";
346          }
347        }
348        public String getSystem() {
349          switch (this) {
350            case VISUALGROUP: return "http://hl7.org/fhir/action-grouping-behavior";
351            case LOGICALGROUP: return "http://hl7.org/fhir/action-grouping-behavior";
352            case SENTENCEGROUP: return "http://hl7.org/fhir/action-grouping-behavior";
353            case NULL: return null;
354            default: return "?";
355          }
356        }
357        public String getDefinition() {
358          switch (this) {
359            case VISUALGROUP: return "Any group marked with this behavior should be displayed as a visual group to the end user.";
360            case LOGICALGROUP: return "A group with this behavior logically groups its sub-elements, and may be shown as a visual group to the end user, but it is not required to do so.";
361            case SENTENCEGROUP: return "A group of related alternative actions is a sentence group if the target referenced by the action is the same in all the actions and each action simply constitutes a different variation on how to specify the details for the target. For example, two actions that could be in a SentenceGroup are \"aspirin, 500 mg, 2 times per day\" and \"aspirin, 300 mg, 3 times per day\". In both cases, aspirin is the target referenced by the action, and the two actions represent different options for how aspirin might be ordered for the patient. Note that a SentenceGroup would almost always have an associated selection behavior of \"AtMostOne\", unless it's a required action, in which case, it would be \"ExactlyOne\".";
362            case NULL: return null;
363            default: return "?";
364          }
365        }
366        public String getDisplay() {
367          switch (this) {
368            case VISUALGROUP: return "Visual Group";
369            case LOGICALGROUP: return "Logical Group";
370            case SENTENCEGROUP: return "Sentence Group";
371            case NULL: return null;
372            default: return "?";
373          }
374        }
375    }
376
377  public static class ActionGroupingBehaviorEnumFactory implements EnumFactory<ActionGroupingBehavior> {
378    public ActionGroupingBehavior fromCode(String codeString) throws IllegalArgumentException {
379      if (codeString == null || "".equals(codeString))
380            if (codeString == null || "".equals(codeString))
381                return null;
382        if ("visual-group".equals(codeString))
383          return ActionGroupingBehavior.VISUALGROUP;
384        if ("logical-group".equals(codeString))
385          return ActionGroupingBehavior.LOGICALGROUP;
386        if ("sentence-group".equals(codeString))
387          return ActionGroupingBehavior.SENTENCEGROUP;
388        throw new IllegalArgumentException("Unknown ActionGroupingBehavior code '"+codeString+"'");
389        }
390
391        public Enumeration<ActionGroupingBehavior> fromType(PrimitiveType<?> code) throws FHIRException {
392          if (code == null)
393            return null;
394          if (code.isEmpty())
395            return new Enumeration<ActionGroupingBehavior>(this, ActionGroupingBehavior.NULL, code);
396          String codeString = ((PrimitiveType) code).asStringValue();
397          if (codeString == null || "".equals(codeString))
398            return new Enumeration<ActionGroupingBehavior>(this, ActionGroupingBehavior.NULL, code);
399        if ("visual-group".equals(codeString))
400          return new Enumeration<ActionGroupingBehavior>(this, ActionGroupingBehavior.VISUALGROUP, code);
401        if ("logical-group".equals(codeString))
402          return new Enumeration<ActionGroupingBehavior>(this, ActionGroupingBehavior.LOGICALGROUP, code);
403        if ("sentence-group".equals(codeString))
404          return new Enumeration<ActionGroupingBehavior>(this, ActionGroupingBehavior.SENTENCEGROUP, code);
405        throw new FHIRException("Unknown ActionGroupingBehavior code '"+codeString+"'");
406        }
407    public String toCode(ActionGroupingBehavior code) {
408      if (code == ActionGroupingBehavior.VISUALGROUP)
409        return "visual-group";
410      if (code == ActionGroupingBehavior.LOGICALGROUP)
411        return "logical-group";
412      if (code == ActionGroupingBehavior.SENTENCEGROUP)
413        return "sentence-group";
414      return "?";
415      }
416    public String toSystem(ActionGroupingBehavior code) {
417      return code.getSystem();
418      }
419    }
420
421    public enum ActionParticipantType {
422        /**
423         * The participant is a care team caring for the patient under evaluation.
424         */
425        CARETEAM, 
426        /**
427         * The participant is a system or device used in the care of the patient.
428         */
429        DEVICE, 
430        /**
431         * The participant is a group of participants involved in the care of the patient.
432         */
433        GROUP, 
434        /**
435         * The participant is an institution that can provide the given healthcare service used in the care of the patient.
436         */
437        HEALTHCARESERVICE, 
438        /**
439         * The participant is a location involved in the care of the patient.
440         */
441        LOCATION, 
442        /**
443         * The participant is an organization involved in the care of the patient.
444         */
445        ORGANIZATION, 
446        /**
447         * The participant is the patient under evaluation.
448         */
449        PATIENT, 
450        /**
451         * The participant is a practitioner involved in the patient's care.
452         */
453        PRACTITIONER, 
454        /**
455         * The participant is a particular practitioner role involved in the patient's care.
456         */
457        PRACTITIONERROLE, 
458        /**
459         * The participant is a person related to the patient.
460         */
461        RELATEDPERSON, 
462        /**
463         * added to help the parsers
464         */
465        NULL;
466        public static ActionParticipantType fromCode(String codeString) throws FHIRException {
467            if (codeString == null || "".equals(codeString))
468                return null;
469        if ("careteam".equals(codeString))
470          return CARETEAM;
471        if ("device".equals(codeString))
472          return DEVICE;
473        if ("group".equals(codeString))
474          return GROUP;
475        if ("healthcareservice".equals(codeString))
476          return HEALTHCARESERVICE;
477        if ("location".equals(codeString))
478          return LOCATION;
479        if ("organization".equals(codeString))
480          return ORGANIZATION;
481        if ("patient".equals(codeString))
482          return PATIENT;
483        if ("practitioner".equals(codeString))
484          return PRACTITIONER;
485        if ("practitionerrole".equals(codeString))
486          return PRACTITIONERROLE;
487        if ("relatedperson".equals(codeString))
488          return RELATEDPERSON;
489        throw new FHIRException("Unknown ActionParticipantType code '"+codeString+"'");
490        }
491        public static boolean isValidCode(String codeString) {
492            if (codeString == null || "".equals(codeString))
493                return false;
494          return Utilities.existsInList(codeString, "careteam", "device", "group", "healthcareservice", "location", "organization", "patient", "practitioner", "practitionerrole", "relatedperson");
495        }
496        public String toCode() {
497          switch (this) {
498            case CARETEAM: return "careteam";
499            case DEVICE: return "device";
500            case GROUP: return "group";
501            case HEALTHCARESERVICE: return "healthcareservice";
502            case LOCATION: return "location";
503            case ORGANIZATION: return "organization";
504            case PATIENT: return "patient";
505            case PRACTITIONER: return "practitioner";
506            case PRACTITIONERROLE: return "practitionerrole";
507            case RELATEDPERSON: return "relatedperson";
508            case NULL: return null;
509            default: return "?";
510          }
511        }
512        public String getSystem() {
513          switch (this) {
514            case CARETEAM: return "http://hl7.org/fhir/action-participant-type";
515            case DEVICE: return "http://hl7.org/fhir/action-participant-type";
516            case GROUP: return "http://hl7.org/fhir/action-participant-type";
517            case HEALTHCARESERVICE: return "http://hl7.org/fhir/action-participant-type";
518            case LOCATION: return "http://hl7.org/fhir/action-participant-type";
519            case ORGANIZATION: return "http://hl7.org/fhir/action-participant-type";
520            case PATIENT: return "http://hl7.org/fhir/action-participant-type";
521            case PRACTITIONER: return "http://hl7.org/fhir/action-participant-type";
522            case PRACTITIONERROLE: return "http://hl7.org/fhir/action-participant-type";
523            case RELATEDPERSON: return "http://hl7.org/fhir/action-participant-type";
524            case NULL: return null;
525            default: return "?";
526          }
527        }
528        public String getDefinition() {
529          switch (this) {
530            case CARETEAM: return "The participant is a care team caring for the patient under evaluation.";
531            case DEVICE: return "The participant is a system or device used in the care of the patient.";
532            case GROUP: return "The participant is a group of participants involved in the care of the patient.";
533            case HEALTHCARESERVICE: return "The participant is an institution that can provide the given healthcare service used in the care of the patient.";
534            case LOCATION: return "The participant is a location involved in the care of the patient.";
535            case ORGANIZATION: return "The participant is an organization involved in the care of the patient.";
536            case PATIENT: return "The participant is the patient under evaluation.";
537            case PRACTITIONER: return "The participant is a practitioner involved in the patient's care.";
538            case PRACTITIONERROLE: return "The participant is a particular practitioner role involved in the patient's care.";
539            case RELATEDPERSON: return "The participant is a person related to the patient.";
540            case NULL: return null;
541            default: return "?";
542          }
543        }
544        public String getDisplay() {
545          switch (this) {
546            case CARETEAM: return "CareTeam";
547            case DEVICE: return "Device";
548            case GROUP: return "Group";
549            case HEALTHCARESERVICE: return "HealthcareService";
550            case LOCATION: return "Location";
551            case ORGANIZATION: return "Organization";
552            case PATIENT: return "Patient";
553            case PRACTITIONER: return "Practitioner";
554            case PRACTITIONERROLE: return "PractitionerRole";
555            case RELATEDPERSON: return "RelatedPerson";
556            case NULL: return null;
557            default: return "?";
558          }
559        }
560    }
561
562  public static class ActionParticipantTypeEnumFactory implements EnumFactory<ActionParticipantType> {
563    public ActionParticipantType fromCode(String codeString) throws IllegalArgumentException {
564      if (codeString == null || "".equals(codeString))
565            if (codeString == null || "".equals(codeString))
566                return null;
567        if ("careteam".equals(codeString))
568          return ActionParticipantType.CARETEAM;
569        if ("device".equals(codeString))
570          return ActionParticipantType.DEVICE;
571        if ("group".equals(codeString))
572          return ActionParticipantType.GROUP;
573        if ("healthcareservice".equals(codeString))
574          return ActionParticipantType.HEALTHCARESERVICE;
575        if ("location".equals(codeString))
576          return ActionParticipantType.LOCATION;
577        if ("organization".equals(codeString))
578          return ActionParticipantType.ORGANIZATION;
579        if ("patient".equals(codeString))
580          return ActionParticipantType.PATIENT;
581        if ("practitioner".equals(codeString))
582          return ActionParticipantType.PRACTITIONER;
583        if ("practitionerrole".equals(codeString))
584          return ActionParticipantType.PRACTITIONERROLE;
585        if ("relatedperson".equals(codeString))
586          return ActionParticipantType.RELATEDPERSON;
587        throw new IllegalArgumentException("Unknown ActionParticipantType code '"+codeString+"'");
588        }
589
590        public Enumeration<ActionParticipantType> fromType(PrimitiveType<?> code) throws FHIRException {
591          if (code == null)
592            return null;
593          if (code.isEmpty())
594            return new Enumeration<ActionParticipantType>(this, ActionParticipantType.NULL, code);
595          String codeString = ((PrimitiveType) code).asStringValue();
596          if (codeString == null || "".equals(codeString))
597            return new Enumeration<ActionParticipantType>(this, ActionParticipantType.NULL, code);
598        if ("careteam".equals(codeString))
599          return new Enumeration<ActionParticipantType>(this, ActionParticipantType.CARETEAM, code);
600        if ("device".equals(codeString))
601          return new Enumeration<ActionParticipantType>(this, ActionParticipantType.DEVICE, code);
602        if ("group".equals(codeString))
603          return new Enumeration<ActionParticipantType>(this, ActionParticipantType.GROUP, code);
604        if ("healthcareservice".equals(codeString))
605          return new Enumeration<ActionParticipantType>(this, ActionParticipantType.HEALTHCARESERVICE, code);
606        if ("location".equals(codeString))
607          return new Enumeration<ActionParticipantType>(this, ActionParticipantType.LOCATION, code);
608        if ("organization".equals(codeString))
609          return new Enumeration<ActionParticipantType>(this, ActionParticipantType.ORGANIZATION, code);
610        if ("patient".equals(codeString))
611          return new Enumeration<ActionParticipantType>(this, ActionParticipantType.PATIENT, code);
612        if ("practitioner".equals(codeString))
613          return new Enumeration<ActionParticipantType>(this, ActionParticipantType.PRACTITIONER, code);
614        if ("practitionerrole".equals(codeString))
615          return new Enumeration<ActionParticipantType>(this, ActionParticipantType.PRACTITIONERROLE, code);
616        if ("relatedperson".equals(codeString))
617          return new Enumeration<ActionParticipantType>(this, ActionParticipantType.RELATEDPERSON, code);
618        throw new FHIRException("Unknown ActionParticipantType code '"+codeString+"'");
619        }
620    public String toCode(ActionParticipantType code) {
621      if (code == ActionParticipantType.CARETEAM)
622        return "careteam";
623      if (code == ActionParticipantType.DEVICE)
624        return "device";
625      if (code == ActionParticipantType.GROUP)
626        return "group";
627      if (code == ActionParticipantType.HEALTHCARESERVICE)
628        return "healthcareservice";
629      if (code == ActionParticipantType.LOCATION)
630        return "location";
631      if (code == ActionParticipantType.ORGANIZATION)
632        return "organization";
633      if (code == ActionParticipantType.PATIENT)
634        return "patient";
635      if (code == ActionParticipantType.PRACTITIONER)
636        return "practitioner";
637      if (code == ActionParticipantType.PRACTITIONERROLE)
638        return "practitionerrole";
639      if (code == ActionParticipantType.RELATEDPERSON)
640        return "relatedperson";
641      return "?";
642      }
643    public String toSystem(ActionParticipantType code) {
644      return code.getSystem();
645      }
646    }
647
648    public enum ActionPrecheckBehavior {
649        /**
650         * An action with this behavior is one of the most frequent action that is, or should be, included by an end user, for the particular context in which the action occurs. The system displaying the action to the end user should consider "pre-checking" such an action as a convenience for the user.
651         */
652        YES, 
653        /**
654         * An action with this behavior is one of the less frequent actions included by the end user, for the particular context in which the action occurs. The system displaying the actions to the end user would typically not "pre-check" such an action.
655         */
656        NO, 
657        /**
658         * added to help the parsers
659         */
660        NULL;
661        public static ActionPrecheckBehavior fromCode(String codeString) throws FHIRException {
662            if (codeString == null || "".equals(codeString))
663                return null;
664        if ("yes".equals(codeString))
665          return YES;
666        if ("no".equals(codeString))
667          return NO;
668        throw new FHIRException("Unknown ActionPrecheckBehavior code '"+codeString+"'");
669        }
670        public static boolean isValidCode(String codeString) {
671            if (codeString == null || "".equals(codeString))
672                return false;
673          return Utilities.existsInList(codeString, "yes", "no");
674        }
675        public String toCode() {
676          switch (this) {
677            case YES: return "yes";
678            case NO: return "no";
679            case NULL: return null;
680            default: return "?";
681          }
682        }
683        public String getSystem() {
684          switch (this) {
685            case YES: return "http://hl7.org/fhir/action-precheck-behavior";
686            case NO: return "http://hl7.org/fhir/action-precheck-behavior";
687            case NULL: return null;
688            default: return "?";
689          }
690        }
691        public String getDefinition() {
692          switch (this) {
693            case YES: return "An action with this behavior is one of the most frequent action that is, or should be, included by an end user, for the particular context in which the action occurs. The system displaying the action to the end user should consider \"pre-checking\" such an action as a convenience for the user.";
694            case NO: return "An action with this behavior is one of the less frequent actions included by the end user, for the particular context in which the action occurs. The system displaying the actions to the end user would typically not \"pre-check\" such an action.";
695            case NULL: return null;
696            default: return "?";
697          }
698        }
699        public String getDisplay() {
700          switch (this) {
701            case YES: return "Yes";
702            case NO: return "No";
703            case NULL: return null;
704            default: return "?";
705          }
706        }
707    }
708
709  public static class ActionPrecheckBehaviorEnumFactory implements EnumFactory<ActionPrecheckBehavior> {
710    public ActionPrecheckBehavior fromCode(String codeString) throws IllegalArgumentException {
711      if (codeString == null || "".equals(codeString))
712            if (codeString == null || "".equals(codeString))
713                return null;
714        if ("yes".equals(codeString))
715          return ActionPrecheckBehavior.YES;
716        if ("no".equals(codeString))
717          return ActionPrecheckBehavior.NO;
718        throw new IllegalArgumentException("Unknown ActionPrecheckBehavior code '"+codeString+"'");
719        }
720
721        public Enumeration<ActionPrecheckBehavior> fromType(PrimitiveType<?> code) throws FHIRException {
722          if (code == null)
723            return null;
724          if (code.isEmpty())
725            return new Enumeration<ActionPrecheckBehavior>(this, ActionPrecheckBehavior.NULL, code);
726          String codeString = ((PrimitiveType) code).asStringValue();
727          if (codeString == null || "".equals(codeString))
728            return new Enumeration<ActionPrecheckBehavior>(this, ActionPrecheckBehavior.NULL, code);
729        if ("yes".equals(codeString))
730          return new Enumeration<ActionPrecheckBehavior>(this, ActionPrecheckBehavior.YES, code);
731        if ("no".equals(codeString))
732          return new Enumeration<ActionPrecheckBehavior>(this, ActionPrecheckBehavior.NO, code);
733        throw new FHIRException("Unknown ActionPrecheckBehavior code '"+codeString+"'");
734        }
735    public String toCode(ActionPrecheckBehavior code) {
736      if (code == ActionPrecheckBehavior.YES)
737        return "yes";
738      if (code == ActionPrecheckBehavior.NO)
739        return "no";
740      return "?";
741      }
742    public String toSystem(ActionPrecheckBehavior code) {
743      return code.getSystem();
744      }
745    }
746
747    public enum ActionRelationshipType {
748        /**
749         * The action must be performed before the related action.
750         */
751        BEFORE, 
752        /**
753         * The action must be performed before the start of the related action.
754         */
755        BEFORESTART, 
756        /**
757         * The action must be performed before the end of the related action.
758         */
759        BEFOREEND, 
760        /**
761         * The action must be performed concurrent with the related action.
762         */
763        CONCURRENT, 
764        /**
765         * The action must be performed concurrent with the start of the related action.
766         */
767        CONCURRENTWITHSTART, 
768        /**
769         * The action must be performed concurrent with the end of the related action.
770         */
771        CONCURRENTWITHEND, 
772        /**
773         * The action must be performed after the related action.
774         */
775        AFTER, 
776        /**
777         * The action must be performed after the start of the related action.
778         */
779        AFTERSTART, 
780        /**
781         * The action must be performed after the end of the related action.
782         */
783        AFTEREND, 
784        /**
785         * added to help the parsers
786         */
787        NULL;
788        public static ActionRelationshipType fromCode(String codeString) throws FHIRException {
789            if (codeString == null || "".equals(codeString))
790                return null;
791        if ("before".equals(codeString))
792          return BEFORE;
793        if ("before-start".equals(codeString))
794          return BEFORESTART;
795        if ("before-end".equals(codeString))
796          return BEFOREEND;
797        if ("concurrent".equals(codeString))
798          return CONCURRENT;
799        if ("concurrent-with-start".equals(codeString))
800          return CONCURRENTWITHSTART;
801        if ("concurrent-with-end".equals(codeString))
802          return CONCURRENTWITHEND;
803        if ("after".equals(codeString))
804          return AFTER;
805        if ("after-start".equals(codeString))
806          return AFTERSTART;
807        if ("after-end".equals(codeString))
808          return AFTEREND;
809        throw new FHIRException("Unknown ActionRelationshipType code '"+codeString+"'");
810        }
811        public static boolean isValidCode(String codeString) {
812            if (codeString == null || "".equals(codeString))
813                return false;
814          return Utilities.existsInList(codeString, "before", "before-start", "before-end", "concurrent", "concurrent-with-start", "concurrent-with-end", "after", "after-start", "after-end");
815        }
816        public String toCode() {
817          switch (this) {
818            case BEFORE: return "before";
819            case BEFORESTART: return "before-start";
820            case BEFOREEND: return "before-end";
821            case CONCURRENT: return "concurrent";
822            case CONCURRENTWITHSTART: return "concurrent-with-start";
823            case CONCURRENTWITHEND: return "concurrent-with-end";
824            case AFTER: return "after";
825            case AFTERSTART: return "after-start";
826            case AFTEREND: return "after-end";
827            case NULL: return null;
828            default: return "?";
829          }
830        }
831        public String getSystem() {
832          switch (this) {
833            case BEFORE: return "http://hl7.org/fhir/action-relationship-type";
834            case BEFORESTART: return "http://hl7.org/fhir/action-relationship-type";
835            case BEFOREEND: return "http://hl7.org/fhir/action-relationship-type";
836            case CONCURRENT: return "http://hl7.org/fhir/action-relationship-type";
837            case CONCURRENTWITHSTART: return "http://hl7.org/fhir/action-relationship-type";
838            case CONCURRENTWITHEND: return "http://hl7.org/fhir/action-relationship-type";
839            case AFTER: return "http://hl7.org/fhir/action-relationship-type";
840            case AFTERSTART: return "http://hl7.org/fhir/action-relationship-type";
841            case AFTEREND: return "http://hl7.org/fhir/action-relationship-type";
842            case NULL: return null;
843            default: return "?";
844          }
845        }
846        public String getDefinition() {
847          switch (this) {
848            case BEFORE: return "The action must be performed before the related action.";
849            case BEFORESTART: return "The action must be performed before the start of the related action.";
850            case BEFOREEND: return "The action must be performed before the end of the related action.";
851            case CONCURRENT: return "The action must be performed concurrent with the related action.";
852            case CONCURRENTWITHSTART: return "The action must be performed concurrent with the start of the related action.";
853            case CONCURRENTWITHEND: return "The action must be performed concurrent with the end of the related action.";
854            case AFTER: return "The action must be performed after the related action.";
855            case AFTERSTART: return "The action must be performed after the start of the related action.";
856            case AFTEREND: return "The action must be performed after the end of the related action.";
857            case NULL: return null;
858            default: return "?";
859          }
860        }
861        public String getDisplay() {
862          switch (this) {
863            case BEFORE: return "Before";
864            case BEFORESTART: return "Before Start";
865            case BEFOREEND: return "Before End";
866            case CONCURRENT: return "Concurrent";
867            case CONCURRENTWITHSTART: return "Concurrent With Start";
868            case CONCURRENTWITHEND: return "Concurrent With End";
869            case AFTER: return "After";
870            case AFTERSTART: return "After Start";
871            case AFTEREND: return "After End";
872            case NULL: return null;
873            default: return "?";
874          }
875        }
876    }
877
878  public static class ActionRelationshipTypeEnumFactory implements EnumFactory<ActionRelationshipType> {
879    public ActionRelationshipType fromCode(String codeString) throws IllegalArgumentException {
880      if (codeString == null || "".equals(codeString))
881            if (codeString == null || "".equals(codeString))
882                return null;
883        if ("before".equals(codeString))
884          return ActionRelationshipType.BEFORE;
885        if ("before-start".equals(codeString))
886          return ActionRelationshipType.BEFORESTART;
887        if ("before-end".equals(codeString))
888          return ActionRelationshipType.BEFOREEND;
889        if ("concurrent".equals(codeString))
890          return ActionRelationshipType.CONCURRENT;
891        if ("concurrent-with-start".equals(codeString))
892          return ActionRelationshipType.CONCURRENTWITHSTART;
893        if ("concurrent-with-end".equals(codeString))
894          return ActionRelationshipType.CONCURRENTWITHEND;
895        if ("after".equals(codeString))
896          return ActionRelationshipType.AFTER;
897        if ("after-start".equals(codeString))
898          return ActionRelationshipType.AFTERSTART;
899        if ("after-end".equals(codeString))
900          return ActionRelationshipType.AFTEREND;
901        throw new IllegalArgumentException("Unknown ActionRelationshipType code '"+codeString+"'");
902        }
903
904        public Enumeration<ActionRelationshipType> fromType(PrimitiveType<?> code) throws FHIRException {
905          if (code == null)
906            return null;
907          if (code.isEmpty())
908            return new Enumeration<ActionRelationshipType>(this, ActionRelationshipType.NULL, code);
909          String codeString = ((PrimitiveType) code).asStringValue();
910          if (codeString == null || "".equals(codeString))
911            return new Enumeration<ActionRelationshipType>(this, ActionRelationshipType.NULL, code);
912        if ("before".equals(codeString))
913          return new Enumeration<ActionRelationshipType>(this, ActionRelationshipType.BEFORE, code);
914        if ("before-start".equals(codeString))
915          return new Enumeration<ActionRelationshipType>(this, ActionRelationshipType.BEFORESTART, code);
916        if ("before-end".equals(codeString))
917          return new Enumeration<ActionRelationshipType>(this, ActionRelationshipType.BEFOREEND, code);
918        if ("concurrent".equals(codeString))
919          return new Enumeration<ActionRelationshipType>(this, ActionRelationshipType.CONCURRENT, code);
920        if ("concurrent-with-start".equals(codeString))
921          return new Enumeration<ActionRelationshipType>(this, ActionRelationshipType.CONCURRENTWITHSTART, code);
922        if ("concurrent-with-end".equals(codeString))
923          return new Enumeration<ActionRelationshipType>(this, ActionRelationshipType.CONCURRENTWITHEND, code);
924        if ("after".equals(codeString))
925          return new Enumeration<ActionRelationshipType>(this, ActionRelationshipType.AFTER, code);
926        if ("after-start".equals(codeString))
927          return new Enumeration<ActionRelationshipType>(this, ActionRelationshipType.AFTERSTART, code);
928        if ("after-end".equals(codeString))
929          return new Enumeration<ActionRelationshipType>(this, ActionRelationshipType.AFTEREND, code);
930        throw new FHIRException("Unknown ActionRelationshipType code '"+codeString+"'");
931        }
932    public String toCode(ActionRelationshipType code) {
933      if (code == ActionRelationshipType.BEFORE)
934        return "before";
935      if (code == ActionRelationshipType.BEFORESTART)
936        return "before-start";
937      if (code == ActionRelationshipType.BEFOREEND)
938        return "before-end";
939      if (code == ActionRelationshipType.CONCURRENT)
940        return "concurrent";
941      if (code == ActionRelationshipType.CONCURRENTWITHSTART)
942        return "concurrent-with-start";
943      if (code == ActionRelationshipType.CONCURRENTWITHEND)
944        return "concurrent-with-end";
945      if (code == ActionRelationshipType.AFTER)
946        return "after";
947      if (code == ActionRelationshipType.AFTERSTART)
948        return "after-start";
949      if (code == ActionRelationshipType.AFTEREND)
950        return "after-end";
951      return "?";
952      }
953    public String toSystem(ActionRelationshipType code) {
954      return code.getSystem();
955      }
956    }
957
958    public enum ActionRequiredBehavior {
959        /**
960         * An action with this behavior must be included in the actions processed by the end user; the end user SHALL NOT choose not to include this action.
961         */
962        MUST, 
963        /**
964         * An action with this behavior may be included in the set of actions processed by the end user.
965         */
966        COULD, 
967        /**
968         * An action with this behavior must be included in the set of actions processed by the end user, unless the end user provides documentation as to why the action was not included.
969         */
970        MUSTUNLESSDOCUMENTED, 
971        /**
972         * added to help the parsers
973         */
974        NULL;
975        public static ActionRequiredBehavior fromCode(String codeString) throws FHIRException {
976            if (codeString == null || "".equals(codeString))
977                return null;
978        if ("must".equals(codeString))
979          return MUST;
980        if ("could".equals(codeString))
981          return COULD;
982        if ("must-unless-documented".equals(codeString))
983          return MUSTUNLESSDOCUMENTED;
984        throw new FHIRException("Unknown ActionRequiredBehavior code '"+codeString+"'");
985        }
986        public static boolean isValidCode(String codeString) {
987            if (codeString == null || "".equals(codeString))
988                return false;
989          return Utilities.existsInList(codeString, "must", "could", "must-unless-documented");
990        }
991        public String toCode() {
992          switch (this) {
993            case MUST: return "must";
994            case COULD: return "could";
995            case MUSTUNLESSDOCUMENTED: return "must-unless-documented";
996            case NULL: return null;
997            default: return "?";
998          }
999        }
1000        public String getSystem() {
1001          switch (this) {
1002            case MUST: return "http://hl7.org/fhir/action-required-behavior";
1003            case COULD: return "http://hl7.org/fhir/action-required-behavior";
1004            case MUSTUNLESSDOCUMENTED: return "http://hl7.org/fhir/action-required-behavior";
1005            case NULL: return null;
1006            default: return "?";
1007          }
1008        }
1009        public String getDefinition() {
1010          switch (this) {
1011            case MUST: return "An action with this behavior must be included in the actions processed by the end user; the end user SHALL NOT choose not to include this action.";
1012            case COULD: return "An action with this behavior may be included in the set of actions processed by the end user.";
1013            case MUSTUNLESSDOCUMENTED: return "An action with this behavior must be included in the set of actions processed by the end user, unless the end user provides documentation as to why the action was not included.";
1014            case NULL: return null;
1015            default: return "?";
1016          }
1017        }
1018        public String getDisplay() {
1019          switch (this) {
1020            case MUST: return "Must";
1021            case COULD: return "Could";
1022            case MUSTUNLESSDOCUMENTED: return "Must Unless Documented";
1023            case NULL: return null;
1024            default: return "?";
1025          }
1026        }
1027    }
1028
1029  public static class ActionRequiredBehaviorEnumFactory implements EnumFactory<ActionRequiredBehavior> {
1030    public ActionRequiredBehavior fromCode(String codeString) throws IllegalArgumentException {
1031      if (codeString == null || "".equals(codeString))
1032            if (codeString == null || "".equals(codeString))
1033                return null;
1034        if ("must".equals(codeString))
1035          return ActionRequiredBehavior.MUST;
1036        if ("could".equals(codeString))
1037          return ActionRequiredBehavior.COULD;
1038        if ("must-unless-documented".equals(codeString))
1039          return ActionRequiredBehavior.MUSTUNLESSDOCUMENTED;
1040        throw new IllegalArgumentException("Unknown ActionRequiredBehavior code '"+codeString+"'");
1041        }
1042
1043        public Enumeration<ActionRequiredBehavior> fromType(PrimitiveType<?> code) throws FHIRException {
1044          if (code == null)
1045            return null;
1046          if (code.isEmpty())
1047            return new Enumeration<ActionRequiredBehavior>(this, ActionRequiredBehavior.NULL, code);
1048          String codeString = ((PrimitiveType) code).asStringValue();
1049          if (codeString == null || "".equals(codeString))
1050            return new Enumeration<ActionRequiredBehavior>(this, ActionRequiredBehavior.NULL, code);
1051        if ("must".equals(codeString))
1052          return new Enumeration<ActionRequiredBehavior>(this, ActionRequiredBehavior.MUST, code);
1053        if ("could".equals(codeString))
1054          return new Enumeration<ActionRequiredBehavior>(this, ActionRequiredBehavior.COULD, code);
1055        if ("must-unless-documented".equals(codeString))
1056          return new Enumeration<ActionRequiredBehavior>(this, ActionRequiredBehavior.MUSTUNLESSDOCUMENTED, code);
1057        throw new FHIRException("Unknown ActionRequiredBehavior code '"+codeString+"'");
1058        }
1059    public String toCode(ActionRequiredBehavior code) {
1060      if (code == ActionRequiredBehavior.MUST)
1061        return "must";
1062      if (code == ActionRequiredBehavior.COULD)
1063        return "could";
1064      if (code == ActionRequiredBehavior.MUSTUNLESSDOCUMENTED)
1065        return "must-unless-documented";
1066      return "?";
1067      }
1068    public String toSystem(ActionRequiredBehavior code) {
1069      return code.getSystem();
1070      }
1071    }
1072
1073    public enum ActionSelectionBehavior {
1074        /**
1075         * Any number of the actions in the group may be chosen, from zero to all.
1076         */
1077        ANY, 
1078        /**
1079         * All the actions in the group must be selected as a single unit.
1080         */
1081        ALL, 
1082        /**
1083         * All the actions in the group are meant to be chosen as a single unit: either all must be selected by the end user, or none may be selected.
1084         */
1085        ALLORNONE, 
1086        /**
1087         * The end user must choose one and only one of the selectable actions in the group. The user SHALL NOT choose none of the actions in the group.
1088         */
1089        EXACTLYONE, 
1090        /**
1091         * The end user may choose zero or at most one of the actions in the group.
1092         */
1093        ATMOSTONE, 
1094        /**
1095         * The end user must choose a minimum of one, and as many additional as desired.
1096         */
1097        ONEORMORE, 
1098        /**
1099         * added to help the parsers
1100         */
1101        NULL;
1102        public static ActionSelectionBehavior fromCode(String codeString) throws FHIRException {
1103            if (codeString == null || "".equals(codeString))
1104                return null;
1105        if ("any".equals(codeString))
1106          return ANY;
1107        if ("all".equals(codeString))
1108          return ALL;
1109        if ("all-or-none".equals(codeString))
1110          return ALLORNONE;
1111        if ("exactly-one".equals(codeString))
1112          return EXACTLYONE;
1113        if ("at-most-one".equals(codeString))
1114          return ATMOSTONE;
1115        if ("one-or-more".equals(codeString))
1116          return ONEORMORE;
1117        throw new FHIRException("Unknown ActionSelectionBehavior code '"+codeString+"'");
1118        }
1119        public static boolean isValidCode(String codeString) {
1120            if (codeString == null || "".equals(codeString))
1121                return false;
1122          return Utilities.existsInList(codeString, "any", "all", "all-or-none", "exactly-one", "at-most-one", "one-or-more");
1123        }
1124        public String toCode() {
1125          switch (this) {
1126            case ANY: return "any";
1127            case ALL: return "all";
1128            case ALLORNONE: return "all-or-none";
1129            case EXACTLYONE: return "exactly-one";
1130            case ATMOSTONE: return "at-most-one";
1131            case ONEORMORE: return "one-or-more";
1132            case NULL: return null;
1133            default: return "?";
1134          }
1135        }
1136        public String getSystem() {
1137          switch (this) {
1138            case ANY: return "http://hl7.org/fhir/action-selection-behavior";
1139            case ALL: return "http://hl7.org/fhir/action-selection-behavior";
1140            case ALLORNONE: return "http://hl7.org/fhir/action-selection-behavior";
1141            case EXACTLYONE: return "http://hl7.org/fhir/action-selection-behavior";
1142            case ATMOSTONE: return "http://hl7.org/fhir/action-selection-behavior";
1143            case ONEORMORE: return "http://hl7.org/fhir/action-selection-behavior";
1144            case NULL: return null;
1145            default: return "?";
1146          }
1147        }
1148        public String getDefinition() {
1149          switch (this) {
1150            case ANY: return "Any number of the actions in the group may be chosen, from zero to all.";
1151            case ALL: return "All the actions in the group must be selected as a single unit.";
1152            case ALLORNONE: return "All the actions in the group are meant to be chosen as a single unit: either all must be selected by the end user, or none may be selected.";
1153            case EXACTLYONE: return "The end user must choose one and only one of the selectable actions in the group. The user SHALL NOT choose none of the actions in the group.";
1154            case ATMOSTONE: return "The end user may choose zero or at most one of the actions in the group.";
1155            case ONEORMORE: return "The end user must choose a minimum of one, and as many additional as desired.";
1156            case NULL: return null;
1157            default: return "?";
1158          }
1159        }
1160        public String getDisplay() {
1161          switch (this) {
1162            case ANY: return "Any";
1163            case ALL: return "All";
1164            case ALLORNONE: return "All Or None";
1165            case EXACTLYONE: return "Exactly One";
1166            case ATMOSTONE: return "At Most One";
1167            case ONEORMORE: return "One Or More";
1168            case NULL: return null;
1169            default: return "?";
1170          }
1171        }
1172    }
1173
1174  public static class ActionSelectionBehaviorEnumFactory implements EnumFactory<ActionSelectionBehavior> {
1175    public ActionSelectionBehavior fromCode(String codeString) throws IllegalArgumentException {
1176      if (codeString == null || "".equals(codeString))
1177            if (codeString == null || "".equals(codeString))
1178                return null;
1179        if ("any".equals(codeString))
1180          return ActionSelectionBehavior.ANY;
1181        if ("all".equals(codeString))
1182          return ActionSelectionBehavior.ALL;
1183        if ("all-or-none".equals(codeString))
1184          return ActionSelectionBehavior.ALLORNONE;
1185        if ("exactly-one".equals(codeString))
1186          return ActionSelectionBehavior.EXACTLYONE;
1187        if ("at-most-one".equals(codeString))
1188          return ActionSelectionBehavior.ATMOSTONE;
1189        if ("one-or-more".equals(codeString))
1190          return ActionSelectionBehavior.ONEORMORE;
1191        throw new IllegalArgumentException("Unknown ActionSelectionBehavior code '"+codeString+"'");
1192        }
1193
1194        public Enumeration<ActionSelectionBehavior> fromType(PrimitiveType<?> code) throws FHIRException {
1195          if (code == null)
1196            return null;
1197          if (code.isEmpty())
1198            return new Enumeration<ActionSelectionBehavior>(this, ActionSelectionBehavior.NULL, code);
1199          String codeString = ((PrimitiveType) code).asStringValue();
1200          if (codeString == null || "".equals(codeString))
1201            return new Enumeration<ActionSelectionBehavior>(this, ActionSelectionBehavior.NULL, code);
1202        if ("any".equals(codeString))
1203          return new Enumeration<ActionSelectionBehavior>(this, ActionSelectionBehavior.ANY, code);
1204        if ("all".equals(codeString))
1205          return new Enumeration<ActionSelectionBehavior>(this, ActionSelectionBehavior.ALL, code);
1206        if ("all-or-none".equals(codeString))
1207          return new Enumeration<ActionSelectionBehavior>(this, ActionSelectionBehavior.ALLORNONE, code);
1208        if ("exactly-one".equals(codeString))
1209          return new Enumeration<ActionSelectionBehavior>(this, ActionSelectionBehavior.EXACTLYONE, code);
1210        if ("at-most-one".equals(codeString))
1211          return new Enumeration<ActionSelectionBehavior>(this, ActionSelectionBehavior.ATMOSTONE, code);
1212        if ("one-or-more".equals(codeString))
1213          return new Enumeration<ActionSelectionBehavior>(this, ActionSelectionBehavior.ONEORMORE, code);
1214        throw new FHIRException("Unknown ActionSelectionBehavior code '"+codeString+"'");
1215        }
1216    public String toCode(ActionSelectionBehavior code) {
1217      if (code == ActionSelectionBehavior.ANY)
1218        return "any";
1219      if (code == ActionSelectionBehavior.ALL)
1220        return "all";
1221      if (code == ActionSelectionBehavior.ALLORNONE)
1222        return "all-or-none";
1223      if (code == ActionSelectionBehavior.EXACTLYONE)
1224        return "exactly-one";
1225      if (code == ActionSelectionBehavior.ATMOSTONE)
1226        return "at-most-one";
1227      if (code == ActionSelectionBehavior.ONEORMORE)
1228        return "one-or-more";
1229      return "?";
1230      }
1231    public String toSystem(ActionSelectionBehavior code) {
1232      return code.getSystem();
1233      }
1234    }
1235
1236    public enum AdministrativeGender {
1237        /**
1238         * Male.
1239         */
1240        MALE, 
1241        /**
1242         * Female.
1243         */
1244        FEMALE, 
1245        /**
1246         * Other.
1247         */
1248        OTHER, 
1249        /**
1250         * Unknown.
1251         */
1252        UNKNOWN, 
1253        /**
1254         * added to help the parsers
1255         */
1256        NULL;
1257        public static AdministrativeGender fromCode(String codeString) throws FHIRException {
1258            if (codeString == null || "".equals(codeString))
1259                return null;
1260        if ("male".equals(codeString))
1261          return MALE;
1262        if ("female".equals(codeString))
1263          return FEMALE;
1264        if ("other".equals(codeString))
1265          return OTHER;
1266        if ("unknown".equals(codeString))
1267          return UNKNOWN;
1268        throw new FHIRException("Unknown AdministrativeGender code '"+codeString+"'");
1269        }
1270        public static boolean isValidCode(String codeString) {
1271            if (codeString == null || "".equals(codeString))
1272                return false;
1273          return Utilities.existsInList(codeString, "male", "female", "other", "unknown");
1274        }
1275        public String toCode() {
1276          switch (this) {
1277            case MALE: return "male";
1278            case FEMALE: return "female";
1279            case OTHER: return "other";
1280            case UNKNOWN: return "unknown";
1281            case NULL: return null;
1282            default: return "?";
1283          }
1284        }
1285        public String getSystem() {
1286          switch (this) {
1287            case MALE: return "http://hl7.org/fhir/administrative-gender";
1288            case FEMALE: return "http://hl7.org/fhir/administrative-gender";
1289            case OTHER: return "http://hl7.org/fhir/administrative-gender";
1290            case UNKNOWN: return "http://hl7.org/fhir/administrative-gender";
1291            case NULL: return null;
1292            default: return "?";
1293          }
1294        }
1295        public String getDefinition() {
1296          switch (this) {
1297            case MALE: return "Male.";
1298            case FEMALE: return "Female.";
1299            case OTHER: return "Other.";
1300            case UNKNOWN: return "Unknown.";
1301            case NULL: return null;
1302            default: return "?";
1303          }
1304        }
1305        public String getDisplay() {
1306          switch (this) {
1307            case MALE: return "Male";
1308            case FEMALE: return "Female";
1309            case OTHER: return "Other";
1310            case UNKNOWN: return "Unknown";
1311            case NULL: return null;
1312            default: return "?";
1313          }
1314        }
1315    }
1316
1317  public static class AdministrativeGenderEnumFactory implements EnumFactory<AdministrativeGender> {
1318    public AdministrativeGender fromCode(String codeString) throws IllegalArgumentException {
1319      if (codeString == null || "".equals(codeString))
1320            if (codeString == null || "".equals(codeString))
1321                return null;
1322        if ("male".equals(codeString))
1323          return AdministrativeGender.MALE;
1324        if ("female".equals(codeString))
1325          return AdministrativeGender.FEMALE;
1326        if ("other".equals(codeString))
1327          return AdministrativeGender.OTHER;
1328        if ("unknown".equals(codeString))
1329          return AdministrativeGender.UNKNOWN;
1330        throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'");
1331        }
1332
1333        public Enumeration<AdministrativeGender> fromType(PrimitiveType<?> code) throws FHIRException {
1334          if (code == null)
1335            return null;
1336          if (code.isEmpty())
1337            return new Enumeration<AdministrativeGender>(this, AdministrativeGender.NULL, code);
1338          String codeString = ((PrimitiveType) code).asStringValue();
1339          if (codeString == null || "".equals(codeString))
1340            return new Enumeration<AdministrativeGender>(this, AdministrativeGender.NULL, code);
1341        if ("male".equals(codeString))
1342          return new Enumeration<AdministrativeGender>(this, AdministrativeGender.MALE, code);
1343        if ("female".equals(codeString))
1344          return new Enumeration<AdministrativeGender>(this, AdministrativeGender.FEMALE, code);
1345        if ("other".equals(codeString))
1346          return new Enumeration<AdministrativeGender>(this, AdministrativeGender.OTHER, code);
1347        if ("unknown".equals(codeString))
1348          return new Enumeration<AdministrativeGender>(this, AdministrativeGender.UNKNOWN, code);
1349        throw new FHIRException("Unknown AdministrativeGender code '"+codeString+"'");
1350        }
1351    public String toCode(AdministrativeGender code) {
1352      if (code == AdministrativeGender.MALE)
1353        return "male";
1354      if (code == AdministrativeGender.FEMALE)
1355        return "female";
1356      if (code == AdministrativeGender.OTHER)
1357        return "other";
1358      if (code == AdministrativeGender.UNKNOWN)
1359        return "unknown";
1360      return "?";
1361      }
1362    public String toSystem(AdministrativeGender code) {
1363      return code.getSystem();
1364      }
1365    }
1366
1367    public enum AllLanguages {
1368        /**
1369         * added to help the parsers
1370         */
1371        NULL;
1372        public static AllLanguages fromCode(String codeString) throws FHIRException {
1373            if (codeString == null || "".equals(codeString))
1374                return null;
1375        throw new FHIRException("Unknown AllLanguages code '"+codeString+"'");
1376        }
1377        public static boolean isValidCode(String codeString) {
1378            if (codeString == null || "".equals(codeString))
1379                return false;
1380          return Utilities.existsInList(codeString);
1381        }
1382        public String toCode() {
1383          switch (this) {
1384            case NULL: return null;
1385            default: return "?";
1386          }
1387        }
1388        public String getSystem() {
1389          switch (this) {
1390            case NULL: return null;
1391            default: return "?";
1392          }
1393        }
1394        public String getDefinition() {
1395          switch (this) {
1396            case NULL: return null;
1397            default: return "?";
1398          }
1399        }
1400        public String getDisplay() {
1401          switch (this) {
1402            case NULL: return null;
1403            default: return "?";
1404          }
1405        }
1406    }
1407
1408  public static class AllLanguagesEnumFactory implements EnumFactory<AllLanguages> {
1409    public AllLanguages fromCode(String codeString) throws IllegalArgumentException {
1410      if (codeString == null || "".equals(codeString))
1411            if (codeString == null || "".equals(codeString))
1412                return null;
1413        throw new IllegalArgumentException("Unknown AllLanguages code '"+codeString+"'");
1414        }
1415
1416        public Enumeration<AllLanguages> fromType(PrimitiveType<?> code) throws FHIRException {
1417          if (code == null)
1418            return null;
1419          if (code.isEmpty())
1420            return new Enumeration<AllLanguages>(this, AllLanguages.NULL, code);
1421          String codeString = ((PrimitiveType) code).asStringValue();
1422          if (codeString == null || "".equals(codeString))
1423            return new Enumeration<AllLanguages>(this, AllLanguages.NULL, code);
1424        throw new FHIRException("Unknown AllLanguages code '"+codeString+"'");
1425        }
1426    public String toCode(AllLanguages code) {
1427      return "?";
1428      }
1429    public String toSystem(AllLanguages code) {
1430      return code.getSystem();
1431      }
1432    }
1433
1434    public enum BindingStrength {
1435        /**
1436         * To be conformant, the concept in this element SHALL be from the specified value set.
1437         */
1438        REQUIRED, 
1439        /**
1440         * To be conformant, the concept in this element SHALL be from the specified value set if any of the codes within the value set can apply to the concept being communicated.  If the value set does not cover the concept (based on human review), alternate codings (or, data type allowing, text) may be included instead.
1441         */
1442        EXTENSIBLE, 
1443        /**
1444         * Instances are encouraged to draw from the specified codes for interoperability purposes but are not required to do so to be considered conformant.
1445         */
1446        PREFERRED, 
1447        /**
1448         * Instances are not expected or even encouraged to draw from the specified value set.  The value set merely provides examples of the types of concepts intended to be included.
1449         */
1450        EXAMPLE, 
1451        /**
1452         * added to help the parsers
1453         */
1454        NULL;
1455        public static BindingStrength fromCode(String codeString) throws FHIRException {
1456            if (codeString == null || "".equals(codeString))
1457                return null;
1458        if ("required".equals(codeString))
1459          return REQUIRED;
1460        if ("extensible".equals(codeString))
1461          return EXTENSIBLE;
1462        if ("preferred".equals(codeString))
1463          return PREFERRED;
1464        if ("example".equals(codeString))
1465          return EXAMPLE;
1466        throw new FHIRException("Unknown BindingStrength code '"+codeString+"'");
1467        }
1468        public static boolean isValidCode(String codeString) {
1469            if (codeString == null || "".equals(codeString))
1470                return false;
1471          return Utilities.existsInList(codeString, "required", "extensible", "preferred", "example");
1472        }
1473        public String toCode() {
1474          switch (this) {
1475            case REQUIRED: return "required";
1476            case EXTENSIBLE: return "extensible";
1477            case PREFERRED: return "preferred";
1478            case EXAMPLE: return "example";
1479            case NULL: return null;
1480            default: return "?";
1481          }
1482        }
1483        public String getSystem() {
1484          switch (this) {
1485            case REQUIRED: return "http://hl7.org/fhir/binding-strength";
1486            case EXTENSIBLE: return "http://hl7.org/fhir/binding-strength";
1487            case PREFERRED: return "http://hl7.org/fhir/binding-strength";
1488            case EXAMPLE: return "http://hl7.org/fhir/binding-strength";
1489            case NULL: return null;
1490            default: return "?";
1491          }
1492        }
1493        public String getDefinition() {
1494          switch (this) {
1495            case REQUIRED: return "To be conformant, the concept in this element SHALL be from the specified value set.";
1496            case EXTENSIBLE: return "To be conformant, the concept in this element SHALL be from the specified value set if any of the codes within the value set can apply to the concept being communicated.  If the value set does not cover the concept (based on human review), alternate codings (or, data type allowing, text) may be included instead.";
1497            case PREFERRED: return "Instances are encouraged to draw from the specified codes for interoperability purposes but are not required to do so to be considered conformant.";
1498            case EXAMPLE: return "Instances are not expected or even encouraged to draw from the specified value set.  The value set merely provides examples of the types of concepts intended to be included.";
1499            case NULL: return null;
1500            default: return "?";
1501          }
1502        }
1503        public String getDisplay() {
1504          switch (this) {
1505            case REQUIRED: return "Required";
1506            case EXTENSIBLE: return "Extensible";
1507            case PREFERRED: return "Preferred";
1508            case EXAMPLE: return "Example";
1509            case NULL: return null;
1510            default: return "?";
1511          }
1512        }
1513    }
1514
1515  public static class BindingStrengthEnumFactory implements EnumFactory<BindingStrength> {
1516    public BindingStrength fromCode(String codeString) throws IllegalArgumentException {
1517      if (codeString == null || "".equals(codeString))
1518            if (codeString == null || "".equals(codeString))
1519                return null;
1520        if ("required".equals(codeString))
1521          return BindingStrength.REQUIRED;
1522        if ("extensible".equals(codeString))
1523          return BindingStrength.EXTENSIBLE;
1524        if ("preferred".equals(codeString))
1525          return BindingStrength.PREFERRED;
1526        if ("example".equals(codeString))
1527          return BindingStrength.EXAMPLE;
1528        throw new IllegalArgumentException("Unknown BindingStrength code '"+codeString+"'");
1529        }
1530
1531        public Enumeration<BindingStrength> fromType(PrimitiveType<?> code) throws FHIRException {
1532          if (code == null)
1533            return null;
1534          if (code.isEmpty())
1535            return new Enumeration<BindingStrength>(this, BindingStrength.NULL, code);
1536          String codeString = ((PrimitiveType) code).asStringValue();
1537          if (codeString == null || "".equals(codeString))
1538            return new Enumeration<BindingStrength>(this, BindingStrength.NULL, code);
1539        if ("required".equals(codeString))
1540          return new Enumeration<BindingStrength>(this, BindingStrength.REQUIRED, code);
1541        if ("extensible".equals(codeString))
1542          return new Enumeration<BindingStrength>(this, BindingStrength.EXTENSIBLE, code);
1543        if ("preferred".equals(codeString))
1544          return new Enumeration<BindingStrength>(this, BindingStrength.PREFERRED, code);
1545        if ("example".equals(codeString))
1546          return new Enumeration<BindingStrength>(this, BindingStrength.EXAMPLE, code);
1547        throw new FHIRException("Unknown BindingStrength code '"+codeString+"'");
1548        }
1549    public String toCode(BindingStrength code) {
1550      if (code == BindingStrength.REQUIRED)
1551        return "required";
1552      if (code == BindingStrength.EXTENSIBLE)
1553        return "extensible";
1554      if (code == BindingStrength.PREFERRED)
1555        return "preferred";
1556      if (code == BindingStrength.EXAMPLE)
1557        return "example";
1558      return "?";
1559      }
1560    public String toSystem(BindingStrength code) {
1561      return code.getSystem();
1562      }
1563    }
1564
1565    public enum CapabilityStatementKind {
1566        /**
1567         * The CapabilityStatement instance represents the present capabilities of a specific system instance.  This is the kind returned by /metadata for a FHIR server end-point.
1568         */
1569        INSTANCE, 
1570        /**
1571         * The CapabilityStatement instance represents the capabilities of a system or piece of software, independent of a particular installation.
1572         */
1573        CAPABILITY, 
1574        /**
1575         * The CapabilityStatement instance represents a set of requirements for other systems to meet; e.g. as part of an implementation guide or 'request for proposal'.
1576         */
1577        REQUIREMENTS, 
1578        /**
1579         * added to help the parsers
1580         */
1581        NULL;
1582        public static CapabilityStatementKind fromCode(String codeString) throws FHIRException {
1583            if (codeString == null || "".equals(codeString))
1584                return null;
1585        if ("instance".equals(codeString))
1586          return INSTANCE;
1587        if ("capability".equals(codeString))
1588          return CAPABILITY;
1589        if ("requirements".equals(codeString))
1590          return REQUIREMENTS;
1591        throw new FHIRException("Unknown CapabilityStatementKind code '"+codeString+"'");
1592        }
1593        public static boolean isValidCode(String codeString) {
1594            if (codeString == null || "".equals(codeString))
1595                return false;
1596          return Utilities.existsInList(codeString, "instance", "capability", "requirements");
1597        }
1598        public String toCode() {
1599          switch (this) {
1600            case INSTANCE: return "instance";
1601            case CAPABILITY: return "capability";
1602            case REQUIREMENTS: return "requirements";
1603            case NULL: return null;
1604            default: return "?";
1605          }
1606        }
1607        public String getSystem() {
1608          switch (this) {
1609            case INSTANCE: return "http://hl7.org/fhir/capability-statement-kind";
1610            case CAPABILITY: return "http://hl7.org/fhir/capability-statement-kind";
1611            case REQUIREMENTS: return "http://hl7.org/fhir/capability-statement-kind";
1612            case NULL: return null;
1613            default: return "?";
1614          }
1615        }
1616        public String getDefinition() {
1617          switch (this) {
1618            case INSTANCE: return "The CapabilityStatement instance represents the present capabilities of a specific system instance.  This is the kind returned by /metadata for a FHIR server end-point.";
1619            case CAPABILITY: return "The CapabilityStatement instance represents the capabilities of a system or piece of software, independent of a particular installation.";
1620            case REQUIREMENTS: return "The CapabilityStatement instance represents a set of requirements for other systems to meet; e.g. as part of an implementation guide or 'request for proposal'.";
1621            case NULL: return null;
1622            default: return "?";
1623          }
1624        }
1625        public String getDisplay() {
1626          switch (this) {
1627            case INSTANCE: return "Instance";
1628            case CAPABILITY: return "Capability";
1629            case REQUIREMENTS: return "Requirements";
1630            case NULL: return null;
1631            default: return "?";
1632          }
1633        }
1634    }
1635
1636  public static class CapabilityStatementKindEnumFactory implements EnumFactory<CapabilityStatementKind> {
1637    public CapabilityStatementKind fromCode(String codeString) throws IllegalArgumentException {
1638      if (codeString == null || "".equals(codeString))
1639            if (codeString == null || "".equals(codeString))
1640                return null;
1641        if ("instance".equals(codeString))
1642          return CapabilityStatementKind.INSTANCE;
1643        if ("capability".equals(codeString))
1644          return CapabilityStatementKind.CAPABILITY;
1645        if ("requirements".equals(codeString))
1646          return CapabilityStatementKind.REQUIREMENTS;
1647        throw new IllegalArgumentException("Unknown CapabilityStatementKind code '"+codeString+"'");
1648        }
1649
1650        public Enumeration<CapabilityStatementKind> fromType(PrimitiveType<?> code) throws FHIRException {
1651          if (code == null)
1652            return null;
1653          if (code.isEmpty())
1654            return new Enumeration<CapabilityStatementKind>(this, CapabilityStatementKind.NULL, code);
1655          String codeString = ((PrimitiveType) code).asStringValue();
1656          if (codeString == null || "".equals(codeString))
1657            return new Enumeration<CapabilityStatementKind>(this, CapabilityStatementKind.NULL, code);
1658        if ("instance".equals(codeString))
1659          return new Enumeration<CapabilityStatementKind>(this, CapabilityStatementKind.INSTANCE, code);
1660        if ("capability".equals(codeString))
1661          return new Enumeration<CapabilityStatementKind>(this, CapabilityStatementKind.CAPABILITY, code);
1662        if ("requirements".equals(codeString))
1663          return new Enumeration<CapabilityStatementKind>(this, CapabilityStatementKind.REQUIREMENTS, code);
1664        throw new FHIRException("Unknown CapabilityStatementKind code '"+codeString+"'");
1665        }
1666    public String toCode(CapabilityStatementKind code) {
1667      if (code == CapabilityStatementKind.INSTANCE)
1668        return "instance";
1669      if (code == CapabilityStatementKind.CAPABILITY)
1670        return "capability";
1671      if (code == CapabilityStatementKind.REQUIREMENTS)
1672        return "requirements";
1673      return "?";
1674      }
1675    public String toSystem(CapabilityStatementKind code) {
1676      return code.getSystem();
1677      }
1678    }
1679
1680    public enum ClaimProcessingCodes {
1681        /**
1682         * The Claim/Pre-authorization/Pre-determination has been received but processing has not begun.
1683         */
1684        QUEUED, 
1685        /**
1686         * The processing has completed without errors
1687         */
1688        COMPLETE, 
1689        /**
1690         * One or more errors have been detected in the Claim
1691         */
1692        ERROR, 
1693        /**
1694         * No errors have been detected in the Claim and some of the adjudication has been performed.
1695         */
1696        PARTIAL, 
1697        /**
1698         * added to help the parsers
1699         */
1700        NULL;
1701        public static ClaimProcessingCodes fromCode(String codeString) throws FHIRException {
1702            if (codeString == null || "".equals(codeString))
1703                return null;
1704        if ("queued".equals(codeString))
1705          return QUEUED;
1706        if ("complete".equals(codeString))
1707          return COMPLETE;
1708        if ("error".equals(codeString))
1709          return ERROR;
1710        if ("partial".equals(codeString))
1711          return PARTIAL;
1712        throw new FHIRException("Unknown ClaimProcessingCodes code '"+codeString+"'");
1713        }
1714        public static boolean isValidCode(String codeString) {
1715            if (codeString == null || "".equals(codeString))
1716                return false;
1717          return Utilities.existsInList(codeString, "queued", "complete", "error", "partial");
1718        }
1719        public String toCode() {
1720          switch (this) {
1721            case QUEUED: return "queued";
1722            case COMPLETE: return "complete";
1723            case ERROR: return "error";
1724            case PARTIAL: return "partial";
1725            case NULL: return null;
1726            default: return "?";
1727          }
1728        }
1729        public String getSystem() {
1730          switch (this) {
1731            case QUEUED: return "http://hl7.org/fhir/claim-outcome";
1732            case COMPLETE: return "http://hl7.org/fhir/claim-outcome";
1733            case ERROR: return "http://hl7.org/fhir/claim-outcome";
1734            case PARTIAL: return "http://hl7.org/fhir/claim-outcome";
1735            case NULL: return null;
1736            default: return "?";
1737          }
1738        }
1739        public String getDefinition() {
1740          switch (this) {
1741            case QUEUED: return "The Claim/Pre-authorization/Pre-determination has been received but processing has not begun.";
1742            case COMPLETE: return "The processing has completed without errors";
1743            case ERROR: return "One or more errors have been detected in the Claim";
1744            case PARTIAL: return "No errors have been detected in the Claim and some of the adjudication has been performed.";
1745            case NULL: return null;
1746            default: return "?";
1747          }
1748        }
1749        public String getDisplay() {
1750          switch (this) {
1751            case QUEUED: return "Queued";
1752            case COMPLETE: return "Processing Complete";
1753            case ERROR: return "Error";
1754            case PARTIAL: return "Partial Processing";
1755            case NULL: return null;
1756            default: return "?";
1757          }
1758        }
1759    }
1760
1761  public static class ClaimProcessingCodesEnumFactory implements EnumFactory<ClaimProcessingCodes> {
1762    public ClaimProcessingCodes fromCode(String codeString) throws IllegalArgumentException {
1763      if (codeString == null || "".equals(codeString))
1764            if (codeString == null || "".equals(codeString))
1765                return null;
1766        if ("queued".equals(codeString))
1767          return ClaimProcessingCodes.QUEUED;
1768        if ("complete".equals(codeString))
1769          return ClaimProcessingCodes.COMPLETE;
1770        if ("error".equals(codeString))
1771          return ClaimProcessingCodes.ERROR;
1772        if ("partial".equals(codeString))
1773          return ClaimProcessingCodes.PARTIAL;
1774        throw new IllegalArgumentException("Unknown ClaimProcessingCodes code '"+codeString+"'");
1775        }
1776
1777        public Enumeration<ClaimProcessingCodes> fromType(PrimitiveType<?> code) throws FHIRException {
1778          if (code == null)
1779            return null;
1780          if (code.isEmpty())
1781            return new Enumeration<ClaimProcessingCodes>(this, ClaimProcessingCodes.NULL, code);
1782          String codeString = ((PrimitiveType) code).asStringValue();
1783          if (codeString == null || "".equals(codeString))
1784            return new Enumeration<ClaimProcessingCodes>(this, ClaimProcessingCodes.NULL, code);
1785        if ("queued".equals(codeString))
1786          return new Enumeration<ClaimProcessingCodes>(this, ClaimProcessingCodes.QUEUED, code);
1787        if ("complete".equals(codeString))
1788          return new Enumeration<ClaimProcessingCodes>(this, ClaimProcessingCodes.COMPLETE, code);
1789        if ("error".equals(codeString))
1790          return new Enumeration<ClaimProcessingCodes>(this, ClaimProcessingCodes.ERROR, code);
1791        if ("partial".equals(codeString))
1792          return new Enumeration<ClaimProcessingCodes>(this, ClaimProcessingCodes.PARTIAL, code);
1793        throw new FHIRException("Unknown ClaimProcessingCodes code '"+codeString+"'");
1794        }
1795    public String toCode(ClaimProcessingCodes code) {
1796      if (code == ClaimProcessingCodes.QUEUED)
1797        return "queued";
1798      if (code == ClaimProcessingCodes.COMPLETE)
1799        return "complete";
1800      if (code == ClaimProcessingCodes.ERROR)
1801        return "error";
1802      if (code == ClaimProcessingCodes.PARTIAL)
1803        return "partial";
1804      return "?";
1805      }
1806    public String toSystem(ClaimProcessingCodes code) {
1807      return code.getSystem();
1808      }
1809    }
1810
1811    public enum CodeSystemContentMode {
1812        /**
1813         * None of the concepts defined by the code system are included in the code system resource.
1814         */
1815        NOTPRESENT, 
1816        /**
1817         * A subset of the valid externally defined concepts are included in the code system resource. There is no specific purpose or documented intent other than for illustrative purposes.
1818         */
1819        EXAMPLE, 
1820        /**
1821         * A subset of the code system concepts are included in the code system resource. This is a curated subset released for a specific purpose under the governance of the code system steward, and that the intent, bounds and consequences of the fragmentation are clearly defined in the fragment or the code system documentation. Fragments are also known as partitions.
1822         */
1823        FRAGMENT, 
1824        /**
1825         * All the concepts defined by the code system are included in the code system resource.
1826         */
1827        COMPLETE, 
1828        /**
1829         * The resource doesn't define any new concepts; it just provides additional designations and properties to another code system.
1830         */
1831        SUPPLEMENT, 
1832        /**
1833         * added to help the parsers
1834         */
1835        NULL;
1836        public static CodeSystemContentMode fromCode(String codeString) throws FHIRException {
1837            if (codeString == null || "".equals(codeString))
1838                return null;
1839        if ("not-present".equals(codeString))
1840          return NOTPRESENT;
1841        if ("example".equals(codeString))
1842          return EXAMPLE;
1843        if ("fragment".equals(codeString))
1844          return FRAGMENT;
1845        if ("complete".equals(codeString))
1846          return COMPLETE;
1847        if ("supplement".equals(codeString))
1848          return SUPPLEMENT;
1849        throw new FHIRException("Unknown CodeSystemContentMode code '"+codeString+"'");
1850        }
1851        public static boolean isValidCode(String codeString) {
1852            if (codeString == null || "".equals(codeString))
1853                return false;
1854          return Utilities.existsInList(codeString, "not-present", "example", "fragment", "complete", "supplement");
1855        }
1856        public String toCode() {
1857          switch (this) {
1858            case NOTPRESENT: return "not-present";
1859            case EXAMPLE: return "example";
1860            case FRAGMENT: return "fragment";
1861            case COMPLETE: return "complete";
1862            case SUPPLEMENT: return "supplement";
1863            case NULL: return null;
1864            default: return "?";
1865          }
1866        }
1867        public String getSystem() {
1868          switch (this) {
1869            case NOTPRESENT: return "http://hl7.org/fhir/codesystem-content-mode";
1870            case EXAMPLE: return "http://hl7.org/fhir/codesystem-content-mode";
1871            case FRAGMENT: return "http://hl7.org/fhir/codesystem-content-mode";
1872            case COMPLETE: return "http://hl7.org/fhir/codesystem-content-mode";
1873            case SUPPLEMENT: return "http://hl7.org/fhir/codesystem-content-mode";
1874            case NULL: return null;
1875            default: return "?";
1876          }
1877        }
1878        public String getDefinition() {
1879          switch (this) {
1880            case NOTPRESENT: return "None of the concepts defined by the code system are included in the code system resource.";
1881            case EXAMPLE: return "A subset of the valid externally defined concepts are included in the code system resource. There is no specific purpose or documented intent other than for illustrative purposes.";
1882            case FRAGMENT: return "A subset of the code system concepts are included in the code system resource. This is a curated subset released for a specific purpose under the governance of the code system steward, and that the intent, bounds and consequences of the fragmentation are clearly defined in the fragment or the code system documentation. Fragments are also known as partitions.";
1883            case COMPLETE: return "All the concepts defined by the code system are included in the code system resource.";
1884            case SUPPLEMENT: return "The resource doesn't define any new concepts; it just provides additional designations and properties to another code system.";
1885            case NULL: return null;
1886            default: return "?";
1887          }
1888        }
1889        public String getDisplay() {
1890          switch (this) {
1891            case NOTPRESENT: return "Not Present";
1892            case EXAMPLE: return "Example";
1893            case FRAGMENT: return "Fragment";
1894            case COMPLETE: return "Complete";
1895            case SUPPLEMENT: return "Supplement";
1896            case NULL: return null;
1897            default: return "?";
1898          }
1899        }
1900    }
1901
1902  public static class CodeSystemContentModeEnumFactory implements EnumFactory<CodeSystemContentMode> {
1903    public CodeSystemContentMode fromCode(String codeString) throws IllegalArgumentException {
1904      if (codeString == null || "".equals(codeString))
1905            if (codeString == null || "".equals(codeString))
1906                return null;
1907        if ("not-present".equals(codeString))
1908          return CodeSystemContentMode.NOTPRESENT;
1909        if ("example".equals(codeString))
1910          return CodeSystemContentMode.EXAMPLE;
1911        if ("fragment".equals(codeString))
1912          return CodeSystemContentMode.FRAGMENT;
1913        if ("complete".equals(codeString))
1914          return CodeSystemContentMode.COMPLETE;
1915        if ("supplement".equals(codeString))
1916          return CodeSystemContentMode.SUPPLEMENT;
1917        throw new IllegalArgumentException("Unknown CodeSystemContentMode code '"+codeString+"'");
1918        }
1919
1920        public Enumeration<CodeSystemContentMode> fromType(PrimitiveType<?> code) throws FHIRException {
1921          if (code == null)
1922            return null;
1923          if (code.isEmpty())
1924            return new Enumeration<CodeSystemContentMode>(this, CodeSystemContentMode.NULL, code);
1925          String codeString = ((PrimitiveType) code).asStringValue();
1926          if (codeString == null || "".equals(codeString))
1927            return new Enumeration<CodeSystemContentMode>(this, CodeSystemContentMode.NULL, code);
1928        if ("not-present".equals(codeString))
1929          return new Enumeration<CodeSystemContentMode>(this, CodeSystemContentMode.NOTPRESENT, code);
1930        if ("example".equals(codeString))
1931          return new Enumeration<CodeSystemContentMode>(this, CodeSystemContentMode.EXAMPLE, code);
1932        if ("fragment".equals(codeString))
1933          return new Enumeration<CodeSystemContentMode>(this, CodeSystemContentMode.FRAGMENT, code);
1934        if ("complete".equals(codeString))
1935          return new Enumeration<CodeSystemContentMode>(this, CodeSystemContentMode.COMPLETE, code);
1936        if ("supplement".equals(codeString))
1937          return new Enumeration<CodeSystemContentMode>(this, CodeSystemContentMode.SUPPLEMENT, code);
1938        throw new FHIRException("Unknown CodeSystemContentMode code '"+codeString+"'");
1939        }
1940    public String toCode(CodeSystemContentMode code) {
1941      if (code == CodeSystemContentMode.NOTPRESENT)
1942        return "not-present";
1943      if (code == CodeSystemContentMode.EXAMPLE)
1944        return "example";
1945      if (code == CodeSystemContentMode.FRAGMENT)
1946        return "fragment";
1947      if (code == CodeSystemContentMode.COMPLETE)
1948        return "complete";
1949      if (code == CodeSystemContentMode.SUPPLEMENT)
1950        return "supplement";
1951      return "?";
1952      }
1953    public String toSystem(CodeSystemContentMode code) {
1954      return code.getSystem();
1955      }
1956    }
1957
1958    public enum CommonLanguages {
1959        /**
1960         * null
1961         */
1962        AR, 
1963        /**
1964         * null
1965         */
1966        BG, 
1967        /**
1968         * null
1969         */
1970        BGBG, 
1971        /**
1972         * null
1973         */
1974        BN, 
1975        /**
1976         * null
1977         */
1978        CS, 
1979        /**
1980         * null
1981         */
1982        CSCZ, 
1983        /**
1984         * null
1985         */
1986        BS, 
1987        /**
1988         * null
1989         */
1990        BSBA, 
1991        /**
1992         * null
1993         */
1994        DA, 
1995        /**
1996         * null
1997         */
1998        DADK, 
1999        /**
2000         * null
2001         */
2002        DE, 
2003        /**
2004         * null
2005         */
2006        DEAT, 
2007        /**
2008         * null
2009         */
2010        DECH, 
2011        /**
2012         * null
2013         */
2014        DEDE, 
2015        /**
2016         * null
2017         */
2018        EL, 
2019        /**
2020         * null
2021         */
2022        ELGR, 
2023        /**
2024         * null
2025         */
2026        EN, 
2027        /**
2028         * null
2029         */
2030        ENAU, 
2031        /**
2032         * null
2033         */
2034        ENCA, 
2035        /**
2036         * null
2037         */
2038        ENGB, 
2039        /**
2040         * null
2041         */
2042        ENIN, 
2043        /**
2044         * null
2045         */
2046        ENNZ, 
2047        /**
2048         * null
2049         */
2050        ENSG, 
2051        /**
2052         * null
2053         */
2054        ENUS, 
2055        /**
2056         * null
2057         */
2058        ES, 
2059        /**
2060         * null
2061         */
2062        ESAR, 
2063        /**
2064         * null
2065         */
2066        ESES, 
2067        /**
2068         * null
2069         */
2070        ESUY, 
2071        /**
2072         * null
2073         */
2074        ET, 
2075        /**
2076         * null
2077         */
2078        ETEE, 
2079        /**
2080         * null
2081         */
2082        FI, 
2083        /**
2084         * null
2085         */
2086        FR, 
2087        /**
2088         * null
2089         */
2090        FRBE, 
2091        /**
2092         * null
2093         */
2094        FRCH, 
2095        /**
2096         * null
2097         */
2098        FRFR, 
2099        /**
2100         * null
2101         */
2102        FIFI, 
2103        /**
2104         * null
2105         */
2106        FRCA, 
2107        /**
2108         * null
2109         */
2110        FY, 
2111        /**
2112         * null
2113         */
2114        FYNL, 
2115        /**
2116         * null
2117         */
2118        HI, 
2119        /**
2120         * null
2121         */
2122        HR, 
2123        /**
2124         * null
2125         */
2126        HRHR, 
2127        /**
2128         * null
2129         */
2130        IS, 
2131        /**
2132         * null
2133         */
2134        ISIS, 
2135        /**
2136         * null
2137         */
2138        IT, 
2139        /**
2140         * null
2141         */
2142        ITCH, 
2143        /**
2144         * null
2145         */
2146        ITIT, 
2147        /**
2148         * null
2149         */
2150        JA, 
2151        /**
2152         * null
2153         */
2154        KO, 
2155        /**
2156         * null
2157         */
2158        LT, 
2159        /**
2160         * null
2161         */
2162        LTLT, 
2163        /**
2164         * null
2165         */
2166        LV, 
2167        /**
2168         * null
2169         */
2170        LVLV, 
2171        /**
2172         * null
2173         */
2174        NL, 
2175        /**
2176         * null
2177         */
2178        NLBE, 
2179        /**
2180         * null
2181         */
2182        NLNL, 
2183        /**
2184         * null
2185         */
2186        NO, 
2187        /**
2188         * null
2189         */
2190        NONO, 
2191        /**
2192         * null
2193         */
2194        PA, 
2195        /**
2196         * null
2197         */
2198        PL, 
2199        /**
2200         * null
2201         */
2202        PLPL, 
2203        /**
2204         * null
2205         */
2206        PT, 
2207        /**
2208         * null
2209         */
2210        PTPT, 
2211        /**
2212         * null
2213         */
2214        PTBR, 
2215        /**
2216         * null
2217         */
2218        RO, 
2219        /**
2220         * null
2221         */
2222        RORO, 
2223        /**
2224         * null
2225         */
2226        RU, 
2227        /**
2228         * null
2229         */
2230        RURU, 
2231        /**
2232         * null
2233         */
2234        SK, 
2235        /**
2236         * null
2237         */
2238        SKSK, 
2239        /**
2240         * null
2241         */
2242        SL, 
2243        /**
2244         * null
2245         */
2246        SLSI, 
2247        /**
2248         * null
2249         */
2250        SR, 
2251        /**
2252         * null
2253         */
2254        SRRS, 
2255        /**
2256         * null
2257         */
2258        SV, 
2259        /**
2260         * null
2261         */
2262        SVSE, 
2263        /**
2264         * null
2265         */
2266        TE, 
2267        /**
2268         * null
2269         */
2270        ZH, 
2271        /**
2272         * null
2273         */
2274        ZHCN, 
2275        /**
2276         * null
2277         */
2278        ZHHK, 
2279        /**
2280         * null
2281         */
2282        ZHSG, 
2283        /**
2284         * null
2285         */
2286        ZHTW, 
2287        /**
2288         * added to help the parsers
2289         */
2290        NULL;
2291        public static CommonLanguages fromCode(String codeString) throws FHIRException {
2292            if (codeString == null || "".equals(codeString))
2293                return null;
2294        if ("ar".equals(codeString))
2295          return AR;
2296        if ("bg".equals(codeString))
2297          return BG;
2298        if ("bg-BG".equals(codeString))
2299          return BGBG;
2300        if ("bn".equals(codeString))
2301          return BN;
2302        if ("cs".equals(codeString))
2303          return CS;
2304        if ("cs-CZ".equals(codeString))
2305          return CSCZ;
2306        if ("bs".equals(codeString))
2307          return BS;
2308        if ("bs-BA".equals(codeString))
2309          return BSBA;
2310        if ("da".equals(codeString))
2311          return DA;
2312        if ("da-DK".equals(codeString))
2313          return DADK;
2314        if ("de".equals(codeString))
2315          return DE;
2316        if ("de-AT".equals(codeString))
2317          return DEAT;
2318        if ("de-CH".equals(codeString))
2319          return DECH;
2320        if ("de-DE".equals(codeString))
2321          return DEDE;
2322        if ("el".equals(codeString))
2323          return EL;
2324        if ("el-GR".equals(codeString))
2325          return ELGR;
2326        if ("en".equals(codeString))
2327          return EN;
2328        if ("en-AU".equals(codeString))
2329          return ENAU;
2330        if ("en-CA".equals(codeString))
2331          return ENCA;
2332        if ("en-GB".equals(codeString))
2333          return ENGB;
2334        if ("en-IN".equals(codeString))
2335          return ENIN;
2336        if ("en-NZ".equals(codeString))
2337          return ENNZ;
2338        if ("en-SG".equals(codeString))
2339          return ENSG;
2340        if ("en-US".equals(codeString))
2341          return ENUS;
2342        if ("es".equals(codeString))
2343          return ES;
2344        if ("es-AR".equals(codeString))
2345          return ESAR;
2346        if ("es-ES".equals(codeString))
2347          return ESES;
2348        if ("es-UY".equals(codeString))
2349          return ESUY;
2350        if ("et".equals(codeString))
2351          return ET;
2352        if ("et-EE".equals(codeString))
2353          return ETEE;
2354        if ("fi".equals(codeString))
2355          return FI;
2356        if ("fr".equals(codeString))
2357          return FR;
2358        if ("fr-BE".equals(codeString))
2359          return FRBE;
2360        if ("fr-CH".equals(codeString))
2361          return FRCH;
2362        if ("fr-FR".equals(codeString))
2363          return FRFR;
2364        if ("fi-FI".equals(codeString))
2365          return FIFI;
2366        if ("fr-CA".equals(codeString))
2367          return FRCA;
2368        if ("fy".equals(codeString))
2369          return FY;
2370        if ("fy-NL".equals(codeString))
2371          return FYNL;
2372        if ("hi".equals(codeString))
2373          return HI;
2374        if ("hr".equals(codeString))
2375          return HR;
2376        if ("hr-HR".equals(codeString))
2377          return HRHR;
2378        if ("is".equals(codeString))
2379          return IS;
2380        if ("is-IS".equals(codeString))
2381          return ISIS;
2382        if ("it".equals(codeString))
2383          return IT;
2384        if ("it-CH".equals(codeString))
2385          return ITCH;
2386        if ("it-IT".equals(codeString))
2387          return ITIT;
2388        if ("ja".equals(codeString))
2389          return JA;
2390        if ("ko".equals(codeString))
2391          return KO;
2392        if ("lt".equals(codeString))
2393          return LT;
2394        if ("lt-LT".equals(codeString))
2395          return LTLT;
2396        if ("lv".equals(codeString))
2397          return LV;
2398        if ("lv-LV".equals(codeString))
2399          return LVLV;
2400        if ("nl".equals(codeString))
2401          return NL;
2402        if ("nl-BE".equals(codeString))
2403          return NLBE;
2404        if ("nl-NL".equals(codeString))
2405          return NLNL;
2406        if ("no".equals(codeString))
2407          return NO;
2408        if ("no-NO".equals(codeString))
2409          return NONO;
2410        if ("pa".equals(codeString))
2411          return PA;
2412        if ("pl".equals(codeString))
2413          return PL;
2414        if ("pl-PL".equals(codeString))
2415          return PLPL;
2416        if ("pt".equals(codeString))
2417          return PT;
2418        if ("pt-PT".equals(codeString))
2419          return PTPT;
2420        if ("pt-BR".equals(codeString))
2421          return PTBR;
2422        if ("ro".equals(codeString))
2423          return RO;
2424        if ("ro-RO".equals(codeString))
2425          return RORO;
2426        if ("ru".equals(codeString))
2427          return RU;
2428        if ("ru-RU".equals(codeString))
2429          return RURU;
2430        if ("sk".equals(codeString))
2431          return SK;
2432        if ("sk-SK".equals(codeString))
2433          return SKSK;
2434        if ("sl".equals(codeString))
2435          return SL;
2436        if ("sl-SI".equals(codeString))
2437          return SLSI;
2438        if ("sr".equals(codeString))
2439          return SR;
2440        if ("sr-RS".equals(codeString))
2441          return SRRS;
2442        if ("sv".equals(codeString))
2443          return SV;
2444        if ("sv-SE".equals(codeString))
2445          return SVSE;
2446        if ("te".equals(codeString))
2447          return TE;
2448        if ("zh".equals(codeString))
2449          return ZH;
2450        if ("zh-CN".equals(codeString))
2451          return ZHCN;
2452        if ("zh-HK".equals(codeString))
2453          return ZHHK;
2454        if ("zh-SG".equals(codeString))
2455          return ZHSG;
2456        if ("zh-TW".equals(codeString))
2457          return ZHTW;
2458        throw new FHIRException("Unknown CommonLanguages code '"+codeString+"'");
2459        }
2460        public static boolean isValidCode(String codeString) {
2461            if (codeString == null || "".equals(codeString))
2462                return false;
2463          return Utilities.existsInList(codeString, "ar", "bg", "bg-BG", "bn", "cs", "cs-CZ", "bs", "bs-BA", "da", "da-DK", "de", "de-AT", "de-CH", "de-DE", "el", "el-GR", "en", "en-AU", "en-CA", "en-GB", "en-IN", "en-NZ", "en-SG", "en-US", "es", "es-AR", "es-ES", "es-UY", "et", "et-EE", "fi", "fr", "fr-BE", "fr-CH", "fr-FR", "fi-FI", "fr-CA", "fy", "fy-NL", "hi", "hr", "hr-HR", "is", "is-IS", "it", "it-CH", "it-IT", "ja", "ko", "lt", "lt-LT", "lv", "lv-LV", "nl", "nl-BE", "nl-NL", "no", "no-NO", "pa", "pl", "pl-PL", "pt", "pt-PT", "pt-BR", "ro", "ro-RO", "ru", "ru-RU", "sk", "sk-SK", "sl", "sl-SI", "sr", "sr-RS", "sv", "sv-SE", "te", "zh", "zh-CN", "zh-HK", "zh-SG", "zh-TW");
2464        }
2465        public String toCode() {
2466          switch (this) {
2467            case AR: return "ar";
2468            case BG: return "bg";
2469            case BGBG: return "bg-BG";
2470            case BN: return "bn";
2471            case CS: return "cs";
2472            case CSCZ: return "cs-CZ";
2473            case BS: return "bs";
2474            case BSBA: return "bs-BA";
2475            case DA: return "da";
2476            case DADK: return "da-DK";
2477            case DE: return "de";
2478            case DEAT: return "de-AT";
2479            case DECH: return "de-CH";
2480            case DEDE: return "de-DE";
2481            case EL: return "el";
2482            case ELGR: return "el-GR";
2483            case EN: return "en";
2484            case ENAU: return "en-AU";
2485            case ENCA: return "en-CA";
2486            case ENGB: return "en-GB";
2487            case ENIN: return "en-IN";
2488            case ENNZ: return "en-NZ";
2489            case ENSG: return "en-SG";
2490            case ENUS: return "en-US";
2491            case ES: return "es";
2492            case ESAR: return "es-AR";
2493            case ESES: return "es-ES";
2494            case ESUY: return "es-UY";
2495            case ET: return "et";
2496            case ETEE: return "et-EE";
2497            case FI: return "fi";
2498            case FR: return "fr";
2499            case FRBE: return "fr-BE";
2500            case FRCH: return "fr-CH";
2501            case FRFR: return "fr-FR";
2502            case FIFI: return "fi-FI";
2503            case FRCA: return "fr-CA";
2504            case FY: return "fy";
2505            case FYNL: return "fy-NL";
2506            case HI: return "hi";
2507            case HR: return "hr";
2508            case HRHR: return "hr-HR";
2509            case IS: return "is";
2510            case ISIS: return "is-IS";
2511            case IT: return "it";
2512            case ITCH: return "it-CH";
2513            case ITIT: return "it-IT";
2514            case JA: return "ja";
2515            case KO: return "ko";
2516            case LT: return "lt";
2517            case LTLT: return "lt-LT";
2518            case LV: return "lv";
2519            case LVLV: return "lv-LV";
2520            case NL: return "nl";
2521            case NLBE: return "nl-BE";
2522            case NLNL: return "nl-NL";
2523            case NO: return "no";
2524            case NONO: return "no-NO";
2525            case PA: return "pa";
2526            case PL: return "pl";
2527            case PLPL: return "pl-PL";
2528            case PT: return "pt";
2529            case PTPT: return "pt-PT";
2530            case PTBR: return "pt-BR";
2531            case RO: return "ro";
2532            case RORO: return "ro-RO";
2533            case RU: return "ru";
2534            case RURU: return "ru-RU";
2535            case SK: return "sk";
2536            case SKSK: return "sk-SK";
2537            case SL: return "sl";
2538            case SLSI: return "sl-SI";
2539            case SR: return "sr";
2540            case SRRS: return "sr-RS";
2541            case SV: return "sv";
2542            case SVSE: return "sv-SE";
2543            case TE: return "te";
2544            case ZH: return "zh";
2545            case ZHCN: return "zh-CN";
2546            case ZHHK: return "zh-HK";
2547            case ZHSG: return "zh-SG";
2548            case ZHTW: return "zh-TW";
2549            case NULL: return null;
2550            default: return "?";
2551          }
2552        }
2553        public String getSystem() {
2554          switch (this) {
2555            case AR: return "urn:ietf:bcp:47";
2556            case BG: return "urn:ietf:bcp:47";
2557            case BGBG: return "urn:ietf:bcp:47";
2558            case BN: return "urn:ietf:bcp:47";
2559            case CS: return "urn:ietf:bcp:47";
2560            case CSCZ: return "urn:ietf:bcp:47";
2561            case BS: return "urn:ietf:bcp:47";
2562            case BSBA: return "urn:ietf:bcp:47";
2563            case DA: return "urn:ietf:bcp:47";
2564            case DADK: return "urn:ietf:bcp:47";
2565            case DE: return "urn:ietf:bcp:47";
2566            case DEAT: return "urn:ietf:bcp:47";
2567            case DECH: return "urn:ietf:bcp:47";
2568            case DEDE: return "urn:ietf:bcp:47";
2569            case EL: return "urn:ietf:bcp:47";
2570            case ELGR: return "urn:ietf:bcp:47";
2571            case EN: return "urn:ietf:bcp:47";
2572            case ENAU: return "urn:ietf:bcp:47";
2573            case ENCA: return "urn:ietf:bcp:47";
2574            case ENGB: return "urn:ietf:bcp:47";
2575            case ENIN: return "urn:ietf:bcp:47";
2576            case ENNZ: return "urn:ietf:bcp:47";
2577            case ENSG: return "urn:ietf:bcp:47";
2578            case ENUS: return "urn:ietf:bcp:47";
2579            case ES: return "urn:ietf:bcp:47";
2580            case ESAR: return "urn:ietf:bcp:47";
2581            case ESES: return "urn:ietf:bcp:47";
2582            case ESUY: return "urn:ietf:bcp:47";
2583            case ET: return "urn:ietf:bcp:47";
2584            case ETEE: return "urn:ietf:bcp:47";
2585            case FI: return "urn:ietf:bcp:47";
2586            case FR: return "urn:ietf:bcp:47";
2587            case FRBE: return "urn:ietf:bcp:47";
2588            case FRCH: return "urn:ietf:bcp:47";
2589            case FRFR: return "urn:ietf:bcp:47";
2590            case FIFI: return "urn:ietf:bcp:47";
2591            case FRCA: return "urn:ietf:bcp:47";
2592            case FY: return "urn:ietf:bcp:47";
2593            case FYNL: return "urn:ietf:bcp:47";
2594            case HI: return "urn:ietf:bcp:47";
2595            case HR: return "urn:ietf:bcp:47";
2596            case HRHR: return "urn:ietf:bcp:47";
2597            case IS: return "urn:ietf:bcp:47";
2598            case ISIS: return "urn:ietf:bcp:47";
2599            case IT: return "urn:ietf:bcp:47";
2600            case ITCH: return "urn:ietf:bcp:47";
2601            case ITIT: return "urn:ietf:bcp:47";
2602            case JA: return "urn:ietf:bcp:47";
2603            case KO: return "urn:ietf:bcp:47";
2604            case LT: return "urn:ietf:bcp:47";
2605            case LTLT: return "urn:ietf:bcp:47";
2606            case LV: return "urn:ietf:bcp:47";
2607            case LVLV: return "urn:ietf:bcp:47";
2608            case NL: return "urn:ietf:bcp:47";
2609            case NLBE: return "urn:ietf:bcp:47";
2610            case NLNL: return "urn:ietf:bcp:47";
2611            case NO: return "urn:ietf:bcp:47";
2612            case NONO: return "urn:ietf:bcp:47";
2613            case PA: return "urn:ietf:bcp:47";
2614            case PL: return "urn:ietf:bcp:47";
2615            case PLPL: return "urn:ietf:bcp:47";
2616            case PT: return "urn:ietf:bcp:47";
2617            case PTPT: return "urn:ietf:bcp:47";
2618            case PTBR: return "urn:ietf:bcp:47";
2619            case RO: return "urn:ietf:bcp:47";
2620            case RORO: return "urn:ietf:bcp:47";
2621            case RU: return "urn:ietf:bcp:47";
2622            case RURU: return "urn:ietf:bcp:47";
2623            case SK: return "urn:ietf:bcp:47";
2624            case SKSK: return "urn:ietf:bcp:47";
2625            case SL: return "urn:ietf:bcp:47";
2626            case SLSI: return "urn:ietf:bcp:47";
2627            case SR: return "urn:ietf:bcp:47";
2628            case SRRS: return "urn:ietf:bcp:47";
2629            case SV: return "urn:ietf:bcp:47";
2630            case SVSE: return "urn:ietf:bcp:47";
2631            case TE: return "urn:ietf:bcp:47";
2632            case ZH: return "urn:ietf:bcp:47";
2633            case ZHCN: return "urn:ietf:bcp:47";
2634            case ZHHK: return "urn:ietf:bcp:47";
2635            case ZHSG: return "urn:ietf:bcp:47";
2636            case ZHTW: return "urn:ietf:bcp:47";
2637            case NULL: return null;
2638            default: return "?";
2639          }
2640        }
2641        public String getDefinition() {
2642          switch (this) {
2643            case AR: return "";
2644            case BG: return "";
2645            case BGBG: return "";
2646            case BN: return "";
2647            case CS: return "";
2648            case CSCZ: return "";
2649            case BS: return "";
2650            case BSBA: return "";
2651            case DA: return "";
2652            case DADK: return "";
2653            case DE: return "";
2654            case DEAT: return "";
2655            case DECH: return "";
2656            case DEDE: return "";
2657            case EL: return "";
2658            case ELGR: return "";
2659            case EN: return "";
2660            case ENAU: return "";
2661            case ENCA: return "";
2662            case ENGB: return "";
2663            case ENIN: return "";
2664            case ENNZ: return "";
2665            case ENSG: return "";
2666            case ENUS: return "";
2667            case ES: return "";
2668            case ESAR: return "";
2669            case ESES: return "";
2670            case ESUY: return "";
2671            case ET: return "";
2672            case ETEE: return "";
2673            case FI: return "";
2674            case FR: return "";
2675            case FRBE: return "";
2676            case FRCH: return "";
2677            case FRFR: return "";
2678            case FIFI: return "";
2679            case FRCA: return "";
2680            case FY: return "";
2681            case FYNL: return "";
2682            case HI: return "";
2683            case HR: return "";
2684            case HRHR: return "";
2685            case IS: return "";
2686            case ISIS: return "";
2687            case IT: return "";
2688            case ITCH: return "";
2689            case ITIT: return "";
2690            case JA: return "";
2691            case KO: return "";
2692            case LT: return "";
2693            case LTLT: return "";
2694            case LV: return "";
2695            case LVLV: return "";
2696            case NL: return "";
2697            case NLBE: return "";
2698            case NLNL: return "";
2699            case NO: return "";
2700            case NONO: return "";
2701            case PA: return "";
2702            case PL: return "";
2703            case PLPL: return "";
2704            case PT: return "";
2705            case PTPT: return "";
2706            case PTBR: return "";
2707            case RO: return "";
2708            case RORO: return "";
2709            case RU: return "";
2710            case RURU: return "";
2711            case SK: return "";
2712            case SKSK: return "";
2713            case SL: return "";
2714            case SLSI: return "";
2715            case SR: return "";
2716            case SRRS: return "";
2717            case SV: return "";
2718            case SVSE: return "";
2719            case TE: return "";
2720            case ZH: return "";
2721            case ZHCN: return "";
2722            case ZHHK: return "";
2723            case ZHSG: return "";
2724            case ZHTW: return "";
2725            case NULL: return null;
2726            default: return "?";
2727          }
2728        }
2729        public String getDisplay() {
2730          switch (this) {
2731            case AR: return "Arabisk";
2732            case BG: return "Bulgarian";
2733            case BGBG: return "Bulgarian (Bulgaria)";
2734            case BN: return "Bengali";
2735            case CS: return "Czech";
2736            case CSCZ: return "Czech (Czechia)";
2737            case BS: return "Bosnian";
2738            case BSBA: return "Bosnian (Bosnia and Herzegovina))";
2739            case DA: return "Danish";
2740            case DADK: return "Danish (Denmark)";
2741            case DE: return "German";
2742            case DEAT: return "German (Austria)";
2743            case DECH: return "German (Switzerland)";
2744            case DEDE: return "German (Germany)";
2745            case EL: return "Greek";
2746            case ELGR: return "Greek (Greece)";
2747            case EN: return "English";
2748            case ENAU: return "English (Australia)";
2749            case ENCA: return "English (Canada)";
2750            case ENGB: return "English (Great Britain)";
2751            case ENIN: return "English (India)";
2752            case ENNZ: return "English (New Zealand)";
2753            case ENSG: return "English (Singapore)";
2754            case ENUS: return "English (United States)";
2755            case ES: return "Spanish";
2756            case ESAR: return "Spanish (Argentina)";
2757            case ESES: return "Spanish (Spain)";
2758            case ESUY: return "Spanish (Uruguay)";
2759            case ET: return "Estonian";
2760            case ETEE: return "Estonian (Estonia)";
2761            case FI: return "Finnish";
2762            case FR: return "French";
2763            case FRBE: return "French (Belgium)";
2764            case FRCH: return "French (Switzerland)";
2765            case FRFR: return "French (France)";
2766            case FIFI: return "Finnish (Finland)";
2767            case FRCA: return "French (Canada)";
2768            case FY: return "Frisian";
2769            case FYNL: return "Frisian (Netherlands)";
2770            case HI: return "Hindi";
2771            case HR: return "Croatian";
2772            case HRHR: return "Croatian (Croatia)";
2773            case IS: return "Icelandic";
2774            case ISIS: return "Icelandic (Iceland)";
2775            case IT: return "Italian";
2776            case ITCH: return "Italian (Switzerland)";
2777            case ITIT: return "Italian (Italy)";
2778            case JA: return "Japanese";
2779            case KO: return "Korean";
2780            case LT: return "Lithuanian";
2781            case LTLT: return "Lithuanian (Lithuania)";
2782            case LV: return "Latvian";
2783            case LVLV: return "Latvian (Latvia)";
2784            case NL: return "Dutch";
2785            case NLBE: return "Dutch (Belgium)";
2786            case NLNL: return "Dutch (Netherlands)";
2787            case NO: return "Norwegian";
2788            case NONO: return "Norwegian (Norway)";
2789            case PA: return "Punjabi";
2790            case PL: return "Polskie";
2791            case PLPL: return "Polish (Poland)";
2792            case PT: return "Portuguese";
2793            case PTPT: return "Portuguese (Portugal)";
2794            case PTBR: return "Portuguese (Brazil)";
2795            case RO: return "Romanian";
2796            case RORO: return "Romanian (Romania)";
2797            case RU: return "Russian";
2798            case RURU: return "Russian (Russia)";
2799            case SK: return "Slovakian";
2800            case SKSK: return "Slovakian (Slovakia)";
2801            case SL: return "Slovenian";
2802            case SLSI: return "Slovenian (Slovenia)";
2803            case SR: return "Serbian";
2804            case SRRS: return "Serbian (Serbia)";
2805            case SV: return "Swedish";
2806            case SVSE: return "Swedish (Sweden)";
2807            case TE: return "Telugu";
2808            case ZH: return "Chinese";
2809            case ZHCN: return "Chinese (China)";
2810            case ZHHK: return "Chinese (Hong Kong)";
2811            case ZHSG: return "Chinese (Singapore)";
2812            case ZHTW: return "Chinese (Taiwan)";
2813            case NULL: return null;
2814            default: return "?";
2815          }
2816        }
2817    }
2818
2819  public static class CommonLanguagesEnumFactory implements EnumFactory<CommonLanguages> {
2820    public CommonLanguages fromCode(String codeString) throws IllegalArgumentException {
2821      if (codeString == null || "".equals(codeString))
2822            if (codeString == null || "".equals(codeString))
2823                return null;
2824        if ("ar".equals(codeString))
2825          return CommonLanguages.AR;
2826        if ("bg".equals(codeString))
2827          return CommonLanguages.BG;
2828        if ("bg-BG".equals(codeString))
2829          return CommonLanguages.BGBG;
2830        if ("bn".equals(codeString))
2831          return CommonLanguages.BN;
2832        if ("cs".equals(codeString))
2833          return CommonLanguages.CS;
2834        if ("cs-CZ".equals(codeString))
2835          return CommonLanguages.CSCZ;
2836        if ("bs".equals(codeString))
2837          return CommonLanguages.BS;
2838        if ("bs-BA".equals(codeString))
2839          return CommonLanguages.BSBA;
2840        if ("da".equals(codeString))
2841          return CommonLanguages.DA;
2842        if ("da-DK".equals(codeString))
2843          return CommonLanguages.DADK;
2844        if ("de".equals(codeString))
2845          return CommonLanguages.DE;
2846        if ("de-AT".equals(codeString))
2847          return CommonLanguages.DEAT;
2848        if ("de-CH".equals(codeString))
2849          return CommonLanguages.DECH;
2850        if ("de-DE".equals(codeString))
2851          return CommonLanguages.DEDE;
2852        if ("el".equals(codeString))
2853          return CommonLanguages.EL;
2854        if ("el-GR".equals(codeString))
2855          return CommonLanguages.ELGR;
2856        if ("en".equals(codeString))
2857          return CommonLanguages.EN;
2858        if ("en-AU".equals(codeString))
2859          return CommonLanguages.ENAU;
2860        if ("en-CA".equals(codeString))
2861          return CommonLanguages.ENCA;
2862        if ("en-GB".equals(codeString))
2863          return CommonLanguages.ENGB;
2864        if ("en-IN".equals(codeString))
2865          return CommonLanguages.ENIN;
2866        if ("en-NZ".equals(codeString))
2867          return CommonLanguages.ENNZ;
2868        if ("en-SG".equals(codeString))
2869          return CommonLanguages.ENSG;
2870        if ("en-US".equals(codeString))
2871          return CommonLanguages.ENUS;
2872        if ("es".equals(codeString))
2873          return CommonLanguages.ES;
2874        if ("es-AR".equals(codeString))
2875          return CommonLanguages.ESAR;
2876        if ("es-ES".equals(codeString))
2877          return CommonLanguages.ESES;
2878        if ("es-UY".equals(codeString))
2879          return CommonLanguages.ESUY;
2880        if ("et".equals(codeString))
2881          return CommonLanguages.ET;
2882        if ("et-EE".equals(codeString))
2883          return CommonLanguages.ETEE;
2884        if ("fi".equals(codeString))
2885          return CommonLanguages.FI;
2886        if ("fr".equals(codeString))
2887          return CommonLanguages.FR;
2888        if ("fr-BE".equals(codeString))
2889          return CommonLanguages.FRBE;
2890        if ("fr-CH".equals(codeString))
2891          return CommonLanguages.FRCH;
2892        if ("fr-FR".equals(codeString))
2893          return CommonLanguages.FRFR;
2894        if ("fi-FI".equals(codeString))
2895          return CommonLanguages.FIFI;
2896        if ("fr-CA".equals(codeString))
2897          return CommonLanguages.FRCA;
2898        if ("fy".equals(codeString))
2899          return CommonLanguages.FY;
2900        if ("fy-NL".equals(codeString))
2901          return CommonLanguages.FYNL;
2902        if ("hi".equals(codeString))
2903          return CommonLanguages.HI;
2904        if ("hr".equals(codeString))
2905          return CommonLanguages.HR;
2906        if ("hr-HR".equals(codeString))
2907          return CommonLanguages.HRHR;
2908        if ("is".equals(codeString))
2909          return CommonLanguages.IS;
2910        if ("is-IS".equals(codeString))
2911          return CommonLanguages.ISIS;
2912        if ("it".equals(codeString))
2913          return CommonLanguages.IT;
2914        if ("it-CH".equals(codeString))
2915          return CommonLanguages.ITCH;
2916        if ("it-IT".equals(codeString))
2917          return CommonLanguages.ITIT;
2918        if ("ja".equals(codeString))
2919          return CommonLanguages.JA;
2920        if ("ko".equals(codeString))
2921          return CommonLanguages.KO;
2922        if ("lt".equals(codeString))
2923          return CommonLanguages.LT;
2924        if ("lt-LT".equals(codeString))
2925          return CommonLanguages.LTLT;
2926        if ("lv".equals(codeString))
2927          return CommonLanguages.LV;
2928        if ("lv-LV".equals(codeString))
2929          return CommonLanguages.LVLV;
2930        if ("nl".equals(codeString))
2931          return CommonLanguages.NL;
2932        if ("nl-BE".equals(codeString))
2933          return CommonLanguages.NLBE;
2934        if ("nl-NL".equals(codeString))
2935          return CommonLanguages.NLNL;
2936        if ("no".equals(codeString))
2937          return CommonLanguages.NO;
2938        if ("no-NO".equals(codeString))
2939          return CommonLanguages.NONO;
2940        if ("pa".equals(codeString))
2941          return CommonLanguages.PA;
2942        if ("pl".equals(codeString))
2943          return CommonLanguages.PL;
2944        if ("pl-PL".equals(codeString))
2945          return CommonLanguages.PLPL;
2946        if ("pt".equals(codeString))
2947          return CommonLanguages.PT;
2948        if ("pt-PT".equals(codeString))
2949          return CommonLanguages.PTPT;
2950        if ("pt-BR".equals(codeString))
2951          return CommonLanguages.PTBR;
2952        if ("ro".equals(codeString))
2953          return CommonLanguages.RO;
2954        if ("ro-RO".equals(codeString))
2955          return CommonLanguages.RORO;
2956        if ("ru".equals(codeString))
2957          return CommonLanguages.RU;
2958        if ("ru-RU".equals(codeString))
2959          return CommonLanguages.RURU;
2960        if ("sk".equals(codeString))
2961          return CommonLanguages.SK;
2962        if ("sk-SK".equals(codeString))
2963          return CommonLanguages.SKSK;
2964        if ("sl".equals(codeString))
2965          return CommonLanguages.SL;
2966        if ("sl-SI".equals(codeString))
2967          return CommonLanguages.SLSI;
2968        if ("sr".equals(codeString))
2969          return CommonLanguages.SR;
2970        if ("sr-RS".equals(codeString))
2971          return CommonLanguages.SRRS;
2972        if ("sv".equals(codeString))
2973          return CommonLanguages.SV;
2974        if ("sv-SE".equals(codeString))
2975          return CommonLanguages.SVSE;
2976        if ("te".equals(codeString))
2977          return CommonLanguages.TE;
2978        if ("zh".equals(codeString))
2979          return CommonLanguages.ZH;
2980        if ("zh-CN".equals(codeString))
2981          return CommonLanguages.ZHCN;
2982        if ("zh-HK".equals(codeString))
2983          return CommonLanguages.ZHHK;
2984        if ("zh-SG".equals(codeString))
2985          return CommonLanguages.ZHSG;
2986        if ("zh-TW".equals(codeString))
2987          return CommonLanguages.ZHTW;
2988        throw new IllegalArgumentException("Unknown CommonLanguages code '"+codeString+"'");
2989        }
2990
2991        public Enumeration<CommonLanguages> fromType(PrimitiveType<?> code) throws FHIRException {
2992          if (code == null)
2993            return null;
2994          if (code.isEmpty())
2995            return new Enumeration<CommonLanguages>(this, CommonLanguages.NULL, code);
2996          String codeString = ((PrimitiveType) code).asStringValue();
2997          if (codeString == null || "".equals(codeString))
2998            return new Enumeration<CommonLanguages>(this, CommonLanguages.NULL, code);
2999        if ("ar".equals(codeString))
3000          return new Enumeration<CommonLanguages>(this, CommonLanguages.AR, code);
3001        if ("bg".equals(codeString))
3002          return new Enumeration<CommonLanguages>(this, CommonLanguages.BG, code);
3003        if ("bg-BG".equals(codeString))
3004          return new Enumeration<CommonLanguages>(this, CommonLanguages.BGBG, code);
3005        if ("bn".equals(codeString))
3006          return new Enumeration<CommonLanguages>(this, CommonLanguages.BN, code);
3007        if ("cs".equals(codeString))
3008          return new Enumeration<CommonLanguages>(this, CommonLanguages.CS, code);
3009        if ("cs-CZ".equals(codeString))
3010          return new Enumeration<CommonLanguages>(this, CommonLanguages.CSCZ, code);
3011        if ("bs".equals(codeString))
3012          return new Enumeration<CommonLanguages>(this, CommonLanguages.BS, code);
3013        if ("bs-BA".equals(codeString))
3014          return new Enumeration<CommonLanguages>(this, CommonLanguages.BSBA, code);
3015        if ("da".equals(codeString))
3016          return new Enumeration<CommonLanguages>(this, CommonLanguages.DA, code);
3017        if ("da-DK".equals(codeString))
3018          return new Enumeration<CommonLanguages>(this, CommonLanguages.DADK, code);
3019        if ("de".equals(codeString))
3020          return new Enumeration<CommonLanguages>(this, CommonLanguages.DE, code);
3021        if ("de-AT".equals(codeString))
3022          return new Enumeration<CommonLanguages>(this, CommonLanguages.DEAT, code);
3023        if ("de-CH".equals(codeString))
3024          return new Enumeration<CommonLanguages>(this, CommonLanguages.DECH, code);
3025        if ("de-DE".equals(codeString))
3026          return new Enumeration<CommonLanguages>(this, CommonLanguages.DEDE, code);
3027        if ("el".equals(codeString))
3028          return new Enumeration<CommonLanguages>(this, CommonLanguages.EL, code);
3029        if ("el-GR".equals(codeString))
3030          return new Enumeration<CommonLanguages>(this, CommonLanguages.ELGR, code);
3031        if ("en".equals(codeString))
3032          return new Enumeration<CommonLanguages>(this, CommonLanguages.EN, code);
3033        if ("en-AU".equals(codeString))
3034          return new Enumeration<CommonLanguages>(this, CommonLanguages.ENAU, code);
3035        if ("en-CA".equals(codeString))
3036          return new Enumeration<CommonLanguages>(this, CommonLanguages.ENCA, code);
3037        if ("en-GB".equals(codeString))
3038          return new Enumeration<CommonLanguages>(this, CommonLanguages.ENGB, code);
3039        if ("en-IN".equals(codeString))
3040          return new Enumeration<CommonLanguages>(this, CommonLanguages.ENIN, code);
3041        if ("en-NZ".equals(codeString))
3042          return new Enumeration<CommonLanguages>(this, CommonLanguages.ENNZ, code);
3043        if ("en-SG".equals(codeString))
3044          return new Enumeration<CommonLanguages>(this, CommonLanguages.ENSG, code);
3045        if ("en-US".equals(codeString))
3046          return new Enumeration<CommonLanguages>(this, CommonLanguages.ENUS, code);
3047        if ("es".equals(codeString))
3048          return new Enumeration<CommonLanguages>(this, CommonLanguages.ES, code);
3049        if ("es-AR".equals(codeString))
3050          return new Enumeration<CommonLanguages>(this, CommonLanguages.ESAR, code);
3051        if ("es-ES".equals(codeString))
3052          return new Enumeration<CommonLanguages>(this, CommonLanguages.ESES, code);
3053        if ("es-UY".equals(codeString))
3054          return new Enumeration<CommonLanguages>(this, CommonLanguages.ESUY, code);
3055        if ("et".equals(codeString))
3056          return new Enumeration<CommonLanguages>(this, CommonLanguages.ET, code);
3057        if ("et-EE".equals(codeString))
3058          return new Enumeration<CommonLanguages>(this, CommonLanguages.ETEE, code);
3059        if ("fi".equals(codeString))
3060          return new Enumeration<CommonLanguages>(this, CommonLanguages.FI, code);
3061        if ("fr".equals(codeString))
3062          return new Enumeration<CommonLanguages>(this, CommonLanguages.FR, code);
3063        if ("fr-BE".equals(codeString))
3064          return new Enumeration<CommonLanguages>(this, CommonLanguages.FRBE, code);
3065        if ("fr-CH".equals(codeString))
3066          return new Enumeration<CommonLanguages>(this, CommonLanguages.FRCH, code);
3067        if ("fr-FR".equals(codeString))
3068          return new Enumeration<CommonLanguages>(this, CommonLanguages.FRFR, code);
3069        if ("fi-FI".equals(codeString))
3070          return new Enumeration<CommonLanguages>(this, CommonLanguages.FIFI, code);
3071        if ("fr-CA".equals(codeString))
3072          return new Enumeration<CommonLanguages>(this, CommonLanguages.FRCA, code);
3073        if ("fy".equals(codeString))
3074          return new Enumeration<CommonLanguages>(this, CommonLanguages.FY, code);
3075        if ("fy-NL".equals(codeString))
3076          return new Enumeration<CommonLanguages>(this, CommonLanguages.FYNL, code);
3077        if ("hi".equals(codeString))
3078          return new Enumeration<CommonLanguages>(this, CommonLanguages.HI, code);
3079        if ("hr".equals(codeString))
3080          return new Enumeration<CommonLanguages>(this, CommonLanguages.HR, code);
3081        if ("hr-HR".equals(codeString))
3082          return new Enumeration<CommonLanguages>(this, CommonLanguages.HRHR, code);
3083        if ("is".equals(codeString))
3084          return new Enumeration<CommonLanguages>(this, CommonLanguages.IS, code);
3085        if ("is-IS".equals(codeString))
3086          return new Enumeration<CommonLanguages>(this, CommonLanguages.ISIS, code);
3087        if ("it".equals(codeString))
3088          return new Enumeration<CommonLanguages>(this, CommonLanguages.IT, code);
3089        if ("it-CH".equals(codeString))
3090          return new Enumeration<CommonLanguages>(this, CommonLanguages.ITCH, code);
3091        if ("it-IT".equals(codeString))
3092          return new Enumeration<CommonLanguages>(this, CommonLanguages.ITIT, code);
3093        if ("ja".equals(codeString))
3094          return new Enumeration<CommonLanguages>(this, CommonLanguages.JA, code);
3095        if ("ko".equals(codeString))
3096          return new Enumeration<CommonLanguages>(this, CommonLanguages.KO, code);
3097        if ("lt".equals(codeString))
3098          return new Enumeration<CommonLanguages>(this, CommonLanguages.LT, code);
3099        if ("lt-LT".equals(codeString))
3100          return new Enumeration<CommonLanguages>(this, CommonLanguages.LTLT, code);
3101        if ("lv".equals(codeString))
3102          return new Enumeration<CommonLanguages>(this, CommonLanguages.LV, code);
3103        if ("lv-LV".equals(codeString))
3104          return new Enumeration<CommonLanguages>(this, CommonLanguages.LVLV, code);
3105        if ("nl".equals(codeString))
3106          return new Enumeration<CommonLanguages>(this, CommonLanguages.NL, code);
3107        if ("nl-BE".equals(codeString))
3108          return new Enumeration<CommonLanguages>(this, CommonLanguages.NLBE, code);
3109        if ("nl-NL".equals(codeString))
3110          return new Enumeration<CommonLanguages>(this, CommonLanguages.NLNL, code);
3111        if ("no".equals(codeString))
3112          return new Enumeration<CommonLanguages>(this, CommonLanguages.NO, code);
3113        if ("no-NO".equals(codeString))
3114          return new Enumeration<CommonLanguages>(this, CommonLanguages.NONO, code);
3115        if ("pa".equals(codeString))
3116          return new Enumeration<CommonLanguages>(this, CommonLanguages.PA, code);
3117        if ("pl".equals(codeString))
3118          return new Enumeration<CommonLanguages>(this, CommonLanguages.PL, code);
3119        if ("pl-PL".equals(codeString))
3120          return new Enumeration<CommonLanguages>(this, CommonLanguages.PLPL, code);
3121        if ("pt".equals(codeString))
3122          return new Enumeration<CommonLanguages>(this, CommonLanguages.PT, code);
3123        if ("pt-PT".equals(codeString))
3124          return new Enumeration<CommonLanguages>(this, CommonLanguages.PTPT, code);
3125        if ("pt-BR".equals(codeString))
3126          return new Enumeration<CommonLanguages>(this, CommonLanguages.PTBR, code);
3127        if ("ro".equals(codeString))
3128          return new Enumeration<CommonLanguages>(this, CommonLanguages.RO, code);
3129        if ("ro-RO".equals(codeString))
3130          return new Enumeration<CommonLanguages>(this, CommonLanguages.RORO, code);
3131        if ("ru".equals(codeString))
3132          return new Enumeration<CommonLanguages>(this, CommonLanguages.RU, code);
3133        if ("ru-RU".equals(codeString))
3134          return new Enumeration<CommonLanguages>(this, CommonLanguages.RURU, code);
3135        if ("sk".equals(codeString))
3136          return new Enumeration<CommonLanguages>(this, CommonLanguages.SK, code);
3137        if ("sk-SK".equals(codeString))
3138          return new Enumeration<CommonLanguages>(this, CommonLanguages.SKSK, code);
3139        if ("sl".equals(codeString))
3140          return new Enumeration<CommonLanguages>(this, CommonLanguages.SL, code);
3141        if ("sl-SI".equals(codeString))
3142          return new Enumeration<CommonLanguages>(this, CommonLanguages.SLSI, code);
3143        if ("sr".equals(codeString))
3144          return new Enumeration<CommonLanguages>(this, CommonLanguages.SR, code);
3145        if ("sr-RS".equals(codeString))
3146          return new Enumeration<CommonLanguages>(this, CommonLanguages.SRRS, code);
3147        if ("sv".equals(codeString))
3148          return new Enumeration<CommonLanguages>(this, CommonLanguages.SV, code);
3149        if ("sv-SE".equals(codeString))
3150          return new Enumeration<CommonLanguages>(this, CommonLanguages.SVSE, code);
3151        if ("te".equals(codeString))
3152          return new Enumeration<CommonLanguages>(this, CommonLanguages.TE, code);
3153        if ("zh".equals(codeString))
3154          return new Enumeration<CommonLanguages>(this, CommonLanguages.ZH, code);
3155        if ("zh-CN".equals(codeString))
3156          return new Enumeration<CommonLanguages>(this, CommonLanguages.ZHCN, code);
3157        if ("zh-HK".equals(codeString))
3158          return new Enumeration<CommonLanguages>(this, CommonLanguages.ZHHK, code);
3159        if ("zh-SG".equals(codeString))
3160          return new Enumeration<CommonLanguages>(this, CommonLanguages.ZHSG, code);
3161        if ("zh-TW".equals(codeString))
3162          return new Enumeration<CommonLanguages>(this, CommonLanguages.ZHTW, code);
3163        throw new FHIRException("Unknown CommonLanguages code '"+codeString+"'");
3164        }
3165    public String toCode(CommonLanguages code) {
3166      if (code == CommonLanguages.AR)
3167        return "ar";
3168      if (code == CommonLanguages.BG)
3169        return "bg";
3170      if (code == CommonLanguages.BGBG)
3171        return "bg-BG";
3172      if (code == CommonLanguages.BN)
3173        return "bn";
3174      if (code == CommonLanguages.CS)
3175        return "cs";
3176      if (code == CommonLanguages.CSCZ)
3177        return "cs-CZ";
3178      if (code == CommonLanguages.BS)
3179        return "bs";
3180      if (code == CommonLanguages.BSBA)
3181        return "bs-BA";
3182      if (code == CommonLanguages.DA)
3183        return "da";
3184      if (code == CommonLanguages.DADK)
3185        return "da-DK";
3186      if (code == CommonLanguages.DE)
3187        return "de";
3188      if (code == CommonLanguages.DEAT)
3189        return "de-AT";
3190      if (code == CommonLanguages.DECH)
3191        return "de-CH";
3192      if (code == CommonLanguages.DEDE)
3193        return "de-DE";
3194      if (code == CommonLanguages.EL)
3195        return "el";
3196      if (code == CommonLanguages.ELGR)
3197        return "el-GR";
3198      if (code == CommonLanguages.EN)
3199        return "en";
3200      if (code == CommonLanguages.ENAU)
3201        return "en-AU";
3202      if (code == CommonLanguages.ENCA)
3203        return "en-CA";
3204      if (code == CommonLanguages.ENGB)
3205        return "en-GB";
3206      if (code == CommonLanguages.ENIN)
3207        return "en-IN";
3208      if (code == CommonLanguages.ENNZ)
3209        return "en-NZ";
3210      if (code == CommonLanguages.ENSG)
3211        return "en-SG";
3212      if (code == CommonLanguages.ENUS)
3213        return "en-US";
3214      if (code == CommonLanguages.ES)
3215        return "es";
3216      if (code == CommonLanguages.ESAR)
3217        return "es-AR";
3218      if (code == CommonLanguages.ESES)
3219        return "es-ES";
3220      if (code == CommonLanguages.ESUY)
3221        return "es-UY";
3222      if (code == CommonLanguages.ET)
3223        return "et";
3224      if (code == CommonLanguages.ETEE)
3225        return "et-EE";
3226      if (code == CommonLanguages.FI)
3227        return "fi";
3228      if (code == CommonLanguages.FR)
3229        return "fr";
3230      if (code == CommonLanguages.FRBE)
3231        return "fr-BE";
3232      if (code == CommonLanguages.FRCH)
3233        return "fr-CH";
3234      if (code == CommonLanguages.FRFR)
3235        return "fr-FR";
3236      if (code == CommonLanguages.FIFI)
3237        return "fi-FI";
3238      if (code == CommonLanguages.FRCA)
3239        return "fr-CA";
3240      if (code == CommonLanguages.FY)
3241        return "fy";
3242      if (code == CommonLanguages.FYNL)
3243        return "fy-NL";
3244      if (code == CommonLanguages.HI)
3245        return "hi";
3246      if (code == CommonLanguages.HR)
3247        return "hr";
3248      if (code == CommonLanguages.HRHR)
3249        return "hr-HR";
3250      if (code == CommonLanguages.IS)
3251        return "is";
3252      if (code == CommonLanguages.ISIS)
3253        return "is-IS";
3254      if (code == CommonLanguages.IT)
3255        return "it";
3256      if (code == CommonLanguages.ITCH)
3257        return "it-CH";
3258      if (code == CommonLanguages.ITIT)
3259        return "it-IT";
3260      if (code == CommonLanguages.JA)
3261        return "ja";
3262      if (code == CommonLanguages.KO)
3263        return "ko";
3264      if (code == CommonLanguages.LT)
3265        return "lt";
3266      if (code == CommonLanguages.LTLT)
3267        return "lt-LT";
3268      if (code == CommonLanguages.LV)
3269        return "lv";
3270      if (code == CommonLanguages.LVLV)
3271        return "lv-LV";
3272      if (code == CommonLanguages.NL)
3273        return "nl";
3274      if (code == CommonLanguages.NLBE)
3275        return "nl-BE";
3276      if (code == CommonLanguages.NLNL)
3277        return "nl-NL";
3278      if (code == CommonLanguages.NO)
3279        return "no";
3280      if (code == CommonLanguages.NONO)
3281        return "no-NO";
3282      if (code == CommonLanguages.PA)
3283        return "pa";
3284      if (code == CommonLanguages.PL)
3285        return "pl";
3286      if (code == CommonLanguages.PLPL)
3287        return "pl-PL";
3288      if (code == CommonLanguages.PT)
3289        return "pt";
3290      if (code == CommonLanguages.PTPT)
3291        return "pt-PT";
3292      if (code == CommonLanguages.PTBR)
3293        return "pt-BR";
3294      if (code == CommonLanguages.RO)
3295        return "ro";
3296      if (code == CommonLanguages.RORO)
3297        return "ro-RO";
3298      if (code == CommonLanguages.RU)
3299        return "ru";
3300      if (code == CommonLanguages.RURU)
3301        return "ru-RU";
3302      if (code == CommonLanguages.SK)
3303        return "sk";
3304      if (code == CommonLanguages.SKSK)
3305        return "sk-SK";
3306      if (code == CommonLanguages.SL)
3307        return "sl";
3308      if (code == CommonLanguages.SLSI)
3309        return "sl-SI";
3310      if (code == CommonLanguages.SR)
3311        return "sr";
3312      if (code == CommonLanguages.SRRS)
3313        return "sr-RS";
3314      if (code == CommonLanguages.SV)
3315        return "sv";
3316      if (code == CommonLanguages.SVSE)
3317        return "sv-SE";
3318      if (code == CommonLanguages.TE)
3319        return "te";
3320      if (code == CommonLanguages.ZH)
3321        return "zh";
3322      if (code == CommonLanguages.ZHCN)
3323        return "zh-CN";
3324      if (code == CommonLanguages.ZHHK)
3325        return "zh-HK";
3326      if (code == CommonLanguages.ZHSG)
3327        return "zh-SG";
3328      if (code == CommonLanguages.ZHTW)
3329        return "zh-TW";
3330      return "?";
3331      }
3332    public String toSystem(CommonLanguages code) {
3333      return code.getSystem();
3334      }
3335    }
3336
3337    public enum CompartmentType {
3338        /**
3339         * The compartment definition is for the patient compartment.
3340         */
3341        PATIENT, 
3342        /**
3343         * The compartment definition is for the encounter compartment.
3344         */
3345        ENCOUNTER, 
3346        /**
3347         * The compartment definition is for the related-person compartment.
3348         */
3349        RELATEDPERSON, 
3350        /**
3351         * The compartment definition is for the practitioner compartment.
3352         */
3353        PRACTITIONER, 
3354        /**
3355         * The compartment definition is for the device compartment.
3356         */
3357        DEVICE, 
3358        /**
3359         * The compartment definition is for the episodeofcare compartment.
3360         */
3361        EPISODEOFCARE, 
3362        /**
3363         * added to help the parsers
3364         */
3365        NULL;
3366        public static CompartmentType fromCode(String codeString) throws FHIRException {
3367            if (codeString == null || "".equals(codeString))
3368                return null;
3369        if ("Patient".equals(codeString))
3370          return PATIENT;
3371        if ("Encounter".equals(codeString))
3372          return ENCOUNTER;
3373        if ("RelatedPerson".equals(codeString))
3374          return RELATEDPERSON;
3375        if ("Practitioner".equals(codeString))
3376          return PRACTITIONER;
3377        if ("Device".equals(codeString))
3378          return DEVICE;
3379        if ("EpisodeOfCare".equals(codeString))
3380          return EPISODEOFCARE;
3381        throw new FHIRException("Unknown CompartmentType code '"+codeString+"'");
3382        }
3383        public static boolean isValidCode(String codeString) {
3384            if (codeString == null || "".equals(codeString))
3385                return false;
3386          return Utilities.existsInList(codeString, "Patient", "Encounter", "RelatedPerson", "Practitioner", "Device", "EpisodeOfCare");
3387        }
3388        public String toCode() {
3389          switch (this) {
3390            case PATIENT: return "Patient";
3391            case ENCOUNTER: return "Encounter";
3392            case RELATEDPERSON: return "RelatedPerson";
3393            case PRACTITIONER: return "Practitioner";
3394            case DEVICE: return "Device";
3395            case EPISODEOFCARE: return "EpisodeOfCare";
3396            case NULL: return null;
3397            default: return "?";
3398          }
3399        }
3400        public String getSystem() {
3401          switch (this) {
3402            case PATIENT: return "http://hl7.org/fhir/compartment-type";
3403            case ENCOUNTER: return "http://hl7.org/fhir/compartment-type";
3404            case RELATEDPERSON: return "http://hl7.org/fhir/compartment-type";
3405            case PRACTITIONER: return "http://hl7.org/fhir/compartment-type";
3406            case DEVICE: return "http://hl7.org/fhir/compartment-type";
3407            case EPISODEOFCARE: return "http://hl7.org/fhir/compartment-type";
3408            case NULL: return null;
3409            default: return "?";
3410          }
3411        }
3412        public String getDefinition() {
3413          switch (this) {
3414            case PATIENT: return "The compartment definition is for the patient compartment.";
3415            case ENCOUNTER: return "The compartment definition is for the encounter compartment.";
3416            case RELATEDPERSON: return "The compartment definition is for the related-person compartment.";
3417            case PRACTITIONER: return "The compartment definition is for the practitioner compartment.";
3418            case DEVICE: return "The compartment definition is for the device compartment.";
3419            case EPISODEOFCARE: return "The compartment definition is for the episodeofcare compartment.";
3420            case NULL: return null;
3421            default: return "?";
3422          }
3423        }
3424        public String getDisplay() {
3425          switch (this) {
3426            case PATIENT: return "Patient";
3427            case ENCOUNTER: return "Encounter";
3428            case RELATEDPERSON: return "RelatedPerson";
3429            case PRACTITIONER: return "Practitioner";
3430            case DEVICE: return "Device";
3431            case EPISODEOFCARE: return "EpisodeOfCare";
3432            case NULL: return null;
3433            default: return "?";
3434          }
3435        }
3436    }
3437
3438  public static class CompartmentTypeEnumFactory implements EnumFactory<CompartmentType> {
3439    public CompartmentType fromCode(String codeString) throws IllegalArgumentException {
3440      if (codeString == null || "".equals(codeString))
3441            if (codeString == null || "".equals(codeString))
3442                return null;
3443        if ("Patient".equals(codeString))
3444          return CompartmentType.PATIENT;
3445        if ("Encounter".equals(codeString))
3446          return CompartmentType.ENCOUNTER;
3447        if ("RelatedPerson".equals(codeString))
3448          return CompartmentType.RELATEDPERSON;
3449        if ("Practitioner".equals(codeString))
3450          return CompartmentType.PRACTITIONER;
3451        if ("Device".equals(codeString))
3452          return CompartmentType.DEVICE;
3453        if ("EpisodeOfCare".equals(codeString))
3454          return CompartmentType.EPISODEOFCARE;
3455        throw new IllegalArgumentException("Unknown CompartmentType code '"+codeString+"'");
3456        }
3457
3458        public Enumeration<CompartmentType> fromType(PrimitiveType<?> code) throws FHIRException {
3459          if (code == null)
3460            return null;
3461          if (code.isEmpty())
3462            return new Enumeration<CompartmentType>(this, CompartmentType.NULL, code);
3463          String codeString = ((PrimitiveType) code).asStringValue();
3464          if (codeString == null || "".equals(codeString))
3465            return new Enumeration<CompartmentType>(this, CompartmentType.NULL, code);
3466        if ("Patient".equals(codeString))
3467          return new Enumeration<CompartmentType>(this, CompartmentType.PATIENT, code);
3468        if ("Encounter".equals(codeString))
3469          return new Enumeration<CompartmentType>(this, CompartmentType.ENCOUNTER, code);
3470        if ("RelatedPerson".equals(codeString))
3471          return new Enumeration<CompartmentType>(this, CompartmentType.RELATEDPERSON, code);
3472        if ("Practitioner".equals(codeString))
3473          return new Enumeration<CompartmentType>(this, CompartmentType.PRACTITIONER, code);
3474        if ("Device".equals(codeString))
3475          return new Enumeration<CompartmentType>(this, CompartmentType.DEVICE, code);
3476        if ("EpisodeOfCare".equals(codeString))
3477          return new Enumeration<CompartmentType>(this, CompartmentType.EPISODEOFCARE, code);
3478        throw new FHIRException("Unknown CompartmentType code '"+codeString+"'");
3479        }
3480    public String toCode(CompartmentType code) {
3481      if (code == CompartmentType.PATIENT)
3482        return "Patient";
3483      if (code == CompartmentType.ENCOUNTER)
3484        return "Encounter";
3485      if (code == CompartmentType.RELATEDPERSON)
3486        return "RelatedPerson";
3487      if (code == CompartmentType.PRACTITIONER)
3488        return "Practitioner";
3489      if (code == CompartmentType.DEVICE)
3490        return "Device";
3491      if (code == CompartmentType.EPISODEOFCARE)
3492        return "EpisodeOfCare";
3493      return "?";
3494      }
3495    public String toSystem(CompartmentType code) {
3496      return code.getSystem();
3497      }
3498    }
3499
3500    public enum CompositionStatus {
3501        /**
3502         * The existence of the composition is registered, but there is nothing yet available.
3503         */
3504        REGISTERED, 
3505        /**
3506         * This is a partial (e.g. initial, interim or preliminary) composition: data in the composition may be incomplete or unverified.
3507         */
3508        PARTIAL, 
3509        /**
3510         * Verified early results are available, but not all results are final.
3511         */
3512        PRELIMINARY, 
3513        /**
3514         * This version of the composition is complete and verified by an appropriate person and no further work is planned. Any subsequent updates would be on a new version of the composition.
3515         */
3516        FINAL, 
3517        /**
3518         * The composition content or the referenced resources have been modified (edited or added to) subsequent to being released as "final" and the composition is complete and verified by an authorized person.
3519         */
3520        AMENDED, 
3521        /**
3522         * Subsequent to being final, the composition content has been modified to correct an error in the composition or referenced results.
3523         */
3524        CORRECTED, 
3525        /**
3526         * Subsequent to being final, the composition content has been modified by adding new content. The existing content is unchanged.
3527         */
3528        APPENDED, 
3529        /**
3530         * The composition is unavailable because the measurement was not started or not completed (also sometimes called "aborted").
3531         */
3532        CANCELLED, 
3533        /**
3534         * The composition or document was originally created/issued in error, and this is an amendment that marks that the entire series should not be considered as valid.
3535         */
3536        ENTEREDINERROR, 
3537        /**
3538         * This composition has been withdrawn or superseded and should no longer be used.
3539         */
3540        DEPRECATED, 
3541        /**
3542         * The authoring/source system does not know which of the status values currently applies for this observation. Note: This concept is not to be used for "other" - one of the listed statuses is presumed to apply, but the authoring/source system does not know which.
3543         */
3544        UNKNOWN, 
3545        /**
3546         * added to help the parsers
3547         */
3548        NULL;
3549        public static CompositionStatus fromCode(String codeString) throws FHIRException {
3550            if (codeString == null || "".equals(codeString))
3551                return null;
3552        if ("registered".equals(codeString))
3553          return REGISTERED;
3554        if ("partial".equals(codeString))
3555          return PARTIAL;
3556        if ("preliminary".equals(codeString))
3557          return PRELIMINARY;
3558        if ("final".equals(codeString))
3559          return FINAL;
3560        if ("amended".equals(codeString))
3561          return AMENDED;
3562        if ("corrected".equals(codeString))
3563          return CORRECTED;
3564        if ("appended".equals(codeString))
3565          return APPENDED;
3566        if ("cancelled".equals(codeString))
3567          return CANCELLED;
3568        if ("entered-in-error".equals(codeString))
3569          return ENTEREDINERROR;
3570        if ("deprecated".equals(codeString))
3571          return DEPRECATED;
3572        if ("unknown".equals(codeString))
3573          return UNKNOWN;
3574        throw new FHIRException("Unknown CompositionStatus code '"+codeString+"'");
3575        }
3576        public static boolean isValidCode(String codeString) {
3577            if (codeString == null || "".equals(codeString))
3578                return false;
3579          return Utilities.existsInList(codeString, "registered", "partial", "preliminary", "final", "amended", "corrected", "appended", "cancelled", "entered-in-error", "deprecated", "unknown");
3580        }
3581        public String toCode() {
3582          switch (this) {
3583            case REGISTERED: return "registered";
3584            case PARTIAL: return "partial";
3585            case PRELIMINARY: return "preliminary";
3586            case FINAL: return "final";
3587            case AMENDED: return "amended";
3588            case CORRECTED: return "corrected";
3589            case APPENDED: return "appended";
3590            case CANCELLED: return "cancelled";
3591            case ENTEREDINERROR: return "entered-in-error";
3592            case DEPRECATED: return "deprecated";
3593            case UNKNOWN: return "unknown";
3594            case NULL: return null;
3595            default: return "?";
3596          }
3597        }
3598        public String getSystem() {
3599          switch (this) {
3600            case REGISTERED: return "http://hl7.org/fhir/composition-status";
3601            case PARTIAL: return "http://hl7.org/fhir/composition-status";
3602            case PRELIMINARY: return "http://hl7.org/fhir/composition-status";
3603            case FINAL: return "http://hl7.org/fhir/composition-status";
3604            case AMENDED: return "http://hl7.org/fhir/composition-status";
3605            case CORRECTED: return "http://hl7.org/fhir/composition-status";
3606            case APPENDED: return "http://hl7.org/fhir/composition-status";
3607            case CANCELLED: return "http://hl7.org/fhir/composition-status";
3608            case ENTEREDINERROR: return "http://hl7.org/fhir/composition-status";
3609            case DEPRECATED: return "http://hl7.org/fhir/composition-status";
3610            case UNKNOWN: return "http://hl7.org/fhir/composition-status";
3611            case NULL: return null;
3612            default: return "?";
3613          }
3614        }
3615        public String getDefinition() {
3616          switch (this) {
3617            case REGISTERED: return "The existence of the composition is registered, but there is nothing yet available.";
3618            case PARTIAL: return "This is a partial (e.g. initial, interim or preliminary) composition: data in the composition may be incomplete or unverified.";
3619            case PRELIMINARY: return "Verified early results are available, but not all results are final.";
3620            case FINAL: return "This version of the composition is complete and verified by an appropriate person and no further work is planned. Any subsequent updates would be on a new version of the composition.";
3621            case AMENDED: return "The composition content or the referenced resources have been modified (edited or added to) subsequent to being released as \"final\" and the composition is complete and verified by an authorized person.";
3622            case CORRECTED: return "Subsequent to being final, the composition content has been modified to correct an error in the composition or referenced results.";
3623            case APPENDED: return "Subsequent to being final, the composition content has been modified by adding new content. The existing content is unchanged.";
3624            case CANCELLED: return "The composition is unavailable because the measurement was not started or not completed (also sometimes called \"aborted\").";
3625            case ENTEREDINERROR: return "The composition or document was originally created/issued in error, and this is an amendment that marks that the entire series should not be considered as valid.";
3626            case DEPRECATED: return "This composition has been withdrawn or superseded and should no longer be used.";
3627            case UNKNOWN: return "The authoring/source system does not know which of the status values currently applies for this observation. Note: This concept is not to be used for \"other\" - one of the listed statuses is presumed to apply, but the authoring/source system does not know which.";
3628            case NULL: return null;
3629            default: return "?";
3630          }
3631        }
3632        public String getDisplay() {
3633          switch (this) {
3634            case REGISTERED: return "Registered";
3635            case PARTIAL: return "Partial";
3636            case PRELIMINARY: return "Preliminary";
3637            case FINAL: return "Final";
3638            case AMENDED: return "Amended";
3639            case CORRECTED: return "Corrected";
3640            case APPENDED: return "Appended";
3641            case CANCELLED: return "Cancelled";
3642            case ENTEREDINERROR: return "Entered in Error";
3643            case DEPRECATED: return "Deprecated";
3644            case UNKNOWN: return "Unknown";
3645            case NULL: return null;
3646            default: return "?";
3647          }
3648        }
3649    }
3650
3651  public static class CompositionStatusEnumFactory implements EnumFactory<CompositionStatus> {
3652    public CompositionStatus fromCode(String codeString) throws IllegalArgumentException {
3653      if (codeString == null || "".equals(codeString))
3654            if (codeString == null || "".equals(codeString))
3655                return null;
3656        if ("registered".equals(codeString))
3657          return CompositionStatus.REGISTERED;
3658        if ("partial".equals(codeString))
3659          return CompositionStatus.PARTIAL;
3660        if ("preliminary".equals(codeString))
3661          return CompositionStatus.PRELIMINARY;
3662        if ("final".equals(codeString))
3663          return CompositionStatus.FINAL;
3664        if ("amended".equals(codeString))
3665          return CompositionStatus.AMENDED;
3666        if ("corrected".equals(codeString))
3667          return CompositionStatus.CORRECTED;
3668        if ("appended".equals(codeString))
3669          return CompositionStatus.APPENDED;
3670        if ("cancelled".equals(codeString))
3671          return CompositionStatus.CANCELLED;
3672        if ("entered-in-error".equals(codeString))
3673          return CompositionStatus.ENTEREDINERROR;
3674        if ("deprecated".equals(codeString))
3675          return CompositionStatus.DEPRECATED;
3676        if ("unknown".equals(codeString))
3677          return CompositionStatus.UNKNOWN;
3678        throw new IllegalArgumentException("Unknown CompositionStatus code '"+codeString+"'");
3679        }
3680
3681        public Enumeration<CompositionStatus> fromType(PrimitiveType<?> code) throws FHIRException {
3682          if (code == null)
3683            return null;
3684          if (code.isEmpty())
3685            return new Enumeration<CompositionStatus>(this, CompositionStatus.NULL, code);
3686          String codeString = ((PrimitiveType) code).asStringValue();
3687          if (codeString == null || "".equals(codeString))
3688            return new Enumeration<CompositionStatus>(this, CompositionStatus.NULL, code);
3689        if ("registered".equals(codeString))
3690          return new Enumeration<CompositionStatus>(this, CompositionStatus.REGISTERED, code);
3691        if ("partial".equals(codeString))
3692          return new Enumeration<CompositionStatus>(this, CompositionStatus.PARTIAL, code);
3693        if ("preliminary".equals(codeString))
3694          return new Enumeration<CompositionStatus>(this, CompositionStatus.PRELIMINARY, code);
3695        if ("final".equals(codeString))
3696          return new Enumeration<CompositionStatus>(this, CompositionStatus.FINAL, code);
3697        if ("amended".equals(codeString))
3698          return new Enumeration<CompositionStatus>(this, CompositionStatus.AMENDED, code);
3699        if ("corrected".equals(codeString))
3700          return new Enumeration<CompositionStatus>(this, CompositionStatus.CORRECTED, code);
3701        if ("appended".equals(codeString))
3702          return new Enumeration<CompositionStatus>(this, CompositionStatus.APPENDED, code);
3703        if ("cancelled".equals(codeString))
3704          return new Enumeration<CompositionStatus>(this, CompositionStatus.CANCELLED, code);
3705        if ("entered-in-error".equals(codeString))
3706          return new Enumeration<CompositionStatus>(this, CompositionStatus.ENTEREDINERROR, code);
3707        if ("deprecated".equals(codeString))
3708          return new Enumeration<CompositionStatus>(this, CompositionStatus.DEPRECATED, code);
3709        if ("unknown".equals(codeString))
3710          return new Enumeration<CompositionStatus>(this, CompositionStatus.UNKNOWN, code);
3711        throw new FHIRException("Unknown CompositionStatus code '"+codeString+"'");
3712        }
3713    public String toCode(CompositionStatus code) {
3714      if (code == CompositionStatus.REGISTERED)
3715        return "registered";
3716      if (code == CompositionStatus.PARTIAL)
3717        return "partial";
3718      if (code == CompositionStatus.PRELIMINARY)
3719        return "preliminary";
3720      if (code == CompositionStatus.FINAL)
3721        return "final";
3722      if (code == CompositionStatus.AMENDED)
3723        return "amended";
3724      if (code == CompositionStatus.CORRECTED)
3725        return "corrected";
3726      if (code == CompositionStatus.APPENDED)
3727        return "appended";
3728      if (code == CompositionStatus.CANCELLED)
3729        return "cancelled";
3730      if (code == CompositionStatus.ENTEREDINERROR)
3731        return "entered-in-error";
3732      if (code == CompositionStatus.DEPRECATED)
3733        return "deprecated";
3734      if (code == CompositionStatus.UNKNOWN)
3735        return "unknown";
3736      return "?";
3737      }
3738    public String toSystem(CompositionStatus code) {
3739      return code.getSystem();
3740      }
3741    }
3742
3743    public enum ConceptMapRelationship {
3744        /**
3745         * The concepts are related to each other, but the exact relationship is not known.
3746         */
3747        RELATEDTO, 
3748        /**
3749         * The definitions of the concepts mean the same thing.
3750         */
3751        EQUIVALENT, 
3752        /**
3753         * The source concept is narrower in meaning than the target concept.
3754         */
3755        SOURCEISNARROWERTHANTARGET, 
3756        /**
3757         * The source concept is broader in meaning than the target concept.
3758         */
3759        SOURCEISBROADERTHANTARGET, 
3760        /**
3761         * This is an explicit assertion that the target concept is not related to the source concept.
3762         */
3763        NOTRELATEDTO, 
3764        /**
3765         * added to help the parsers
3766         */
3767        NULL;
3768        public static ConceptMapRelationship fromCode(String codeString) throws FHIRException {
3769            if (codeString == null || "".equals(codeString))
3770                return null;
3771        if ("related-to".equals(codeString))
3772          return RELATEDTO;
3773        if ("equivalent".equals(codeString))
3774          return EQUIVALENT;
3775        if ("source-is-narrower-than-target".equals(codeString))
3776          return SOURCEISNARROWERTHANTARGET;
3777        if ("source-is-broader-than-target".equals(codeString))
3778          return SOURCEISBROADERTHANTARGET;
3779        if ("not-related-to".equals(codeString))
3780          return NOTRELATEDTO;
3781        throw new FHIRException("Unknown ConceptMapRelationship code '"+codeString+"'");
3782        }
3783        public static boolean isValidCode(String codeString) {
3784            if (codeString == null || "".equals(codeString))
3785                return false;
3786          return Utilities.existsInList(codeString, "related-to", "equivalent", "source-is-narrower-than-target", "source-is-broader-than-target", "not-related-to");
3787        }
3788        public String toCode() {
3789          switch (this) {
3790            case RELATEDTO: return "related-to";
3791            case EQUIVALENT: return "equivalent";
3792            case SOURCEISNARROWERTHANTARGET: return "source-is-narrower-than-target";
3793            case SOURCEISBROADERTHANTARGET: return "source-is-broader-than-target";
3794            case NOTRELATEDTO: return "not-related-to";
3795            case NULL: return null;
3796            default: return "?";
3797          }
3798        }
3799        public String getSystem() {
3800          switch (this) {
3801            case RELATEDTO: return "http://hl7.org/fhir/concept-map-relationship";
3802            case EQUIVALENT: return "http://hl7.org/fhir/concept-map-relationship";
3803            case SOURCEISNARROWERTHANTARGET: return "http://hl7.org/fhir/concept-map-relationship";
3804            case SOURCEISBROADERTHANTARGET: return "http://hl7.org/fhir/concept-map-relationship";
3805            case NOTRELATEDTO: return "http://hl7.org/fhir/concept-map-relationship";
3806            case NULL: return null;
3807            default: return "?";
3808          }
3809        }
3810        public String getDefinition() {
3811          switch (this) {
3812            case RELATEDTO: return "The concepts are related to each other, but the exact relationship is not known.";
3813            case EQUIVALENT: return "The definitions of the concepts mean the same thing.";
3814            case SOURCEISNARROWERTHANTARGET: return "The source concept is narrower in meaning than the target concept.";
3815            case SOURCEISBROADERTHANTARGET: return "The source concept is broader in meaning than the target concept.";
3816            case NOTRELATEDTO: return "This is an explicit assertion that the target concept is not related to the source concept.";
3817            case NULL: return null;
3818            default: return "?";
3819          }
3820        }
3821        public String getDisplay() {
3822          switch (this) {
3823            case RELATEDTO: return "Related To";
3824            case EQUIVALENT: return "Equivalent";
3825            case SOURCEISNARROWERTHANTARGET: return "Source Is Narrower Than Target";
3826            case SOURCEISBROADERTHANTARGET: return "Source Is Broader Than Target";
3827            case NOTRELATEDTO: return "Not Related To";
3828            case NULL: return null;
3829            default: return "?";
3830          }
3831        }
3832    }
3833
3834  public static class ConceptMapRelationshipEnumFactory implements EnumFactory<ConceptMapRelationship> {
3835    public ConceptMapRelationship fromCode(String codeString) throws IllegalArgumentException {
3836      if (codeString == null || "".equals(codeString))
3837            if (codeString == null || "".equals(codeString))
3838                return null;
3839        if ("related-to".equals(codeString))
3840          return ConceptMapRelationship.RELATEDTO;
3841        if ("equivalent".equals(codeString))
3842          return ConceptMapRelationship.EQUIVALENT;
3843        if ("source-is-narrower-than-target".equals(codeString))
3844          return ConceptMapRelationship.SOURCEISNARROWERTHANTARGET;
3845        if ("source-is-broader-than-target".equals(codeString))
3846          return ConceptMapRelationship.SOURCEISBROADERTHANTARGET;
3847        if ("not-related-to".equals(codeString))
3848          return ConceptMapRelationship.NOTRELATEDTO;
3849        throw new IllegalArgumentException("Unknown ConceptMapRelationship code '"+codeString+"'");
3850        }
3851
3852        public Enumeration<ConceptMapRelationship> fromType(PrimitiveType<?> code) throws FHIRException {
3853          if (code == null)
3854            return null;
3855          if (code.isEmpty())
3856            return new Enumeration<ConceptMapRelationship>(this, ConceptMapRelationship.NULL, code);
3857          String codeString = ((PrimitiveType) code).asStringValue();
3858          if (codeString == null || "".equals(codeString))
3859            return new Enumeration<ConceptMapRelationship>(this, ConceptMapRelationship.NULL, code);
3860        if ("related-to".equals(codeString))
3861          return new Enumeration<ConceptMapRelationship>(this, ConceptMapRelationship.RELATEDTO, code);
3862        if ("equivalent".equals(codeString))
3863          return new Enumeration<ConceptMapRelationship>(this, ConceptMapRelationship.EQUIVALENT, code);
3864        if ("source-is-narrower-than-target".equals(codeString))
3865          return new Enumeration<ConceptMapRelationship>(this, ConceptMapRelationship.SOURCEISNARROWERTHANTARGET, code);
3866        if ("source-is-broader-than-target".equals(codeString))
3867          return new Enumeration<ConceptMapRelationship>(this, ConceptMapRelationship.SOURCEISBROADERTHANTARGET, code);
3868        if ("not-related-to".equals(codeString))
3869          return new Enumeration<ConceptMapRelationship>(this, ConceptMapRelationship.NOTRELATEDTO, code);
3870        throw new FHIRException("Unknown ConceptMapRelationship code '"+codeString+"'");
3871        }
3872    public String toCode(ConceptMapRelationship code) {
3873      if (code == ConceptMapRelationship.RELATEDTO)
3874        return "related-to";
3875      if (code == ConceptMapRelationship.EQUIVALENT)
3876        return "equivalent";
3877      if (code == ConceptMapRelationship.SOURCEISNARROWERTHANTARGET)
3878        return "source-is-narrower-than-target";
3879      if (code == ConceptMapRelationship.SOURCEISBROADERTHANTARGET)
3880        return "source-is-broader-than-target";
3881      if (code == ConceptMapRelationship.NOTRELATEDTO)
3882        return "not-related-to";
3883      return "?";
3884      }
3885    public String toSystem(ConceptMapRelationship code) {
3886      return code.getSystem();
3887      }
3888    }
3889
3890    public enum ConsentDataMeaning {
3891        /**
3892         * The consent applies directly to the instance of the resource.
3893         */
3894        INSTANCE, 
3895        /**
3896         * The consent applies directly to the instance of the resource and instances it refers to.
3897         */
3898        RELATED, 
3899        /**
3900         * The consent applies directly to the instance of the resource and instances that refer to it.
3901         */
3902        DEPENDENTS, 
3903        /**
3904         * The consent applies to instances of resources that are authored by.
3905         */
3906        AUTHOREDBY, 
3907        /**
3908         * added to help the parsers
3909         */
3910        NULL;
3911        public static ConsentDataMeaning fromCode(String codeString) throws FHIRException {
3912            if (codeString == null || "".equals(codeString))
3913                return null;
3914        if ("instance".equals(codeString))
3915          return INSTANCE;
3916        if ("related".equals(codeString))
3917          return RELATED;
3918        if ("dependents".equals(codeString))
3919          return DEPENDENTS;
3920        if ("authoredby".equals(codeString))
3921          return AUTHOREDBY;
3922        throw new FHIRException("Unknown ConsentDataMeaning code '"+codeString+"'");
3923        }
3924        public static boolean isValidCode(String codeString) {
3925            if (codeString == null || "".equals(codeString))
3926                return false;
3927          return Utilities.existsInList(codeString, "instance", "related", "dependents", "authoredby");
3928        }
3929        public String toCode() {
3930          switch (this) {
3931            case INSTANCE: return "instance";
3932            case RELATED: return "related";
3933            case DEPENDENTS: return "dependents";
3934            case AUTHOREDBY: return "authoredby";
3935            case NULL: return null;
3936            default: return "?";
3937          }
3938        }
3939        public String getSystem() {
3940          switch (this) {
3941            case INSTANCE: return "http://hl7.org/fhir/consent-data-meaning";
3942            case RELATED: return "http://hl7.org/fhir/consent-data-meaning";
3943            case DEPENDENTS: return "http://hl7.org/fhir/consent-data-meaning";
3944            case AUTHOREDBY: return "http://hl7.org/fhir/consent-data-meaning";
3945            case NULL: return null;
3946            default: return "?";
3947          }
3948        }
3949        public String getDefinition() {
3950          switch (this) {
3951            case INSTANCE: return "The consent applies directly to the instance of the resource.";
3952            case RELATED: return "The consent applies directly to the instance of the resource and instances it refers to.";
3953            case DEPENDENTS: return "The consent applies directly to the instance of the resource and instances that refer to it.";
3954            case AUTHOREDBY: return "The consent applies to instances of resources that are authored by.";
3955            case NULL: return null;
3956            default: return "?";
3957          }
3958        }
3959        public String getDisplay() {
3960          switch (this) {
3961            case INSTANCE: return "Instance";
3962            case RELATED: return "Related";
3963            case DEPENDENTS: return "Dependents";
3964            case AUTHOREDBY: return "AuthoredBy";
3965            case NULL: return null;
3966            default: return "?";
3967          }
3968        }
3969    }
3970
3971  public static class ConsentDataMeaningEnumFactory implements EnumFactory<ConsentDataMeaning> {
3972    public ConsentDataMeaning fromCode(String codeString) throws IllegalArgumentException {
3973      if (codeString == null || "".equals(codeString))
3974            if (codeString == null || "".equals(codeString))
3975                return null;
3976        if ("instance".equals(codeString))
3977          return ConsentDataMeaning.INSTANCE;
3978        if ("related".equals(codeString))
3979          return ConsentDataMeaning.RELATED;
3980        if ("dependents".equals(codeString))
3981          return ConsentDataMeaning.DEPENDENTS;
3982        if ("authoredby".equals(codeString))
3983          return ConsentDataMeaning.AUTHOREDBY;
3984        throw new IllegalArgumentException("Unknown ConsentDataMeaning code '"+codeString+"'");
3985        }
3986
3987        public Enumeration<ConsentDataMeaning> fromType(PrimitiveType<?> code) throws FHIRException {
3988          if (code == null)
3989            return null;
3990          if (code.isEmpty())
3991            return new Enumeration<ConsentDataMeaning>(this, ConsentDataMeaning.NULL, code);
3992          String codeString = ((PrimitiveType) code).asStringValue();
3993          if (codeString == null || "".equals(codeString))
3994            return new Enumeration<ConsentDataMeaning>(this, ConsentDataMeaning.NULL, code);
3995        if ("instance".equals(codeString))
3996          return new Enumeration<ConsentDataMeaning>(this, ConsentDataMeaning.INSTANCE, code);
3997        if ("related".equals(codeString))
3998          return new Enumeration<ConsentDataMeaning>(this, ConsentDataMeaning.RELATED, code);
3999        if ("dependents".equals(codeString))
4000          return new Enumeration<ConsentDataMeaning>(this, ConsentDataMeaning.DEPENDENTS, code);
4001        if ("authoredby".equals(codeString))
4002          return new Enumeration<ConsentDataMeaning>(this, ConsentDataMeaning.AUTHOREDBY, code);
4003        throw new FHIRException("Unknown ConsentDataMeaning code '"+codeString+"'");
4004        }
4005    public String toCode(ConsentDataMeaning code) {
4006      if (code == ConsentDataMeaning.INSTANCE)
4007        return "instance";
4008      if (code == ConsentDataMeaning.RELATED)
4009        return "related";
4010      if (code == ConsentDataMeaning.DEPENDENTS)
4011        return "dependents";
4012      if (code == ConsentDataMeaning.AUTHOREDBY)
4013        return "authoredby";
4014      return "?";
4015      }
4016    public String toSystem(ConsentDataMeaning code) {
4017      return code.getSystem();
4018      }
4019    }
4020
4021    public enum ConsentProvisionType {
4022        /**
4023         * Consent is denied for actions meeting these rules.
4024         */
4025        DENY, 
4026        /**
4027         * Consent is provided for actions meeting these rules.
4028         */
4029        PERMIT, 
4030        /**
4031         * added to help the parsers
4032         */
4033        NULL;
4034        public static ConsentProvisionType fromCode(String codeString) throws FHIRException {
4035            if (codeString == null || "".equals(codeString))
4036                return null;
4037        if ("deny".equals(codeString))
4038          return DENY;
4039        if ("permit".equals(codeString))
4040          return PERMIT;
4041        throw new FHIRException("Unknown ConsentProvisionType code '"+codeString+"'");
4042        }
4043        public static boolean isValidCode(String codeString) {
4044            if (codeString == null || "".equals(codeString))
4045                return false;
4046          return Utilities.existsInList(codeString, "deny", "permit");
4047        }
4048        public String toCode() {
4049          switch (this) {
4050            case DENY: return "deny";
4051            case PERMIT: return "permit";
4052            case NULL: return null;
4053            default: return "?";
4054          }
4055        }
4056        public String getSystem() {
4057          switch (this) {
4058            case DENY: return "http://hl7.org/fhir/consent-provision-type";
4059            case PERMIT: return "http://hl7.org/fhir/consent-provision-type";
4060            case NULL: return null;
4061            default: return "?";
4062          }
4063        }
4064        public String getDefinition() {
4065          switch (this) {
4066            case DENY: return "Consent is denied for actions meeting these rules.";
4067            case PERMIT: return "Consent is provided for actions meeting these rules.";
4068            case NULL: return null;
4069            default: return "?";
4070          }
4071        }
4072        public String getDisplay() {
4073          switch (this) {
4074            case DENY: return "Deny";
4075            case PERMIT: return "Permit";
4076            case NULL: return null;
4077            default: return "?";
4078          }
4079        }
4080    }
4081
4082  public static class ConsentProvisionTypeEnumFactory implements EnumFactory<ConsentProvisionType> {
4083    public ConsentProvisionType fromCode(String codeString) throws IllegalArgumentException {
4084      if (codeString == null || "".equals(codeString))
4085            if (codeString == null || "".equals(codeString))
4086                return null;
4087        if ("deny".equals(codeString))
4088          return ConsentProvisionType.DENY;
4089        if ("permit".equals(codeString))
4090          return ConsentProvisionType.PERMIT;
4091        throw new IllegalArgumentException("Unknown ConsentProvisionType code '"+codeString+"'");
4092        }
4093
4094        public Enumeration<ConsentProvisionType> fromType(PrimitiveType<?> code) throws FHIRException {
4095          if (code == null)
4096            return null;
4097          if (code.isEmpty())
4098            return new Enumeration<ConsentProvisionType>(this, ConsentProvisionType.NULL, code);
4099          String codeString = ((PrimitiveType) code).asStringValue();
4100          if (codeString == null || "".equals(codeString))
4101            return new Enumeration<ConsentProvisionType>(this, ConsentProvisionType.NULL, code);
4102        if ("deny".equals(codeString))
4103          return new Enumeration<ConsentProvisionType>(this, ConsentProvisionType.DENY, code);
4104        if ("permit".equals(codeString))
4105          return new Enumeration<ConsentProvisionType>(this, ConsentProvisionType.PERMIT, code);
4106        throw new FHIRException("Unknown ConsentProvisionType code '"+codeString+"'");
4107        }
4108    public String toCode(ConsentProvisionType code) {
4109      if (code == ConsentProvisionType.DENY)
4110        return "deny";
4111      if (code == ConsentProvisionType.PERMIT)
4112        return "permit";
4113      return "?";
4114      }
4115    public String toSystem(ConsentProvisionType code) {
4116      return code.getSystem();
4117      }
4118    }
4119
4120    public enum Currencies {
4121        /**
4122         * null
4123         */
4124        AED, 
4125        /**
4126         * null
4127         */
4128        AFN, 
4129        /**
4130         * null
4131         */
4132        ALL, 
4133        /**
4134         * null
4135         */
4136        AMD, 
4137        /**
4138         * null
4139         */
4140        ANG, 
4141        /**
4142         * null
4143         */
4144        AOA, 
4145        /**
4146         * null
4147         */
4148        ARS, 
4149        /**
4150         * null
4151         */
4152        AUD, 
4153        /**
4154         * null
4155         */
4156        AWG, 
4157        /**
4158         * null
4159         */
4160        AZN, 
4161        /**
4162         * null
4163         */
4164        BAM, 
4165        /**
4166         * null
4167         */
4168        BBD, 
4169        /**
4170         * null
4171         */
4172        BDT, 
4173        /**
4174         * null
4175         */
4176        BGN, 
4177        /**
4178         * null
4179         */
4180        BHD, 
4181        /**
4182         * null
4183         */
4184        BIF, 
4185        /**
4186         * null
4187         */
4188        BMD, 
4189        /**
4190         * null
4191         */
4192        BND, 
4193        /**
4194         * null
4195         */
4196        BOB, 
4197        /**
4198         * null
4199         */
4200        BOV, 
4201        /**
4202         * null
4203         */
4204        BRL, 
4205        /**
4206         * null
4207         */
4208        BSD, 
4209        /**
4210         * null
4211         */
4212        BTN, 
4213        /**
4214         * null
4215         */
4216        BWP, 
4217        /**
4218         * null
4219         */
4220        BYN, 
4221        /**
4222         * null
4223         */
4224        BZD, 
4225        /**
4226         * null
4227         */
4228        CAD, 
4229        /**
4230         * null
4231         */
4232        CDF, 
4233        /**
4234         * null
4235         */
4236        CHE, 
4237        /**
4238         * null
4239         */
4240        CHF, 
4241        /**
4242         * null
4243         */
4244        CHW, 
4245        /**
4246         * null
4247         */
4248        CLF, 
4249        /**
4250         * null
4251         */
4252        CLP, 
4253        /**
4254         * null
4255         */
4256        CNY, 
4257        /**
4258         * null
4259         */
4260        COP, 
4261        /**
4262         * null
4263         */
4264        COU, 
4265        /**
4266         * null
4267         */
4268        CRC, 
4269        /**
4270         * null
4271         */
4272        CUC, 
4273        /**
4274         * null
4275         */
4276        CUP, 
4277        /**
4278         * null
4279         */
4280        CVE, 
4281        /**
4282         * null
4283         */
4284        CZK, 
4285        /**
4286         * null
4287         */
4288        DJF, 
4289        /**
4290         * null
4291         */
4292        DKK, 
4293        /**
4294         * null
4295         */
4296        DOP, 
4297        /**
4298         * null
4299         */
4300        DZD, 
4301        /**
4302         * null
4303         */
4304        EGP, 
4305        /**
4306         * null
4307         */
4308        ERN, 
4309        /**
4310         * null
4311         */
4312        ETB, 
4313        /**
4314         * null
4315         */
4316        EUR, 
4317        /**
4318         * null
4319         */
4320        FJD, 
4321        /**
4322         * null
4323         */
4324        FKP, 
4325        /**
4326         * null
4327         */
4328        GBP, 
4329        /**
4330         * null
4331         */
4332        GEL, 
4333        /**
4334         * null
4335         */
4336        GGP, 
4337        /**
4338         * null
4339         */
4340        GHS, 
4341        /**
4342         * null
4343         */
4344        GIP, 
4345        /**
4346         * null
4347         */
4348        GMD, 
4349        /**
4350         * null
4351         */
4352        GNF, 
4353        /**
4354         * null
4355         */
4356        GTQ, 
4357        /**
4358         * null
4359         */
4360        GYD, 
4361        /**
4362         * null
4363         */
4364        HKD, 
4365        /**
4366         * null
4367         */
4368        HNL, 
4369        /**
4370         * null
4371         */
4372        HRK, 
4373        /**
4374         * null
4375         */
4376        HTG, 
4377        /**
4378         * null
4379         */
4380        HUF, 
4381        /**
4382         * null
4383         */
4384        IDR, 
4385        /**
4386         * null
4387         */
4388        ILS, 
4389        /**
4390         * null
4391         */
4392        IMP, 
4393        /**
4394         * null
4395         */
4396        INR, 
4397        /**
4398         * null
4399         */
4400        IQD, 
4401        /**
4402         * null
4403         */
4404        IRR, 
4405        /**
4406         * null
4407         */
4408        ISK, 
4409        /**
4410         * null
4411         */
4412        JEP, 
4413        /**
4414         * null
4415         */
4416        JMD, 
4417        /**
4418         * null
4419         */
4420        JOD, 
4421        /**
4422         * null
4423         */
4424        JPY, 
4425        /**
4426         * null
4427         */
4428        KES, 
4429        /**
4430         * null
4431         */
4432        KGS, 
4433        /**
4434         * null
4435         */
4436        KHR, 
4437        /**
4438         * null
4439         */
4440        KMF, 
4441        /**
4442         * null
4443         */
4444        KPW, 
4445        /**
4446         * null
4447         */
4448        KRW, 
4449        /**
4450         * null
4451         */
4452        KWD, 
4453        /**
4454         * null
4455         */
4456        KYD, 
4457        /**
4458         * null
4459         */
4460        KZT, 
4461        /**
4462         * null
4463         */
4464        LAK, 
4465        /**
4466         * null
4467         */
4468        LBP, 
4469        /**
4470         * null
4471         */
4472        LKR, 
4473        /**
4474         * null
4475         */
4476        LRD, 
4477        /**
4478         * null
4479         */
4480        LSL, 
4481        /**
4482         * null
4483         */
4484        LYD, 
4485        /**
4486         * null
4487         */
4488        MAD, 
4489        /**
4490         * null
4491         */
4492        MDL, 
4493        /**
4494         * null
4495         */
4496        MGA, 
4497        /**
4498         * null
4499         */
4500        MKD, 
4501        /**
4502         * null
4503         */
4504        MMK, 
4505        /**
4506         * null
4507         */
4508        MNT, 
4509        /**
4510         * null
4511         */
4512        MOP, 
4513        /**
4514         * null
4515         */
4516        MRU, 
4517        /**
4518         * null
4519         */
4520        MUR, 
4521        /**
4522         * null
4523         */
4524        MVR, 
4525        /**
4526         * null
4527         */
4528        MWK, 
4529        /**
4530         * null
4531         */
4532        MXN, 
4533        /**
4534         * null
4535         */
4536        MXV, 
4537        /**
4538         * null
4539         */
4540        MYR, 
4541        /**
4542         * null
4543         */
4544        MZN, 
4545        /**
4546         * null
4547         */
4548        NAD, 
4549        /**
4550         * null
4551         */
4552        NGN, 
4553        /**
4554         * null
4555         */
4556        NIO, 
4557        /**
4558         * null
4559         */
4560        NOK, 
4561        /**
4562         * null
4563         */
4564        NPR, 
4565        /**
4566         * null
4567         */
4568        NZD, 
4569        /**
4570         * null
4571         */
4572        OMR, 
4573        /**
4574         * null
4575         */
4576        PAB, 
4577        /**
4578         * null
4579         */
4580        PEN, 
4581        /**
4582         * null
4583         */
4584        PGK, 
4585        /**
4586         * null
4587         */
4588        PHP, 
4589        /**
4590         * null
4591         */
4592        PKR, 
4593        /**
4594         * null
4595         */
4596        PLN, 
4597        /**
4598         * null
4599         */
4600        PYG, 
4601        /**
4602         * null
4603         */
4604        QAR, 
4605        /**
4606         * null
4607         */
4608        RON, 
4609        /**
4610         * null
4611         */
4612        RSD, 
4613        /**
4614         * null
4615         */
4616        RUB, 
4617        /**
4618         * null
4619         */
4620        RWF, 
4621        /**
4622         * null
4623         */
4624        SAR, 
4625        /**
4626         * null
4627         */
4628        SBD, 
4629        /**
4630         * null
4631         */
4632        SCR, 
4633        /**
4634         * null
4635         */
4636        SDG, 
4637        /**
4638         * null
4639         */
4640        SEK, 
4641        /**
4642         * null
4643         */
4644        SGD, 
4645        /**
4646         * null
4647         */
4648        SHP, 
4649        /**
4650         * null
4651         */
4652        SLL, 
4653        /**
4654         * null
4655         */
4656        SOS, 
4657        /**
4658         * null
4659         */
4660        SRD, 
4661        /**
4662         * null
4663         */
4664        SSP, 
4665        /**
4666         * null
4667         */
4668        STN, 
4669        /**
4670         * null
4671         */
4672        SVC, 
4673        /**
4674         * null
4675         */
4676        SYP, 
4677        /**
4678         * null
4679         */
4680        SZL, 
4681        /**
4682         * null
4683         */
4684        THB, 
4685        /**
4686         * null
4687         */
4688        TJS, 
4689        /**
4690         * null
4691         */
4692        TMT, 
4693        /**
4694         * null
4695         */
4696        TND, 
4697        /**
4698         * null
4699         */
4700        TOP, 
4701        /**
4702         * null
4703         */
4704        TRY, 
4705        /**
4706         * null
4707         */
4708        TTD, 
4709        /**
4710         * null
4711         */
4712        TVD, 
4713        /**
4714         * null
4715         */
4716        TWD, 
4717        /**
4718         * null
4719         */
4720        TZS, 
4721        /**
4722         * null
4723         */
4724        UAH, 
4725        /**
4726         * null
4727         */
4728        UGX, 
4729        /**
4730         * null
4731         */
4732        USD, 
4733        /**
4734         * null
4735         */
4736        USN, 
4737        /**
4738         * null
4739         */
4740        UYI, 
4741        /**
4742         * null
4743         */
4744        UYU, 
4745        /**
4746         * null
4747         */
4748        UZS, 
4749        /**
4750         * null
4751         */
4752        VEF, 
4753        /**
4754         * null
4755         */
4756        VND, 
4757        /**
4758         * null
4759         */
4760        VUV, 
4761        /**
4762         * null
4763         */
4764        WST, 
4765        /**
4766         * null
4767         */
4768        XAF, 
4769        /**
4770         * null
4771         */
4772        XAG, 
4773        /**
4774         * null
4775         */
4776        XAU, 
4777        /**
4778         * null
4779         */
4780        XBA, 
4781        /**
4782         * null
4783         */
4784        XBB, 
4785        /**
4786         * null
4787         */
4788        XBC, 
4789        /**
4790         * null
4791         */
4792        XBD, 
4793        /**
4794         * null
4795         */
4796        XCD, 
4797        /**
4798         * null
4799         */
4800        XDR, 
4801        /**
4802         * null
4803         */
4804        XOF, 
4805        /**
4806         * null
4807         */
4808        XPD, 
4809        /**
4810         * null
4811         */
4812        XPF, 
4813        /**
4814         * null
4815         */
4816        XPT, 
4817        /**
4818         * null
4819         */
4820        XSU, 
4821        /**
4822         * null
4823         */
4824        XTS, 
4825        /**
4826         * null
4827         */
4828        XUA, 
4829        /**
4830         * null
4831         */
4832        XXX, 
4833        /**
4834         * null
4835         */
4836        YER, 
4837        /**
4838         * null
4839         */
4840        ZAR, 
4841        /**
4842         * null
4843         */
4844        ZMW, 
4845        /**
4846         * null
4847         */
4848        ZWL, 
4849        /**
4850         * added to help the parsers
4851         */
4852        NULL;
4853        public static Currencies fromCode(String codeString) throws FHIRException {
4854            if (codeString == null || "".equals(codeString))
4855                return null;
4856        if ("AED".equals(codeString))
4857          return AED;
4858        if ("AFN".equals(codeString))
4859          return AFN;
4860        if ("ALL".equals(codeString))
4861          return ALL;
4862        if ("AMD".equals(codeString))
4863          return AMD;
4864        if ("ANG".equals(codeString))
4865          return ANG;
4866        if ("AOA".equals(codeString))
4867          return AOA;
4868        if ("ARS".equals(codeString))
4869          return ARS;
4870        if ("AUD".equals(codeString))
4871          return AUD;
4872        if ("AWG".equals(codeString))
4873          return AWG;
4874        if ("AZN".equals(codeString))
4875          return AZN;
4876        if ("BAM".equals(codeString))
4877          return BAM;
4878        if ("BBD".equals(codeString))
4879          return BBD;
4880        if ("BDT".equals(codeString))
4881          return BDT;
4882        if ("BGN".equals(codeString))
4883          return BGN;
4884        if ("BHD".equals(codeString))
4885          return BHD;
4886        if ("BIF".equals(codeString))
4887          return BIF;
4888        if ("BMD".equals(codeString))
4889          return BMD;
4890        if ("BND".equals(codeString))
4891          return BND;
4892        if ("BOB".equals(codeString))
4893          return BOB;
4894        if ("BOV".equals(codeString))
4895          return BOV;
4896        if ("BRL".equals(codeString))
4897          return BRL;
4898        if ("BSD".equals(codeString))
4899          return BSD;
4900        if ("BTN".equals(codeString))
4901          return BTN;
4902        if ("BWP".equals(codeString))
4903          return BWP;
4904        if ("BYN".equals(codeString))
4905          return BYN;
4906        if ("BZD".equals(codeString))
4907          return BZD;
4908        if ("CAD".equals(codeString))
4909          return CAD;
4910        if ("CDF".equals(codeString))
4911          return CDF;
4912        if ("CHE".equals(codeString))
4913          return CHE;
4914        if ("CHF".equals(codeString))
4915          return CHF;
4916        if ("CHW".equals(codeString))
4917          return CHW;
4918        if ("CLF".equals(codeString))
4919          return CLF;
4920        if ("CLP".equals(codeString))
4921          return CLP;
4922        if ("CNY".equals(codeString))
4923          return CNY;
4924        if ("COP".equals(codeString))
4925          return COP;
4926        if ("COU".equals(codeString))
4927          return COU;
4928        if ("CRC".equals(codeString))
4929          return CRC;
4930        if ("CUC".equals(codeString))
4931          return CUC;
4932        if ("CUP".equals(codeString))
4933          return CUP;
4934        if ("CVE".equals(codeString))
4935          return CVE;
4936        if ("CZK".equals(codeString))
4937          return CZK;
4938        if ("DJF".equals(codeString))
4939          return DJF;
4940        if ("DKK".equals(codeString))
4941          return DKK;
4942        if ("DOP".equals(codeString))
4943          return DOP;
4944        if ("DZD".equals(codeString))
4945          return DZD;
4946        if ("EGP".equals(codeString))
4947          return EGP;
4948        if ("ERN".equals(codeString))
4949          return ERN;
4950        if ("ETB".equals(codeString))
4951          return ETB;
4952        if ("EUR".equals(codeString))
4953          return EUR;
4954        if ("FJD".equals(codeString))
4955          return FJD;
4956        if ("FKP".equals(codeString))
4957          return FKP;
4958        if ("GBP".equals(codeString))
4959          return GBP;
4960        if ("GEL".equals(codeString))
4961          return GEL;
4962        if ("GGP".equals(codeString))
4963          return GGP;
4964        if ("GHS".equals(codeString))
4965          return GHS;
4966        if ("GIP".equals(codeString))
4967          return GIP;
4968        if ("GMD".equals(codeString))
4969          return GMD;
4970        if ("GNF".equals(codeString))
4971          return GNF;
4972        if ("GTQ".equals(codeString))
4973          return GTQ;
4974        if ("GYD".equals(codeString))
4975          return GYD;
4976        if ("HKD".equals(codeString))
4977          return HKD;
4978        if ("HNL".equals(codeString))
4979          return HNL;
4980        if ("HRK".equals(codeString))
4981          return HRK;
4982        if ("HTG".equals(codeString))
4983          return HTG;
4984        if ("HUF".equals(codeString))
4985          return HUF;
4986        if ("IDR".equals(codeString))
4987          return IDR;
4988        if ("ILS".equals(codeString))
4989          return ILS;
4990        if ("IMP".equals(codeString))
4991          return IMP;
4992        if ("INR".equals(codeString))
4993          return INR;
4994        if ("IQD".equals(codeString))
4995          return IQD;
4996        if ("IRR".equals(codeString))
4997          return IRR;
4998        if ("ISK".equals(codeString))
4999          return ISK;
5000        if ("JEP".equals(codeString))
5001          return JEP;
5002        if ("JMD".equals(codeString))
5003          return JMD;
5004        if ("JOD".equals(codeString))
5005          return JOD;
5006        if ("JPY".equals(codeString))
5007          return JPY;
5008        if ("KES".equals(codeString))
5009          return KES;
5010        if ("KGS".equals(codeString))
5011          return KGS;
5012        if ("KHR".equals(codeString))
5013          return KHR;
5014        if ("KMF".equals(codeString))
5015          return KMF;
5016        if ("KPW".equals(codeString))
5017          return KPW;
5018        if ("KRW".equals(codeString))
5019          return KRW;
5020        if ("KWD".equals(codeString))
5021          return KWD;
5022        if ("KYD".equals(codeString))
5023          return KYD;
5024        if ("KZT".equals(codeString))
5025          return KZT;
5026        if ("LAK".equals(codeString))
5027          return LAK;
5028        if ("LBP".equals(codeString))
5029          return LBP;
5030        if ("LKR".equals(codeString))
5031          return LKR;
5032        if ("LRD".equals(codeString))
5033          return LRD;
5034        if ("LSL".equals(codeString))
5035          return LSL;
5036        if ("LYD".equals(codeString))
5037          return LYD;
5038        if ("MAD".equals(codeString))
5039          return MAD;
5040        if ("MDL".equals(codeString))
5041          return MDL;
5042        if ("MGA".equals(codeString))
5043          return MGA;
5044        if ("MKD".equals(codeString))
5045          return MKD;
5046        if ("MMK".equals(codeString))
5047          return MMK;
5048        if ("MNT".equals(codeString))
5049          return MNT;
5050        if ("MOP".equals(codeString))
5051          return MOP;
5052        if ("MRU".equals(codeString))
5053          return MRU;
5054        if ("MUR".equals(codeString))
5055          return MUR;
5056        if ("MVR".equals(codeString))
5057          return MVR;
5058        if ("MWK".equals(codeString))
5059          return MWK;
5060        if ("MXN".equals(codeString))
5061          return MXN;
5062        if ("MXV".equals(codeString))
5063          return MXV;
5064        if ("MYR".equals(codeString))
5065          return MYR;
5066        if ("MZN".equals(codeString))
5067          return MZN;
5068        if ("NAD".equals(codeString))
5069          return NAD;
5070        if ("NGN".equals(codeString))
5071          return NGN;
5072        if ("NIO".equals(codeString))
5073          return NIO;
5074        if ("NOK".equals(codeString))
5075          return NOK;
5076        if ("NPR".equals(codeString))
5077          return NPR;
5078        if ("NZD".equals(codeString))
5079          return NZD;
5080        if ("OMR".equals(codeString))
5081          return OMR;
5082        if ("PAB".equals(codeString))
5083          return PAB;
5084        if ("PEN".equals(codeString))
5085          return PEN;
5086        if ("PGK".equals(codeString))
5087          return PGK;
5088        if ("PHP".equals(codeString))
5089          return PHP;
5090        if ("PKR".equals(codeString))
5091          return PKR;
5092        if ("PLN".equals(codeString))
5093          return PLN;
5094        if ("PYG".equals(codeString))
5095          return PYG;
5096        if ("QAR".equals(codeString))
5097          return QAR;
5098        if ("RON".equals(codeString))
5099          return RON;
5100        if ("RSD".equals(codeString))
5101          return RSD;
5102        if ("RUB".equals(codeString))
5103          return RUB;
5104        if ("RWF".equals(codeString))
5105          return RWF;
5106        if ("SAR".equals(codeString))
5107          return SAR;
5108        if ("SBD".equals(codeString))
5109          return SBD;
5110        if ("SCR".equals(codeString))
5111          return SCR;
5112        if ("SDG".equals(codeString))
5113          return SDG;
5114        if ("SEK".equals(codeString))
5115          return SEK;
5116        if ("SGD".equals(codeString))
5117          return SGD;
5118        if ("SHP".equals(codeString))
5119          return SHP;
5120        if ("SLL".equals(codeString))
5121          return SLL;
5122        if ("SOS".equals(codeString))
5123          return SOS;
5124        if ("SRD".equals(codeString))
5125          return SRD;
5126        if ("SSP".equals(codeString))
5127          return SSP;
5128        if ("STN".equals(codeString))
5129          return STN;
5130        if ("SVC".equals(codeString))
5131          return SVC;
5132        if ("SYP".equals(codeString))
5133          return SYP;
5134        if ("SZL".equals(codeString))
5135          return SZL;
5136        if ("THB".equals(codeString))
5137          return THB;
5138        if ("TJS".equals(codeString))
5139          return TJS;
5140        if ("TMT".equals(codeString))
5141          return TMT;
5142        if ("TND".equals(codeString))
5143          return TND;
5144        if ("TOP".equals(codeString))
5145          return TOP;
5146        if ("TRY".equals(codeString))
5147          return TRY;
5148        if ("TTD".equals(codeString))
5149          return TTD;
5150        if ("TVD".equals(codeString))
5151          return TVD;
5152        if ("TWD".equals(codeString))
5153          return TWD;
5154        if ("TZS".equals(codeString))
5155          return TZS;
5156        if ("UAH".equals(codeString))
5157          return UAH;
5158        if ("UGX".equals(codeString))
5159          return UGX;
5160        if ("USD".equals(codeString))
5161          return USD;
5162        if ("USN".equals(codeString))
5163          return USN;
5164        if ("UYI".equals(codeString))
5165          return UYI;
5166        if ("UYU".equals(codeString))
5167          return UYU;
5168        if ("UZS".equals(codeString))
5169          return UZS;
5170        if ("VEF".equals(codeString))
5171          return VEF;
5172        if ("VND".equals(codeString))
5173          return VND;
5174        if ("VUV".equals(codeString))
5175          return VUV;
5176        if ("WST".equals(codeString))
5177          return WST;
5178        if ("XAF".equals(codeString))
5179          return XAF;
5180        if ("XAG".equals(codeString))
5181          return XAG;
5182        if ("XAU".equals(codeString))
5183          return XAU;
5184        if ("XBA".equals(codeString))
5185          return XBA;
5186        if ("XBB".equals(codeString))
5187          return XBB;
5188        if ("XBC".equals(codeString))
5189          return XBC;
5190        if ("XBD".equals(codeString))
5191          return XBD;
5192        if ("XCD".equals(codeString))
5193          return XCD;
5194        if ("XDR".equals(codeString))
5195          return XDR;
5196        if ("XOF".equals(codeString))
5197          return XOF;
5198        if ("XPD".equals(codeString))
5199          return XPD;
5200        if ("XPF".equals(codeString))
5201          return XPF;
5202        if ("XPT".equals(codeString))
5203          return XPT;
5204        if ("XSU".equals(codeString))
5205          return XSU;
5206        if ("XTS".equals(codeString))
5207          return XTS;
5208        if ("XUA".equals(codeString))
5209          return XUA;
5210        if ("XXX".equals(codeString))
5211          return XXX;
5212        if ("YER".equals(codeString))
5213          return YER;
5214        if ("ZAR".equals(codeString))
5215          return ZAR;
5216        if ("ZMW".equals(codeString))
5217          return ZMW;
5218        if ("ZWL".equals(codeString))
5219          return ZWL;
5220        throw new FHIRException("Unknown Currencies code '"+codeString+"'");
5221        }
5222        public static boolean isValidCode(String codeString) {
5223            if (codeString == null || "".equals(codeString))
5224                return false;
5225          return Utilities.existsInList(codeString, "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLF", "CLP", "CNY", "COP", "COU", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "IMP", "INR", "IQD", "IRR", "ISK", "JEP", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRU", "MUR", "MVR", "MWK", "MXN", "MXV", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STN", "SVC", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TVD", "TWD", "TZS", "UAH", "UGX", "USD", "USN", "UYI", "UYU", "UZS", "VEF", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT", "XSU", "XTS", "XUA", "XXX", "YER", "ZAR", "ZMW", "ZWL");
5226        }
5227        public String toCode() {
5228          switch (this) {
5229            case AED: return "AED";
5230            case AFN: return "AFN";
5231            case ALL: return "ALL";
5232            case AMD: return "AMD";
5233            case ANG: return "ANG";
5234            case AOA: return "AOA";
5235            case ARS: return "ARS";
5236            case AUD: return "AUD";
5237            case AWG: return "AWG";
5238            case AZN: return "AZN";
5239            case BAM: return "BAM";
5240            case BBD: return "BBD";
5241            case BDT: return "BDT";
5242            case BGN: return "BGN";
5243            case BHD: return "BHD";
5244            case BIF: return "BIF";
5245            case BMD: return "BMD";
5246            case BND: return "BND";
5247            case BOB: return "BOB";
5248            case BOV: return "BOV";
5249            case BRL: return "BRL";
5250            case BSD: return "BSD";
5251            case BTN: return "BTN";
5252            case BWP: return "BWP";
5253            case BYN: return "BYN";
5254            case BZD: return "BZD";
5255            case CAD: return "CAD";
5256            case CDF: return "CDF";
5257            case CHE: return "CHE";
5258            case CHF: return "CHF";
5259            case CHW: return "CHW";
5260            case CLF: return "CLF";
5261            case CLP: return "CLP";
5262            case CNY: return "CNY";
5263            case COP: return "COP";
5264            case COU: return "COU";
5265            case CRC: return "CRC";
5266            case CUC: return "CUC";
5267            case CUP: return "CUP";
5268            case CVE: return "CVE";
5269            case CZK: return "CZK";
5270            case DJF: return "DJF";
5271            case DKK: return "DKK";
5272            case DOP: return "DOP";
5273            case DZD: return "DZD";
5274            case EGP: return "EGP";
5275            case ERN: return "ERN";
5276            case ETB: return "ETB";
5277            case EUR: return "EUR";
5278            case FJD: return "FJD";
5279            case FKP: return "FKP";
5280            case GBP: return "GBP";
5281            case GEL: return "GEL";
5282            case GGP: return "GGP";
5283            case GHS: return "GHS";
5284            case GIP: return "GIP";
5285            case GMD: return "GMD";
5286            case GNF: return "GNF";
5287            case GTQ: return "GTQ";
5288            case GYD: return "GYD";
5289            case HKD: return "HKD";
5290            case HNL: return "HNL";
5291            case HRK: return "HRK";
5292            case HTG: return "HTG";
5293            case HUF: return "HUF";
5294            case IDR: return "IDR";
5295            case ILS: return "ILS";
5296            case IMP: return "IMP";
5297            case INR: return "INR";
5298            case IQD: return "IQD";
5299            case IRR: return "IRR";
5300            case ISK: return "ISK";
5301            case JEP: return "JEP";
5302            case JMD: return "JMD";
5303            case JOD: return "JOD";
5304            case JPY: return "JPY";
5305            case KES: return "KES";
5306            case KGS: return "KGS";
5307            case KHR: return "KHR";
5308            case KMF: return "KMF";
5309            case KPW: return "KPW";
5310            case KRW: return "KRW";
5311            case KWD: return "KWD";
5312            case KYD: return "KYD";
5313            case KZT: return "KZT";
5314            case LAK: return "LAK";
5315            case LBP: return "LBP";
5316            case LKR: return "LKR";
5317            case LRD: return "LRD";
5318            case LSL: return "LSL";
5319            case LYD: return "LYD";
5320            case MAD: return "MAD";
5321            case MDL: return "MDL";
5322            case MGA: return "MGA";
5323            case MKD: return "MKD";
5324            case MMK: return "MMK";
5325            case MNT: return "MNT";
5326            case MOP: return "MOP";
5327            case MRU: return "MRU";
5328            case MUR: return "MUR";
5329            case MVR: return "MVR";
5330            case MWK: return "MWK";
5331            case MXN: return "MXN";
5332            case MXV: return "MXV";
5333            case MYR: return "MYR";
5334            case MZN: return "MZN";
5335            case NAD: return "NAD";
5336            case NGN: return "NGN";
5337            case NIO: return "NIO";
5338            case NOK: return "NOK";
5339            case NPR: return "NPR";
5340            case NZD: return "NZD";
5341            case OMR: return "OMR";
5342            case PAB: return "PAB";
5343            case PEN: return "PEN";
5344            case PGK: return "PGK";
5345            case PHP: return "PHP";
5346            case PKR: return "PKR";
5347            case PLN: return "PLN";
5348            case PYG: return "PYG";
5349            case QAR: return "QAR";
5350            case RON: return "RON";
5351            case RSD: return "RSD";
5352            case RUB: return "RUB";
5353            case RWF: return "RWF";
5354            case SAR: return "SAR";
5355            case SBD: return "SBD";
5356            case SCR: return "SCR";
5357            case SDG: return "SDG";
5358            case SEK: return "SEK";
5359            case SGD: return "SGD";
5360            case SHP: return "SHP";
5361            case SLL: return "SLL";
5362            case SOS: return "SOS";
5363            case SRD: return "SRD";
5364            case SSP: return "SSP";
5365            case STN: return "STN";
5366            case SVC: return "SVC";
5367            case SYP: return "SYP";
5368            case SZL: return "SZL";
5369            case THB: return "THB";
5370            case TJS: return "TJS";
5371            case TMT: return "TMT";
5372            case TND: return "TND";
5373            case TOP: return "TOP";
5374            case TRY: return "TRY";
5375            case TTD: return "TTD";
5376            case TVD: return "TVD";
5377            case TWD: return "TWD";
5378            case TZS: return "TZS";
5379            case UAH: return "UAH";
5380            case UGX: return "UGX";
5381            case USD: return "USD";
5382            case USN: return "USN";
5383            case UYI: return "UYI";
5384            case UYU: return "UYU";
5385            case UZS: return "UZS";
5386            case VEF: return "VEF";
5387            case VND: return "VND";
5388            case VUV: return "VUV";
5389            case WST: return "WST";
5390            case XAF: return "XAF";
5391            case XAG: return "XAG";
5392            case XAU: return "XAU";
5393            case XBA: return "XBA";
5394            case XBB: return "XBB";
5395            case XBC: return "XBC";
5396            case XBD: return "XBD";
5397            case XCD: return "XCD";
5398            case XDR: return "XDR";
5399            case XOF: return "XOF";
5400            case XPD: return "XPD";
5401            case XPF: return "XPF";
5402            case XPT: return "XPT";
5403            case XSU: return "XSU";
5404            case XTS: return "XTS";
5405            case XUA: return "XUA";
5406            case XXX: return "XXX";
5407            case YER: return "YER";
5408            case ZAR: return "ZAR";
5409            case ZMW: return "ZMW";
5410            case ZWL: return "ZWL";
5411            case NULL: return null;
5412            default: return "?";
5413          }
5414        }
5415        public String getSystem() {
5416          switch (this) {
5417            case AED: return "urn:iso:std:iso:4217";
5418            case AFN: return "urn:iso:std:iso:4217";
5419            case ALL: return "urn:iso:std:iso:4217";
5420            case AMD: return "urn:iso:std:iso:4217";
5421            case ANG: return "urn:iso:std:iso:4217";
5422            case AOA: return "urn:iso:std:iso:4217";
5423            case ARS: return "urn:iso:std:iso:4217";
5424            case AUD: return "urn:iso:std:iso:4217";
5425            case AWG: return "urn:iso:std:iso:4217";
5426            case AZN: return "urn:iso:std:iso:4217";
5427            case BAM: return "urn:iso:std:iso:4217";
5428            case BBD: return "urn:iso:std:iso:4217";
5429            case BDT: return "urn:iso:std:iso:4217";
5430            case BGN: return "urn:iso:std:iso:4217";
5431            case BHD: return "urn:iso:std:iso:4217";
5432            case BIF: return "urn:iso:std:iso:4217";
5433            case BMD: return "urn:iso:std:iso:4217";
5434            case BND: return "urn:iso:std:iso:4217";
5435            case BOB: return "urn:iso:std:iso:4217";
5436            case BOV: return "urn:iso:std:iso:4217";
5437            case BRL: return "urn:iso:std:iso:4217";
5438            case BSD: return "urn:iso:std:iso:4217";
5439            case BTN: return "urn:iso:std:iso:4217";
5440            case BWP: return "urn:iso:std:iso:4217";
5441            case BYN: return "urn:iso:std:iso:4217";
5442            case BZD: return "urn:iso:std:iso:4217";
5443            case CAD: return "urn:iso:std:iso:4217";
5444            case CDF: return "urn:iso:std:iso:4217";
5445            case CHE: return "urn:iso:std:iso:4217";
5446            case CHF: return "urn:iso:std:iso:4217";
5447            case CHW: return "urn:iso:std:iso:4217";
5448            case CLF: return "urn:iso:std:iso:4217";
5449            case CLP: return "urn:iso:std:iso:4217";
5450            case CNY: return "urn:iso:std:iso:4217";
5451            case COP: return "urn:iso:std:iso:4217";
5452            case COU: return "urn:iso:std:iso:4217";
5453            case CRC: return "urn:iso:std:iso:4217";
5454            case CUC: return "urn:iso:std:iso:4217";
5455            case CUP: return "urn:iso:std:iso:4217";
5456            case CVE: return "urn:iso:std:iso:4217";
5457            case CZK: return "urn:iso:std:iso:4217";
5458            case DJF: return "urn:iso:std:iso:4217";
5459            case DKK: return "urn:iso:std:iso:4217";
5460            case DOP: return "urn:iso:std:iso:4217";
5461            case DZD: return "urn:iso:std:iso:4217";
5462            case EGP: return "urn:iso:std:iso:4217";
5463            case ERN: return "urn:iso:std:iso:4217";
5464            case ETB: return "urn:iso:std:iso:4217";
5465            case EUR: return "urn:iso:std:iso:4217";
5466            case FJD: return "urn:iso:std:iso:4217";
5467            case FKP: return "urn:iso:std:iso:4217";
5468            case GBP: return "urn:iso:std:iso:4217";
5469            case GEL: return "urn:iso:std:iso:4217";
5470            case GGP: return "urn:iso:std:iso:4217";
5471            case GHS: return "urn:iso:std:iso:4217";
5472            case GIP: return "urn:iso:std:iso:4217";
5473            case GMD: return "urn:iso:std:iso:4217";
5474            case GNF: return "urn:iso:std:iso:4217";
5475            case GTQ: return "urn:iso:std:iso:4217";
5476            case GYD: return "urn:iso:std:iso:4217";
5477            case HKD: return "urn:iso:std:iso:4217";
5478            case HNL: return "urn:iso:std:iso:4217";
5479            case HRK: return "urn:iso:std:iso:4217";
5480            case HTG: return "urn:iso:std:iso:4217";
5481            case HUF: return "urn:iso:std:iso:4217";
5482            case IDR: return "urn:iso:std:iso:4217";
5483            case ILS: return "urn:iso:std:iso:4217";
5484            case IMP: return "urn:iso:std:iso:4217";
5485            case INR: return "urn:iso:std:iso:4217";
5486            case IQD: return "urn:iso:std:iso:4217";
5487            case IRR: return "urn:iso:std:iso:4217";
5488            case ISK: return "urn:iso:std:iso:4217";
5489            case JEP: return "urn:iso:std:iso:4217";
5490            case JMD: return "urn:iso:std:iso:4217";
5491            case JOD: return "urn:iso:std:iso:4217";
5492            case JPY: return "urn:iso:std:iso:4217";
5493            case KES: return "urn:iso:std:iso:4217";
5494            case KGS: return "urn:iso:std:iso:4217";
5495            case KHR: return "urn:iso:std:iso:4217";
5496            case KMF: return "urn:iso:std:iso:4217";
5497            case KPW: return "urn:iso:std:iso:4217";
5498            case KRW: return "urn:iso:std:iso:4217";
5499            case KWD: return "urn:iso:std:iso:4217";
5500            case KYD: return "urn:iso:std:iso:4217";
5501            case KZT: return "urn:iso:std:iso:4217";
5502            case LAK: return "urn:iso:std:iso:4217";
5503            case LBP: return "urn:iso:std:iso:4217";
5504            case LKR: return "urn:iso:std:iso:4217";
5505            case LRD: return "urn:iso:std:iso:4217";
5506            case LSL: return "urn:iso:std:iso:4217";
5507            case LYD: return "urn:iso:std:iso:4217";
5508            case MAD: return "urn:iso:std:iso:4217";
5509            case MDL: return "urn:iso:std:iso:4217";
5510            case MGA: return "urn:iso:std:iso:4217";
5511            case MKD: return "urn:iso:std:iso:4217";
5512            case MMK: return "urn:iso:std:iso:4217";
5513            case MNT: return "urn:iso:std:iso:4217";
5514            case MOP: return "urn:iso:std:iso:4217";
5515            case MRU: return "urn:iso:std:iso:4217";
5516            case MUR: return "urn:iso:std:iso:4217";
5517            case MVR: return "urn:iso:std:iso:4217";
5518            case MWK: return "urn:iso:std:iso:4217";
5519            case MXN: return "urn:iso:std:iso:4217";
5520            case MXV: return "urn:iso:std:iso:4217";
5521            case MYR: return "urn:iso:std:iso:4217";
5522            case MZN: return "urn:iso:std:iso:4217";
5523            case NAD: return "urn:iso:std:iso:4217";
5524            case NGN: return "urn:iso:std:iso:4217";
5525            case NIO: return "urn:iso:std:iso:4217";
5526            case NOK: return "urn:iso:std:iso:4217";
5527            case NPR: return "urn:iso:std:iso:4217";
5528            case NZD: return "urn:iso:std:iso:4217";
5529            case OMR: return "urn:iso:std:iso:4217";
5530            case PAB: return "urn:iso:std:iso:4217";
5531            case PEN: return "urn:iso:std:iso:4217";
5532            case PGK: return "urn:iso:std:iso:4217";
5533            case PHP: return "urn:iso:std:iso:4217";
5534            case PKR: return "urn:iso:std:iso:4217";
5535            case PLN: return "urn:iso:std:iso:4217";
5536            case PYG: return "urn:iso:std:iso:4217";
5537            case QAR: return "urn:iso:std:iso:4217";
5538            case RON: return "urn:iso:std:iso:4217";
5539            case RSD: return "urn:iso:std:iso:4217";
5540            case RUB: return "urn:iso:std:iso:4217";
5541            case RWF: return "urn:iso:std:iso:4217";
5542            case SAR: return "urn:iso:std:iso:4217";
5543            case SBD: return "urn:iso:std:iso:4217";
5544            case SCR: return "urn:iso:std:iso:4217";
5545            case SDG: return "urn:iso:std:iso:4217";
5546            case SEK: return "urn:iso:std:iso:4217";
5547            case SGD: return "urn:iso:std:iso:4217";
5548            case SHP: return "urn:iso:std:iso:4217";
5549            case SLL: return "urn:iso:std:iso:4217";
5550            case SOS: return "urn:iso:std:iso:4217";
5551            case SRD: return "urn:iso:std:iso:4217";
5552            case SSP: return "urn:iso:std:iso:4217";
5553            case STN: return "urn:iso:std:iso:4217";
5554            case SVC: return "urn:iso:std:iso:4217";
5555            case SYP: return "urn:iso:std:iso:4217";
5556            case SZL: return "urn:iso:std:iso:4217";
5557            case THB: return "urn:iso:std:iso:4217";
5558            case TJS: return "urn:iso:std:iso:4217";
5559            case TMT: return "urn:iso:std:iso:4217";
5560            case TND: return "urn:iso:std:iso:4217";
5561            case TOP: return "urn:iso:std:iso:4217";
5562            case TRY: return "urn:iso:std:iso:4217";
5563            case TTD: return "urn:iso:std:iso:4217";
5564            case TVD: return "urn:iso:std:iso:4217";
5565            case TWD: return "urn:iso:std:iso:4217";
5566            case TZS: return "urn:iso:std:iso:4217";
5567            case UAH: return "urn:iso:std:iso:4217";
5568            case UGX: return "urn:iso:std:iso:4217";
5569            case USD: return "urn:iso:std:iso:4217";
5570            case USN: return "urn:iso:std:iso:4217";
5571            case UYI: return "urn:iso:std:iso:4217";
5572            case UYU: return "urn:iso:std:iso:4217";
5573            case UZS: return "urn:iso:std:iso:4217";
5574            case VEF: return "urn:iso:std:iso:4217";
5575            case VND: return "urn:iso:std:iso:4217";
5576            case VUV: return "urn:iso:std:iso:4217";
5577            case WST: return "urn:iso:std:iso:4217";
5578            case XAF: return "urn:iso:std:iso:4217";
5579            case XAG: return "urn:iso:std:iso:4217";
5580            case XAU: return "urn:iso:std:iso:4217";
5581            case XBA: return "urn:iso:std:iso:4217";
5582            case XBB: return "urn:iso:std:iso:4217";
5583            case XBC: return "urn:iso:std:iso:4217";
5584            case XBD: return "urn:iso:std:iso:4217";
5585            case XCD: return "urn:iso:std:iso:4217";
5586            case XDR: return "urn:iso:std:iso:4217";
5587            case XOF: return "urn:iso:std:iso:4217";
5588            case XPD: return "urn:iso:std:iso:4217";
5589            case XPF: return "urn:iso:std:iso:4217";
5590            case XPT: return "urn:iso:std:iso:4217";
5591            case XSU: return "urn:iso:std:iso:4217";
5592            case XTS: return "urn:iso:std:iso:4217";
5593            case XUA: return "urn:iso:std:iso:4217";
5594            case XXX: return "urn:iso:std:iso:4217";
5595            case YER: return "urn:iso:std:iso:4217";
5596            case ZAR: return "urn:iso:std:iso:4217";
5597            case ZMW: return "urn:iso:std:iso:4217";
5598            case ZWL: return "urn:iso:std:iso:4217";
5599            case NULL: return null;
5600            default: return "?";
5601          }
5602        }
5603        public String getDefinition() {
5604          switch (this) {
5605            case AED: return "";
5606            case AFN: return "";
5607            case ALL: return "";
5608            case AMD: return "";
5609            case ANG: return "";
5610            case AOA: return "";
5611            case ARS: return "";
5612            case AUD: return "";
5613            case AWG: return "";
5614            case AZN: return "";
5615            case BAM: return "";
5616            case BBD: return "";
5617            case BDT: return "";
5618            case BGN: return "";
5619            case BHD: return "";
5620            case BIF: return "";
5621            case BMD: return "";
5622            case BND: return "";
5623            case BOB: return "";
5624            case BOV: return "";
5625            case BRL: return "";
5626            case BSD: return "";
5627            case BTN: return "";
5628            case BWP: return "";
5629            case BYN: return "";
5630            case BZD: return "";
5631            case CAD: return "";
5632            case CDF: return "";
5633            case CHE: return "";
5634            case CHF: return "";
5635            case CHW: return "";
5636            case CLF: return "";
5637            case CLP: return "";
5638            case CNY: return "";
5639            case COP: return "";
5640            case COU: return "";
5641            case CRC: return "";
5642            case CUC: return "";
5643            case CUP: return "";
5644            case CVE: return "";
5645            case CZK: return "";
5646            case DJF: return "";
5647            case DKK: return "";
5648            case DOP: return "";
5649            case DZD: return "";
5650            case EGP: return "";
5651            case ERN: return "";
5652            case ETB: return "";
5653            case EUR: return "";
5654            case FJD: return "";
5655            case FKP: return "";
5656            case GBP: return "";
5657            case GEL: return "";
5658            case GGP: return "";
5659            case GHS: return "";
5660            case GIP: return "";
5661            case GMD: return "";
5662            case GNF: return "";
5663            case GTQ: return "";
5664            case GYD: return "";
5665            case HKD: return "";
5666            case HNL: return "";
5667            case HRK: return "";
5668            case HTG: return "";
5669            case HUF: return "";
5670            case IDR: return "";
5671            case ILS: return "";
5672            case IMP: return "";
5673            case INR: return "";
5674            case IQD: return "";
5675            case IRR: return "";
5676            case ISK: return "";
5677            case JEP: return "";
5678            case JMD: return "";
5679            case JOD: return "";
5680            case JPY: return "";
5681            case KES: return "";
5682            case KGS: return "";
5683            case KHR: return "";
5684            case KMF: return "";
5685            case KPW: return "";
5686            case KRW: return "";
5687            case KWD: return "";
5688            case KYD: return "";
5689            case KZT: return "";
5690            case LAK: return "";
5691            case LBP: return "";
5692            case LKR: return "";
5693            case LRD: return "";
5694            case LSL: return "";
5695            case LYD: return "";
5696            case MAD: return "";
5697            case MDL: return "";
5698            case MGA: return "";
5699            case MKD: return "";
5700            case MMK: return "";
5701            case MNT: return "";
5702            case MOP: return "";
5703            case MRU: return "";
5704            case MUR: return "";
5705            case MVR: return "";
5706            case MWK: return "";
5707            case MXN: return "";
5708            case MXV: return "";
5709            case MYR: return "";
5710            case MZN: return "";
5711            case NAD: return "";
5712            case NGN: return "";
5713            case NIO: return "";
5714            case NOK: return "";
5715            case NPR: return "";
5716            case NZD: return "";
5717            case OMR: return "";
5718            case PAB: return "";
5719            case PEN: return "";
5720            case PGK: return "";
5721            case PHP: return "";
5722            case PKR: return "";
5723            case PLN: return "";
5724            case PYG: return "";
5725            case QAR: return "";
5726            case RON: return "";
5727            case RSD: return "";
5728            case RUB: return "";
5729            case RWF: return "";
5730            case SAR: return "";
5731            case SBD: return "";
5732            case SCR: return "";
5733            case SDG: return "";
5734            case SEK: return "";
5735            case SGD: return "";
5736            case SHP: return "";
5737            case SLL: return "";
5738            case SOS: return "";
5739            case SRD: return "";
5740            case SSP: return "";
5741            case STN: return "";
5742            case SVC: return "";
5743            case SYP: return "";
5744            case SZL: return "";
5745            case THB: return "";
5746            case TJS: return "";
5747            case TMT: return "";
5748            case TND: return "";
5749            case TOP: return "";
5750            case TRY: return "";
5751            case TTD: return "";
5752            case TVD: return "";
5753            case TWD: return "";
5754            case TZS: return "";
5755            case UAH: return "";
5756            case UGX: return "";
5757            case USD: return "";
5758            case USN: return "";
5759            case UYI: return "";
5760            case UYU: return "";
5761            case UZS: return "";
5762            case VEF: return "";
5763            case VND: return "";
5764            case VUV: return "";
5765            case WST: return "";
5766            case XAF: return "";
5767            case XAG: return "";
5768            case XAU: return "";
5769            case XBA: return "";
5770            case XBB: return "";
5771            case XBC: return "";
5772            case XBD: return "";
5773            case XCD: return "";
5774            case XDR: return "";
5775            case XOF: return "";
5776            case XPD: return "";
5777            case XPF: return "";
5778            case XPT: return "";
5779            case XSU: return "";
5780            case XTS: return "";
5781            case XUA: return "";
5782            case XXX: return "";
5783            case YER: return "";
5784            case ZAR: return "";
5785            case ZMW: return "";
5786            case ZWL: return "";
5787            case NULL: return null;
5788            default: return "?";
5789          }
5790        }
5791        public String getDisplay() {
5792          switch (this) {
5793            case AED: return "United Arab Emirates dirham";
5794            case AFN: return "Afghan afghani";
5795            case ALL: return "Albanian lek";
5796            case AMD: return "Armenian dram";
5797            case ANG: return "Netherlands Antillean guilder";
5798            case AOA: return "Angolan kwanza";
5799            case ARS: return "Argentine peso";
5800            case AUD: return "Australian dollar";
5801            case AWG: return "Aruban florin";
5802            case AZN: return "Azerbaijani manat";
5803            case BAM: return "Bosnia and Herzegovina convertible mark";
5804            case BBD: return "Barbados dollar";
5805            case BDT: return "Bangladeshi taka";
5806            case BGN: return "Bulgarian lev";
5807            case BHD: return "Bahraini dinar";
5808            case BIF: return "Burundian franc";
5809            case BMD: return "Bermudian dollar";
5810            case BND: return "Brunei dollar";
5811            case BOB: return "Boliviano";
5812            case BOV: return "Bolivian Mvdol (funds code)";
5813            case BRL: return "Brazilian real";
5814            case BSD: return "Bahamian dollar";
5815            case BTN: return "Bhutanese ngultrum";
5816            case BWP: return "Botswana pula";
5817            case BYN: return "Belarusian ruble";
5818            case BZD: return "Belize dollar";
5819            case CAD: return "Canadian dollar";
5820            case CDF: return "Congolese franc";
5821            case CHE: return "WIR Euro (complementary currency)";
5822            case CHF: return "Swiss franc";
5823            case CHW: return "WIR Franc (complementary currency)";
5824            case CLF: return "Unidad de Fomento (funds code)";
5825            case CLP: return "Chilean peso";
5826            case CNY: return "Renminbi (Chinese) yuan[8]";
5827            case COP: return "Colombian peso";
5828            case COU: return "Unidad de Valor Real (UVR) (funds code)[9]";
5829            case CRC: return "Costa Rican colon";
5830            case CUC: return "Cuban convertible peso";
5831            case CUP: return "Cuban peso";
5832            case CVE: return "Cape Verde escudo";
5833            case CZK: return "Czech koruna";
5834            case DJF: return "Djiboutian franc";
5835            case DKK: return "Danish krone";
5836            case DOP: return "Dominican peso";
5837            case DZD: return "Algerian dinar";
5838            case EGP: return "Egyptian pound";
5839            case ERN: return "Eritrean nakfa";
5840            case ETB: return "Ethiopian birr";
5841            case EUR: return "Euro";
5842            case FJD: return "Fiji dollar";
5843            case FKP: return "Falkland Islands pound";
5844            case GBP: return "Pound sterling";
5845            case GEL: return "Georgian lari";
5846            case GGP: return "Guernsey Pound";
5847            case GHS: return "Ghanaian cedi";
5848            case GIP: return "Gibraltar pound";
5849            case GMD: return "Gambian dalasi";
5850            case GNF: return "Guinean franc";
5851            case GTQ: return "Guatemalan quetzal";
5852            case GYD: return "Guyanese dollar";
5853            case HKD: return "Hong Kong dollar";
5854            case HNL: return "Honduran lempira";
5855            case HRK: return "Croatian kuna";
5856            case HTG: return "Haitian gourde";
5857            case HUF: return "Hungarian forint";
5858            case IDR: return "Indonesian rupiah";
5859            case ILS: return "Israeli new shekel";
5860            case IMP: return "Isle of Man Pound";
5861            case INR: return "Indian rupee";
5862            case IQD: return "Iraqi dinar";
5863            case IRR: return "Iranian rial";
5864            case ISK: return "Icelandic króna";
5865            case JEP: return "Jersey Pound";
5866            case JMD: return "Jamaican dollar";
5867            case JOD: return "Jordanian dinar";
5868            case JPY: return "Japanese yen";
5869            case KES: return "Kenyan shilling";
5870            case KGS: return "Kyrgyzstani som";
5871            case KHR: return "Cambodian riel";
5872            case KMF: return "Comoro franc";
5873            case KPW: return "North Korean won";
5874            case KRW: return "South Korean won";
5875            case KWD: return "Kuwaiti dinar";
5876            case KYD: return "Cayman Islands dollar";
5877            case KZT: return "Kazakhstani tenge";
5878            case LAK: return "Lao kip";
5879            case LBP: return "Lebanese pound";
5880            case LKR: return "Sri Lankan rupee";
5881            case LRD: return "Liberian dollar";
5882            case LSL: return "Lesotho loti";
5883            case LYD: return "Libyan dinar";
5884            case MAD: return "Moroccan dirham";
5885            case MDL: return "Moldovan leu";
5886            case MGA: return "Malagasy ariary";
5887            case MKD: return "Macedonian denar";
5888            case MMK: return "Myanmar kyat";
5889            case MNT: return "Mongolian tögrög";
5890            case MOP: return "Macanese pataca";
5891            case MRU: return "Mauritanian ouguiya";
5892            case MUR: return "Mauritian rupee";
5893            case MVR: return "Maldivian rufiyaa";
5894            case MWK: return "Malawian kwacha";
5895            case MXN: return "Mexican peso";
5896            case MXV: return "Mexican Unidad de Inversion (UDI) (funds code)";
5897            case MYR: return "Malaysian ringgit";
5898            case MZN: return "Mozambican metical";
5899            case NAD: return "Namibian dollar";
5900            case NGN: return "Nigerian naira";
5901            case NIO: return "Nicaraguan córdoba";
5902            case NOK: return "Norwegian krone";
5903            case NPR: return "Nepalese rupee";
5904            case NZD: return "New Zealand dollar";
5905            case OMR: return "Omani rial";
5906            case PAB: return "Panamanian balboa";
5907            case PEN: return "Peruvian Sol";
5908            case PGK: return "Papua New Guinean kina";
5909            case PHP: return "Philippine piso[13]";
5910            case PKR: return "Pakistani rupee";
5911            case PLN: return "Polish z?oty";
5912            case PYG: return "Paraguayan guaraní";
5913            case QAR: return "Qatari riyal";
5914            case RON: return "Romanian leu";
5915            case RSD: return "Serbian dinar";
5916            case RUB: return "Russian ruble";
5917            case RWF: return "Rwandan franc";
5918            case SAR: return "Saudi riyal";
5919            case SBD: return "Solomon Islands dollar";
5920            case SCR: return "Seychelles rupee";
5921            case SDG: return "Sudanese pound";
5922            case SEK: return "Swedish krona/kronor";
5923            case SGD: return "Singapore dollar";
5924            case SHP: return "Saint Helena pound";
5925            case SLL: return "Sierra Leonean leone";
5926            case SOS: return "Somali shilling";
5927            case SRD: return "Surinamese dollar";
5928            case SSP: return "South Sudanese pound";
5929            case STN: return "São Tomé and Príncipe dobra";
5930            case SVC: return "Salvadoran colón";
5931            case SYP: return "Syrian pound";
5932            case SZL: return "Swazi lilangeni";
5933            case THB: return "Thai baht";
5934            case TJS: return "Tajikistani somoni";
5935            case TMT: return "Turkmenistan manat";
5936            case TND: return "Tunisian dinar";
5937            case TOP: return "Tongan pa?anga";
5938            case TRY: return "Turkish lira";
5939            case TTD: return "Trinidad and Tobago dollar";
5940            case TVD: return "Tuvalu Dollar";
5941            case TWD: return "New Taiwan dollar";
5942            case TZS: return "Tanzanian shilling";
5943            case UAH: return "Ukrainian hryvnia";
5944            case UGX: return "Ugandan shilling";
5945            case USD: return "United States dollar";
5946            case USN: return "United States dollar (next day) (funds code)";
5947            case UYI: return "Uruguay Peso en Unidades Indexadas (URUIURUI) (funds code)";
5948            case UYU: return "Uruguayan peso";
5949            case UZS: return "Uzbekistan som";
5950            case VEF: return "Venezuelan bolívar";
5951            case VND: return "Vietnamese ??ng";
5952            case VUV: return "Vanuatu vatu";
5953            case WST: return "Samoan tala";
5954            case XAF: return "CFA franc BEAC";
5955            case XAG: return "Silver (one troy ounce)";
5956            case XAU: return "Gold (one troy ounce)";
5957            case XBA: return "European Composite Unit (EURCO) (bond market unit)";
5958            case XBB: return "European Monetary Unit (E.M.U.-6) (bond market unit)";
5959            case XBC: return "European Unit of Account 9 (E.U.A.-9) (bond market unit)";
5960            case XBD: return "European Unit of Account 17 (E.U.A.-17) (bond market unit)";
5961            case XCD: return "East Caribbean dollar";
5962            case XDR: return "Special drawing rights";
5963            case XOF: return "CFA franc BCEAO";
5964            case XPD: return "Palladium (one troy ounce)";
5965            case XPF: return "CFP franc (franc Pacifique)";
5966            case XPT: return "Platinum (one troy ounce)";
5967            case XSU: return "SUCRE";
5968            case XTS: return "Code reserved for testing purposes";
5969            case XUA: return "ADB Unit of Account";
5970            case XXX: return "No currency";
5971            case YER: return "Yemeni rial";
5972            case ZAR: return "South African rand";
5973            case ZMW: return "Zambian kwacha";
5974            case ZWL: return "Zimbabwean dollar A/10";
5975            case NULL: return null;
5976            default: return "?";
5977          }
5978        }
5979    }
5980
5981  public static class CurrenciesEnumFactory implements EnumFactory<Currencies> {
5982    public Currencies fromCode(String codeString) throws IllegalArgumentException {
5983      if (codeString == null || "".equals(codeString))
5984            if (codeString == null || "".equals(codeString))
5985                return null;
5986        if ("AED".equals(codeString))
5987          return Currencies.AED;
5988        if ("AFN".equals(codeString))
5989          return Currencies.AFN;
5990        if ("ALL".equals(codeString))
5991          return Currencies.ALL;
5992        if ("AMD".equals(codeString))
5993          return Currencies.AMD;
5994        if ("ANG".equals(codeString))
5995          return Currencies.ANG;
5996        if ("AOA".equals(codeString))
5997          return Currencies.AOA;
5998        if ("ARS".equals(codeString))
5999          return Currencies.ARS;
6000        if ("AUD".equals(codeString))
6001          return Currencies.AUD;
6002        if ("AWG".equals(codeString))
6003          return Currencies.AWG;
6004        if ("AZN".equals(codeString))
6005          return Currencies.AZN;
6006        if ("BAM".equals(codeString))
6007          return Currencies.BAM;
6008        if ("BBD".equals(codeString))
6009          return Currencies.BBD;
6010        if ("BDT".equals(codeString))
6011          return Currencies.BDT;
6012        if ("BGN".equals(codeString))
6013          return Currencies.BGN;
6014        if ("BHD".equals(codeString))
6015          return Currencies.BHD;
6016        if ("BIF".equals(codeString))
6017          return Currencies.BIF;
6018        if ("BMD".equals(codeString))
6019          return Currencies.BMD;
6020        if ("BND".equals(codeString))
6021          return Currencies.BND;
6022        if ("BOB".equals(codeString))
6023          return Currencies.BOB;
6024        if ("BOV".equals(codeString))
6025          return Currencies.BOV;
6026        if ("BRL".equals(codeString))
6027          return Currencies.BRL;
6028        if ("BSD".equals(codeString))
6029          return Currencies.BSD;
6030        if ("BTN".equals(codeString))
6031          return Currencies.BTN;
6032        if ("BWP".equals(codeString))
6033          return Currencies.BWP;
6034        if ("BYN".equals(codeString))
6035          return Currencies.BYN;
6036        if ("BZD".equals(codeString))
6037          return Currencies.BZD;
6038        if ("CAD".equals(codeString))
6039          return Currencies.CAD;
6040        if ("CDF".equals(codeString))
6041          return Currencies.CDF;
6042        if ("CHE".equals(codeString))
6043          return Currencies.CHE;
6044        if ("CHF".equals(codeString))
6045          return Currencies.CHF;
6046        if ("CHW".equals(codeString))
6047          return Currencies.CHW;
6048        if ("CLF".equals(codeString))
6049          return Currencies.CLF;
6050        if ("CLP".equals(codeString))
6051          return Currencies.CLP;
6052        if ("CNY".equals(codeString))
6053          return Currencies.CNY;
6054        if ("COP".equals(codeString))
6055          return Currencies.COP;
6056        if ("COU".equals(codeString))
6057          return Currencies.COU;
6058        if ("CRC".equals(codeString))
6059          return Currencies.CRC;
6060        if ("CUC".equals(codeString))
6061          return Currencies.CUC;
6062        if ("CUP".equals(codeString))
6063          return Currencies.CUP;
6064        if ("CVE".equals(codeString))
6065          return Currencies.CVE;
6066        if ("CZK".equals(codeString))
6067          return Currencies.CZK;
6068        if ("DJF".equals(codeString))
6069          return Currencies.DJF;
6070        if ("DKK".equals(codeString))
6071          return Currencies.DKK;
6072        if ("DOP".equals(codeString))
6073          return Currencies.DOP;
6074        if ("DZD".equals(codeString))
6075          return Currencies.DZD;
6076        if ("EGP".equals(codeString))
6077          return Currencies.EGP;
6078        if ("ERN".equals(codeString))
6079          return Currencies.ERN;
6080        if ("ETB".equals(codeString))
6081          return Currencies.ETB;
6082        if ("EUR".equals(codeString))
6083          return Currencies.EUR;
6084        if ("FJD".equals(codeString))
6085          return Currencies.FJD;
6086        if ("FKP".equals(codeString))
6087          return Currencies.FKP;
6088        if ("GBP".equals(codeString))
6089          return Currencies.GBP;
6090        if ("GEL".equals(codeString))
6091          return Currencies.GEL;
6092        if ("GGP".equals(codeString))
6093          return Currencies.GGP;
6094        if ("GHS".equals(codeString))
6095          return Currencies.GHS;
6096        if ("GIP".equals(codeString))
6097          return Currencies.GIP;
6098        if ("GMD".equals(codeString))
6099          return Currencies.GMD;
6100        if ("GNF".equals(codeString))
6101          return Currencies.GNF;
6102        if ("GTQ".equals(codeString))
6103          return Currencies.GTQ;
6104        if ("GYD".equals(codeString))
6105          return Currencies.GYD;
6106        if ("HKD".equals(codeString))
6107          return Currencies.HKD;
6108        if ("HNL".equals(codeString))
6109          return Currencies.HNL;
6110        if ("HRK".equals(codeString))
6111          return Currencies.HRK;
6112        if ("HTG".equals(codeString))
6113          return Currencies.HTG;
6114        if ("HUF".equals(codeString))
6115          return Currencies.HUF;
6116        if ("IDR".equals(codeString))
6117          return Currencies.IDR;
6118        if ("ILS".equals(codeString))
6119          return Currencies.ILS;
6120        if ("IMP".equals(codeString))
6121          return Currencies.IMP;
6122        if ("INR".equals(codeString))
6123          return Currencies.INR;
6124        if ("IQD".equals(codeString))
6125          return Currencies.IQD;
6126        if ("IRR".equals(codeString))
6127          return Currencies.IRR;
6128        if ("ISK".equals(codeString))
6129          return Currencies.ISK;
6130        if ("JEP".equals(codeString))
6131          return Currencies.JEP;
6132        if ("JMD".equals(codeString))
6133          return Currencies.JMD;
6134        if ("JOD".equals(codeString))
6135          return Currencies.JOD;
6136        if ("JPY".equals(codeString))
6137          return Currencies.JPY;
6138        if ("KES".equals(codeString))
6139          return Currencies.KES;
6140        if ("KGS".equals(codeString))
6141          return Currencies.KGS;
6142        if ("KHR".equals(codeString))
6143          return Currencies.KHR;
6144        if ("KMF".equals(codeString))
6145          return Currencies.KMF;
6146        if ("KPW".equals(codeString))
6147          return Currencies.KPW;
6148        if ("KRW".equals(codeString))
6149          return Currencies.KRW;
6150        if ("KWD".equals(codeString))
6151          return Currencies.KWD;
6152        if ("KYD".equals(codeString))
6153          return Currencies.KYD;
6154        if ("KZT".equals(codeString))
6155          return Currencies.KZT;
6156        if ("LAK".equals(codeString))
6157          return Currencies.LAK;
6158        if ("LBP".equals(codeString))
6159          return Currencies.LBP;
6160        if ("LKR".equals(codeString))
6161          return Currencies.LKR;
6162        if ("LRD".equals(codeString))
6163          return Currencies.LRD;
6164        if ("LSL".equals(codeString))
6165          return Currencies.LSL;
6166        if ("LYD".equals(codeString))
6167          return Currencies.LYD;
6168        if ("MAD".equals(codeString))
6169          return Currencies.MAD;
6170        if ("MDL".equals(codeString))
6171          return Currencies.MDL;
6172        if ("MGA".equals(codeString))
6173          return Currencies.MGA;
6174        if ("MKD".equals(codeString))
6175          return Currencies.MKD;
6176        if ("MMK".equals(codeString))
6177          return Currencies.MMK;
6178        if ("MNT".equals(codeString))
6179          return Currencies.MNT;
6180        if ("MOP".equals(codeString))
6181          return Currencies.MOP;
6182        if ("MRU".equals(codeString))
6183          return Currencies.MRU;
6184        if ("MUR".equals(codeString))
6185          return Currencies.MUR;
6186        if ("MVR".equals(codeString))
6187          return Currencies.MVR;
6188        if ("MWK".equals(codeString))
6189          return Currencies.MWK;
6190        if ("MXN".equals(codeString))
6191          return Currencies.MXN;
6192        if ("MXV".equals(codeString))
6193          return Currencies.MXV;
6194        if ("MYR".equals(codeString))
6195          return Currencies.MYR;
6196        if ("MZN".equals(codeString))
6197          return Currencies.MZN;
6198        if ("NAD".equals(codeString))
6199          return Currencies.NAD;
6200        if ("NGN".equals(codeString))
6201          return Currencies.NGN;
6202        if ("NIO".equals(codeString))
6203          return Currencies.NIO;
6204        if ("NOK".equals(codeString))
6205          return Currencies.NOK;
6206        if ("NPR".equals(codeString))
6207          return Currencies.NPR;
6208        if ("NZD".equals(codeString))
6209          return Currencies.NZD;
6210        if ("OMR".equals(codeString))
6211          return Currencies.OMR;
6212        if ("PAB".equals(codeString))
6213          return Currencies.PAB;
6214        if ("PEN".equals(codeString))
6215          return Currencies.PEN;
6216        if ("PGK".equals(codeString))
6217          return Currencies.PGK;
6218        if ("PHP".equals(codeString))
6219          return Currencies.PHP;
6220        if ("PKR".equals(codeString))
6221          return Currencies.PKR;
6222        if ("PLN".equals(codeString))
6223          return Currencies.PLN;
6224        if ("PYG".equals(codeString))
6225          return Currencies.PYG;
6226        if ("QAR".equals(codeString))
6227          return Currencies.QAR;
6228        if ("RON".equals(codeString))
6229          return Currencies.RON;
6230        if ("RSD".equals(codeString))
6231          return Currencies.RSD;
6232        if ("RUB".equals(codeString))
6233          return Currencies.RUB;
6234        if ("RWF".equals(codeString))
6235          return Currencies.RWF;
6236        if ("SAR".equals(codeString))
6237          return Currencies.SAR;
6238        if ("SBD".equals(codeString))
6239          return Currencies.SBD;
6240        if ("SCR".equals(codeString))
6241          return Currencies.SCR;
6242        if ("SDG".equals(codeString))
6243          return Currencies.SDG;
6244        if ("SEK".equals(codeString))
6245          return Currencies.SEK;
6246        if ("SGD".equals(codeString))
6247          return Currencies.SGD;
6248        if ("SHP".equals(codeString))
6249          return Currencies.SHP;
6250        if ("SLL".equals(codeString))
6251          return Currencies.SLL;
6252        if ("SOS".equals(codeString))
6253          return Currencies.SOS;
6254        if ("SRD".equals(codeString))
6255          return Currencies.SRD;
6256        if ("SSP".equals(codeString))
6257          return Currencies.SSP;
6258        if ("STN".equals(codeString))
6259          return Currencies.STN;
6260        if ("SVC".equals(codeString))
6261          return Currencies.SVC;
6262        if ("SYP".equals(codeString))
6263          return Currencies.SYP;
6264        if ("SZL".equals(codeString))
6265          return Currencies.SZL;
6266        if ("THB".equals(codeString))
6267          return Currencies.THB;
6268        if ("TJS".equals(codeString))
6269          return Currencies.TJS;
6270        if ("TMT".equals(codeString))
6271          return Currencies.TMT;
6272        if ("TND".equals(codeString))
6273          return Currencies.TND;
6274        if ("TOP".equals(codeString))
6275          return Currencies.TOP;
6276        if ("TRY".equals(codeString))
6277          return Currencies.TRY;
6278        if ("TTD".equals(codeString))
6279          return Currencies.TTD;
6280        if ("TVD".equals(codeString))
6281          return Currencies.TVD;
6282        if ("TWD".equals(codeString))
6283          return Currencies.TWD;
6284        if ("TZS".equals(codeString))
6285          return Currencies.TZS;
6286        if ("UAH".equals(codeString))
6287          return Currencies.UAH;
6288        if ("UGX".equals(codeString))
6289          return Currencies.UGX;
6290        if ("USD".equals(codeString))
6291          return Currencies.USD;
6292        if ("USN".equals(codeString))
6293          return Currencies.USN;
6294        if ("UYI".equals(codeString))
6295          return Currencies.UYI;
6296        if ("UYU".equals(codeString))
6297          return Currencies.UYU;
6298        if ("UZS".equals(codeString))
6299          return Currencies.UZS;
6300        if ("VEF".equals(codeString))
6301          return Currencies.VEF;
6302        if ("VND".equals(codeString))
6303          return Currencies.VND;
6304        if ("VUV".equals(codeString))
6305          return Currencies.VUV;
6306        if ("WST".equals(codeString))
6307          return Currencies.WST;
6308        if ("XAF".equals(codeString))
6309          return Currencies.XAF;
6310        if ("XAG".equals(codeString))
6311          return Currencies.XAG;
6312        if ("XAU".equals(codeString))
6313          return Currencies.XAU;
6314        if ("XBA".equals(codeString))
6315          return Currencies.XBA;
6316        if ("XBB".equals(codeString))
6317          return Currencies.XBB;
6318        if ("XBC".equals(codeString))
6319          return Currencies.XBC;
6320        if ("XBD".equals(codeString))
6321          return Currencies.XBD;
6322        if ("XCD".equals(codeString))
6323          return Currencies.XCD;
6324        if ("XDR".equals(codeString))
6325          return Currencies.XDR;
6326        if ("XOF".equals(codeString))
6327          return Currencies.XOF;
6328        if ("XPD".equals(codeString))
6329          return Currencies.XPD;
6330        if ("XPF".equals(codeString))
6331          return Currencies.XPF;
6332        if ("XPT".equals(codeString))
6333          return Currencies.XPT;
6334        if ("XSU".equals(codeString))
6335          return Currencies.XSU;
6336        if ("XTS".equals(codeString))
6337          return Currencies.XTS;
6338        if ("XUA".equals(codeString))
6339          return Currencies.XUA;
6340        if ("XXX".equals(codeString))
6341          return Currencies.XXX;
6342        if ("YER".equals(codeString))
6343          return Currencies.YER;
6344        if ("ZAR".equals(codeString))
6345          return Currencies.ZAR;
6346        if ("ZMW".equals(codeString))
6347          return Currencies.ZMW;
6348        if ("ZWL".equals(codeString))
6349          return Currencies.ZWL;
6350        throw new IllegalArgumentException("Unknown Currencies code '"+codeString+"'");
6351        }
6352
6353        public Enumeration<Currencies> fromType(PrimitiveType<?> code) throws FHIRException {
6354          if (code == null)
6355            return null;
6356          if (code.isEmpty())
6357            return new Enumeration<Currencies>(this, Currencies.NULL, code);
6358          String codeString = ((PrimitiveType) code).asStringValue();
6359          if (codeString == null || "".equals(codeString))
6360            return new Enumeration<Currencies>(this, Currencies.NULL, code);
6361        if ("AED".equals(codeString))
6362          return new Enumeration<Currencies>(this, Currencies.AED, code);
6363        if ("AFN".equals(codeString))
6364          return new Enumeration<Currencies>(this, Currencies.AFN, code);
6365        if ("ALL".equals(codeString))
6366          return new Enumeration<Currencies>(this, Currencies.ALL, code);
6367        if ("AMD".equals(codeString))
6368          return new Enumeration<Currencies>(this, Currencies.AMD, code);
6369        if ("ANG".equals(codeString))
6370          return new Enumeration<Currencies>(this, Currencies.ANG, code);
6371        if ("AOA".equals(codeString))
6372          return new Enumeration<Currencies>(this, Currencies.AOA, code);
6373        if ("ARS".equals(codeString))
6374          return new Enumeration<Currencies>(this, Currencies.ARS, code);
6375        if ("AUD".equals(codeString))
6376          return new Enumeration<Currencies>(this, Currencies.AUD, code);
6377        if ("AWG".equals(codeString))
6378          return new Enumeration<Currencies>(this, Currencies.AWG, code);
6379        if ("AZN".equals(codeString))
6380          return new Enumeration<Currencies>(this, Currencies.AZN, code);
6381        if ("BAM".equals(codeString))
6382          return new Enumeration<Currencies>(this, Currencies.BAM, code);
6383        if ("BBD".equals(codeString))
6384          return new Enumeration<Currencies>(this, Currencies.BBD, code);
6385        if ("BDT".equals(codeString))
6386          return new Enumeration<Currencies>(this, Currencies.BDT, code);
6387        if ("BGN".equals(codeString))
6388          return new Enumeration<Currencies>(this, Currencies.BGN, code);
6389        if ("BHD".equals(codeString))
6390          return new Enumeration<Currencies>(this, Currencies.BHD, code);
6391        if ("BIF".equals(codeString))
6392          return new Enumeration<Currencies>(this, Currencies.BIF, code);
6393        if ("BMD".equals(codeString))
6394          return new Enumeration<Currencies>(this, Currencies.BMD, code);
6395        if ("BND".equals(codeString))
6396          return new Enumeration<Currencies>(this, Currencies.BND, code);
6397        if ("BOB".equals(codeString))
6398          return new Enumeration<Currencies>(this, Currencies.BOB, code);
6399        if ("BOV".equals(codeString))
6400          return new Enumeration<Currencies>(this, Currencies.BOV, code);
6401        if ("BRL".equals(codeString))
6402          return new Enumeration<Currencies>(this, Currencies.BRL, code);
6403        if ("BSD".equals(codeString))
6404          return new Enumeration<Currencies>(this, Currencies.BSD, code);
6405        if ("BTN".equals(codeString))
6406          return new Enumeration<Currencies>(this, Currencies.BTN, code);
6407        if ("BWP".equals(codeString))
6408          return new Enumeration<Currencies>(this, Currencies.BWP, code);
6409        if ("BYN".equals(codeString))
6410          return new Enumeration<Currencies>(this, Currencies.BYN, code);
6411        if ("BZD".equals(codeString))
6412          return new Enumeration<Currencies>(this, Currencies.BZD, code);
6413        if ("CAD".equals(codeString))
6414          return new Enumeration<Currencies>(this, Currencies.CAD, code);
6415        if ("CDF".equals(codeString))
6416          return new Enumeration<Currencies>(this, Currencies.CDF, code);
6417        if ("CHE".equals(codeString))
6418          return new Enumeration<Currencies>(this, Currencies.CHE, code);
6419        if ("CHF".equals(codeString))
6420          return new Enumeration<Currencies>(this, Currencies.CHF, code);
6421        if ("CHW".equals(codeString))
6422          return new Enumeration<Currencies>(this, Currencies.CHW, code);
6423        if ("CLF".equals(codeString))
6424          return new Enumeration<Currencies>(this, Currencies.CLF, code);
6425        if ("CLP".equals(codeString))
6426          return new Enumeration<Currencies>(this, Currencies.CLP, code);
6427        if ("CNY".equals(codeString))
6428          return new Enumeration<Currencies>(this, Currencies.CNY, code);
6429        if ("COP".equals(codeString))
6430          return new Enumeration<Currencies>(this, Currencies.COP, code);
6431        if ("COU".equals(codeString))
6432          return new Enumeration<Currencies>(this, Currencies.COU, code);
6433        if ("CRC".equals(codeString))
6434          return new Enumeration<Currencies>(this, Currencies.CRC, code);
6435        if ("CUC".equals(codeString))
6436          return new Enumeration<Currencies>(this, Currencies.CUC, code);
6437        if ("CUP".equals(codeString))
6438          return new Enumeration<Currencies>(this, Currencies.CUP, code);
6439        if ("CVE".equals(codeString))
6440          return new Enumeration<Currencies>(this, Currencies.CVE, code);
6441        if ("CZK".equals(codeString))
6442          return new Enumeration<Currencies>(this, Currencies.CZK, code);
6443        if ("DJF".equals(codeString))
6444          return new Enumeration<Currencies>(this, Currencies.DJF, code);
6445        if ("DKK".equals(codeString))
6446          return new Enumeration<Currencies>(this, Currencies.DKK, code);
6447        if ("DOP".equals(codeString))
6448          return new Enumeration<Currencies>(this, Currencies.DOP, code);
6449        if ("DZD".equals(codeString))
6450          return new Enumeration<Currencies>(this, Currencies.DZD, code);
6451        if ("EGP".equals(codeString))
6452          return new Enumeration<Currencies>(this, Currencies.EGP, code);
6453        if ("ERN".equals(codeString))
6454          return new Enumeration<Currencies>(this, Currencies.ERN, code);
6455        if ("ETB".equals(codeString))
6456          return new Enumeration<Currencies>(this, Currencies.ETB, code);
6457        if ("EUR".equals(codeString))
6458          return new Enumeration<Currencies>(this, Currencies.EUR, code);
6459        if ("FJD".equals(codeString))
6460          return new Enumeration<Currencies>(this, Currencies.FJD, code);
6461        if ("FKP".equals(codeString))
6462          return new Enumeration<Currencies>(this, Currencies.FKP, code);
6463        if ("GBP".equals(codeString))
6464          return new Enumeration<Currencies>(this, Currencies.GBP, code);
6465        if ("GEL".equals(codeString))
6466          return new Enumeration<Currencies>(this, Currencies.GEL, code);
6467        if ("GGP".equals(codeString))
6468          return new Enumeration<Currencies>(this, Currencies.GGP, code);
6469        if ("GHS".equals(codeString))
6470          return new Enumeration<Currencies>(this, Currencies.GHS, code);
6471        if ("GIP".equals(codeString))
6472          return new Enumeration<Currencies>(this, Currencies.GIP, code);
6473        if ("GMD".equals(codeString))
6474          return new Enumeration<Currencies>(this, Currencies.GMD, code);
6475        if ("GNF".equals(codeString))
6476          return new Enumeration<Currencies>(this, Currencies.GNF, code);
6477        if ("GTQ".equals(codeString))
6478          return new Enumeration<Currencies>(this, Currencies.GTQ, code);
6479        if ("GYD".equals(codeString))
6480          return new Enumeration<Currencies>(this, Currencies.GYD, code);
6481        if ("HKD".equals(codeString))
6482          return new Enumeration<Currencies>(this, Currencies.HKD, code);
6483        if ("HNL".equals(codeString))
6484          return new Enumeration<Currencies>(this, Currencies.HNL, code);
6485        if ("HRK".equals(codeString))
6486          return new Enumeration<Currencies>(this, Currencies.HRK, code);
6487        if ("HTG".equals(codeString))
6488          return new Enumeration<Currencies>(this, Currencies.HTG, code);
6489        if ("HUF".equals(codeString))
6490          return new Enumeration<Currencies>(this, Currencies.HUF, code);
6491        if ("IDR".equals(codeString))
6492          return new Enumeration<Currencies>(this, Currencies.IDR, code);
6493        if ("ILS".equals(codeString))
6494          return new Enumeration<Currencies>(this, Currencies.ILS, code);
6495        if ("IMP".equals(codeString))
6496          return new Enumeration<Currencies>(this, Currencies.IMP, code);
6497        if ("INR".equals(codeString))
6498          return new Enumeration<Currencies>(this, Currencies.INR, code);
6499        if ("IQD".equals(codeString))
6500          return new Enumeration<Currencies>(this, Currencies.IQD, code);
6501        if ("IRR".equals(codeString))
6502          return new Enumeration<Currencies>(this, Currencies.IRR, code);
6503        if ("ISK".equals(codeString))
6504          return new Enumeration<Currencies>(this, Currencies.ISK, code);
6505        if ("JEP".equals(codeString))
6506          return new Enumeration<Currencies>(this, Currencies.JEP, code);
6507        if ("JMD".equals(codeString))
6508          return new Enumeration<Currencies>(this, Currencies.JMD, code);
6509        if ("JOD".equals(codeString))
6510          return new Enumeration<Currencies>(this, Currencies.JOD, code);
6511        if ("JPY".equals(codeString))
6512          return new Enumeration<Currencies>(this, Currencies.JPY, code);
6513        if ("KES".equals(codeString))
6514          return new Enumeration<Currencies>(this, Currencies.KES, code);
6515        if ("KGS".equals(codeString))
6516          return new Enumeration<Currencies>(this, Currencies.KGS, code);
6517        if ("KHR".equals(codeString))
6518          return new Enumeration<Currencies>(this, Currencies.KHR, code);
6519        if ("KMF".equals(codeString))
6520          return new Enumeration<Currencies>(this, Currencies.KMF, code);
6521        if ("KPW".equals(codeString))
6522          return new Enumeration<Currencies>(this, Currencies.KPW, code);
6523        if ("KRW".equals(codeString))
6524          return new Enumeration<Currencies>(this, Currencies.KRW, code);
6525        if ("KWD".equals(codeString))
6526          return new Enumeration<Currencies>(this, Currencies.KWD, code);
6527        if ("KYD".equals(codeString))
6528          return new Enumeration<Currencies>(this, Currencies.KYD, code);
6529        if ("KZT".equals(codeString))
6530          return new Enumeration<Currencies>(this, Currencies.KZT, code);
6531        if ("LAK".equals(codeString))
6532          return new Enumeration<Currencies>(this, Currencies.LAK, code);
6533        if ("LBP".equals(codeString))
6534          return new Enumeration<Currencies>(this, Currencies.LBP, code);
6535        if ("LKR".equals(codeString))
6536          return new Enumeration<Currencies>(this, Currencies.LKR, code);
6537        if ("LRD".equals(codeString))
6538          return new Enumeration<Currencies>(this, Currencies.LRD, code);
6539        if ("LSL".equals(codeString))
6540          return new Enumeration<Currencies>(this, Currencies.LSL, code);
6541        if ("LYD".equals(codeString))
6542          return new Enumeration<Currencies>(this, Currencies.LYD, code);
6543        if ("MAD".equals(codeString))
6544          return new Enumeration<Currencies>(this, Currencies.MAD, code);
6545        if ("MDL".equals(codeString))
6546          return new Enumeration<Currencies>(this, Currencies.MDL, code);
6547        if ("MGA".equals(codeString))
6548          return new Enumeration<Currencies>(this, Currencies.MGA, code);
6549        if ("MKD".equals(codeString))
6550          return new Enumeration<Currencies>(this, Currencies.MKD, code);
6551        if ("MMK".equals(codeString))
6552          return new Enumeration<Currencies>(this, Currencies.MMK, code);
6553        if ("MNT".equals(codeString))
6554          return new Enumeration<Currencies>(this, Currencies.MNT, code);
6555        if ("MOP".equals(codeString))
6556          return new Enumeration<Currencies>(this, Currencies.MOP, code);
6557        if ("MRU".equals(codeString))
6558          return new Enumeration<Currencies>(this, Currencies.MRU, code);
6559        if ("MUR".equals(codeString))
6560          return new Enumeration<Currencies>(this, Currencies.MUR, code);
6561        if ("MVR".equals(codeString))
6562          return new Enumeration<Currencies>(this, Currencies.MVR, code);
6563        if ("MWK".equals(codeString))
6564          return new Enumeration<Currencies>(this, Currencies.MWK, code);
6565        if ("MXN".equals(codeString))
6566          return new Enumeration<Currencies>(this, Currencies.MXN, code);
6567        if ("MXV".equals(codeString))
6568          return new Enumeration<Currencies>(this, Currencies.MXV, code);
6569        if ("MYR".equals(codeString))
6570          return new Enumeration<Currencies>(this, Currencies.MYR, code);
6571        if ("MZN".equals(codeString))
6572          return new Enumeration<Currencies>(this, Currencies.MZN, code);
6573        if ("NAD".equals(codeString))
6574          return new Enumeration<Currencies>(this, Currencies.NAD, code);
6575        if ("NGN".equals(codeString))
6576          return new Enumeration<Currencies>(this, Currencies.NGN, code);
6577        if ("NIO".equals(codeString))
6578          return new Enumeration<Currencies>(this, Currencies.NIO, code);
6579        if ("NOK".equals(codeString))
6580          return new Enumeration<Currencies>(this, Currencies.NOK, code);
6581        if ("NPR".equals(codeString))
6582          return new Enumeration<Currencies>(this, Currencies.NPR, code);
6583        if ("NZD".equals(codeString))
6584          return new Enumeration<Currencies>(this, Currencies.NZD, code);
6585        if ("OMR".equals(codeString))
6586          return new Enumeration<Currencies>(this, Currencies.OMR, code);
6587        if ("PAB".equals(codeString))
6588          return new Enumeration<Currencies>(this, Currencies.PAB, code);
6589        if ("PEN".equals(codeString))
6590          return new Enumeration<Currencies>(this, Currencies.PEN, code);
6591        if ("PGK".equals(codeString))
6592          return new Enumeration<Currencies>(this, Currencies.PGK, code);
6593        if ("PHP".equals(codeString))
6594          return new Enumeration<Currencies>(this, Currencies.PHP, code);
6595        if ("PKR".equals(codeString))
6596          return new Enumeration<Currencies>(this, Currencies.PKR, code);
6597        if ("PLN".equals(codeString))
6598          return new Enumeration<Currencies>(this, Currencies.PLN, code);
6599        if ("PYG".equals(codeString))
6600          return new Enumeration<Currencies>(this, Currencies.PYG, code);
6601        if ("QAR".equals(codeString))
6602          return new Enumeration<Currencies>(this, Currencies.QAR, code);
6603        if ("RON".equals(codeString))
6604          return new Enumeration<Currencies>(this, Currencies.RON, code);
6605        if ("RSD".equals(codeString))
6606          return new Enumeration<Currencies>(this, Currencies.RSD, code);
6607        if ("RUB".equals(codeString))
6608          return new Enumeration<Currencies>(this, Currencies.RUB, code);
6609        if ("RWF".equals(codeString))
6610          return new Enumeration<Currencies>(this, Currencies.RWF, code);
6611        if ("SAR".equals(codeString))
6612          return new Enumeration<Currencies>(this, Currencies.SAR, code);
6613        if ("SBD".equals(codeString))
6614          return new Enumeration<Currencies>(this, Currencies.SBD, code);
6615        if ("SCR".equals(codeString))
6616          return new Enumeration<Currencies>(this, Currencies.SCR, code);
6617        if ("SDG".equals(codeString))
6618          return new Enumeration<Currencies>(this, Currencies.SDG, code);
6619        if ("SEK".equals(codeString))
6620          return new Enumeration<Currencies>(this, Currencies.SEK, code);
6621        if ("SGD".equals(codeString))
6622          return new Enumeration<Currencies>(this, Currencies.SGD, code);
6623        if ("SHP".equals(codeString))
6624          return new Enumeration<Currencies>(this, Currencies.SHP, code);
6625        if ("SLL".equals(codeString))
6626          return new Enumeration<Currencies>(this, Currencies.SLL, code);
6627        if ("SOS".equals(codeString))
6628          return new Enumeration<Currencies>(this, Currencies.SOS, code);
6629        if ("SRD".equals(codeString))
6630          return new Enumeration<Currencies>(this, Currencies.SRD, code);
6631        if ("SSP".equals(codeString))
6632          return new Enumeration<Currencies>(this, Currencies.SSP, code);
6633        if ("STN".equals(codeString))
6634          return new Enumeration<Currencies>(this, Currencies.STN, code);
6635        if ("SVC".equals(codeString))
6636          return new Enumeration<Currencies>(this, Currencies.SVC, code);
6637        if ("SYP".equals(codeString))
6638          return new Enumeration<Currencies>(this, Currencies.SYP, code);
6639        if ("SZL".equals(codeString))
6640          return new Enumeration<Currencies>(this, Currencies.SZL, code);
6641        if ("THB".equals(codeString))
6642          return new Enumeration<Currencies>(this, Currencies.THB, code);
6643        if ("TJS".equals(codeString))
6644          return new Enumeration<Currencies>(this, Currencies.TJS, code);
6645        if ("TMT".equals(codeString))
6646          return new Enumeration<Currencies>(this, Currencies.TMT, code);
6647        if ("TND".equals(codeString))
6648          return new Enumeration<Currencies>(this, Currencies.TND, code);
6649        if ("TOP".equals(codeString))
6650          return new Enumeration<Currencies>(this, Currencies.TOP, code);
6651        if ("TRY".equals(codeString))
6652          return new Enumeration<Currencies>(this, Currencies.TRY, code);
6653        if ("TTD".equals(codeString))
6654          return new Enumeration<Currencies>(this, Currencies.TTD, code);
6655        if ("TVD".equals(codeString))
6656          return new Enumeration<Currencies>(this, Currencies.TVD, code);
6657        if ("TWD".equals(codeString))
6658          return new Enumeration<Currencies>(this, Currencies.TWD, code);
6659        if ("TZS".equals(codeString))
6660          return new Enumeration<Currencies>(this, Currencies.TZS, code);
6661        if ("UAH".equals(codeString))
6662          return new Enumeration<Currencies>(this, Currencies.UAH, code);
6663        if ("UGX".equals(codeString))
6664          return new Enumeration<Currencies>(this, Currencies.UGX, code);
6665        if ("USD".equals(codeString))
6666          return new Enumeration<Currencies>(this, Currencies.USD, code);
6667        if ("USN".equals(codeString))
6668          return new Enumeration<Currencies>(this, Currencies.USN, code);
6669        if ("UYI".equals(codeString))
6670          return new Enumeration<Currencies>(this, Currencies.UYI, code);
6671        if ("UYU".equals(codeString))
6672          return new Enumeration<Currencies>(this, Currencies.UYU, code);
6673        if ("UZS".equals(codeString))
6674          return new Enumeration<Currencies>(this, Currencies.UZS, code);
6675        if ("VEF".equals(codeString))
6676          return new Enumeration<Currencies>(this, Currencies.VEF, code);
6677        if ("VND".equals(codeString))
6678          return new Enumeration<Currencies>(this, Currencies.VND, code);
6679        if ("VUV".equals(codeString))
6680          return new Enumeration<Currencies>(this, Currencies.VUV, code);
6681        if ("WST".equals(codeString))
6682          return new Enumeration<Currencies>(this, Currencies.WST, code);
6683        if ("XAF".equals(codeString))
6684          return new Enumeration<Currencies>(this, Currencies.XAF, code);
6685        if ("XAG".equals(codeString))
6686          return new Enumeration<Currencies>(this, Currencies.XAG, code);
6687        if ("XAU".equals(codeString))
6688          return new Enumeration<Currencies>(this, Currencies.XAU, code);
6689        if ("XBA".equals(codeString))
6690          return new Enumeration<Currencies>(this, Currencies.XBA, code);
6691        if ("XBB".equals(codeString))
6692          return new Enumeration<Currencies>(this, Currencies.XBB, code);
6693        if ("XBC".equals(codeString))
6694          return new Enumeration<Currencies>(this, Currencies.XBC, code);
6695        if ("XBD".equals(codeString))
6696          return new Enumeration<Currencies>(this, Currencies.XBD, code);
6697        if ("XCD".equals(codeString))
6698          return new Enumeration<Currencies>(this, Currencies.XCD, code);
6699        if ("XDR".equals(codeString))
6700          return new Enumeration<Currencies>(this, Currencies.XDR, code);
6701        if ("XOF".equals(codeString))
6702          return new Enumeration<Currencies>(this, Currencies.XOF, code);
6703        if ("XPD".equals(codeString))
6704          return new Enumeration<Currencies>(this, Currencies.XPD, code);
6705        if ("XPF".equals(codeString))
6706          return new Enumeration<Currencies>(this, Currencies.XPF, code);
6707        if ("XPT".equals(codeString))
6708          return new Enumeration<Currencies>(this, Currencies.XPT, code);
6709        if ("XSU".equals(codeString))
6710          return new Enumeration<Currencies>(this, Currencies.XSU, code);
6711        if ("XTS".equals(codeString))
6712          return new Enumeration<Currencies>(this, Currencies.XTS, code);
6713        if ("XUA".equals(codeString))
6714          return new Enumeration<Currencies>(this, Currencies.XUA, code);
6715        if ("XXX".equals(codeString))
6716          return new Enumeration<Currencies>(this, Currencies.XXX, code);
6717        if ("YER".equals(codeString))
6718          return new Enumeration<Currencies>(this, Currencies.YER, code);
6719        if ("ZAR".equals(codeString))
6720          return new Enumeration<Currencies>(this, Currencies.ZAR, code);
6721        if ("ZMW".equals(codeString))
6722          return new Enumeration<Currencies>(this, Currencies.ZMW, code);
6723        if ("ZWL".equals(codeString))
6724          return new Enumeration<Currencies>(this, Currencies.ZWL, code);
6725        throw new FHIRException("Unknown Currencies code '"+codeString+"'");
6726        }
6727    public String toCode(Currencies code) {
6728      if (code == Currencies.AED)
6729        return "AED";
6730      if (code == Currencies.AFN)
6731        return "AFN";
6732      if (code == Currencies.ALL)
6733        return "ALL";
6734      if (code == Currencies.AMD)
6735        return "AMD";
6736      if (code == Currencies.ANG)
6737        return "ANG";
6738      if (code == Currencies.AOA)
6739        return "AOA";
6740      if (code == Currencies.ARS)
6741        return "ARS";
6742      if (code == Currencies.AUD)
6743        return "AUD";
6744      if (code == Currencies.AWG)
6745        return "AWG";
6746      if (code == Currencies.AZN)
6747        return "AZN";
6748      if (code == Currencies.BAM)
6749        return "BAM";
6750      if (code == Currencies.BBD)
6751        return "BBD";
6752      if (code == Currencies.BDT)
6753        return "BDT";
6754      if (code == Currencies.BGN)
6755        return "BGN";
6756      if (code == Currencies.BHD)
6757        return "BHD";
6758      if (code == Currencies.BIF)
6759        return "BIF";
6760      if (code == Currencies.BMD)
6761        return "BMD";
6762      if (code == Currencies.BND)
6763        return "BND";
6764      if (code == Currencies.BOB)
6765        return "BOB";
6766      if (code == Currencies.BOV)
6767        return "BOV";
6768      if (code == Currencies.BRL)
6769        return "BRL";
6770      if (code == Currencies.BSD)
6771        return "BSD";
6772      if (code == Currencies.BTN)
6773        return "BTN";
6774      if (code == Currencies.BWP)
6775        return "BWP";
6776      if (code == Currencies.BYN)
6777        return "BYN";
6778      if (code == Currencies.BZD)
6779        return "BZD";
6780      if (code == Currencies.CAD)
6781        return "CAD";
6782      if (code == Currencies.CDF)
6783        return "CDF";
6784      if (code == Currencies.CHE)
6785        return "CHE";
6786      if (code == Currencies.CHF)
6787        return "CHF";
6788      if (code == Currencies.CHW)
6789        return "CHW";
6790      if (code == Currencies.CLF)
6791        return "CLF";
6792      if (code == Currencies.CLP)
6793        return "CLP";
6794      if (code == Currencies.CNY)
6795        return "CNY";
6796      if (code == Currencies.COP)
6797        return "COP";
6798      if (code == Currencies.COU)
6799        return "COU";
6800      if (code == Currencies.CRC)
6801        return "CRC";
6802      if (code == Currencies.CUC)
6803        return "CUC";
6804      if (code == Currencies.CUP)
6805        return "CUP";
6806      if (code == Currencies.CVE)
6807        return "CVE";
6808      if (code == Currencies.CZK)
6809        return "CZK";
6810      if (code == Currencies.DJF)
6811        return "DJF";
6812      if (code == Currencies.DKK)
6813        return "DKK";
6814      if (code == Currencies.DOP)
6815        return "DOP";
6816      if (code == Currencies.DZD)
6817        return "DZD";
6818      if (code == Currencies.EGP)
6819        return "EGP";
6820      if (code == Currencies.ERN)
6821        return "ERN";
6822      if (code == Currencies.ETB)
6823        return "ETB";
6824      if (code == Currencies.EUR)
6825        return "EUR";
6826      if (code == Currencies.FJD)
6827        return "FJD";
6828      if (code == Currencies.FKP)
6829        return "FKP";
6830      if (code == Currencies.GBP)
6831        return "GBP";
6832      if (code == Currencies.GEL)
6833        return "GEL";
6834      if (code == Currencies.GGP)
6835        return "GGP";
6836      if (code == Currencies.GHS)
6837        return "GHS";
6838      if (code == Currencies.GIP)
6839        return "GIP";
6840      if (code == Currencies.GMD)
6841        return "GMD";
6842      if (code == Currencies.GNF)
6843        return "GNF";
6844      if (code == Currencies.GTQ)
6845        return "GTQ";
6846      if (code == Currencies.GYD)
6847        return "GYD";
6848      if (code == Currencies.HKD)
6849        return "HKD";
6850      if (code == Currencies.HNL)
6851        return "HNL";
6852      if (code == Currencies.HRK)
6853        return "HRK";
6854      if (code == Currencies.HTG)
6855        return "HTG";
6856      if (code == Currencies.HUF)
6857        return "HUF";
6858      if (code == Currencies.IDR)
6859        return "IDR";
6860      if (code == Currencies.ILS)
6861        return "ILS";
6862      if (code == Currencies.IMP)
6863        return "IMP";
6864      if (code == Currencies.INR)
6865        return "INR";
6866      if (code == Currencies.IQD)
6867        return "IQD";
6868      if (code == Currencies.IRR)
6869        return "IRR";
6870      if (code == Currencies.ISK)
6871        return "ISK";
6872      if (code == Currencies.JEP)
6873        return "JEP";
6874      if (code == Currencies.JMD)
6875        return "JMD";
6876      if (code == Currencies.JOD)
6877        return "JOD";
6878      if (code == Currencies.JPY)
6879        return "JPY";
6880      if (code == Currencies.KES)
6881        return "KES";
6882      if (code == Currencies.KGS)
6883        return "KGS";
6884      if (code == Currencies.KHR)
6885        return "KHR";
6886      if (code == Currencies.KMF)
6887        return "KMF";
6888      if (code == Currencies.KPW)
6889        return "KPW";
6890      if (code == Currencies.KRW)
6891        return "KRW";
6892      if (code == Currencies.KWD)
6893        return "KWD";
6894      if (code == Currencies.KYD)
6895        return "KYD";
6896      if (code == Currencies.KZT)
6897        return "KZT";
6898      if (code == Currencies.LAK)
6899        return "LAK";
6900      if (code == Currencies.LBP)
6901        return "LBP";
6902      if (code == Currencies.LKR)
6903        return "LKR";
6904      if (code == Currencies.LRD)
6905        return "LRD";
6906      if (code == Currencies.LSL)
6907        return "LSL";
6908      if (code == Currencies.LYD)
6909        return "LYD";
6910      if (code == Currencies.MAD)
6911        return "MAD";
6912      if (code == Currencies.MDL)
6913        return "MDL";
6914      if (code == Currencies.MGA)
6915        return "MGA";
6916      if (code == Currencies.MKD)
6917        return "MKD";
6918      if (code == Currencies.MMK)
6919        return "MMK";
6920      if (code == Currencies.MNT)
6921        return "MNT";
6922      if (code == Currencies.MOP)
6923        return "MOP";
6924      if (code == Currencies.MRU)
6925        return "MRU";
6926      if (code == Currencies.MUR)
6927        return "MUR";
6928      if (code == Currencies.MVR)
6929        return "MVR";
6930      if (code == Currencies.MWK)
6931        return "MWK";
6932      if (code == Currencies.MXN)
6933        return "MXN";
6934      if (code == Currencies.MXV)
6935        return "MXV";
6936      if (code == Currencies.MYR)
6937        return "MYR";
6938      if (code == Currencies.MZN)
6939        return "MZN";
6940      if (code == Currencies.NAD)
6941        return "NAD";
6942      if (code == Currencies.NGN)
6943        return "NGN";
6944      if (code == Currencies.NIO)
6945        return "NIO";
6946      if (code == Currencies.NOK)
6947        return "NOK";
6948      if (code == Currencies.NPR)
6949        return "NPR";
6950      if (code == Currencies.NZD)
6951        return "NZD";
6952      if (code == Currencies.OMR)
6953        return "OMR";
6954      if (code == Currencies.PAB)
6955        return "PAB";
6956      if (code == Currencies.PEN)
6957        return "PEN";
6958      if (code == Currencies.PGK)
6959        return "PGK";
6960      if (code == Currencies.PHP)
6961        return "PHP";
6962      if (code == Currencies.PKR)
6963        return "PKR";
6964      if (code == Currencies.PLN)
6965        return "PLN";
6966      if (code == Currencies.PYG)
6967        return "PYG";
6968      if (code == Currencies.QAR)
6969        return "QAR";
6970      if (code == Currencies.RON)
6971        return "RON";
6972      if (code == Currencies.RSD)
6973        return "RSD";
6974      if (code == Currencies.RUB)
6975        return "RUB";
6976      if (code == Currencies.RWF)
6977        return "RWF";
6978      if (code == Currencies.SAR)
6979        return "SAR";
6980      if (code == Currencies.SBD)
6981        return "SBD";
6982      if (code == Currencies.SCR)
6983        return "SCR";
6984      if (code == Currencies.SDG)
6985        return "SDG";
6986      if (code == Currencies.SEK)
6987        return "SEK";
6988      if (code == Currencies.SGD)
6989        return "SGD";
6990      if (code == Currencies.SHP)
6991        return "SHP";
6992      if (code == Currencies.SLL)
6993        return "SLL";
6994      if (code == Currencies.SOS)
6995        return "SOS";
6996      if (code == Currencies.SRD)
6997        return "SRD";
6998      if (code == Currencies.SSP)
6999        return "SSP";
7000      if (code == Currencies.STN)
7001        return "STN";
7002      if (code == Currencies.SVC)
7003        return "SVC";
7004      if (code == Currencies.SYP)
7005        return "SYP";
7006      if (code == Currencies.SZL)
7007        return "SZL";
7008      if (code == Currencies.THB)
7009        return "THB";
7010      if (code == Currencies.TJS)
7011        return "TJS";
7012      if (code == Currencies.TMT)
7013        return "TMT";
7014      if (code == Currencies.TND)
7015        return "TND";
7016      if (code == Currencies.TOP)
7017        return "TOP";
7018      if (code == Currencies.TRY)
7019        return "TRY";
7020      if (code == Currencies.TTD)
7021        return "TTD";
7022      if (code == Currencies.TVD)
7023        return "TVD";
7024      if (code == Currencies.TWD)
7025        return "TWD";
7026      if (code == Currencies.TZS)
7027        return "TZS";
7028      if (code == Currencies.UAH)
7029        return "UAH";
7030      if (code == Currencies.UGX)
7031        return "UGX";
7032      if (code == Currencies.USD)
7033        return "USD";
7034      if (code == Currencies.USN)
7035        return "USN";
7036      if (code == Currencies.UYI)
7037        return "UYI";
7038      if (code == Currencies.UYU)
7039        return "UYU";
7040      if (code == Currencies.UZS)
7041        return "UZS";
7042      if (code == Currencies.VEF)
7043        return "VEF";
7044      if (code == Currencies.VND)
7045        return "VND";
7046      if (code == Currencies.VUV)
7047        return "VUV";
7048      if (code == Currencies.WST)
7049        return "WST";
7050      if (code == Currencies.XAF)
7051        return "XAF";
7052      if (code == Currencies.XAG)
7053        return "XAG";
7054      if (code == Currencies.XAU)
7055        return "XAU";
7056      if (code == Currencies.XBA)
7057        return "XBA";
7058      if (code == Currencies.XBB)
7059        return "XBB";
7060      if (code == Currencies.XBC)
7061        return "XBC";
7062      if (code == Currencies.XBD)
7063        return "XBD";
7064      if (code == Currencies.XCD)
7065        return "XCD";
7066      if (code == Currencies.XDR)
7067        return "XDR";
7068      if (code == Currencies.XOF)
7069        return "XOF";
7070      if (code == Currencies.XPD)
7071        return "XPD";
7072      if (code == Currencies.XPF)
7073        return "XPF";
7074      if (code == Currencies.XPT)
7075        return "XPT";
7076      if (code == Currencies.XSU)
7077        return "XSU";
7078      if (code == Currencies.XTS)
7079        return "XTS";
7080      if (code == Currencies.XUA)
7081        return "XUA";
7082      if (code == Currencies.XXX)
7083        return "XXX";
7084      if (code == Currencies.YER)
7085        return "YER";
7086      if (code == Currencies.ZAR)
7087        return "ZAR";
7088      if (code == Currencies.ZMW)
7089        return "ZMW";
7090      if (code == Currencies.ZWL)
7091        return "ZWL";
7092      return "?";
7093      }
7094    public String toSystem(Currencies code) {
7095      return code.getSystem();
7096      }
7097    }
7098
7099    public enum DaysOfWeek {
7100        /**
7101         * Monday.
7102         */
7103        MON, 
7104        /**
7105         * Tuesday.
7106         */
7107        TUE, 
7108        /**
7109         * Wednesday.
7110         */
7111        WED, 
7112        /**
7113         * Thursday.
7114         */
7115        THU, 
7116        /**
7117         * Friday.
7118         */
7119        FRI, 
7120        /**
7121         * Saturday.
7122         */
7123        SAT, 
7124        /**
7125         * Sunday.
7126         */
7127        SUN, 
7128        /**
7129         * added to help the parsers
7130         */
7131        NULL;
7132        public static DaysOfWeek fromCode(String codeString) throws FHIRException {
7133            if (codeString == null || "".equals(codeString))
7134                return null;
7135        if ("mon".equals(codeString))
7136          return MON;
7137        if ("tue".equals(codeString))
7138          return TUE;
7139        if ("wed".equals(codeString))
7140          return WED;
7141        if ("thu".equals(codeString))
7142          return THU;
7143        if ("fri".equals(codeString))
7144          return FRI;
7145        if ("sat".equals(codeString))
7146          return SAT;
7147        if ("sun".equals(codeString))
7148          return SUN;
7149        throw new FHIRException("Unknown DaysOfWeek code '"+codeString+"'");
7150        }
7151        public static boolean isValidCode(String codeString) {
7152            if (codeString == null || "".equals(codeString))
7153                return false;
7154          return Utilities.existsInList(codeString, "mon", "tue", "wed", "thu", "fri", "sat", "sun");
7155        }
7156        public String toCode() {
7157          switch (this) {
7158            case MON: return "mon";
7159            case TUE: return "tue";
7160            case WED: return "wed";
7161            case THU: return "thu";
7162            case FRI: return "fri";
7163            case SAT: return "sat";
7164            case SUN: return "sun";
7165            case NULL: return null;
7166            default: return "?";
7167          }
7168        }
7169        public String getSystem() {
7170          switch (this) {
7171            case MON: return "http://hl7.org/fhir/days-of-week";
7172            case TUE: return "http://hl7.org/fhir/days-of-week";
7173            case WED: return "http://hl7.org/fhir/days-of-week";
7174            case THU: return "http://hl7.org/fhir/days-of-week";
7175            case FRI: return "http://hl7.org/fhir/days-of-week";
7176            case SAT: return "http://hl7.org/fhir/days-of-week";
7177            case SUN: return "http://hl7.org/fhir/days-of-week";
7178            case NULL: return null;
7179            default: return "?";
7180          }
7181        }
7182        public String getDefinition() {
7183          switch (this) {
7184            case MON: return "Monday.";
7185            case TUE: return "Tuesday.";
7186            case WED: return "Wednesday.";
7187            case THU: return "Thursday.";
7188            case FRI: return "Friday.";
7189            case SAT: return "Saturday.";
7190            case SUN: return "Sunday.";
7191            case NULL: return null;
7192            default: return "?";
7193          }
7194        }
7195        public String getDisplay() {
7196          switch (this) {
7197            case MON: return "Monday";
7198            case TUE: return "Tuesday";
7199            case WED: return "Wednesday";
7200            case THU: return "Thursday";
7201            case FRI: return "Friday";
7202            case SAT: return "Saturday";
7203            case SUN: return "Sunday";
7204            case NULL: return null;
7205            default: return "?";
7206          }
7207        }
7208    }
7209
7210  public static class DaysOfWeekEnumFactory implements EnumFactory<DaysOfWeek> {
7211    public DaysOfWeek fromCode(String codeString) throws IllegalArgumentException {
7212      if (codeString == null || "".equals(codeString))
7213            if (codeString == null || "".equals(codeString))
7214                return null;
7215        if ("mon".equals(codeString))
7216          return DaysOfWeek.MON;
7217        if ("tue".equals(codeString))
7218          return DaysOfWeek.TUE;
7219        if ("wed".equals(codeString))
7220          return DaysOfWeek.WED;
7221        if ("thu".equals(codeString))
7222          return DaysOfWeek.THU;
7223        if ("fri".equals(codeString))
7224          return DaysOfWeek.FRI;
7225        if ("sat".equals(codeString))
7226          return DaysOfWeek.SAT;
7227        if ("sun".equals(codeString))
7228          return DaysOfWeek.SUN;
7229        throw new IllegalArgumentException("Unknown DaysOfWeek code '"+codeString+"'");
7230        }
7231
7232        public Enumeration<DaysOfWeek> fromType(PrimitiveType<?> code) throws FHIRException {
7233          if (code == null)
7234            return null;
7235          if (code.isEmpty())
7236            return new Enumeration<DaysOfWeek>(this, DaysOfWeek.NULL, code);
7237          String codeString = ((PrimitiveType) code).asStringValue();
7238          if (codeString == null || "".equals(codeString))
7239            return new Enumeration<DaysOfWeek>(this, DaysOfWeek.NULL, code);
7240        if ("mon".equals(codeString))
7241          return new Enumeration<DaysOfWeek>(this, DaysOfWeek.MON, code);
7242        if ("tue".equals(codeString))
7243          return new Enumeration<DaysOfWeek>(this, DaysOfWeek.TUE, code);
7244        if ("wed".equals(codeString))
7245          return new Enumeration<DaysOfWeek>(this, DaysOfWeek.WED, code);
7246        if ("thu".equals(codeString))
7247          return new Enumeration<DaysOfWeek>(this, DaysOfWeek.THU, code);
7248        if ("fri".equals(codeString))
7249          return new Enumeration<DaysOfWeek>(this, DaysOfWeek.FRI, code);
7250        if ("sat".equals(codeString))
7251          return new Enumeration<DaysOfWeek>(this, DaysOfWeek.SAT, code);
7252        if ("sun".equals(codeString))
7253          return new Enumeration<DaysOfWeek>(this, DaysOfWeek.SUN, code);
7254        throw new FHIRException("Unknown DaysOfWeek code '"+codeString+"'");
7255        }
7256    public String toCode(DaysOfWeek code) {
7257      if (code == DaysOfWeek.MON)
7258        return "mon";
7259      if (code == DaysOfWeek.TUE)
7260        return "tue";
7261      if (code == DaysOfWeek.WED)
7262        return "wed";
7263      if (code == DaysOfWeek.THU)
7264        return "thu";
7265      if (code == DaysOfWeek.FRI)
7266        return "fri";
7267      if (code == DaysOfWeek.SAT)
7268        return "sat";
7269      if (code == DaysOfWeek.SUN)
7270        return "sun";
7271      return "?";
7272      }
7273    public String toSystem(DaysOfWeek code) {
7274      return code.getSystem();
7275      }
7276    }
7277
7278    public enum DeviceNameType {
7279        /**
7280         * The term assigned to a medical device by the entity who registers or submits information about it to a jurisdiction or its databases. This may be considered the manufacturer assigned name (e.g., brand name assigned by the labeler or manufacturer in US, or device name assigned by the manufacturer in EU) and may also be synonymous with proprietary name or trade name of the device.
7281         */
7282        REGISTEREDNAME, 
7283        /**
7284         * The term that generically describes the device by a name as assigned by the manufacturer that is recognized by lay person.  This common or generic name may be printed on the package it came in or some combination of that name with the model number, serial number, or other attribute that makes the name easy to understand for the user of that device. It is often exposed in communicating devices transport protocols. It is provided to help users identify the device when reported in discovery operations.
7285         */
7286        USERFRIENDLYNAME, 
7287        /**
7288         * the term used by the patient associated with the device when describing the device, for example 'knee implant', when documented as a self-reported device.
7289         */
7290        PATIENTREPORTEDNAME, 
7291        /**
7292         * added to help the parsers
7293         */
7294        NULL;
7295        public static DeviceNameType fromCode(String codeString) throws FHIRException {
7296            if (codeString == null || "".equals(codeString))
7297                return null;
7298        if ("registered-name".equals(codeString))
7299          return REGISTEREDNAME;
7300        if ("user-friendly-name".equals(codeString))
7301          return USERFRIENDLYNAME;
7302        if ("patient-reported-name".equals(codeString))
7303          return PATIENTREPORTEDNAME;
7304        throw new FHIRException("Unknown DeviceNameType code '"+codeString+"'");
7305        }
7306        public static boolean isValidCode(String codeString) {
7307            if (codeString == null || "".equals(codeString))
7308                return false;
7309          return Utilities.existsInList(codeString, "registered-name", "user-friendly-name", "patient-reported-name");
7310        }
7311        public String toCode() {
7312          switch (this) {
7313            case REGISTEREDNAME: return "registered-name";
7314            case USERFRIENDLYNAME: return "user-friendly-name";
7315            case PATIENTREPORTEDNAME: return "patient-reported-name";
7316            case NULL: return null;
7317            default: return "?";
7318          }
7319        }
7320        public String getSystem() {
7321          switch (this) {
7322            case REGISTEREDNAME: return "http://hl7.org/fhir/device-nametype";
7323            case USERFRIENDLYNAME: return "http://hl7.org/fhir/device-nametype";
7324            case PATIENTREPORTEDNAME: return "http://hl7.org/fhir/device-nametype";
7325            case NULL: return null;
7326            default: return "?";
7327          }
7328        }
7329        public String getDefinition() {
7330          switch (this) {
7331            case REGISTEREDNAME: return "The term assigned to a medical device by the entity who registers or submits information about it to a jurisdiction or its databases. This may be considered the manufacturer assigned name (e.g., brand name assigned by the labeler or manufacturer in US, or device name assigned by the manufacturer in EU) and may also be synonymous with proprietary name or trade name of the device.";
7332            case USERFRIENDLYNAME: return "The term that generically describes the device by a name as assigned by the manufacturer that is recognized by lay person.  This common or generic name may be printed on the package it came in or some combination of that name with the model number, serial number, or other attribute that makes the name easy to understand for the user of that device. It is often exposed in communicating devices transport protocols. It is provided to help users identify the device when reported in discovery operations.";
7333            case PATIENTREPORTEDNAME: return "the term used by the patient associated with the device when describing the device, for example 'knee implant', when documented as a self-reported device.";
7334            case NULL: return null;
7335            default: return "?";
7336          }
7337        }
7338        public String getDisplay() {
7339          switch (this) {
7340            case REGISTEREDNAME: return "Registered name";
7341            case USERFRIENDLYNAME: return "User Friendly name";
7342            case PATIENTREPORTEDNAME: return "Patient Reported name";
7343            case NULL: return null;
7344            default: return "?";
7345          }
7346        }
7347    }
7348
7349  public static class DeviceNameTypeEnumFactory implements EnumFactory<DeviceNameType> {
7350    public DeviceNameType fromCode(String codeString) throws IllegalArgumentException {
7351      if (codeString == null || "".equals(codeString))
7352            if (codeString == null || "".equals(codeString))
7353                return null;
7354        if ("registered-name".equals(codeString))
7355          return DeviceNameType.REGISTEREDNAME;
7356        if ("user-friendly-name".equals(codeString))
7357          return DeviceNameType.USERFRIENDLYNAME;
7358        if ("patient-reported-name".equals(codeString))
7359          return DeviceNameType.PATIENTREPORTEDNAME;
7360        throw new IllegalArgumentException("Unknown DeviceNameType code '"+codeString+"'");
7361        }
7362
7363        public Enumeration<DeviceNameType> fromType(PrimitiveType<?> code) throws FHIRException {
7364          if (code == null)
7365            return null;
7366          if (code.isEmpty())
7367            return new Enumeration<DeviceNameType>(this, DeviceNameType.NULL, code);
7368          String codeString = ((PrimitiveType) code).asStringValue();
7369          if (codeString == null || "".equals(codeString))
7370            return new Enumeration<DeviceNameType>(this, DeviceNameType.NULL, code);
7371        if ("registered-name".equals(codeString))
7372          return new Enumeration<DeviceNameType>(this, DeviceNameType.REGISTEREDNAME, code);
7373        if ("user-friendly-name".equals(codeString))
7374          return new Enumeration<DeviceNameType>(this, DeviceNameType.USERFRIENDLYNAME, code);
7375        if ("patient-reported-name".equals(codeString))
7376          return new Enumeration<DeviceNameType>(this, DeviceNameType.PATIENTREPORTEDNAME, code);
7377        throw new FHIRException("Unknown DeviceNameType code '"+codeString+"'");
7378        }
7379    public String toCode(DeviceNameType code) {
7380      if (code == DeviceNameType.REGISTEREDNAME)
7381        return "registered-name";
7382      if (code == DeviceNameType.USERFRIENDLYNAME)
7383        return "user-friendly-name";
7384      if (code == DeviceNameType.PATIENTREPORTEDNAME)
7385        return "patient-reported-name";
7386      return "?";
7387      }
7388    public String toSystem(DeviceNameType code) {
7389      return code.getSystem();
7390      }
7391    }
7392
7393    public enum EncounterStatus {
7394        /**
7395         * The Encounter has not yet started.
7396         */
7397        PLANNED, 
7398        /**
7399         * The Encounter has begun and the patient is present / the practitioner and the patient are meeting.
7400         */
7401        INPROGRESS, 
7402        /**
7403         * The Encounter has begun, but is currently on hold, e.g. because the patient is temporarily on leave.
7404         */
7405        ONHOLD, 
7406        /**
7407         * The Encounter has been clinically completed, the patient has been discharged from the facility or the visit has ended, and the patient may have departed (refer to subjectStatus). While the encounter is in this status, administrative activities are usually performed, collating all required documentation and charge information before being released for billing, at which point the status will move to completed.
7408         */
7409        DISCHARGED, 
7410        /**
7411         * The Encounter has ended.
7412         */
7413        COMPLETED, 
7414        /**
7415         * The Encounter has ended before it has begun.
7416         */
7417        CANCELLED, 
7418        /**
7419         * The Encounter has started, but was not able to be completed. Further action may need to be performed, such as rescheduling appointments related to this encounter.
7420         */
7421        DISCONTINUED, 
7422        /**
7423         * This instance should not have been part of this patient's medical record.
7424         */
7425        ENTEREDINERROR, 
7426        /**
7427         * The encounter status is unknown. Note that "unknown" is a value of last resort and every attempt should be made to provide a meaningful value other than "unknown".
7428         */
7429        UNKNOWN, 
7430        /**
7431         * added to help the parsers
7432         */
7433        NULL;
7434        public static EncounterStatus fromCode(String codeString) throws FHIRException {
7435            if (codeString == null || "".equals(codeString))
7436                return null;
7437        if ("planned".equals(codeString))
7438          return PLANNED;
7439        if ("in-progress".equals(codeString))
7440          return INPROGRESS;
7441        if ("on-hold".equals(codeString))
7442          return ONHOLD;
7443        if ("discharged".equals(codeString))
7444          return DISCHARGED;
7445        if ("completed".equals(codeString))
7446          return COMPLETED;
7447        if ("cancelled".equals(codeString))
7448          return CANCELLED;
7449        if ("discontinued".equals(codeString))
7450          return DISCONTINUED;
7451        if ("entered-in-error".equals(codeString))
7452          return ENTEREDINERROR;
7453        if ("unknown".equals(codeString))
7454          return UNKNOWN;
7455        throw new FHIRException("Unknown EncounterStatus code '"+codeString+"'");
7456        }
7457        public static boolean isValidCode(String codeString) {
7458            if (codeString == null || "".equals(codeString))
7459                return false;
7460          return Utilities.existsInList(codeString, "planned", "in-progress", "on-hold", "discharged", "completed", "cancelled", "discontinued", "entered-in-error", "unknown");
7461        }
7462        public String toCode() {
7463          switch (this) {
7464            case PLANNED: return "planned";
7465            case INPROGRESS: return "in-progress";
7466            case ONHOLD: return "on-hold";
7467            case DISCHARGED: return "discharged";
7468            case COMPLETED: return "completed";
7469            case CANCELLED: return "cancelled";
7470            case DISCONTINUED: return "discontinued";
7471            case ENTEREDINERROR: return "entered-in-error";
7472            case UNKNOWN: return "unknown";
7473            case NULL: return null;
7474            default: return "?";
7475          }
7476        }
7477        public String getSystem() {
7478          switch (this) {
7479            case PLANNED: return "http://hl7.org/fhir/encounter-status";
7480            case INPROGRESS: return "http://hl7.org/fhir/encounter-status";
7481            case ONHOLD: return "http://hl7.org/fhir/encounter-status";
7482            case DISCHARGED: return "http://hl7.org/fhir/encounter-status";
7483            case COMPLETED: return "http://hl7.org/fhir/encounter-status";
7484            case CANCELLED: return "http://hl7.org/fhir/encounter-status";
7485            case DISCONTINUED: return "http://hl7.org/fhir/encounter-status";
7486            case ENTEREDINERROR: return "http://hl7.org/fhir/encounter-status";
7487            case UNKNOWN: return "http://hl7.org/fhir/encounter-status";
7488            case NULL: return null;
7489            default: return "?";
7490          }
7491        }
7492        public String getDefinition() {
7493          switch (this) {
7494            case PLANNED: return "The Encounter has not yet started.";
7495            case INPROGRESS: return "The Encounter has begun and the patient is present / the practitioner and the patient are meeting.";
7496            case ONHOLD: return "The Encounter has begun, but is currently on hold, e.g. because the patient is temporarily on leave.";
7497            case DISCHARGED: return "The Encounter has been clinically completed, the patient has been discharged from the facility or the visit has ended, and the patient may have departed (refer to subjectStatus). While the encounter is in this status, administrative activities are usually performed, collating all required documentation and charge information before being released for billing, at which point the status will move to completed.";
7498            case COMPLETED: return "The Encounter has ended.";
7499            case CANCELLED: return "The Encounter has ended before it has begun.";
7500            case DISCONTINUED: return "The Encounter has started, but was not able to be completed. Further action may need to be performed, such as rescheduling appointments related to this encounter.";
7501            case ENTEREDINERROR: return "This instance should not have been part of this patient's medical record.";
7502            case UNKNOWN: return "The encounter status is unknown. Note that \"unknown\" is a value of last resort and every attempt should be made to provide a meaningful value other than \"unknown\".";
7503            case NULL: return null;
7504            default: return "?";
7505          }
7506        }
7507        public String getDisplay() {
7508          switch (this) {
7509            case PLANNED: return "Planned";
7510            case INPROGRESS: return "In Progress";
7511            case ONHOLD: return "On Hold";
7512            case DISCHARGED: return "Discharged";
7513            case COMPLETED: return "Completed";
7514            case CANCELLED: return "Cancelled";
7515            case DISCONTINUED: return "Discontinued";
7516            case ENTEREDINERROR: return "Entered in Error";
7517            case UNKNOWN: return "Unknown";
7518            case NULL: return null;
7519            default: return "?";
7520          }
7521        }
7522    }
7523
7524  public static class EncounterStatusEnumFactory implements EnumFactory<EncounterStatus> {
7525    public EncounterStatus fromCode(String codeString) throws IllegalArgumentException {
7526      if (codeString == null || "".equals(codeString))
7527            if (codeString == null || "".equals(codeString))
7528                return null;
7529        if ("planned".equals(codeString))
7530          return EncounterStatus.PLANNED;
7531        if ("in-progress".equals(codeString))
7532          return EncounterStatus.INPROGRESS;
7533        if ("on-hold".equals(codeString))
7534          return EncounterStatus.ONHOLD;
7535        if ("discharged".equals(codeString))
7536          return EncounterStatus.DISCHARGED;
7537        if ("completed".equals(codeString))
7538          return EncounterStatus.COMPLETED;
7539        if ("cancelled".equals(codeString))
7540          return EncounterStatus.CANCELLED;
7541        if ("discontinued".equals(codeString))
7542          return EncounterStatus.DISCONTINUED;
7543        if ("entered-in-error".equals(codeString))
7544          return EncounterStatus.ENTEREDINERROR;
7545        if ("unknown".equals(codeString))
7546          return EncounterStatus.UNKNOWN;
7547        throw new IllegalArgumentException("Unknown EncounterStatus code '"+codeString+"'");
7548        }
7549
7550        public Enumeration<EncounterStatus> fromType(PrimitiveType<?> code) throws FHIRException {
7551          if (code == null)
7552            return null;
7553          if (code.isEmpty())
7554            return new Enumeration<EncounterStatus>(this, EncounterStatus.NULL, code);
7555          String codeString = ((PrimitiveType) code).asStringValue();
7556          if (codeString == null || "".equals(codeString))
7557            return new Enumeration<EncounterStatus>(this, EncounterStatus.NULL, code);
7558        if ("planned".equals(codeString))
7559          return new Enumeration<EncounterStatus>(this, EncounterStatus.PLANNED, code);
7560        if ("in-progress".equals(codeString))
7561          return new Enumeration<EncounterStatus>(this, EncounterStatus.INPROGRESS, code);
7562        if ("on-hold".equals(codeString))
7563          return new Enumeration<EncounterStatus>(this, EncounterStatus.ONHOLD, code);
7564        if ("discharged".equals(codeString))
7565          return new Enumeration<EncounterStatus>(this, EncounterStatus.DISCHARGED, code);
7566        if ("completed".equals(codeString))
7567          return new Enumeration<EncounterStatus>(this, EncounterStatus.COMPLETED, code);
7568        if ("cancelled".equals(codeString))
7569          return new Enumeration<EncounterStatus>(this, EncounterStatus.CANCELLED, code);
7570        if ("discontinued".equals(codeString))
7571          return new Enumeration<EncounterStatus>(this, EncounterStatus.DISCONTINUED, code);
7572        if ("entered-in-error".equals(codeString))
7573          return new Enumeration<EncounterStatus>(this, EncounterStatus.ENTEREDINERROR, code);
7574        if ("unknown".equals(codeString))
7575          return new Enumeration<EncounterStatus>(this, EncounterStatus.UNKNOWN, code);
7576        throw new FHIRException("Unknown EncounterStatus code '"+codeString+"'");
7577        }
7578    public String toCode(EncounterStatus code) {
7579      if (code == EncounterStatus.PLANNED)
7580        return "planned";
7581      if (code == EncounterStatus.INPROGRESS)
7582        return "in-progress";
7583      if (code == EncounterStatus.ONHOLD)
7584        return "on-hold";
7585      if (code == EncounterStatus.DISCHARGED)
7586        return "discharged";
7587      if (code == EncounterStatus.COMPLETED)
7588        return "completed";
7589      if (code == EncounterStatus.CANCELLED)
7590        return "cancelled";
7591      if (code == EncounterStatus.DISCONTINUED)
7592        return "discontinued";
7593      if (code == EncounterStatus.ENTEREDINERROR)
7594        return "entered-in-error";
7595      if (code == EncounterStatus.UNKNOWN)
7596        return "unknown";
7597      return "?";
7598      }
7599    public String toSystem(EncounterStatus code) {
7600      return code.getSystem();
7601      }
7602    }
7603
7604    public enum EventStatus {
7605        /**
7606         * The core event has not started yet, but some staging activities have begun (e.g. surgical suite preparation).  Preparation stages may be tracked for billing purposes.
7607         */
7608        PREPARATION, 
7609        /**
7610         * The event is currently occurring.
7611         */
7612        INPROGRESS, 
7613        /**
7614         * The event was terminated prior to any activity beyond preparation.  I.e. The 'main' activity has not yet begun.  The boundary between preparatory and the 'main' activity is context-specific.
7615         */
7616        NOTDONE, 
7617        /**
7618         * The event has been temporarily stopped but is expected to resume in the future.
7619         */
7620        ONHOLD, 
7621        /**
7622         * The event was terminated prior to the full completion of the intended activity but after at least some of the 'main' activity (beyond preparation) has occurred.
7623         */
7624        STOPPED, 
7625        /**
7626         * The event has now concluded.
7627         */
7628        COMPLETED, 
7629        /**
7630         * This electronic record should never have existed, though it is possible that real-world decisions were based on it.  (If real-world activity has occurred, the status should be "stopped" rather than "entered-in-error".).
7631         */
7632        ENTEREDINERROR, 
7633        /**
7634         * The authoring/source system does not know which of the status values currently applies for this event.  Note: This concept is not to be used for "other" - one of the listed statuses is presumed to apply,  but the authoring/source system does not know which.
7635         */
7636        UNKNOWN, 
7637        /**
7638         * added to help the parsers
7639         */
7640        NULL;
7641        public static EventStatus fromCode(String codeString) throws FHIRException {
7642            if (codeString == null || "".equals(codeString))
7643                return null;
7644        if ("preparation".equals(codeString))
7645          return PREPARATION;
7646        if ("in-progress".equals(codeString))
7647          return INPROGRESS;
7648        if ("not-done".equals(codeString))
7649          return NOTDONE;
7650        if ("on-hold".equals(codeString))
7651          return ONHOLD;
7652        if ("stopped".equals(codeString))
7653          return STOPPED;
7654        if ("completed".equals(codeString))
7655          return COMPLETED;
7656        if ("entered-in-error".equals(codeString))
7657          return ENTEREDINERROR;
7658        if ("unknown".equals(codeString))
7659          return UNKNOWN;
7660        throw new FHIRException("Unknown EventStatus code '"+codeString+"'");
7661        }
7662        public static boolean isValidCode(String codeString) {
7663            if (codeString == null || "".equals(codeString))
7664                return false;
7665          return Utilities.existsInList(codeString, "preparation", "in-progress", "not-done", "on-hold", "stopped", "completed", "entered-in-error", "unknown");
7666        }
7667        public String toCode() {
7668          switch (this) {
7669            case PREPARATION: return "preparation";
7670            case INPROGRESS: return "in-progress";
7671            case NOTDONE: return "not-done";
7672            case ONHOLD: return "on-hold";
7673            case STOPPED: return "stopped";
7674            case COMPLETED: return "completed";
7675            case ENTEREDINERROR: return "entered-in-error";
7676            case UNKNOWN: return "unknown";
7677            case NULL: return null;
7678            default: return "?";
7679          }
7680        }
7681        public String getSystem() {
7682          switch (this) {
7683            case PREPARATION: return "http://hl7.org/fhir/event-status";
7684            case INPROGRESS: return "http://hl7.org/fhir/event-status";
7685            case NOTDONE: return "http://hl7.org/fhir/event-status";
7686            case ONHOLD: return "http://hl7.org/fhir/event-status";
7687            case STOPPED: return "http://hl7.org/fhir/event-status";
7688            case COMPLETED: return "http://hl7.org/fhir/event-status";
7689            case ENTEREDINERROR: return "http://hl7.org/fhir/event-status";
7690            case UNKNOWN: return "http://hl7.org/fhir/event-status";
7691            case NULL: return null;
7692            default: return "?";
7693          }
7694        }
7695        public String getDefinition() {
7696          switch (this) {
7697            case PREPARATION: return "The core event has not started yet, but some staging activities have begun (e.g. surgical suite preparation).  Preparation stages may be tracked for billing purposes.";
7698            case INPROGRESS: return "The event is currently occurring.";
7699            case NOTDONE: return "The event was terminated prior to any activity beyond preparation.  I.e. The 'main' activity has not yet begun.  The boundary between preparatory and the 'main' activity is context-specific.";
7700            case ONHOLD: return "The event has been temporarily stopped but is expected to resume in the future.";
7701            case STOPPED: return "The event was terminated prior to the full completion of the intended activity but after at least some of the 'main' activity (beyond preparation) has occurred.";
7702            case COMPLETED: return "The event has now concluded.";
7703            case ENTEREDINERROR: return "This electronic record should never have existed, though it is possible that real-world decisions were based on it.  (If real-world activity has occurred, the status should be \"stopped\" rather than \"entered-in-error\".).";
7704            case UNKNOWN: return "The authoring/source system does not know which of the status values currently applies for this event.  Note: This concept is not to be used for \"other\" - one of the listed statuses is presumed to apply,  but the authoring/source system does not know which.";
7705            case NULL: return null;
7706            default: return "?";
7707          }
7708        }
7709        public String getDisplay() {
7710          switch (this) {
7711            case PREPARATION: return "Preparation";
7712            case INPROGRESS: return "In Progress";
7713            case NOTDONE: return "Not Done";
7714            case ONHOLD: return "On Hold";
7715            case STOPPED: return "Stopped";
7716            case COMPLETED: return "Completed";
7717            case ENTEREDINERROR: return "Entered in Error";
7718            case UNKNOWN: return "Unknown";
7719            case NULL: return null;
7720            default: return "?";
7721          }
7722        }
7723    }
7724
7725  public static class EventStatusEnumFactory implements EnumFactory<EventStatus> {
7726    public EventStatus fromCode(String codeString) throws IllegalArgumentException {
7727      if (codeString == null || "".equals(codeString))
7728            if (codeString == null || "".equals(codeString))
7729                return null;
7730        if ("preparation".equals(codeString))
7731          return EventStatus.PREPARATION;
7732        if ("in-progress".equals(codeString))
7733          return EventStatus.INPROGRESS;
7734        if ("not-done".equals(codeString))
7735          return EventStatus.NOTDONE;
7736        if ("on-hold".equals(codeString))
7737          return EventStatus.ONHOLD;
7738        if ("stopped".equals(codeString))
7739          return EventStatus.STOPPED;
7740        if ("completed".equals(codeString))
7741          return EventStatus.COMPLETED;
7742        if ("entered-in-error".equals(codeString))
7743          return EventStatus.ENTEREDINERROR;
7744        if ("unknown".equals(codeString))
7745          return EventStatus.UNKNOWN;
7746        throw new IllegalArgumentException("Unknown EventStatus code '"+codeString+"'");
7747        }
7748
7749        public Enumeration<EventStatus> fromType(PrimitiveType<?> code) throws FHIRException {
7750          if (code == null)
7751            return null;
7752          if (code.isEmpty())
7753            return new Enumeration<EventStatus>(this, EventStatus.NULL, code);
7754          String codeString = ((PrimitiveType) code).asStringValue();
7755          if (codeString == null || "".equals(codeString))
7756            return new Enumeration<EventStatus>(this, EventStatus.NULL, code);
7757        if ("preparation".equals(codeString))
7758          return new Enumeration<EventStatus>(this, EventStatus.PREPARATION, code);
7759        if ("in-progress".equals(codeString))
7760          return new Enumeration<EventStatus>(this, EventStatus.INPROGRESS, code);
7761        if ("not-done".equals(codeString))
7762          return new Enumeration<EventStatus>(this, EventStatus.NOTDONE, code);
7763        if ("on-hold".equals(codeString))
7764          return new Enumeration<EventStatus>(this, EventStatus.ONHOLD, code);
7765        if ("stopped".equals(codeString))
7766          return new Enumeration<EventStatus>(this, EventStatus.STOPPED, code);
7767        if ("completed".equals(codeString))
7768          return new Enumeration<EventStatus>(this, EventStatus.COMPLETED, code);
7769        if ("entered-in-error".equals(codeString))
7770          return new Enumeration<EventStatus>(this, EventStatus.ENTEREDINERROR, code);
7771        if ("unknown".equals(codeString))
7772          return new Enumeration<EventStatus>(this, EventStatus.UNKNOWN, code);
7773        throw new FHIRException("Unknown EventStatus code '"+codeString+"'");
7774        }
7775    public String toCode(EventStatus code) {
7776      if (code == EventStatus.PREPARATION)
7777        return "preparation";
7778      if (code == EventStatus.INPROGRESS)
7779        return "in-progress";
7780      if (code == EventStatus.NOTDONE)
7781        return "not-done";
7782      if (code == EventStatus.ONHOLD)
7783        return "on-hold";
7784      if (code == EventStatus.STOPPED)
7785        return "stopped";
7786      if (code == EventStatus.COMPLETED)
7787        return "completed";
7788      if (code == EventStatus.ENTEREDINERROR)
7789        return "entered-in-error";
7790      if (code == EventStatus.UNKNOWN)
7791        return "unknown";
7792      return "?";
7793      }
7794    public String toSystem(EventStatus code) {
7795      return code.getSystem();
7796      }
7797    }
7798
7799    public enum EvidenceVariableHandling {
7800        /**
7801         * A continuous variable is one for which, within the limits the variable ranges, any value is possible (from STATO http://purl.obolibrary.org/obo/STATO_0000251).
7802         */
7803        CONTINUOUS, 
7804        /**
7805         * A dichotomous variable is a categorical variable which is defined to have only 2 categories or possible values (from STATO http://purl.obolibrary.org/obo/STATO_0000090).
7806         */
7807        DICHOTOMOUS, 
7808        /**
7809         * An ordinal variable is a categorical variable where the discrete possible values are ordered or correspond to an implicit ranking (from STATO http://purl.obolibrary.org/obo/STATO_0000228).
7810         */
7811        ORDINAL, 
7812        /**
7813         * A polychotomous variable is a categorical variable which is defined to have minimally 2 categories or possible values. (from STATO  http://purl.obolibrary.org/obo/STATO_0000087).  Suggestion to limit code use to situations when neither dichotomous nor ordinal variables apply.
7814         */
7815        POLYCHOTOMOUS, 
7816        /**
7817         * added to help the parsers
7818         */
7819        NULL;
7820        public static EvidenceVariableHandling fromCode(String codeString) throws FHIRException {
7821            if (codeString == null || "".equals(codeString))
7822                return null;
7823        if ("continuous".equals(codeString))
7824          return CONTINUOUS;
7825        if ("dichotomous".equals(codeString))
7826          return DICHOTOMOUS;
7827        if ("ordinal".equals(codeString))
7828          return ORDINAL;
7829        if ("polychotomous".equals(codeString))
7830          return POLYCHOTOMOUS;
7831        throw new FHIRException("Unknown EvidenceVariableHandling code '"+codeString+"'");
7832        }
7833        public static boolean isValidCode(String codeString) {
7834            if (codeString == null || "".equals(codeString))
7835                return false;
7836          return Utilities.existsInList(codeString, "continuous", "dichotomous", "ordinal", "polychotomous");
7837        }
7838        public String toCode() {
7839          switch (this) {
7840            case CONTINUOUS: return "continuous";
7841            case DICHOTOMOUS: return "dichotomous";
7842            case ORDINAL: return "ordinal";
7843            case POLYCHOTOMOUS: return "polychotomous";
7844            case NULL: return null;
7845            default: return "?";
7846          }
7847        }
7848        public String getSystem() {
7849          switch (this) {
7850            case CONTINUOUS: return "http://hl7.org/fhir/variable-handling";
7851            case DICHOTOMOUS: return "http://hl7.org/fhir/variable-handling";
7852            case ORDINAL: return "http://hl7.org/fhir/variable-handling";
7853            case POLYCHOTOMOUS: return "http://hl7.org/fhir/variable-handling";
7854            case NULL: return null;
7855            default: return "?";
7856          }
7857        }
7858        public String getDefinition() {
7859          switch (this) {
7860            case CONTINUOUS: return "A continuous variable is one for which, within the limits the variable ranges, any value is possible (from STATO http://purl.obolibrary.org/obo/STATO_0000251).";
7861            case DICHOTOMOUS: return "A dichotomous variable is a categorical variable which is defined to have only 2 categories or possible values (from STATO http://purl.obolibrary.org/obo/STATO_0000090).";
7862            case ORDINAL: return "An ordinal variable is a categorical variable where the discrete possible values are ordered or correspond to an implicit ranking (from STATO http://purl.obolibrary.org/obo/STATO_0000228).";
7863            case POLYCHOTOMOUS: return "A polychotomous variable is a categorical variable which is defined to have minimally 2 categories or possible values. (from STATO  http://purl.obolibrary.org/obo/STATO_0000087).  Suggestion to limit code use to situations when neither dichotomous nor ordinal variables apply.";
7864            case NULL: return null;
7865            default: return "?";
7866          }
7867        }
7868        public String getDisplay() {
7869          switch (this) {
7870            case CONTINUOUS: return "continuous variable";
7871            case DICHOTOMOUS: return "dichotomous variable";
7872            case ORDINAL: return "ordinal variable";
7873            case POLYCHOTOMOUS: return "polychotomous variable";
7874            case NULL: return null;
7875            default: return "?";
7876          }
7877        }
7878    }
7879
7880  public static class EvidenceVariableHandlingEnumFactory implements EnumFactory<EvidenceVariableHandling> {
7881    public EvidenceVariableHandling fromCode(String codeString) throws IllegalArgumentException {
7882      if (codeString == null || "".equals(codeString))
7883            if (codeString == null || "".equals(codeString))
7884                return null;
7885        if ("continuous".equals(codeString))
7886          return EvidenceVariableHandling.CONTINUOUS;
7887        if ("dichotomous".equals(codeString))
7888          return EvidenceVariableHandling.DICHOTOMOUS;
7889        if ("ordinal".equals(codeString))
7890          return EvidenceVariableHandling.ORDINAL;
7891        if ("polychotomous".equals(codeString))
7892          return EvidenceVariableHandling.POLYCHOTOMOUS;
7893        throw new IllegalArgumentException("Unknown EvidenceVariableHandling code '"+codeString+"'");
7894        }
7895
7896        public Enumeration<EvidenceVariableHandling> fromType(PrimitiveType<?> code) throws FHIRException {
7897          if (code == null)
7898            return null;
7899          if (code.isEmpty())
7900            return new Enumeration<EvidenceVariableHandling>(this, EvidenceVariableHandling.NULL, code);
7901          String codeString = ((PrimitiveType) code).asStringValue();
7902          if (codeString == null || "".equals(codeString))
7903            return new Enumeration<EvidenceVariableHandling>(this, EvidenceVariableHandling.NULL, code);
7904        if ("continuous".equals(codeString))
7905          return new Enumeration<EvidenceVariableHandling>(this, EvidenceVariableHandling.CONTINUOUS, code);
7906        if ("dichotomous".equals(codeString))
7907          return new Enumeration<EvidenceVariableHandling>(this, EvidenceVariableHandling.DICHOTOMOUS, code);
7908        if ("ordinal".equals(codeString))
7909          return new Enumeration<EvidenceVariableHandling>(this, EvidenceVariableHandling.ORDINAL, code);
7910        if ("polychotomous".equals(codeString))
7911          return new Enumeration<EvidenceVariableHandling>(this, EvidenceVariableHandling.POLYCHOTOMOUS, code);
7912        throw new FHIRException("Unknown EvidenceVariableHandling code '"+codeString+"'");
7913        }
7914    public String toCode(EvidenceVariableHandling code) {
7915      if (code == EvidenceVariableHandling.CONTINUOUS)
7916        return "continuous";
7917      if (code == EvidenceVariableHandling.DICHOTOMOUS)
7918        return "dichotomous";
7919      if (code == EvidenceVariableHandling.ORDINAL)
7920        return "ordinal";
7921      if (code == EvidenceVariableHandling.POLYCHOTOMOUS)
7922        return "polychotomous";
7923      return "?";
7924      }
7925    public String toSystem(EvidenceVariableHandling code) {
7926      return code.getSystem();
7927      }
7928    }
7929
7930    public enum ExampleScenarioActorType {
7931        /**
7932         * A human actor
7933         */
7934        PERSON, 
7935        /**
7936         * A software application or other system
7937         */
7938        SYSTEM, 
7939        /**
7940         * added to help the parsers
7941         */
7942        NULL;
7943        public static ExampleScenarioActorType fromCode(String codeString) throws FHIRException {
7944            if (codeString == null || "".equals(codeString))
7945                return null;
7946        if ("person".equals(codeString))
7947          return PERSON;
7948        if ("system".equals(codeString))
7949          return SYSTEM;
7950        throw new FHIRException("Unknown ExampleScenarioActorType code '"+codeString+"'");
7951        }
7952        public static boolean isValidCode(String codeString) {
7953            if (codeString == null || "".equals(codeString))
7954                return false;
7955          return Utilities.existsInList(codeString, "person", "system");
7956        }
7957        public String toCode() {
7958          switch (this) {
7959            case PERSON: return "person";
7960            case SYSTEM: return "system";
7961            case NULL: return null;
7962            default: return "?";
7963          }
7964        }
7965        public String getSystem() {
7966          switch (this) {
7967            case PERSON: return "http://hl7.org/fhir/examplescenario-actor-type";
7968            case SYSTEM: return "http://hl7.org/fhir/examplescenario-actor-type";
7969            case NULL: return null;
7970            default: return "?";
7971          }
7972        }
7973        public String getDefinition() {
7974          switch (this) {
7975            case PERSON: return "A human actor";
7976            case SYSTEM: return "A software application or other system";
7977            case NULL: return null;
7978            default: return "?";
7979          }
7980        }
7981        public String getDisplay() {
7982          switch (this) {
7983            case PERSON: return "Person";
7984            case SYSTEM: return "System";
7985            case NULL: return null;
7986            default: return "?";
7987          }
7988        }
7989    }
7990
7991  public static class ExampleScenarioActorTypeEnumFactory implements EnumFactory<ExampleScenarioActorType> {
7992    public ExampleScenarioActorType fromCode(String codeString) throws IllegalArgumentException {
7993      if (codeString == null || "".equals(codeString))
7994            if (codeString == null || "".equals(codeString))
7995                return null;
7996        if ("person".equals(codeString))
7997          return ExampleScenarioActorType.PERSON;
7998        if ("system".equals(codeString))
7999          return ExampleScenarioActorType.SYSTEM;
8000        throw new IllegalArgumentException("Unknown ExampleScenarioActorType code '"+codeString+"'");
8001        }
8002
8003        public Enumeration<ExampleScenarioActorType> fromType(PrimitiveType<?> code) throws FHIRException {
8004          if (code == null)
8005            return null;
8006          if (code.isEmpty())
8007            return new Enumeration<ExampleScenarioActorType>(this, ExampleScenarioActorType.NULL, code);
8008          String codeString = ((PrimitiveType) code).asStringValue();
8009          if (codeString == null || "".equals(codeString))
8010            return new Enumeration<ExampleScenarioActorType>(this, ExampleScenarioActorType.NULL, code);
8011        if ("person".equals(codeString))
8012          return new Enumeration<ExampleScenarioActorType>(this, ExampleScenarioActorType.PERSON, code);
8013        if ("system".equals(codeString))
8014          return new Enumeration<ExampleScenarioActorType>(this, ExampleScenarioActorType.SYSTEM, code);
8015        throw new FHIRException("Unknown ExampleScenarioActorType code '"+codeString+"'");
8016        }
8017    public String toCode(ExampleScenarioActorType code) {
8018      if (code == ExampleScenarioActorType.PERSON)
8019        return "person";
8020      if (code == ExampleScenarioActorType.SYSTEM)
8021        return "system";
8022      return "?";
8023      }
8024    public String toSystem(ExampleScenarioActorType code) {
8025      return code.getSystem();
8026      }
8027    }
8028
8029    public enum FHIRTypes {
8030        /**
8031         * Base Type: Base definition for all types defined in FHIR type system.
8032         */
8033        BASE, 
8034        /**
8035         * Element Type: Base definition for all elements in a resource.
8036         */
8037        ELEMENT, 
8038        /**
8039         * BackboneElement Type: Base definition for all elements that are defined inside a resource - but not those in a data type.
8040         */
8041        BACKBONEELEMENT, 
8042        /**
8043         * DataType Type: The base class for all re-useable types defined as part of the FHIR Specification.
8044         */
8045        DATATYPE, 
8046        /**
8047         * Address Type: An address expressed using postal conventions (as opposed to GPS or other location definition formats).  This data type may be used to convey addresses for use in delivering mail as well as for visiting locations which might not be valid for mail delivery.  There are a variety of postal address formats defined around the world.
8048The ISO21090-codedString may be used to provide a coded representation of the contents of strings in an Address.
8049         */
8050        ADDRESS, 
8051        /**
8052         * Annotation Type: A  text note which also  contains information about who made the statement and when.
8053         */
8054        ANNOTATION, 
8055        /**
8056         * Attachment Type: For referring to data content defined in other formats.
8057         */
8058        ATTACHMENT, 
8059        /**
8060         * Availability Type: Availability data for an {item}.
8061         */
8062        AVAILABILITY, 
8063        /**
8064         * BackboneType Type: Base definition for the few data types that are allowed to carry modifier extensions.
8065         */
8066        BACKBONETYPE, 
8067        /**
8068         * Dosage Type: Indicates how the medication is/was taken or should be taken by the patient.
8069         */
8070        DOSAGE, 
8071        /**
8072         * ElementDefinition Type: Captures constraints on each element within the resource, profile, or extension.
8073         */
8074        ELEMENTDEFINITION, 
8075        /**
8076         * MarketingStatus Type: The marketing status describes the date when a medicinal product is actually put on the market or the date as of which it is no longer available.
8077         */
8078        MARKETINGSTATUS, 
8079        /**
8080         * ProductShelfLife Type: The shelf-life and storage information for a medicinal product item or container can be described using this class.
8081         */
8082        PRODUCTSHELFLIFE, 
8083        /**
8084         * Timing Type: Specifies an event that may occur multiple times. Timing schedules are used to record when things are planned, expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds, and may be used for reporting the schedule to which past regular activities were carried out.
8085         */
8086        TIMING, 
8087        /**
8088         * CodeableConcept Type: A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text.
8089         */
8090        CODEABLECONCEPT, 
8091        /**
8092         * CodeableReference Type: A reference to a resource (by instance), or instead, a reference to a concept defined in a terminology or ontology (by class).
8093         */
8094        CODEABLEREFERENCE, 
8095        /**
8096         * Coding Type: A reference to a code defined by a terminology system.
8097         */
8098        CODING, 
8099        /**
8100         * ContactDetail Type: Specifies contact information for a person or organization.
8101         */
8102        CONTACTDETAIL, 
8103        /**
8104         * ContactPoint Type: Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc.
8105         */
8106        CONTACTPOINT, 
8107        /**
8108         * Contributor Type: A contributor to the content of a knowledge asset, including authors, editors, reviewers, and endorsers.
8109         */
8110        CONTRIBUTOR, 
8111        /**
8112         * DataRequirement Type: Describes a required data item for evaluation in terms of the type of data, and optional code or date-based filters of the data.
8113         */
8114        DATAREQUIREMENT, 
8115        /**
8116         * Expression Type: A expression that is evaluated in a specified context and returns a value. The context of use of the expression must specify the context in which the expression is evaluated, and how the result of the expression is used.
8117         */
8118        EXPRESSION, 
8119        /**
8120         * ExtendedContactDetail Type: Specifies contact information for a specific purpose over a period of time, might be handled/monitored by a specific named person or organization.
8121         */
8122        EXTENDEDCONTACTDETAIL, 
8123        /**
8124         * Extension Type: Optional Extension Element - found in all resources.
8125         */
8126        EXTENSION, 
8127        /**
8128         * HumanName Type: A name, normally of a human, that can be used for other living entities (e.g. animals but not organizations) that have been assigned names by a human and may need the use of name parts or the need for usage information.
8129         */
8130        HUMANNAME, 
8131        /**
8132         * Identifier Type: An identifier - identifies some entity uniquely and unambiguously. Typically this is used for business identifiers.
8133         */
8134        IDENTIFIER, 
8135        /**
8136         * Meta Type: The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.
8137         */
8138        META, 
8139        /**
8140         * MonetaryComponent Type: Availability data for an {item}.
8141         */
8142        MONETARYCOMPONENT, 
8143        /**
8144         * Money Type: An amount of economic utility in some recognized currency.
8145         */
8146        MONEY, 
8147        /**
8148         * Narrative Type: A human-readable summary of the resource conveying the essential clinical and business information for the resource.
8149         */
8150        NARRATIVE, 
8151        /**
8152         * ParameterDefinition Type: The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse.
8153         */
8154        PARAMETERDEFINITION, 
8155        /**
8156         * Period Type: A time period defined by a start and end date and optionally time.
8157         */
8158        PERIOD, 
8159        /**
8160         * PrimitiveType Type: The base type for all re-useable types defined that have a simple property.
8161         */
8162        PRIMITIVETYPE, 
8163        /**
8164         * base64Binary Type: A stream of bytes
8165         */
8166        BASE64BINARY, 
8167        /**
8168         * boolean Type: Value of "true" or "false"
8169         */
8170        BOOLEAN, 
8171        /**
8172         * date Type: A date or partial date (e.g. just year or year + month). There is no UTC offset. The format is a union of the schema types gYear, gYearMonth and date.  Dates SHALL be valid dates.
8173         */
8174        DATE, 
8175        /**
8176         * dateTime Type: A date, date-time or partial date (e.g. just year or year + month).  If hours and minutes are specified, a UTC offset SHALL be populated. The format is a union of the schema types gYear, gYearMonth, date and dateTime. Seconds must be provided due to schema type constraints but may be zero-filled and may be ignored.                 Dates SHALL be valid dates.
8177         */
8178        DATETIME, 
8179        /**
8180         * decimal Type: A rational number with implicit precision
8181         */
8182        DECIMAL, 
8183        /**
8184         * instant Type: An instant in time - known at least to the second
8185         */
8186        INSTANT, 
8187        /**
8188         * integer Type: A whole number
8189         */
8190        INTEGER, 
8191        /**
8192         * positiveInt type: An integer with a value that is positive (e.g. >0)
8193         */
8194        POSITIVEINT, 
8195        /**
8196         * unsignedInt type: An integer with a value that is not negative (e.g. >= 0)
8197         */
8198        UNSIGNEDINT, 
8199        /**
8200         * integer64 Type: A very large whole number
8201         */
8202        INTEGER64, 
8203        /**
8204         * string Type: A sequence of Unicode characters
8205         */
8206        STRING, 
8207        /**
8208         * code type: A string which has at least one character and no leading or trailing whitespace and where there is no whitespace other than single spaces in the contents
8209         */
8210        CODE, 
8211        /**
8212         * id type: Any combination of letters, numerals, "-" and ".", with a length limit of 64 characters.  (This might be an integer, an unprefixed OID, UUID or any other identifier pattern that meets these constraints.)  Ids are case-insensitive.
8213         */
8214        ID, 
8215        /**
8216         * markdown type: A string that may contain Github Flavored Markdown syntax for optional processing by a mark down presentation engine
8217         */
8218        MARKDOWN, 
8219        /**
8220         * time Type: A time during the day, with no date specified
8221         */
8222        TIME, 
8223        /**
8224         * uri Type: String of characters used to identify a name or a resource
8225         */
8226        URI, 
8227        /**
8228         * canonical type: A URI that is a reference to a canonical URL on a FHIR resource
8229         */
8230        CANONICAL, 
8231        /**
8232         * oid type: An OID represented as a URI
8233         */
8234        OID, 
8235        /**
8236         * url type: A URI that is a literal reference
8237         */
8238        URL, 
8239        /**
8240         * uuid type: A UUID, represented as a URI
8241         */
8242        UUID, 
8243        /**
8244         * Quantity Type: A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies.
8245         */
8246        QUANTITY, 
8247        /**
8248         * Age Type: A duration of time during which an organism (or a process) has existed.
8249         */
8250        AGE, 
8251        /**
8252         * Count Type: A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies.
8253         */
8254        COUNT, 
8255        /**
8256         * Distance Type: A length - a value with a unit that is a physical distance.
8257         */
8258        DISTANCE, 
8259        /**
8260         * Duration Type: A length of time.
8261         */
8262        DURATION, 
8263        /**
8264         * Range Type: A set of ordered Quantities defined by a low and high limit.
8265         */
8266        RANGE, 
8267        /**
8268         * Ratio Type: A relationship of two Quantity values - expressed as a numerator and a denominator.
8269         */
8270        RATIO, 
8271        /**
8272         * RatioRange Type: A range of ratios expressed as a low and high numerator and a denominator.
8273         */
8274        RATIORANGE, 
8275        /**
8276         * Reference Type: A reference from one resource to another.
8277         */
8278        REFERENCE, 
8279        /**
8280         * RelatedArtifact Type: Related artifacts such as additional documentation, justification, or bibliographic references.
8281         */
8282        RELATEDARTIFACT, 
8283        /**
8284         * SampledData Type: A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data.
8285         */
8286        SAMPLEDDATA, 
8287        /**
8288         * Signature Type: A signature along with supporting context. The signature may be a digital signature that is cryptographic in nature, or some other signature acceptable to the domain. This other signature may be as simple as a graphical image representing a hand-written signature, or a signature ceremony Different signature approaches have different utilities.
8289         */
8290        SIGNATURE, 
8291        /**
8292         * TriggerDefinition Type: A description of a triggering event. Triggering events can be named events, data events, or periodic, as determined by the type element.
8293         */
8294        TRIGGERDEFINITION, 
8295        /**
8296         * UsageContext Type: Specifies clinical/business/etc. metadata that can be used to retrieve, index and/or categorize an artifact. This metadata can either be specific to the applicable population (e.g., age category, DRG) or the specific context of care (e.g., venue, care setting, provider of care).
8297         */
8298        USAGECONTEXT, 
8299        /**
8300         * VirtualServiceDetail Type: Virtual Service Contact Details.
8301         */
8302        VIRTUALSERVICEDETAIL, 
8303        /**
8304         * xhtml Type definition
8305         */
8306        XHTML, 
8307        /**
8308         * This is the base resource type for everything.
8309         */
8310        RESOURCE, 
8311        /**
8312         * A resource that represents the data of a single raw artifact as digital content accessible in its native format.  A Binary resource can contain any content, whether text, image, pdf, zip archive, etc.
8313         */
8314        BINARY, 
8315        /**
8316         * A container for a collection of resources.
8317         */
8318        BUNDLE, 
8319        /**
8320         * A resource that includes narrative, extensions, and contained resources.
8321         */
8322        DOMAINRESOURCE, 
8323        /**
8324         * A financial tool for tracking value accrued for a particular purpose.  In the healthcare field, used to track charges for a patient, cost centers, etc.
8325         */
8326        ACCOUNT, 
8327        /**
8328         * This resource allows for the definition of some activity to be performed, independent of a particular patient, practitioner, or other performance context.
8329         */
8330        ACTIVITYDEFINITION, 
8331        /**
8332         * The ActorDefinition resource is used to describe an actor - a human or an application that plays a role in data exchange, and that may have obligations associated with the role the actor plays.
8333         */
8334        ACTORDEFINITION, 
8335        /**
8336         * A medicinal product in the final form which is suitable for administering to a patient (after any mixing of multiple components, dissolution etc. has been performed).
8337         */
8338        ADMINISTRABLEPRODUCTDEFINITION, 
8339        /**
8340         * An event (i.e. any change to current patient status) that may be related to unintended effects on a patient or research participant. The unintended effects may require additional monitoring, treatment, hospitalization, or may result in death. The AdverseEvent resource also extends to potential or avoided events that could have had such effects. There are two major domains where the AdverseEvent resource is expected to be used. One is in clinical care reported adverse events and the other is in reporting adverse events in clinical  research trial management.  Adverse events can be reported by healthcare providers, patients, caregivers or by medical products manufacturers.  Given the differences between these two concepts, we recommend consulting the domain specific implementation guides when implementing the AdverseEvent Resource. The implementation guides include specific extensions, value sets and constraints.
8341         */
8342        ADVERSEEVENT, 
8343        /**
8344         * Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance.
8345         */
8346        ALLERGYINTOLERANCE, 
8347        /**
8348         * A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s).
8349         */
8350        APPOINTMENT, 
8351        /**
8352         * A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection.
8353         */
8354        APPOINTMENTRESPONSE, 
8355        /**
8356         * This Resource provides one or more comments, classifiers or ratings about a Resource and supports attribution and rights management metadata for the added content.
8357         */
8358        ARTIFACTASSESSMENT, 
8359        /**
8360         * A record of an event relevant for purposes such as operations, privacy, security, maintenance, and performance analysis.
8361         */
8362        AUDITEVENT, 
8363        /**
8364         * Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification.
8365         */
8366        BASIC, 
8367        /**
8368         * A biological material originating from a biological entity intended to be transplanted or infused into another (possibly the same) biological entity.
8369         */
8370        BIOLOGICALLYDERIVEDPRODUCT, 
8371        /**
8372         * A record of dispensation of a biologically derived product.
8373         */
8374        BIOLOGICALLYDERIVEDPRODUCTDISPENSE, 
8375        /**
8376         * Record details about an anatomical structure.  This resource may be used when a coded concept does not provide the necessary detail needed for the use case.
8377         */
8378        BODYSTRUCTURE, 
8379        /**
8380         * Common Interface declaration for conformance and knowledge artifact resources.
8381         */
8382        CANONICALRESOURCE, 
8383        /**
8384         * A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server or Client for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation.
8385         */
8386        CAPABILITYSTATEMENT, 
8387        /**
8388         * Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions.
8389         */
8390        CAREPLAN, 
8391        /**
8392         * The Care Team includes all the people and organizations who plan to participate in the coordination and delivery of care.
8393         */
8394        CARETEAM, 
8395        /**
8396         * The resource ChargeItem describes the provision of healthcare provider products for a certain patient, therefore referring not only to the product, but containing in addition details of the provision, like date, time, amounts and participating organizations and persons. Main Usage of the ChargeItem is to enable the billing process and internal cost allocation.
8397         */
8398        CHARGEITEM, 
8399        /**
8400         * The ChargeItemDefinition resource provides the properties that apply to the (billing) codes necessary to calculate costs and prices. The properties may differ largely depending on type and realm, therefore this resource gives only a rough structure and requires profiling for each type of billing code system.
8401         */
8402        CHARGEITEMDEFINITION, 
8403        /**
8404         * The Citation Resource enables reference to any knowledge artifact for purposes of identification and attribution. The Citation Resource supports existing reference structures and developing publication practices such as versioning, expressing complex contributorship roles, and referencing computable resources.
8405         */
8406        CITATION, 
8407        /**
8408         * A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement.
8409         */
8410        CLAIM, 
8411        /**
8412         * This resource provides the adjudication details from the processing of a Claim resource.
8413         */
8414        CLAIMRESPONSE, 
8415        /**
8416         * A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter,  but this varies greatly depending on the clinical workflow. This resource is called "ClinicalImpression" rather than "ClinicalAssessment" to avoid confusion with the recording of assessment tools such as Apgar score.
8417         */
8418        CLINICALIMPRESSION, 
8419        /**
8420         * A single issue - either an indication, contraindication, interaction or an undesirable effect for a medicinal product, medication, device or procedure.
8421         */
8422        CLINICALUSEDEFINITION, 
8423        /**
8424         * The CodeSystem resource is used to declare the existence of and describe a code system or code system supplement and its key properties, and optionally define a part or all of its content.
8425         */
8426        CODESYSTEM, 
8427        /**
8428         * A clinical or business level record of information being transmitted or shared; e.g. an alert that was sent to a responsible provider, a public health agency communication to a provider/reporter in response to a case report for a reportable condition.
8429         */
8430        COMMUNICATION, 
8431        /**
8432         * A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition.
8433         */
8434        COMMUNICATIONREQUEST, 
8435        /**
8436         * A compartment definition that defines how resources are accessed on a server.
8437         */
8438        COMPARTMENTDEFINITION, 
8439        /**
8440         * A set of healthcare-related information that is assembled together into a single logical package that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. A Composition defines the structure and narrative content necessary for a document. However, a Composition alone does not constitute a document. Rather, the Composition must be the first entry in a Bundle where Bundle.type=document, and any other resources referenced from Composition must be included as subsequent entries in the Bundle (for example Patient, Practitioner, Encounter, etc.).
8441         */
8442        COMPOSITION, 
8443        /**
8444         * A statement of relationships from one set of concepts to one or more other concepts - either concepts in code systems, or data element/data element concepts, or classes in class models.
8445         */
8446        CONCEPTMAP, 
8447        /**
8448         * A clinical condition, problem, diagnosis, or other event, situation, issue, or clinical concept that has risen to a level of concern.
8449         */
8450        CONDITION, 
8451        /**
8452         * A definition of a condition and information relevant to managing it.
8453         */
8454        CONDITIONDEFINITION, 
8455        /**
8456         * A record of a healthcare consumer?s  choices  or choices made on their behalf by a third party, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time.
8457         */
8458        CONSENT, 
8459        /**
8460         * Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement.
8461         */
8462        CONTRACT, 
8463        /**
8464         * Financial instrument which may be used to reimburse or pay for health care products and services. Includes both insurance and self-payment.
8465         */
8466        COVERAGE, 
8467        /**
8468         * The CoverageEligibilityRequest provides patient and insurance coverage information to an insurer for them to respond, in the form of an CoverageEligibilityResponse, with information regarding whether the stated coverage is valid and in-force and optionally to provide the insurance details of the policy.
8469         */
8470        COVERAGEELIGIBILITYREQUEST, 
8471        /**
8472         * This resource provides eligibility and plan details from the processing of an CoverageEligibilityRequest resource.
8473         */
8474        COVERAGEELIGIBILITYRESPONSE, 
8475        /**
8476         * Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, gaps in care, etc.
8477         */
8478        DETECTEDISSUE, 
8479        /**
8480         * This resource describes the properties (regulated, has real time clock, etc.), adminstrative (manufacturer name, model number, serial number, firmware, etc.), and type (knee replacement, blood pressure cuff, MRI, etc.) of a physical unit (these values do not change much within a given module, for example the serail number, manufacturer name, and model number). An actual unit may consist of several modules in a distinct hierarchy and these are represented by multiple Device resources and bound through the 'parent' element.
8481         */
8482        DEVICE, 
8483        /**
8484         * A record of association of a device.
8485         */
8486        DEVICEASSOCIATION, 
8487        /**
8488         * This is a specialized resource that defines the characteristics and capabilities of a device.
8489         */
8490        DEVICEDEFINITION, 
8491        /**
8492         * Indicates that a device is to be or has been dispensed for a named person/patient.  This includes a description of the product (supply) provided and the instructions for using the device.
8493         */
8494        DEVICEDISPENSE, 
8495        /**
8496         * Describes a measurement, calculation or setting capability of a device.  The DeviceMetric resource is derived from the ISO/IEEE 11073-10201 Domain Information Model standard, but is more widely applicable. 
8497         */
8498        DEVICEMETRIC, 
8499        /**
8500         * Represents a request a device to be provided to a specific patient. The device may be an implantable device to be subsequently implanted, or an external assistive device, such as a walker, to be delivered and subsequently be used.
8501         */
8502        DEVICEREQUEST, 
8503        /**
8504         * A record of a device being used by a patient where the record is the result of a report from the patient or a clinician.
8505         */
8506        DEVICEUSAGE, 
8507        /**
8508         * The findings and interpretation of diagnostic tests performed on patients, groups of patients, products, substances, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting provider information, and some mix of atomic results, images, textual and coded interpretations, and formatted representation of diagnostic reports. The report also includes non-clinical context such as batch analysis and stability reporting of products and substances.
8509         */
8510        DIAGNOSTICREPORT, 
8511        /**
8512         * A reference to a document of any kind for any purpose. While the term ?document? implies a more narrow focus, for this resource this ?document? encompasses *any* serialized object with a mime-type, it includes formal patient-centric documents (CDA), clinical notes, scanned paper, non-patient specific documents like policy text, as well as a photo, video, or audio recording acquired or used in healthcare.  The DocumentReference resource provides metadata about the document so that the document can be discovered and managed.  The actual content may be inline base64 encoded data or provided by direct reference.
8513         */
8514        DOCUMENTREFERENCE, 
8515        /**
8516         * An interaction between healthcare provider(s), and/or patient(s) for the purpose of providing healthcare service(s) or assessing the health status of patient(s).
8517         */
8518        ENCOUNTER, 
8519        /**
8520         * A record of significant events/milestones key data throughout the history of an Encounter
8521         */
8522        ENCOUNTERHISTORY, 
8523        /**
8524         * The technical details of an endpoint that can be used for electronic services, such as for web services providing XDS.b, a REST endpoint for another FHIR server, or a s/Mime email address. This may include any security context information.
8525         */
8526        ENDPOINT, 
8527        /**
8528         * This resource provides the insurance enrollment details to the insurer regarding a specified coverage.
8529         */
8530        ENROLLMENTREQUEST, 
8531        /**
8532         * This resource provides enrollment and plan details from the processing of an EnrollmentRequest resource.
8533         */
8534        ENROLLMENTRESPONSE, 
8535        /**
8536         * An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time.
8537         */
8538        EPISODEOFCARE, 
8539        /**
8540         * The EventDefinition resource provides a reusable description of when a particular event can occur.
8541         */
8542        EVENTDEFINITION, 
8543        /**
8544         * The Evidence Resource provides a machine-interpretable expression of an evidence concept including the evidence variables (e.g., population, exposures/interventions, comparators, outcomes, measured variables, confounding variables), the statistics, and the certainty of this evidence.
8545         */
8546        EVIDENCE, 
8547        /**
8548         * The EvidenceReport Resource is a specialized container for a collection of resources and codeable concepts, adapted to support compositions of Evidence, EvidenceVariable, and Citation resources and related concepts.
8549         */
8550        EVIDENCEREPORT, 
8551        /**
8552         * The EvidenceVariable resource describes an element that knowledge (Evidence) is about.
8553         */
8554        EVIDENCEVARIABLE, 
8555        /**
8556         * A walkthrough of a workflow showing the interaction between systems and the instances shared, possibly including the evolution of instances over time.
8557         */
8558        EXAMPLESCENARIO, 
8559        /**
8560         * This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.
8561         */
8562        EXPLANATIONOFBENEFIT, 
8563        /**
8564         * Significant health conditions for a person related to the patient relevant in the context of care for the patient.
8565         */
8566        FAMILYMEMBERHISTORY, 
8567        /**
8568         * Prospective warnings of potential issues when providing care to the patient.
8569         */
8570        FLAG, 
8571        /**
8572         * This resource describes a product or service that is available through a program and includes the conditions and constraints of availability.  All of the information in this resource is specific to the inclusion of the item in the formulary and is not inherent to the item itself.
8573         */
8574        FORMULARYITEM, 
8575        /**
8576         * A set of analyses performed to analyze and generate genomic data.
8577         */
8578        GENOMICSTUDY, 
8579        /**
8580         * Describes the intended objective(s) for a patient, group or organization care, for example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc.
8581         */
8582        GOAL, 
8583        /**
8584         * A formal computable definition of a graph of resources - that is, a coherent set of resources that form a graph by following references. The Graph Definition resource defines a set and makes rules about the set.
8585         */
8586        GRAPHDEFINITION, 
8587        /**
8588         * Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively, and are not formally or legally recognized; i.e. a collection of entities that isn't an Organization.
8589         */
8590        GROUP, 
8591        /**
8592         * A guidance response is the formal response to a guidance request, including any output parameters returned by the evaluation, as well as the description of any proposed actions to be taken.
8593         */
8594        GUIDANCERESPONSE, 
8595        /**
8596         * The details of a healthcare service available at a location or in a catalog.  In the case where there is a hierarchy of services (for example, Lab -> Pathology -> Wound Cultures), this can be represented using a set of linked HealthcareServices.
8597         */
8598        HEALTHCARESERVICE, 
8599        /**
8600         * A selection of DICOM SOP instances and/or frames within a single Study and Series. This might include additional specifics such as an image region, an Observation UID or a Segmentation Number, allowing linkage to an Observation Resource or transferring this information along with the ImagingStudy Resource.
8601         */
8602        IMAGINGSELECTION, 
8603        /**
8604         * Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context.  A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities.
8605         */
8606        IMAGINGSTUDY, 
8607        /**
8608         * Describes the event of a patient being administered a vaccine or a record of an immunization as reported by a patient, a clinician or another party.
8609         */
8610        IMMUNIZATION, 
8611        /**
8612         * Describes a comparison of an immunization event against published recommendations to determine if the administration is "valid" in relation to those  recommendations.
8613         */
8614        IMMUNIZATIONEVALUATION, 
8615        /**
8616         * A patient's point-in-time set of recommendations (i.e. forecasting) according to a published schedule with optional supporting justification.
8617         */
8618        IMMUNIZATIONRECOMMENDATION, 
8619        /**
8620         * A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts.
8621         */
8622        IMPLEMENTATIONGUIDE, 
8623        /**
8624         * An ingredient of a manufactured item or pharmaceutical product.
8625         */
8626        INGREDIENT, 
8627        /**
8628         * Details of a Health Insurance product/plan provided by an organization.
8629         */
8630        INSURANCEPLAN, 
8631        /**
8632         * functional description of an inventory item used in inventory and supply-related workflows.
8633         */
8634        INVENTORYITEM, 
8635        /**
8636         * A report of inventory or stock items.
8637         */
8638        INVENTORYREPORT, 
8639        /**
8640         * Invoice containing collected ChargeItems from an Account with calculated individual and total price for Billing purpose.
8641         */
8642        INVOICE, 
8643        /**
8644         * The Library resource is a general-purpose container for knowledge asset definitions. It can be used to describe and expose existing knowledge assets such as logic libraries and information model descriptions, as well as to describe a collection of knowledge assets.
8645         */
8646        LIBRARY, 
8647        /**
8648         * Identifies two or more records (resource instances) that refer to the same real-world "occurrence".
8649         */
8650        LINKAGE, 
8651        /**
8652         * A List is a curated collection of resources, for things such as problem lists, allergy lists, facility list, organization list, etc.
8653         */
8654        LIST, 
8655        /**
8656         * Details and position information for a place where services are provided and resources and participants may be stored, found, contained, or accommodated.
8657         */
8658        LOCATION, 
8659        /**
8660         * The definition and characteristics of a medicinal manufactured item, such as a tablet or capsule, as contained in a packaged medicinal product.
8661         */
8662        MANUFACTUREDITEMDEFINITION, 
8663        /**
8664         * The Measure resource provides the definition of a quality measure.
8665         */
8666        MEASURE, 
8667        /**
8668         * The MeasureReport resource contains the results of the calculation of a measure; and optionally a reference to the resources involved in that calculation.
8669         */
8670        MEASUREREPORT, 
8671        /**
8672         * This resource is primarily used for the identification and definition of a medication, including ingredients, for the purposes of prescribing, dispensing, and administering a medication as well as for making statements about medication use.
8673         */
8674        MEDICATION, 
8675        /**
8676         * Describes the event of a patient consuming or otherwise being administered a medication.  This may be as simple as swallowing a tablet or it may be a long running infusion. Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner. This event can also be used to record waste using a status of not-done and the appropriate statusReason.
8677         */
8678        MEDICATIONADMINISTRATION, 
8679        /**
8680         * Indicates that a medication product is to be or has been dispensed for a named person/patient.  This includes a description of the medication product (supply) provided and the instructions for administering the medication.  The medication dispense is the result of a pharmacy system responding to a medication order.
8681         */
8682        MEDICATIONDISPENSE, 
8683        /**
8684         * Information about a medication that is used to support knowledge.
8685         */
8686        MEDICATIONKNOWLEDGE, 
8687        /**
8688         * An order or request for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called "MedicationRequest" rather than "MedicationPrescription" or "MedicationOrder" to generalize the use across inpatient and outpatient settings, including care plans, etc., and to harmonize with workflow patterns.
8689         */
8690        MEDICATIONREQUEST, 
8691        /**
8692         * A record of a medication that is being consumed by a patient.   A MedicationStatement may indicate that the patient may be taking the medication now or has taken the medication in the past or will be taking the medication in the future.  The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician.  A common scenario where this information is captured is during the history taking process during a patient visit or stay.   The medication information may come from sources such as the patient's memory, from a prescription bottle,  or from a list of medications the patient, clinician or other party maintains. 
8693
8694The primary difference between a medicationstatement and a medicationadministration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication.  A medicationstatement is often, if not always, less specific.  There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise.  As stated earlier, the Medication Statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains.  Medication administration is more formal and is not missing detailed information.
8695         */
8696        MEDICATIONSTATEMENT, 
8697        /**
8698         * Detailed definition of a medicinal product, typically for uses other than direct patient care (e.g. regulatory use, drug catalogs, to support prescribing, adverse events management etc.).
8699         */
8700        MEDICINALPRODUCTDEFINITION, 
8701        /**
8702         * Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted.
8703         */
8704        MESSAGEDEFINITION, 
8705        /**
8706         * The header for a message exchange that is either requesting or responding to an action.  The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle.
8707         */
8708        MESSAGEHEADER, 
8709        /**
8710         * Common Interface declaration for conformance and knowledge artifact resources.
8711         */
8712        METADATARESOURCE, 
8713        /**
8714         * Representation of a molecular sequence.
8715         */
8716        MOLECULARSEQUENCE, 
8717        /**
8718         * A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc.  Represents a "System" used within the Identifier and Coding data types.
8719         */
8720        NAMINGSYSTEM, 
8721        /**
8722         * A record of food or fluid that is being consumed by a patient.  A NutritionIntake may indicate that the patient may be consuming the food or fluid now or has consumed the food or fluid in the past.  The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician.  A common scenario where this information is captured is during the history taking process during a patient visit or stay or through an app that tracks food or fluids consumed.   The consumption information may come from sources such as the patient's memory, from a nutrition label,  or from a clinician documenting observed intake.
8723         */
8724        NUTRITIONINTAKE, 
8725        /**
8726         * A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.
8727         */
8728        NUTRITIONORDER, 
8729        /**
8730         * A food or supplement that is consumed by patients.
8731         */
8732        NUTRITIONPRODUCT, 
8733        /**
8734         * Measurements and simple assertions made about a patient, device or other subject.
8735         */
8736        OBSERVATION, 
8737        /**
8738         * Set of definitional characteristics for a kind of observation or measurement produced or consumed by an orderable health care service.
8739         */
8740        OBSERVATIONDEFINITION, 
8741        /**
8742         * A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction).
8743         */
8744        OPERATIONDEFINITION, 
8745        /**
8746         * A collection of error, warning, or information messages that result from a system action.
8747         */
8748        OPERATIONOUTCOME, 
8749        /**
8750         * A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action.  Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, payer/insurer, etc.
8751         */
8752        ORGANIZATION, 
8753        /**
8754         * Defines an affiliation/assotiation/relationship between 2 distinct organizations, that is not a part-of relationship/sub-division relationship.
8755         */
8756        ORGANIZATIONAFFILIATION, 
8757        /**
8758         * A medically related item or items, in a container or package.
8759         */
8760        PACKAGEDPRODUCTDEFINITION, 
8761        /**
8762         * Demographics and other administrative information about an individual or animal receiving care or other health-related services.
8763         */
8764        PATIENT, 
8765        /**
8766         * This resource provides the status of the payment for goods and services rendered, and the request and response resource references.
8767         */
8768        PAYMENTNOTICE, 
8769        /**
8770         * This resource provides the details including amount of a payment and allocates the payment items being paid.
8771         */
8772        PAYMENTRECONCILIATION, 
8773        /**
8774         * Permission resource holds access rules for a given data and context.
8775         */
8776        PERMISSION, 
8777        /**
8778         * Demographics and administrative information about a person independent of a specific health-related context.
8779         */
8780        PERSON, 
8781        /**
8782         * This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical and non-clinical artifacts such as clinical decision support rules, order sets, protocols, and drug quality specifications.
8783         */
8784        PLANDEFINITION, 
8785        /**
8786         * A person who is directly or indirectly involved in the provisioning of healthcare or related services.
8787         */
8788        PRACTITIONER, 
8789        /**
8790         * A specific set of Roles/Locations/specialties/services that a practitioner may perform, or has performed at an organization during a period of time.
8791         */
8792        PRACTITIONERROLE, 
8793        /**
8794         * An action that is or was performed on or for a patient, practitioner, device, organization, or location. For example, this can be a physical intervention on a patient like an operation, or less invasive like long term services, counseling, or hypnotherapy.  This can be a quality or safety inspection for a location, organization, or device.  This can be an accreditation procedure on a practitioner for licensing.
8795         */
8796        PROCEDURE, 
8797        /**
8798         * Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies.
8799         */
8800        PROVENANCE, 
8801        /**
8802         * A structured set of questions intended to guide the collection of answers from end-users. Questionnaires provide detailed control over order, presentation, phraseology and grouping to allow coherent, consistent data collection.
8803         */
8804        QUESTIONNAIRE, 
8805        /**
8806         * A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the questionnaire being responded to.
8807         */
8808        QUESTIONNAIRERESPONSE, 
8809        /**
8810         * Regulatory approval, clearance or licencing related to a regulated product, treatment, facility or activity that is cited in a guidance, regulation, rule or legislative act. An example is Market Authorization relating to a Medicinal Product.
8811         */
8812        REGULATEDAUTHORIZATION, 
8813        /**
8814         * Information about a person that is involved in a patient's health or the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process.
8815         */
8816        RELATEDPERSON, 
8817        /**
8818         * A set of related requests that can be used to capture intended activities that have inter-dependencies such as "give this medication after that one".
8819         */
8820        REQUESTORCHESTRATION, 
8821        /**
8822         * The Requirements resource is used to describe an actor - a human or an application that plays a role in data exchange, and that may have obligations associated with the role the actor plays.
8823         */
8824        REQUIREMENTS, 
8825        /**
8826         * A scientific study of nature that sometimes includes processes involved in health and disease. For example, clinical trials are research studies that involve people. These studies may be related to new ways to screen, prevent, diagnose, and treat disease. They may also study certain outcomes and certain groups of people by looking at data collected in the past or future.
8827         */
8828        RESEARCHSTUDY, 
8829        /**
8830         * A ResearchSubject is a participant or object which is the recipient of investigative activities in a research study.
8831         */
8832        RESEARCHSUBJECT, 
8833        /**
8834         * An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome.
8835         */
8836        RISKASSESSMENT, 
8837        /**
8838         * A container for slots of time that may be available for booking appointments.
8839         */
8840        SCHEDULE, 
8841        /**
8842         * A search parameter that defines a named search item that can be used to search/filter on a resource.
8843         */
8844        SEARCHPARAMETER, 
8845        /**
8846         * A record of a request for service such as diagnostic investigations, treatments, or operations to be performed.
8847         */
8848        SERVICEREQUEST, 
8849        /**
8850         * A slot of time on a schedule that may be available for booking appointments.
8851         */
8852        SLOT, 
8853        /**
8854         * A sample to be used for analysis.
8855         */
8856        SPECIMEN, 
8857        /**
8858         * A kind of specimen with associated set of requirements.
8859         */
8860        SPECIMENDEFINITION, 
8861        /**
8862         * A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions and constraints on resources and data types.
8863         */
8864        STRUCTUREDEFINITION, 
8865        /**
8866         * A Map of relationships between 2 structures that can be used to transform data.
8867         */
8868        STRUCTUREMAP, 
8869        /**
8870         * The subscription resource describes a particular client's request to be notified about a SubscriptionTopic.
8871         */
8872        SUBSCRIPTION, 
8873        /**
8874         * The SubscriptionStatus resource describes the state of a Subscription during notifications. It is not persisted.
8875         */
8876        SUBSCRIPTIONSTATUS, 
8877        /**
8878         * Describes a stream of resource state changes identified by trigger criteria and annotated with labels useful to filter projections from this topic.
8879         */
8880        SUBSCRIPTIONTOPIC, 
8881        /**
8882         * A homogeneous material with a definite composition.
8883         */
8884        SUBSTANCE, 
8885        /**
8886         * The detailed description of a substance, typically at a level beyond what is used for prescribing.
8887         */
8888        SUBSTANCEDEFINITION, 
8889        /**
8890         * Nucleic acids are defined by three distinct elements: the base, sugar and linkage. Individual substance/moiety IDs will be created for each of these elements. The nucleotide sequence will be always entered in the 5?-3? direction.
8891         */
8892        SUBSTANCENUCLEICACID, 
8893        /**
8894         * Properties of a substance specific to it being a polymer.
8895         */
8896        SUBSTANCEPOLYMER, 
8897        /**
8898         * A SubstanceProtein is defined as a single unit of a linear amino acid sequence, or a combination of subunits that are either covalently linked or have a defined invariant stoichiometric relationship. This includes all synthetic, recombinant and purified SubstanceProteins of defined sequence, whether the use is therapeutic or prophylactic. This set of elements will be used to describe albumins, coagulation factors, cytokines, growth factors, peptide/SubstanceProtein hormones, enzymes, toxins, toxoids, recombinant vaccines, and immunomodulators.
8899         */
8900        SUBSTANCEPROTEIN, 
8901        /**
8902         * Todo.
8903         */
8904        SUBSTANCEREFERENCEINFORMATION, 
8905        /**
8906         * Source material shall capture information on the taxonomic and anatomical origins as well as the fraction of a material that can result in or can be modified to form a substance. This set of data elements shall be used to define polymer substances isolated from biological matrices. Taxonomic and anatomical origins shall be described using a controlled vocabulary as required. This information is captured for naturally derived polymers ( . starch) and structurally diverse substances. For Organisms belonging to the Kingdom Plantae the Substance level defines the fresh material of a single species or infraspecies, the Herbal Drug and the Herbal preparation. For Herbal preparations, the fraction information will be captured at the Substance information level and additional information for herbal extracts will be captured at the Specified Substance Group 1 information level. See for further explanation the Substance Class: Structurally Diverse and the herbal annex.
8907         */
8908        SUBSTANCESOURCEMATERIAL, 
8909        /**
8910         * Record of delivery of what is supplied.
8911         */
8912        SUPPLYDELIVERY, 
8913        /**
8914         * A record of a non-patient specific request for a medication, substance, device, certain types of biologically derived product, and nutrition product used in the healthcare setting.
8915         */
8916        SUPPLYREQUEST, 
8917        /**
8918         * A task to be performed.
8919         */
8920        TASK, 
8921        /**
8922         * A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.
8923         */
8924        TERMINOLOGYCAPABILITIES, 
8925        /**
8926         * A plan for executing testing on an artifact or specifications
8927         */
8928        TESTPLAN, 
8929        /**
8930         * A summary of information based on the results of executing a TestScript.
8931         */
8932        TESTREPORT, 
8933        /**
8934         * A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.
8935         */
8936        TESTSCRIPT, 
8937        /**
8938         * Record of transport.
8939         */
8940        TRANSPORT, 
8941        /**
8942         * A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html).
8943         */
8944        VALUESET, 
8945        /**
8946         * Describes validation requirements, source(s), status and dates for one or more elements.
8947         */
8948        VERIFICATIONRESULT, 
8949        /**
8950         * An authorization for the provision of glasses and/or contact lenses to a patient.
8951         */
8952        VISIONPRESCRIPTION, 
8953        /**
8954         * This resource is used to pass information into and back from an operation (whether invoked directly from REST or within a messaging environment).  It is not persisted or allowed to be referenced by other resources except as described in the definition of the Parameters resource.
8955         */
8956        PARAMETERS, 
8957        /**
8958         * added to help the parsers
8959         */
8960        NULL;
8961        public static FHIRTypes fromCode(String codeString) throws FHIRException {
8962            if (codeString == null || "".equals(codeString))
8963                return null;
8964        if ("Base".equals(codeString))
8965          return BASE;
8966        if ("Element".equals(codeString))
8967          return ELEMENT;
8968        if ("BackboneElement".equals(codeString))
8969          return BACKBONEELEMENT;
8970        if ("DataType".equals(codeString))
8971          return DATATYPE;
8972        if ("Address".equals(codeString))
8973          return ADDRESS;
8974        if ("Annotation".equals(codeString))
8975          return ANNOTATION;
8976        if ("Attachment".equals(codeString))
8977          return ATTACHMENT;
8978        if ("Availability".equals(codeString))
8979          return AVAILABILITY;
8980        if ("BackboneType".equals(codeString))
8981          return BACKBONETYPE;
8982        if ("Dosage".equals(codeString))
8983          return DOSAGE;
8984        if ("ElementDefinition".equals(codeString))
8985          return ELEMENTDEFINITION;
8986        if ("MarketingStatus".equals(codeString))
8987          return MARKETINGSTATUS;
8988        if ("ProductShelfLife".equals(codeString))
8989          return PRODUCTSHELFLIFE;
8990        if ("Timing".equals(codeString))
8991          return TIMING;
8992        if ("CodeableConcept".equals(codeString))
8993          return CODEABLECONCEPT;
8994        if ("CodeableReference".equals(codeString))
8995          return CODEABLEREFERENCE;
8996        if ("Coding".equals(codeString))
8997          return CODING;
8998        if ("ContactDetail".equals(codeString))
8999          return CONTACTDETAIL;
9000        if ("ContactPoint".equals(codeString))
9001          return CONTACTPOINT;
9002        if ("Contributor".equals(codeString))
9003          return CONTRIBUTOR;
9004        if ("DataRequirement".equals(codeString))
9005          return DATAREQUIREMENT;
9006        if ("Expression".equals(codeString))
9007          return EXPRESSION;
9008        if ("ExtendedContactDetail".equals(codeString))
9009          return EXTENDEDCONTACTDETAIL;
9010        if ("Extension".equals(codeString))
9011          return EXTENSION;
9012        if ("HumanName".equals(codeString))
9013          return HUMANNAME;
9014        if ("Identifier".equals(codeString))
9015          return IDENTIFIER;
9016        if ("Meta".equals(codeString))
9017          return META;
9018        if ("MonetaryComponent".equals(codeString))
9019          return MONETARYCOMPONENT;
9020        if ("Money".equals(codeString))
9021          return MONEY;
9022        if ("Narrative".equals(codeString))
9023          return NARRATIVE;
9024        if ("ParameterDefinition".equals(codeString))
9025          return PARAMETERDEFINITION;
9026        if ("Period".equals(codeString))
9027          return PERIOD;
9028        if ("PrimitiveType".equals(codeString))
9029          return PRIMITIVETYPE;
9030        if ("base64Binary".equals(codeString))
9031          return BASE64BINARY;
9032        if ("boolean".equals(codeString))
9033          return BOOLEAN;
9034        if ("date".equals(codeString))
9035          return DATE;
9036        if ("dateTime".equals(codeString))
9037          return DATETIME;
9038        if ("decimal".equals(codeString))
9039          return DECIMAL;
9040        if ("instant".equals(codeString))
9041          return INSTANT;
9042        if ("integer".equals(codeString))
9043          return INTEGER;
9044        if ("positiveInt".equals(codeString))
9045          return POSITIVEINT;
9046        if ("unsignedInt".equals(codeString))
9047          return UNSIGNEDINT;
9048        if ("integer64".equals(codeString))
9049          return INTEGER64;
9050        if ("string".equals(codeString))
9051          return STRING;
9052        if ("code".equals(codeString))
9053          return CODE;
9054        if ("id".equals(codeString))
9055          return ID;
9056        if ("markdown".equals(codeString))
9057          return MARKDOWN;
9058        if ("time".equals(codeString))
9059          return TIME;
9060        if ("uri".equals(codeString))
9061          return URI;
9062        if ("canonical".equals(codeString))
9063          return CANONICAL;
9064        if ("oid".equals(codeString))
9065          return OID;
9066        if ("url".equals(codeString))
9067          return URL;
9068        if ("uuid".equals(codeString))
9069          return UUID;
9070        if ("Quantity".equals(codeString))
9071          return QUANTITY;
9072        if ("Age".equals(codeString))
9073          return AGE;
9074        if ("Count".equals(codeString))
9075          return COUNT;
9076        if ("Distance".equals(codeString))
9077          return DISTANCE;
9078        if ("Duration".equals(codeString))
9079          return DURATION;
9080        if ("Range".equals(codeString))
9081          return RANGE;
9082        if ("Ratio".equals(codeString))
9083          return RATIO;
9084        if ("RatioRange".equals(codeString))
9085          return RATIORANGE;
9086        if ("Reference".equals(codeString))
9087          return REFERENCE;
9088        if ("RelatedArtifact".equals(codeString))
9089          return RELATEDARTIFACT;
9090        if ("SampledData".equals(codeString))
9091          return SAMPLEDDATA;
9092        if ("Signature".equals(codeString))
9093          return SIGNATURE;
9094        if ("TriggerDefinition".equals(codeString))
9095          return TRIGGERDEFINITION;
9096        if ("UsageContext".equals(codeString))
9097          return USAGECONTEXT;
9098        if ("VirtualServiceDetail".equals(codeString))
9099          return VIRTUALSERVICEDETAIL;
9100        if ("xhtml".equals(codeString))
9101          return XHTML;
9102        if ("Resource".equals(codeString) || "Any".equals(codeString))
9103          return RESOURCE;
9104        if ("Binary".equals(codeString))
9105          return BINARY;
9106        if ("Bundle".equals(codeString))
9107          return BUNDLE;
9108        if ("DomainResource".equals(codeString))
9109          return DOMAINRESOURCE;
9110        if ("Account".equals(codeString))
9111          return ACCOUNT;
9112        if ("ActivityDefinition".equals(codeString))
9113          return ACTIVITYDEFINITION;
9114        if ("ActorDefinition".equals(codeString))
9115          return ACTORDEFINITION;
9116        if ("AdministrableProductDefinition".equals(codeString))
9117          return ADMINISTRABLEPRODUCTDEFINITION;
9118        if ("AdverseEvent".equals(codeString))
9119          return ADVERSEEVENT;
9120        if ("AllergyIntolerance".equals(codeString))
9121          return ALLERGYINTOLERANCE;
9122        if ("Appointment".equals(codeString))
9123          return APPOINTMENT;
9124        if ("AppointmentResponse".equals(codeString))
9125          return APPOINTMENTRESPONSE;
9126        if ("ArtifactAssessment".equals(codeString))
9127          return ARTIFACTASSESSMENT;
9128        if ("AuditEvent".equals(codeString))
9129          return AUDITEVENT;
9130        if ("Basic".equals(codeString))
9131          return BASIC;
9132        if ("BiologicallyDerivedProduct".equals(codeString))
9133          return BIOLOGICALLYDERIVEDPRODUCT;
9134        if ("BiologicallyDerivedProductDispense".equals(codeString))
9135          return BIOLOGICALLYDERIVEDPRODUCTDISPENSE;
9136        if ("BodyStructure".equals(codeString))
9137          return BODYSTRUCTURE;
9138        if ("CanonicalResource".equals(codeString))
9139          return CANONICALRESOURCE;
9140        if ("CapabilityStatement".equals(codeString))
9141          return CAPABILITYSTATEMENT;
9142        if ("CarePlan".equals(codeString))
9143          return CAREPLAN;
9144        if ("CareTeam".equals(codeString))
9145          return CARETEAM;
9146        if ("ChargeItem".equals(codeString))
9147          return CHARGEITEM;
9148        if ("ChargeItemDefinition".equals(codeString))
9149          return CHARGEITEMDEFINITION;
9150        if ("Citation".equals(codeString))
9151          return CITATION;
9152        if ("Claim".equals(codeString))
9153          return CLAIM;
9154        if ("ClaimResponse".equals(codeString))
9155          return CLAIMRESPONSE;
9156        if ("ClinicalImpression".equals(codeString))
9157          return CLINICALIMPRESSION;
9158        if ("ClinicalUseDefinition".equals(codeString))
9159          return CLINICALUSEDEFINITION;
9160        if ("CodeSystem".equals(codeString))
9161          return CODESYSTEM;
9162        if ("Communication".equals(codeString))
9163          return COMMUNICATION;
9164        if ("CommunicationRequest".equals(codeString))
9165          return COMMUNICATIONREQUEST;
9166        if ("CompartmentDefinition".equals(codeString))
9167          return COMPARTMENTDEFINITION;
9168        if ("Composition".equals(codeString))
9169          return COMPOSITION;
9170        if ("ConceptMap".equals(codeString))
9171          return CONCEPTMAP;
9172        if ("Condition".equals(codeString))
9173          return CONDITION;
9174        if ("ConditionDefinition".equals(codeString))
9175          return CONDITIONDEFINITION;
9176        if ("Consent".equals(codeString))
9177          return CONSENT;
9178        if ("Contract".equals(codeString))
9179          return CONTRACT;
9180        if ("Coverage".equals(codeString))
9181          return COVERAGE;
9182        if ("CoverageEligibilityRequest".equals(codeString))
9183          return COVERAGEELIGIBILITYREQUEST;
9184        if ("CoverageEligibilityResponse".equals(codeString))
9185          return COVERAGEELIGIBILITYRESPONSE;
9186        if ("DetectedIssue".equals(codeString))
9187          return DETECTEDISSUE;
9188        if ("Device".equals(codeString))
9189          return DEVICE;
9190        if ("DeviceAssociation".equals(codeString))
9191          return DEVICEASSOCIATION;
9192        if ("DeviceDefinition".equals(codeString))
9193          return DEVICEDEFINITION;
9194        if ("DeviceDispense".equals(codeString))
9195          return DEVICEDISPENSE;
9196        if ("DeviceMetric".equals(codeString))
9197          return DEVICEMETRIC;
9198        if ("DeviceRequest".equals(codeString))
9199          return DEVICEREQUEST;
9200        if ("DeviceUsage".equals(codeString))
9201          return DEVICEUSAGE;
9202        if ("DiagnosticReport".equals(codeString))
9203          return DIAGNOSTICREPORT;
9204        if ("DocumentReference".equals(codeString))
9205          return DOCUMENTREFERENCE;
9206        if ("Encounter".equals(codeString))
9207          return ENCOUNTER;
9208        if ("EncounterHistory".equals(codeString))
9209          return ENCOUNTERHISTORY;
9210        if ("Endpoint".equals(codeString))
9211          return ENDPOINT;
9212        if ("EnrollmentRequest".equals(codeString))
9213          return ENROLLMENTREQUEST;
9214        if ("EnrollmentResponse".equals(codeString))
9215          return ENROLLMENTRESPONSE;
9216        if ("EpisodeOfCare".equals(codeString))
9217          return EPISODEOFCARE;
9218        if ("EventDefinition".equals(codeString))
9219          return EVENTDEFINITION;
9220        if ("Evidence".equals(codeString))
9221          return EVIDENCE;
9222        if ("EvidenceReport".equals(codeString))
9223          return EVIDENCEREPORT;
9224        if ("EvidenceVariable".equals(codeString))
9225          return EVIDENCEVARIABLE;
9226        if ("ExampleScenario".equals(codeString))
9227          return EXAMPLESCENARIO;
9228        if ("ExplanationOfBenefit".equals(codeString))
9229          return EXPLANATIONOFBENEFIT;
9230        if ("FamilyMemberHistory".equals(codeString))
9231          return FAMILYMEMBERHISTORY;
9232        if ("Flag".equals(codeString))
9233          return FLAG;
9234        if ("FormularyItem".equals(codeString))
9235          return FORMULARYITEM;
9236        if ("GenomicStudy".equals(codeString))
9237          return GENOMICSTUDY;
9238        if ("Goal".equals(codeString))
9239          return GOAL;
9240        if ("GraphDefinition".equals(codeString))
9241          return GRAPHDEFINITION;
9242        if ("Group".equals(codeString))
9243          return GROUP;
9244        if ("GuidanceResponse".equals(codeString))
9245          return GUIDANCERESPONSE;
9246        if ("HealthcareService".equals(codeString))
9247          return HEALTHCARESERVICE;
9248        if ("ImagingSelection".equals(codeString))
9249          return IMAGINGSELECTION;
9250        if ("ImagingStudy".equals(codeString))
9251          return IMAGINGSTUDY;
9252        if ("Immunization".equals(codeString))
9253          return IMMUNIZATION;
9254        if ("ImmunizationEvaluation".equals(codeString))
9255          return IMMUNIZATIONEVALUATION;
9256        if ("ImmunizationRecommendation".equals(codeString))
9257          return IMMUNIZATIONRECOMMENDATION;
9258        if ("ImplementationGuide".equals(codeString))
9259          return IMPLEMENTATIONGUIDE;
9260        if ("Ingredient".equals(codeString))
9261          return INGREDIENT;
9262        if ("InsurancePlan".equals(codeString))
9263          return INSURANCEPLAN;
9264        if ("InventoryItem".equals(codeString))
9265          return INVENTORYITEM;
9266        if ("InventoryReport".equals(codeString))
9267          return INVENTORYREPORT;
9268        if ("Invoice".equals(codeString))
9269          return INVOICE;
9270        if ("Library".equals(codeString))
9271          return LIBRARY;
9272        if ("Linkage".equals(codeString))
9273          return LINKAGE;
9274        if ("List".equals(codeString))
9275          return LIST;
9276        if ("Location".equals(codeString))
9277          return LOCATION;
9278        if ("ManufacturedItemDefinition".equals(codeString))
9279          return MANUFACTUREDITEMDEFINITION;
9280        if ("Measure".equals(codeString))
9281          return MEASURE;
9282        if ("MeasureReport".equals(codeString))
9283          return MEASUREREPORT;
9284        if ("Medication".equals(codeString))
9285          return MEDICATION;
9286        if ("MedicationAdministration".equals(codeString))
9287          return MEDICATIONADMINISTRATION;
9288        if ("MedicationDispense".equals(codeString))
9289          return MEDICATIONDISPENSE;
9290        if ("MedicationKnowledge".equals(codeString))
9291          return MEDICATIONKNOWLEDGE;
9292        if ("MedicationRequest".equals(codeString))
9293          return MEDICATIONREQUEST;
9294        if ("MedicationStatement".equals(codeString))
9295          return MEDICATIONSTATEMENT;
9296        if ("MedicinalProductDefinition".equals(codeString))
9297          return MEDICINALPRODUCTDEFINITION;
9298        if ("MessageDefinition".equals(codeString))
9299          return MESSAGEDEFINITION;
9300        if ("MessageHeader".equals(codeString))
9301          return MESSAGEHEADER;
9302        if ("MetadataResource".equals(codeString))
9303          return METADATARESOURCE;
9304        if ("MolecularSequence".equals(codeString))
9305          return MOLECULARSEQUENCE;
9306        if ("NamingSystem".equals(codeString))
9307          return NAMINGSYSTEM;
9308        if ("NutritionIntake".equals(codeString))
9309          return NUTRITIONINTAKE;
9310        if ("NutritionOrder".equals(codeString))
9311          return NUTRITIONORDER;
9312        if ("NutritionProduct".equals(codeString))
9313          return NUTRITIONPRODUCT;
9314        if ("Observation".equals(codeString))
9315          return OBSERVATION;
9316        if ("ObservationDefinition".equals(codeString))
9317          return OBSERVATIONDEFINITION;
9318        if ("OperationDefinition".equals(codeString))
9319          return OPERATIONDEFINITION;
9320        if ("OperationOutcome".equals(codeString))
9321          return OPERATIONOUTCOME;
9322        if ("Organization".equals(codeString))
9323          return ORGANIZATION;
9324        if ("OrganizationAffiliation".equals(codeString))
9325          return ORGANIZATIONAFFILIATION;
9326        if ("PackagedProductDefinition".equals(codeString))
9327          return PACKAGEDPRODUCTDEFINITION;
9328        if ("Patient".equals(codeString))
9329          return PATIENT;
9330        if ("PaymentNotice".equals(codeString))
9331          return PAYMENTNOTICE;
9332        if ("PaymentReconciliation".equals(codeString))
9333          return PAYMENTRECONCILIATION;
9334        if ("Permission".equals(codeString))
9335          return PERMISSION;
9336        if ("Person".equals(codeString))
9337          return PERSON;
9338        if ("PlanDefinition".equals(codeString))
9339          return PLANDEFINITION;
9340        if ("Practitioner".equals(codeString))
9341          return PRACTITIONER;
9342        if ("PractitionerRole".equals(codeString))
9343          return PRACTITIONERROLE;
9344        if ("Procedure".equals(codeString))
9345          return PROCEDURE;
9346        if ("Provenance".equals(codeString))
9347          return PROVENANCE;
9348        if ("Questionnaire".equals(codeString))
9349          return QUESTIONNAIRE;
9350        if ("QuestionnaireResponse".equals(codeString))
9351          return QUESTIONNAIRERESPONSE;
9352        if ("RegulatedAuthorization".equals(codeString))
9353          return REGULATEDAUTHORIZATION;
9354        if ("RelatedPerson".equals(codeString))
9355          return RELATEDPERSON;
9356        if ("RequestOrchestration".equals(codeString))
9357          return REQUESTORCHESTRATION;
9358        if ("Requirements".equals(codeString))
9359          return REQUIREMENTS;
9360        if ("ResearchStudy".equals(codeString))
9361          return RESEARCHSTUDY;
9362        if ("ResearchSubject".equals(codeString))
9363          return RESEARCHSUBJECT;
9364        if ("RiskAssessment".equals(codeString))
9365          return RISKASSESSMENT;
9366        if ("Schedule".equals(codeString))
9367          return SCHEDULE;
9368        if ("SearchParameter".equals(codeString))
9369          return SEARCHPARAMETER;
9370        if ("ServiceRequest".equals(codeString))
9371          return SERVICEREQUEST;
9372        if ("Slot".equals(codeString))
9373          return SLOT;
9374        if ("Specimen".equals(codeString))
9375          return SPECIMEN;
9376        if ("SpecimenDefinition".equals(codeString))
9377          return SPECIMENDEFINITION;
9378        if ("StructureDefinition".equals(codeString))
9379          return STRUCTUREDEFINITION;
9380        if ("StructureMap".equals(codeString))
9381          return STRUCTUREMAP;
9382        if ("Subscription".equals(codeString))
9383          return SUBSCRIPTION;
9384        if ("SubscriptionStatus".equals(codeString))
9385          return SUBSCRIPTIONSTATUS;
9386        if ("SubscriptionTopic".equals(codeString))
9387          return SUBSCRIPTIONTOPIC;
9388        if ("Substance".equals(codeString))
9389          return SUBSTANCE;
9390        if ("SubstanceDefinition".equals(codeString))
9391          return SUBSTANCEDEFINITION;
9392        if ("SubstanceNucleicAcid".equals(codeString))
9393          return SUBSTANCENUCLEICACID;
9394        if ("SubstancePolymer".equals(codeString))
9395          return SUBSTANCEPOLYMER;
9396        if ("SubstanceProtein".equals(codeString))
9397          return SUBSTANCEPROTEIN;
9398        if ("SubstanceReferenceInformation".equals(codeString))
9399          return SUBSTANCEREFERENCEINFORMATION;
9400        if ("SubstanceSourceMaterial".equals(codeString))
9401          return SUBSTANCESOURCEMATERIAL;
9402        if ("SupplyDelivery".equals(codeString))
9403          return SUPPLYDELIVERY;
9404        if ("SupplyRequest".equals(codeString))
9405          return SUPPLYREQUEST;
9406        if ("Task".equals(codeString))
9407          return TASK;
9408        if ("TerminologyCapabilities".equals(codeString))
9409          return TERMINOLOGYCAPABILITIES;
9410        if ("TestPlan".equals(codeString))
9411          return TESTPLAN;
9412        if ("TestReport".equals(codeString))
9413          return TESTREPORT;
9414        if ("TestScript".equals(codeString))
9415          return TESTSCRIPT;
9416        if ("Transport".equals(codeString))
9417          return TRANSPORT;
9418        if ("ValueSet".equals(codeString))
9419          return VALUESET;
9420        if ("VerificationResult".equals(codeString))
9421          return VERIFICATIONRESULT;
9422        if ("VisionPrescription".equals(codeString))
9423          return VISIONPRESCRIPTION;
9424        if ("Parameters".equals(codeString))
9425          return PARAMETERS;
9426        throw new FHIRException("Unknown FHIRTypes code '"+codeString+"'");
9427        }
9428        public static boolean isValidCode(String codeString) {
9429            if (codeString == null || "".equals(codeString))
9430                return false;
9431          return Utilities.existsInList(codeString, "Base", "Element", "BackboneElement", "DataType", "Address", "Annotation", "Attachment", "Availability", "BackboneType", "Dosage", "ElementDefinition", "MarketingStatus", "ProductShelfLife", "Timing", "CodeableConcept", "CodeableReference", "Coding", "ContactDetail", "ContactPoint", "Contributor", "DataRequirement", "Expression", "ExtendedContactDetail", "Extension", "HumanName", "Identifier", "Meta", "MonetaryComponent", "Money", "Narrative", "ParameterDefinition", "Period", "PrimitiveType", "base64Binary", "boolean", "date", "dateTime", "decimal", "instant", "integer", "positiveInt", "unsignedInt", "integer64", "string", "code", "id", "markdown", "time", "uri", "canonical", "oid", "url", "uuid", "Quantity", "Age", "Count", "Distance", "Duration", "Range", "Ratio", "RatioRange", "Reference", "RelatedArtifact", "SampledData", "Signature", "TriggerDefinition", "UsageContext", "VirtualServiceDetail", "xhtml", "Resource", "Binary", "Bundle", "DomainResource", "Account", "ActivityDefinition", "ActorDefinition", "AdministrableProductDefinition", "AdverseEvent", "AllergyIntolerance", "Appointment", "AppointmentResponse", "ArtifactAssessment", "AuditEvent", "Basic", "BiologicallyDerivedProduct", "BiologicallyDerivedProductDispense", "BodyStructure", "CanonicalResource", "CapabilityStatement", "CarePlan", "CareTeam", "ChargeItem", "ChargeItemDefinition", "Citation", "Claim", "ClaimResponse", "ClinicalImpression", "ClinicalUseDefinition", "CodeSystem", "Communication", "CommunicationRequest", "CompartmentDefinition", "Composition", "ConceptMap", "Condition", "ConditionDefinition", "Consent", "Contract", "Coverage", "CoverageEligibilityRequest", "CoverageEligibilityResponse", "DetectedIssue", "Device", "DeviceAssociation", "DeviceDefinition", "DeviceDispense", "DeviceMetric", "DeviceRequest", "DeviceUsage", "DiagnosticReport", "DocumentReference", "Encounter", "EncounterHistory", "Endpoint", "EnrollmentRequest", "EnrollmentResponse", "EpisodeOfCare", "EventDefinition", "Evidence", "EvidenceReport", "EvidenceVariable", "ExampleScenario", "ExplanationOfBenefit", "FamilyMemberHistory", "Flag", "FormularyItem", "GenomicStudy", "Goal", "GraphDefinition", "Group", "GuidanceResponse", "HealthcareService", "ImagingSelection", "ImagingStudy", "Immunization", "ImmunizationEvaluation", "ImmunizationRecommendation", "ImplementationGuide", "Ingredient", "InsurancePlan", "InventoryItem", "InventoryReport", "Invoice", "Library", "Linkage", "List", "Location", "ManufacturedItemDefinition", "Measure", "MeasureReport", "Medication", "MedicationAdministration", "MedicationDispense", "MedicationKnowledge", "MedicationRequest", "MedicationStatement", "MedicinalProductDefinition", "MessageDefinition", "MessageHeader", "MetadataResource", "MolecularSequence", "NamingSystem", "NutritionIntake", "NutritionOrder", "NutritionProduct", "Observation", "ObservationDefinition", "OperationDefinition", "OperationOutcome", "Organization", "OrganizationAffiliation", "PackagedProductDefinition", "Patient", "PaymentNotice", "PaymentReconciliation", "Permission", "Person", "PlanDefinition", "Practitioner", "PractitionerRole", "Procedure", "Provenance", "Questionnaire", "QuestionnaireResponse", "RegulatedAuthorization", "RelatedPerson", "RequestOrchestration", "Requirements", "ResearchStudy", "ResearchSubject", "RiskAssessment", "Schedule", "SearchParameter", "ServiceRequest", "Slot", "Specimen", "SpecimenDefinition", "StructureDefinition", "StructureMap", "Subscription", "SubscriptionStatus", "SubscriptionTopic", "Substance", "SubstanceDefinition", "SubstanceNucleicAcid", "SubstancePolymer", "SubstanceProtein", "SubstanceReferenceInformation", "SubstanceSourceMaterial", "SupplyDelivery", "SupplyRequest", "Task", "TerminologyCapabilities", "TestPlan", "TestReport", "TestScript", "Transport", "ValueSet", "VerificationResult", "VisionPrescription", "Parameters");
9432        }
9433        public String toCode() {
9434          switch (this) {
9435            case BASE: return "Base";
9436            case ELEMENT: return "Element";
9437            case BACKBONEELEMENT: return "BackboneElement";
9438            case DATATYPE: return "DataType";
9439            case ADDRESS: return "Address";
9440            case ANNOTATION: return "Annotation";
9441            case ATTACHMENT: return "Attachment";
9442            case AVAILABILITY: return "Availability";
9443            case BACKBONETYPE: return "BackboneType";
9444            case DOSAGE: return "Dosage";
9445            case ELEMENTDEFINITION: return "ElementDefinition";
9446            case MARKETINGSTATUS: return "MarketingStatus";
9447            case PRODUCTSHELFLIFE: return "ProductShelfLife";
9448            case TIMING: return "Timing";
9449            case CODEABLECONCEPT: return "CodeableConcept";
9450            case CODEABLEREFERENCE: return "CodeableReference";
9451            case CODING: return "Coding";
9452            case CONTACTDETAIL: return "ContactDetail";
9453            case CONTACTPOINT: return "ContactPoint";
9454            case CONTRIBUTOR: return "Contributor";
9455            case DATAREQUIREMENT: return "DataRequirement";
9456            case EXPRESSION: return "Expression";
9457            case EXTENDEDCONTACTDETAIL: return "ExtendedContactDetail";