001package org.hl7.fhir.dstu2.model;
002
003/*
004  Copyright (c) 2011+, HL7, Inc.
005  All rights reserved.
006  
007  Redistribution and use in source and binary forms, with or without modification, 
008  are permitted provided that the following conditions are met:
009    
010   * Redistributions of source code must retain the above copyright notice, this 
011     list of conditions and the following disclaimer.
012   * Redistributions in binary form must reproduce the above copyright notice, 
013     this list of conditions and the following disclaimer in the documentation 
014     and/or other materials provided with the distribution.
015   * Neither the name of HL7 nor the names of its contributors may be used to 
016     endorse or promote products derived from this software without specific 
017     prior written permission.
018  
019  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
020  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
021  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
022  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
023  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
024  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
025  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
026  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
027  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
028  POSSIBILITY OF SUCH DAMAGE.
029  
030 */
031
032
033
034import org.hl7.fhir.exceptions.FHIRException;
035
036public class Enumerations {
037
038// In here: 
039//   AdministrativeGender: The gender of a person used for administrative purposes.
040//   AgeUnits: A valueSet of UCUM codes for representing age value units.
041//   BindingStrength: Indication of the degree of conformance expectations associated with a binding.
042//   ConceptMapEquivalence: The degree of equivalence between concepts.
043//   ConformanceResourceStatus: The lifecycle status of a Value Set or Concept Map.
044//   DataAbsentReason: Used to specify why the normally expected content of the data element is missing.
045//   DataType: The type of an element - one of the FHIR data types.
046//   DocumentReferenceStatus: The status of the document reference.
047//   FHIRDefinedType: Either a resource or a data type.
048//   MessageEvent: One of the message events defined as part of FHIR.
049//   NoteType: The presentation types of notes.
050//   RemittanceOutcome: The outcome of the processing.
051//   ResourceType: One of the resource types defined as part of FHIR.
052//   SearchParamType: Data types allowed to be used for search parameters.
053//   SpecialValues: A set of generally useful codes defined so they can be included in value sets.
054
055
056    public enum AdministrativeGender {
057        /**
058         * Male
059         */
060        MALE, 
061        /**
062         * Female
063         */
064        FEMALE, 
065        /**
066         * Other
067         */
068        OTHER, 
069        /**
070         * Unknown
071         */
072        UNKNOWN, 
073        /**
074         * added to help the parsers
075         */
076        NULL;
077        public static AdministrativeGender fromCode(String codeString) throws FHIRException {
078            if (codeString == null || "".equals(codeString))
079                return null;
080        if ("male".equals(codeString))
081          return MALE;
082        if ("female".equals(codeString))
083          return FEMALE;
084        if ("other".equals(codeString))
085          return OTHER;
086        if ("unknown".equals(codeString))
087          return UNKNOWN;
088        throw new FHIRException("Unknown AdministrativeGender code '"+codeString+"'");
089        }
090        public String toCode() {
091          switch (this) {
092            case MALE: return "male";
093            case FEMALE: return "female";
094            case OTHER: return "other";
095            case UNKNOWN: return "unknown";
096            case NULL: return null;
097            default: return "?";
098          }
099        }
100        public String getSystem() {
101          switch (this) {
102            case MALE: return "http://hl7.org/fhir/administrative-gender";
103            case FEMALE: return "http://hl7.org/fhir/administrative-gender";
104            case OTHER: return "http://hl7.org/fhir/administrative-gender";
105            case UNKNOWN: return "http://hl7.org/fhir/administrative-gender";
106            case NULL: return null;
107            default: return "?";
108          }
109        }
110        public String getDefinition() {
111          switch (this) {
112            case MALE: return "Male";
113            case FEMALE: return "Female";
114            case OTHER: return "Other";
115            case UNKNOWN: return "Unknown";
116            case NULL: return null;
117            default: return "?";
118          }
119        }
120        public String getDisplay() {
121          switch (this) {
122            case MALE: return "Male";
123            case FEMALE: return "Female";
124            case OTHER: return "Other";
125            case UNKNOWN: return "Unknown";
126            case NULL: return null;
127            default: return "?";
128          }
129        }
130    }
131
132  public static class AdministrativeGenderEnumFactory implements EnumFactory<AdministrativeGender> {
133    public AdministrativeGender fromCode(String codeString) throws IllegalArgumentException {
134      if (codeString == null || "".equals(codeString))
135            if (codeString == null || "".equals(codeString))
136                return null;
137        if ("male".equals(codeString))
138          return AdministrativeGender.MALE;
139        if ("female".equals(codeString))
140          return AdministrativeGender.FEMALE;
141        if ("other".equals(codeString))
142          return AdministrativeGender.OTHER;
143        if ("unknown".equals(codeString))
144          return AdministrativeGender.UNKNOWN;
145        throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'");
146        }
147        public Enumeration<AdministrativeGender> fromType(Base code) throws FHIRException {
148          if (code == null || code.isEmpty())
149            return null;
150          String codeString = ((PrimitiveType) code).asStringValue();
151          if (codeString == null || "".equals(codeString))
152            return null;
153        if ("male".equals(codeString))
154          return new Enumeration<AdministrativeGender>(this, AdministrativeGender.MALE);
155        if ("female".equals(codeString))
156          return new Enumeration<AdministrativeGender>(this, AdministrativeGender.FEMALE);
157        if ("other".equals(codeString))
158          return new Enumeration<AdministrativeGender>(this, AdministrativeGender.OTHER);
159        if ("unknown".equals(codeString))
160          return new Enumeration<AdministrativeGender>(this, AdministrativeGender.UNKNOWN);
161        throw new FHIRException("Unknown AdministrativeGender code '"+codeString+"'");
162        }
163    public String toCode(AdministrativeGender code) {
164      if (code == AdministrativeGender.MALE)
165        return "male";
166      if (code == AdministrativeGender.FEMALE)
167        return "female";
168      if (code == AdministrativeGender.OTHER)
169        return "other";
170      if (code == AdministrativeGender.UNKNOWN)
171        return "unknown";
172      return "?";
173      }
174    }
175
176    public enum AgeUnits {
177        /**
178         * null
179         */
180        MIN, 
181        /**
182         * null
183         */
184        H, 
185        /**
186         * null
187         */
188        D, 
189        /**
190         * null
191         */
192        WK, 
193        /**
194         * null
195         */
196        MO, 
197        /**
198         * null
199         */
200        A, 
201        /**
202         * added to help the parsers
203         */
204        NULL;
205        public static AgeUnits fromCode(String codeString) throws FHIRException {
206            if (codeString == null || "".equals(codeString))
207                return null;
208        if ("min".equals(codeString))
209          return MIN;
210        if ("h".equals(codeString))
211          return H;
212        if ("d".equals(codeString))
213          return D;
214        if ("wk".equals(codeString))
215          return WK;
216        if ("mo".equals(codeString))
217          return MO;
218        if ("a".equals(codeString))
219          return A;
220        throw new FHIRException("Unknown AgeUnits code '"+codeString+"'");
221        }
222        public String toCode() {
223          switch (this) {
224            case MIN: return "min";
225            case H: return "h";
226            case D: return "d";
227            case WK: return "wk";
228            case MO: return "mo";
229            case A: return "a";
230            case NULL: return null;
231            default: return "?";
232          }
233        }
234        public String getSystem() {
235          switch (this) {
236            case MIN: return "http://unitsofmeasure.org";
237            case H: return "http://unitsofmeasure.org";
238            case D: return "http://unitsofmeasure.org";
239            case WK: return "http://unitsofmeasure.org";
240            case MO: return "http://unitsofmeasure.org";
241            case A: return "http://unitsofmeasure.org";
242            case NULL: return null;
243            default: return "?";
244          }
245        }
246        public String getDefinition() {
247          switch (this) {
248            case MIN: return "";
249            case H: return "";
250            case D: return "";
251            case WK: return "";
252            case MO: return "";
253            case A: return "";
254            case NULL: return null;
255            default: return "?";
256          }
257        }
258        public String getDisplay() {
259          switch (this) {
260            case MIN: return "Minute";
261            case H: return "Hour";
262            case D: return "Day";
263            case WK: return "Week";
264            case MO: return "Month";
265            case A: return "Year";
266            case NULL: return null;
267            default: return "?";
268          }
269        }
270    }
271
272  public static class AgeUnitsEnumFactory implements EnumFactory<AgeUnits> {
273    public AgeUnits fromCode(String codeString) throws IllegalArgumentException {
274      if (codeString == null || "".equals(codeString))
275            if (codeString == null || "".equals(codeString))
276                return null;
277        if ("min".equals(codeString))
278          return AgeUnits.MIN;
279        if ("h".equals(codeString))
280          return AgeUnits.H;
281        if ("d".equals(codeString))
282          return AgeUnits.D;
283        if ("wk".equals(codeString))
284          return AgeUnits.WK;
285        if ("mo".equals(codeString))
286          return AgeUnits.MO;
287        if ("a".equals(codeString))
288          return AgeUnits.A;
289        throw new IllegalArgumentException("Unknown AgeUnits code '"+codeString+"'");
290        }
291        public Enumeration<AgeUnits> fromType(Base code) throws FHIRException {
292          if (code == null || code.isEmpty())
293            return null;
294          String codeString = ((PrimitiveType) code).asStringValue();
295          if (codeString == null || "".equals(codeString))
296            return null;
297        if ("min".equals(codeString))
298          return new Enumeration<AgeUnits>(this, AgeUnits.MIN);
299        if ("h".equals(codeString))
300          return new Enumeration<AgeUnits>(this, AgeUnits.H);
301        if ("d".equals(codeString))
302          return new Enumeration<AgeUnits>(this, AgeUnits.D);
303        if ("wk".equals(codeString))
304          return new Enumeration<AgeUnits>(this, AgeUnits.WK);
305        if ("mo".equals(codeString))
306          return new Enumeration<AgeUnits>(this, AgeUnits.MO);
307        if ("a".equals(codeString))
308          return new Enumeration<AgeUnits>(this, AgeUnits.A);
309        throw new FHIRException("Unknown AgeUnits code '"+codeString+"'");
310        }
311    public String toCode(AgeUnits code) {
312      if (code == AgeUnits.MIN)
313        return "min";
314      if (code == AgeUnits.H)
315        return "h";
316      if (code == AgeUnits.D)
317        return "d";
318      if (code == AgeUnits.WK)
319        return "wk";
320      if (code == AgeUnits.MO)
321        return "mo";
322      if (code == AgeUnits.A)
323        return "a";
324      return "?";
325      }
326    }
327
328    public enum BindingStrength {
329        /**
330         * To be conformant, instances of this element SHALL include a code from the specified value set.
331         */
332        REQUIRED, 
333        /**
334         * To be conformant, instances of this element SHALL include a code from the specified value set if any of the codes within the value set can apply to the concept being communicated.  If the valueset does not cover the concept (based on human review), alternate codings (or, data type allowing, text) may be included instead.
335         */
336        EXTENSIBLE, 
337        /**
338         * Instances are encouraged to draw from the specified codes for interoperability purposes but are not required to do so to be considered conformant.
339         */
340        PREFERRED, 
341        /**
342         * 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.
343         */
344        EXAMPLE, 
345        /**
346         * added to help the parsers
347         */
348        NULL;
349        public static BindingStrength fromCode(String codeString) throws FHIRException {
350            if (codeString == null || "".equals(codeString))
351                return null;
352        if ("required".equals(codeString))
353          return REQUIRED;
354        if ("extensible".equals(codeString))
355          return EXTENSIBLE;
356        if ("preferred".equals(codeString))
357          return PREFERRED;
358        if ("example".equals(codeString))
359          return EXAMPLE;
360        throw new FHIRException("Unknown BindingStrength code '"+codeString+"'");
361        }
362        public String toCode() {
363          switch (this) {
364            case REQUIRED: return "required";
365            case EXTENSIBLE: return "extensible";
366            case PREFERRED: return "preferred";
367            case EXAMPLE: return "example";
368            case NULL: return null;
369            default: return "?";
370          }
371        }
372        public String getSystem() {
373          switch (this) {
374            case REQUIRED: return "http://hl7.org/fhir/binding-strength";
375            case EXTENSIBLE: return "http://hl7.org/fhir/binding-strength";
376            case PREFERRED: return "http://hl7.org/fhir/binding-strength";
377            case EXAMPLE: return "http://hl7.org/fhir/binding-strength";
378            case NULL: return null;
379            default: return "?";
380          }
381        }
382        public String getDefinition() {
383          switch (this) {
384            case REQUIRED: return "To be conformant, instances of this element SHALL include a code from the specified value set.";
385            case EXTENSIBLE: return "To be conformant, instances of this element SHALL include a code from the specified value set if any of the codes within the value set can apply to the concept being communicated.  If the valueset does not cover the concept (based on human review), alternate codings (or, data type allowing, text) may be included instead.";
386            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.";
387            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.";
388            case NULL: return null;
389            default: return "?";
390          }
391        }
392        public String getDisplay() {
393          switch (this) {
394            case REQUIRED: return "Required";
395            case EXTENSIBLE: return "Extensible";
396            case PREFERRED: return "Preferred";
397            case EXAMPLE: return "Example";
398            case NULL: return null;
399            default: return "?";
400          }
401        }
402    }
403
404  public static class BindingStrengthEnumFactory implements EnumFactory<BindingStrength> {
405    public BindingStrength fromCode(String codeString) throws IllegalArgumentException {
406      if (codeString == null || "".equals(codeString))
407            if (codeString == null || "".equals(codeString))
408                return null;
409        if ("required".equals(codeString))
410          return BindingStrength.REQUIRED;
411        if ("extensible".equals(codeString))
412          return BindingStrength.EXTENSIBLE;
413        if ("preferred".equals(codeString))
414          return BindingStrength.PREFERRED;
415        if ("example".equals(codeString))
416          return BindingStrength.EXAMPLE;
417        throw new IllegalArgumentException("Unknown BindingStrength code '"+codeString+"'");
418        }
419        public Enumeration<BindingStrength> fromType(Base code) throws FHIRException {
420          if (code == null || code.isEmpty())
421            return null;
422          String codeString = ((PrimitiveType) code).asStringValue();
423          if (codeString == null || "".equals(codeString))
424            return null;
425        if ("required".equals(codeString))
426          return new Enumeration<BindingStrength>(this, BindingStrength.REQUIRED);
427        if ("extensible".equals(codeString))
428          return new Enumeration<BindingStrength>(this, BindingStrength.EXTENSIBLE);
429        if ("preferred".equals(codeString))
430          return new Enumeration<BindingStrength>(this, BindingStrength.PREFERRED);
431        if ("example".equals(codeString))
432          return new Enumeration<BindingStrength>(this, BindingStrength.EXAMPLE);
433        throw new FHIRException("Unknown BindingStrength code '"+codeString+"'");
434        }
435    public String toCode(BindingStrength code) {
436      if (code == BindingStrength.REQUIRED)
437        return "required";
438      if (code == BindingStrength.EXTENSIBLE)
439        return "extensible";
440      if (code == BindingStrength.PREFERRED)
441        return "preferred";
442      if (code == BindingStrength.EXAMPLE)
443        return "example";
444      return "?";
445      }
446    }
447
448    public enum ConceptMapEquivalence {
449        /**
450         * The definitions of the concepts mean the same thing (including when structural implications of meaning are considered) (i.e. extensionally identical).
451         */
452        EQUIVALENT, 
453        /**
454         * The definitions of the concepts are exactly the same (i.e. only grammatical differences) and structural implications of meaning are identical or irrelevant (i.e. intentionally identical).
455         */
456        EQUAL, 
457        /**
458         * The target mapping is wider in meaning than the source concept.
459         */
460        WIDER, 
461        /**
462         * The target mapping subsumes the meaning of the source concept (e.g. the source is-a target).
463         */
464        SUBSUMES, 
465        /**
466         * The target mapping is narrower in meaning that the source concept. The sense in which the mapping is narrower SHALL be described in the comments in this case, and applications should be careful when attempting to use these mappings operationally.
467         */
468        NARROWER, 
469        /**
470         * The target mapping specializes the meaning of the source concept (e.g. the target is-a source).
471         */
472        SPECIALIZES, 
473        /**
474         * The target mapping overlaps with the source concept, but both source and target cover additional meaning, or the definitions are imprecise and it is uncertain whether they have the same boundaries to their meaning. The sense in which the mapping is narrower SHALL be described in the comments in this case, and applications should be careful when attempting to use these mappings operationally.
475         */
476        INEXACT, 
477        /**
478         * There is no match for this concept in the destination concept system.
479         */
480        UNMATCHED, 
481        /**
482         * This is an explicit assertion that there is no mapping between the source and target concept.
483         */
484        DISJOINT, 
485        /**
486         * added to help the parsers
487         */
488        NULL;
489        public static ConceptMapEquivalence fromCode(String codeString) throws FHIRException {
490            if (codeString == null || "".equals(codeString))
491                return null;
492        if ("equivalent".equals(codeString))
493          return EQUIVALENT;
494        if ("equal".equals(codeString))
495          return EQUAL;
496        if ("wider".equals(codeString))
497          return WIDER;
498        if ("subsumes".equals(codeString))
499          return SUBSUMES;
500        if ("narrower".equals(codeString))
501          return NARROWER;
502        if ("specializes".equals(codeString))
503          return SPECIALIZES;
504        if ("inexact".equals(codeString))
505          return INEXACT;
506        if ("unmatched".equals(codeString))
507          return UNMATCHED;
508        if ("disjoint".equals(codeString))
509          return DISJOINT;
510        throw new FHIRException("Unknown ConceptMapEquivalence code '"+codeString+"'");
511        }
512        public String toCode() {
513          switch (this) {
514            case EQUIVALENT: return "equivalent";
515            case EQUAL: return "equal";
516            case WIDER: return "wider";
517            case SUBSUMES: return "subsumes";
518            case NARROWER: return "narrower";
519            case SPECIALIZES: return "specializes";
520            case INEXACT: return "inexact";
521            case UNMATCHED: return "unmatched";
522            case DISJOINT: return "disjoint";
523            case NULL: return null;
524            default: return "?";
525          }
526        }
527        public String getSystem() {
528          switch (this) {
529            case EQUIVALENT: return "http://hl7.org/fhir/concept-map-equivalence";
530            case EQUAL: return "http://hl7.org/fhir/concept-map-equivalence";
531            case WIDER: return "http://hl7.org/fhir/concept-map-equivalence";
532            case SUBSUMES: return "http://hl7.org/fhir/concept-map-equivalence";
533            case NARROWER: return "http://hl7.org/fhir/concept-map-equivalence";
534            case SPECIALIZES: return "http://hl7.org/fhir/concept-map-equivalence";
535            case INEXACT: return "http://hl7.org/fhir/concept-map-equivalence";
536            case UNMATCHED: return "http://hl7.org/fhir/concept-map-equivalence";
537            case DISJOINT: return "http://hl7.org/fhir/concept-map-equivalence";
538            case NULL: return null;
539            default: return "?";
540          }
541        }
542        public String getDefinition() {
543          switch (this) {
544            case EQUIVALENT: return "The definitions of the concepts mean the same thing (including when structural implications of meaning are considered) (i.e. extensionally identical).";
545            case EQUAL: return "The definitions of the concepts are exactly the same (i.e. only grammatical differences) and structural implications of meaning are identical or irrelevant (i.e. intentionally identical).";
546            case WIDER: return "The target mapping is wider in meaning than the source concept.";
547            case SUBSUMES: return "The target mapping subsumes the meaning of the source concept (e.g. the source is-a target).";
548            case NARROWER: return "The target mapping is narrower in meaning that the source concept. The sense in which the mapping is narrower SHALL be described in the comments in this case, and applications should be careful when attempting to use these mappings operationally.";
549            case SPECIALIZES: return "The target mapping specializes the meaning of the source concept (e.g. the target is-a source).";
550            case INEXACT: return "The target mapping overlaps with the source concept, but both source and target cover additional meaning, or the definitions are imprecise and it is uncertain whether they have the same boundaries to their meaning. The sense in which the mapping is narrower SHALL be described in the comments in this case, and applications should be careful when attempting to use these mappings operationally.";
551            case UNMATCHED: return "There is no match for this concept in the destination concept system.";
552            case DISJOINT: return "This is an explicit assertion that there is no mapping between the source and target concept.";
553            case NULL: return null;
554            default: return "?";
555          }
556        }
557        public String getDisplay() {
558          switch (this) {
559            case EQUIVALENT: return "Equivalent";
560            case EQUAL: return "Equal";
561            case WIDER: return "Wider";
562            case SUBSUMES: return "Subsumes";
563            case NARROWER: return "Narrower";
564            case SPECIALIZES: return "Specializes";
565            case INEXACT: return "Inexact";
566            case UNMATCHED: return "Unmatched";
567            case DISJOINT: return "Disjoint";
568            case NULL: return null;
569            default: return "?";
570          }
571        }
572    }
573
574  public static class ConceptMapEquivalenceEnumFactory implements EnumFactory<ConceptMapEquivalence> {
575    public ConceptMapEquivalence fromCode(String codeString) throws IllegalArgumentException {
576      if (codeString == null || "".equals(codeString))
577            if (codeString == null || "".equals(codeString))
578                return null;
579        if ("equivalent".equals(codeString))
580          return ConceptMapEquivalence.EQUIVALENT;
581        if ("equal".equals(codeString))
582          return ConceptMapEquivalence.EQUAL;
583        if ("wider".equals(codeString))
584          return ConceptMapEquivalence.WIDER;
585        if ("subsumes".equals(codeString))
586          return ConceptMapEquivalence.SUBSUMES;
587        if ("narrower".equals(codeString))
588          return ConceptMapEquivalence.NARROWER;
589        if ("specializes".equals(codeString))
590          return ConceptMapEquivalence.SPECIALIZES;
591        if ("inexact".equals(codeString))
592          return ConceptMapEquivalence.INEXACT;
593        if ("unmatched".equals(codeString))
594          return ConceptMapEquivalence.UNMATCHED;
595        if ("disjoint".equals(codeString))
596          return ConceptMapEquivalence.DISJOINT;
597        throw new IllegalArgumentException("Unknown ConceptMapEquivalence code '"+codeString+"'");
598        }
599        public Enumeration<ConceptMapEquivalence> fromType(Base code) throws FHIRException {
600          if (code == null || code.isEmpty())
601            return null;
602          String codeString = ((PrimitiveType) code).asStringValue();
603          if (codeString == null || "".equals(codeString))
604            return null;
605        if ("equivalent".equals(codeString))
606          return new Enumeration<ConceptMapEquivalence>(this, ConceptMapEquivalence.EQUIVALENT);
607        if ("equal".equals(codeString))
608          return new Enumeration<ConceptMapEquivalence>(this, ConceptMapEquivalence.EQUAL);
609        if ("wider".equals(codeString))
610          return new Enumeration<ConceptMapEquivalence>(this, ConceptMapEquivalence.WIDER);
611        if ("subsumes".equals(codeString))
612          return new Enumeration<ConceptMapEquivalence>(this, ConceptMapEquivalence.SUBSUMES);
613        if ("narrower".equals(codeString))
614          return new Enumeration<ConceptMapEquivalence>(this, ConceptMapEquivalence.NARROWER);
615        if ("specializes".equals(codeString))
616          return new Enumeration<ConceptMapEquivalence>(this, ConceptMapEquivalence.SPECIALIZES);
617        if ("inexact".equals(codeString))
618          return new Enumeration<ConceptMapEquivalence>(this, ConceptMapEquivalence.INEXACT);
619        if ("unmatched".equals(codeString))
620          return new Enumeration<ConceptMapEquivalence>(this, ConceptMapEquivalence.UNMATCHED);
621        if ("disjoint".equals(codeString))
622          return new Enumeration<ConceptMapEquivalence>(this, ConceptMapEquivalence.DISJOINT);
623        throw new FHIRException("Unknown ConceptMapEquivalence code '"+codeString+"'");
624        }
625    public String toCode(ConceptMapEquivalence code) {
626      if (code == ConceptMapEquivalence.EQUIVALENT)
627        return "equivalent";
628      if (code == ConceptMapEquivalence.EQUAL)
629        return "equal";
630      if (code == ConceptMapEquivalence.WIDER)
631        return "wider";
632      if (code == ConceptMapEquivalence.SUBSUMES)
633        return "subsumes";
634      if (code == ConceptMapEquivalence.NARROWER)
635        return "narrower";
636      if (code == ConceptMapEquivalence.SPECIALIZES)
637        return "specializes";
638      if (code == ConceptMapEquivalence.INEXACT)
639        return "inexact";
640      if (code == ConceptMapEquivalence.UNMATCHED)
641        return "unmatched";
642      if (code == ConceptMapEquivalence.DISJOINT)
643        return "disjoint";
644      return "?";
645      }
646    }
647
648    public enum ConformanceResourceStatus {
649        /**
650         * This resource is still under development.
651         */
652        DRAFT, 
653        /**
654         * This resource is ready for normal use.
655         */
656        ACTIVE, 
657        /**
658         * This resource has been withdrawn or superseded and should no longer be used.
659         */
660        RETIRED, 
661        /**
662         * added to help the parsers
663         */
664        NULL;
665        public static ConformanceResourceStatus fromCode(String codeString) throws FHIRException {
666            if (codeString == null || "".equals(codeString))
667                return null;
668        if ("draft".equals(codeString))
669          return DRAFT;
670        if ("active".equals(codeString))
671          return ACTIVE;
672        if ("retired".equals(codeString))
673          return RETIRED;
674        throw new FHIRException("Unknown ConformanceResourceStatus code '"+codeString+"'");
675        }
676        public String toCode() {
677          switch (this) {
678            case DRAFT: return "draft";
679            case ACTIVE: return "active";
680            case RETIRED: return "retired";
681            case NULL: return null;
682            default: return "?";
683          }
684        }
685        public String getSystem() {
686          switch (this) {
687            case DRAFT: return "http://hl7.org/fhir/conformance-resource-status";
688            case ACTIVE: return "http://hl7.org/fhir/conformance-resource-status";
689            case RETIRED: return "http://hl7.org/fhir/conformance-resource-status";
690            case NULL: return null;
691            default: return "?";
692          }
693        }
694        public String getDefinition() {
695          switch (this) {
696            case DRAFT: return "This resource is still under development.";
697            case ACTIVE: return "This resource is ready for normal use.";
698            case RETIRED: return "This resource has been withdrawn or superseded and should no longer be used.";
699            case NULL: return null;
700            default: return "?";
701          }
702        }
703        public String getDisplay() {
704          switch (this) {
705            case DRAFT: return "Draft";
706            case ACTIVE: return "Active";
707            case RETIRED: return "Retired";
708            case NULL: return null;
709            default: return "?";
710          }
711        }
712    }
713
714  public static class ConformanceResourceStatusEnumFactory implements EnumFactory<ConformanceResourceStatus> {
715    public ConformanceResourceStatus fromCode(String codeString) throws IllegalArgumentException {
716      if (codeString == null || "".equals(codeString))
717            if (codeString == null || "".equals(codeString))
718                return null;
719        if ("draft".equals(codeString))
720          return ConformanceResourceStatus.DRAFT;
721        if ("active".equals(codeString))
722          return ConformanceResourceStatus.ACTIVE;
723        if ("retired".equals(codeString))
724          return ConformanceResourceStatus.RETIRED;
725        throw new IllegalArgumentException("Unknown ConformanceResourceStatus code '"+codeString+"'");
726        }
727        public Enumeration<ConformanceResourceStatus> fromType(Base code) throws FHIRException {
728          if (code == null || code.isEmpty())
729            return null;
730          String codeString = ((PrimitiveType) code).asStringValue();
731          if (codeString == null || "".equals(codeString))
732            return null;
733        if ("draft".equals(codeString))
734          return new Enumeration<ConformanceResourceStatus>(this, ConformanceResourceStatus.DRAFT);
735        if ("active".equals(codeString))
736          return new Enumeration<ConformanceResourceStatus>(this, ConformanceResourceStatus.ACTIVE);
737        if ("retired".equals(codeString))
738          return new Enumeration<ConformanceResourceStatus>(this, ConformanceResourceStatus.RETIRED);
739        throw new FHIRException("Unknown ConformanceResourceStatus code '"+codeString+"'");
740        }
741    public String toCode(ConformanceResourceStatus code) {
742      if (code == ConformanceResourceStatus.DRAFT)
743        return "draft";
744      if (code == ConformanceResourceStatus.ACTIVE)
745        return "active";
746      if (code == ConformanceResourceStatus.RETIRED)
747        return "retired";
748      return "?";
749      }
750    }
751
752    public enum DataAbsentReason {
753        /**
754         * The value is not known.
755         */
756        UNKNOWN, 
757        /**
758         * The source human does not know the value.
759         */
760        ASKED, 
761        /**
762         * There is reason to expect (from the workflow) that the value may become known.
763         */
764        TEMP, 
765        /**
766         * The workflow didn't lead to this value being known.
767         */
768        NOTASKED, 
769        /**
770         * The information is not available due to security, privacy or related reasons.
771         */
772        MASKED, 
773        /**
774         * The source system wasn't capable of supporting this element.
775         */
776        UNSUPPORTED, 
777        /**
778         * The content of the data is represented in the resource narrative.
779         */
780        ASTEXT, 
781        /**
782         * Some system or workflow process error means that the information is not available.
783         */
784        ERROR, 
785        /**
786         * NaN, standing for not a number, is a numeric data type value representing an undefined or unrepresentable value.
787         */
788        NAN, 
789        /**
790         * added to help the parsers
791         */
792        NULL;
793        public static DataAbsentReason fromCode(String codeString) throws FHIRException {
794            if (codeString == null || "".equals(codeString))
795                return null;
796        if ("unknown".equals(codeString))
797          return UNKNOWN;
798        if ("asked".equals(codeString))
799          return ASKED;
800        if ("temp".equals(codeString))
801          return TEMP;
802        if ("not-asked".equals(codeString))
803          return NOTASKED;
804        if ("masked".equals(codeString))
805          return MASKED;
806        if ("unsupported".equals(codeString))
807          return UNSUPPORTED;
808        if ("astext".equals(codeString))
809          return ASTEXT;
810        if ("error".equals(codeString))
811          return ERROR;
812        if ("NaN".equals(codeString))
813          return NAN;
814        throw new FHIRException("Unknown DataAbsentReason code '"+codeString+"'");
815        }
816        public String toCode() {
817          switch (this) {
818            case UNKNOWN: return "unknown";
819            case ASKED: return "asked";
820            case TEMP: return "temp";
821            case NOTASKED: return "not-asked";
822            case MASKED: return "masked";
823            case UNSUPPORTED: return "unsupported";
824            case ASTEXT: return "astext";
825            case ERROR: return "error";
826            case NAN: return "NaN";
827            case NULL: return null;
828            default: return "?";
829          }
830        }
831        public String getSystem() {
832          switch (this) {
833            case UNKNOWN: return "http://hl7.org/fhir/data-absent-reason";
834            case ASKED: return "http://hl7.org/fhir/data-absent-reason";
835            case TEMP: return "http://hl7.org/fhir/data-absent-reason";
836            case NOTASKED: return "http://hl7.org/fhir/data-absent-reason";
837            case MASKED: return "http://hl7.org/fhir/data-absent-reason";
838            case UNSUPPORTED: return "http://hl7.org/fhir/data-absent-reason";
839            case ASTEXT: return "http://hl7.org/fhir/data-absent-reason";
840            case ERROR: return "http://hl7.org/fhir/data-absent-reason";
841            case NAN: return "http://hl7.org/fhir/data-absent-reason";
842            case NULL: return null;
843            default: return "?";
844          }
845        }
846        public String getDefinition() {
847          switch (this) {
848            case UNKNOWN: return "The value is not known.";
849            case ASKED: return "The source human does not know the value.";
850            case TEMP: return "There is reason to expect (from the workflow) that the value may become known.";
851            case NOTASKED: return "The workflow didn't lead to this value being known.";
852            case MASKED: return "The information is not available due to security, privacy or related reasons.";
853            case UNSUPPORTED: return "The source system wasn't capable of supporting this element.";
854            case ASTEXT: return "The content of the data is represented in the resource narrative.";
855            case ERROR: return "Some system or workflow process error means that the information is not available.";
856            case NAN: return "NaN, standing for not a number, is a numeric data type value representing an undefined or unrepresentable value.";
857            case NULL: return null;
858            default: return "?";
859          }
860        }
861        public String getDisplay() {
862          switch (this) {
863            case UNKNOWN: return "Unknown";
864            case ASKED: return "Asked";
865            case TEMP: return "Temp";
866            case NOTASKED: return "Not Asked";
867            case MASKED: return "Masked";
868            case UNSUPPORTED: return "Unsupported";
869            case ASTEXT: return "As Text";
870            case ERROR: return "Error";
871            case NAN: return "Not a Number";
872            case NULL: return null;
873            default: return "?";
874          }
875        }
876    }
877
878  public static class DataAbsentReasonEnumFactory implements EnumFactory<DataAbsentReason> {
879    public DataAbsentReason fromCode(String codeString) throws IllegalArgumentException {
880      if (codeString == null || "".equals(codeString))
881            if (codeString == null || "".equals(codeString))
882                return null;
883        if ("unknown".equals(codeString))
884          return DataAbsentReason.UNKNOWN;
885        if ("asked".equals(codeString))
886          return DataAbsentReason.ASKED;
887        if ("temp".equals(codeString))
888          return DataAbsentReason.TEMP;
889        if ("not-asked".equals(codeString))
890          return DataAbsentReason.NOTASKED;
891        if ("masked".equals(codeString))
892          return DataAbsentReason.MASKED;
893        if ("unsupported".equals(codeString))
894          return DataAbsentReason.UNSUPPORTED;
895        if ("astext".equals(codeString))
896          return DataAbsentReason.ASTEXT;
897        if ("error".equals(codeString))
898          return DataAbsentReason.ERROR;
899        if ("NaN".equals(codeString))
900          return DataAbsentReason.NAN;
901        throw new IllegalArgumentException("Unknown DataAbsentReason code '"+codeString+"'");
902        }
903        public Enumeration<DataAbsentReason> fromType(Base code) throws FHIRException {
904          if (code == null || code.isEmpty())
905            return null;
906          String codeString = ((PrimitiveType) code).asStringValue();
907          if (codeString == null || "".equals(codeString))
908            return null;
909        if ("unknown".equals(codeString))
910          return new Enumeration<DataAbsentReason>(this, DataAbsentReason.UNKNOWN);
911        if ("asked".equals(codeString))
912          return new Enumeration<DataAbsentReason>(this, DataAbsentReason.ASKED);
913        if ("temp".equals(codeString))
914          return new Enumeration<DataAbsentReason>(this, DataAbsentReason.TEMP);
915        if ("not-asked".equals(codeString))
916          return new Enumeration<DataAbsentReason>(this, DataAbsentReason.NOTASKED);
917        if ("masked".equals(codeString))
918          return new Enumeration<DataAbsentReason>(this, DataAbsentReason.MASKED);
919        if ("unsupported".equals(codeString))
920          return new Enumeration<DataAbsentReason>(this, DataAbsentReason.UNSUPPORTED);
921        if ("astext".equals(codeString))
922          return new Enumeration<DataAbsentReason>(this, DataAbsentReason.ASTEXT);
923        if ("error".equals(codeString))
924          return new Enumeration<DataAbsentReason>(this, DataAbsentReason.ERROR);
925        if ("NaN".equals(codeString))
926          return new Enumeration<DataAbsentReason>(this, DataAbsentReason.NAN);
927        throw new FHIRException("Unknown DataAbsentReason code '"+codeString+"'");
928        }
929    public String toCode(DataAbsentReason code) {
930      if (code == DataAbsentReason.UNKNOWN)
931        return "unknown";
932      if (code == DataAbsentReason.ASKED)
933        return "asked";
934      if (code == DataAbsentReason.TEMP)
935        return "temp";
936      if (code == DataAbsentReason.NOTASKED)
937        return "not-asked";
938      if (code == DataAbsentReason.MASKED)
939        return "masked";
940      if (code == DataAbsentReason.UNSUPPORTED)
941        return "unsupported";
942      if (code == DataAbsentReason.ASTEXT)
943        return "astext";
944      if (code == DataAbsentReason.ERROR)
945        return "error";
946      if (code == DataAbsentReason.NAN)
947        return "NaN";
948      return "?";
949      }
950    }
951
952    public enum DataType {
953        /**
954         * There is a variety of postal address formats defined around the world. This format defines a superset that is the basis for all addresses around the world.
955         */
956        ADDRESS, 
957        /**
958         * null
959         */
960        AGE, 
961        /**
962         * A  text note which also  contains information about who made the statement and when.
963         */
964        ANNOTATION, 
965        /**
966         * For referring to data content defined in other formats.
967         */
968        ATTACHMENT, 
969        /**
970         * Base definition for all elements that are defined inside a resource - but not those in a data type.
971         */
972        BACKBONEELEMENT, 
973        /**
974         * A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text.
975         */
976        CODEABLECONCEPT, 
977        /**
978         * A reference to a code defined by a terminology system.
979         */
980        CODING, 
981        /**
982         * Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc.
983         */
984        CONTACTPOINT, 
985        /**
986         * null
987         */
988        COUNT, 
989        /**
990         * null
991         */
992        DISTANCE, 
993        /**
994         * null
995         */
996        DURATION, 
997        /**
998         * Base definition for all elements in a resource.
999         */
1000        ELEMENT, 
1001        /**
1002         * Captures constraints on each element within the resource, profile, or extension.
1003         */
1004        ELEMENTDEFINITION, 
1005        /**
1006         * Optional Extensions Element - found in all resources.
1007         */
1008        EXTENSION, 
1009        /**
1010         * A human's name with the ability to identify parts and usage.
1011         */
1012        HUMANNAME, 
1013        /**
1014         * A technical identifier - identifies some entity uniquely and unambiguously.
1015         */
1016        IDENTIFIER, 
1017        /**
1018         * The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource.
1019         */
1020        META, 
1021        /**
1022         * null
1023         */
1024        MONEY, 
1025        /**
1026         * A human-readable formatted text, including images.
1027         */
1028        NARRATIVE, 
1029        /**
1030         * A time period defined by a start and end date and optionally time.
1031         */
1032        PERIOD, 
1033        /**
1034         * 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.
1035         */
1036        QUANTITY, 
1037        /**
1038         * A set of ordered Quantities defined by a low and high limit.
1039         */
1040        RANGE, 
1041        /**
1042         * A relationship of two Quantity values - expressed as a numerator and a denominator.
1043         */
1044        RATIO, 
1045        /**
1046         * A reference from one resource to another.
1047         */
1048        REFERENCE, 
1049        /**
1050         * A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data.
1051         */
1052        SAMPLEDDATA, 
1053        /**
1054         * A digital signature along with supporting context. The signature may be electronic/cryptographic in nature, or a graphical image representing a hand-written signature, or a signature process. Different Signature approaches have different utilities.
1055         */
1056        SIGNATURE, 
1057        /**
1058         * null
1059         */
1060        SIMPLEQUANTITY, 
1061        /**
1062         * Specifies an event that may occur multiple times. Timing schedules are used to record when things are 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.
1063         */
1064        TIMING, 
1065        /**
1066         * A stream of bytes
1067         */
1068        BASE64BINARY, 
1069        /**
1070         * Value of "true" or "false"
1071         */
1072        BOOLEAN, 
1073        /**
1074         * 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
1075         */
1076        CODE, 
1077        /**
1078         * A date or partial date (e.g. just year or year + month). There is no time zone. The format is a union of the schema types gYear, gYearMonth and date.  Dates SHALL be valid dates.
1079         */
1080        DATE, 
1081        /**
1082         * A date, date-time or partial date (e.g. just year or year + month).  If hours and minutes are specified, a time zone 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.
1083         */
1084        DATETIME, 
1085        /**
1086         * A rational number with implicit precision
1087         */
1088        DECIMAL, 
1089        /**
1090         * 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.
1091         */
1092        ID, 
1093        /**
1094         * An instant in time - known at least to the second
1095         */
1096        INSTANT, 
1097        /**
1098         * A whole number
1099         */
1100        INTEGER, 
1101        /**
1102         * A string that may contain markdown syntax for optional processing by a mark down presentation engine
1103         */
1104        MARKDOWN, 
1105        /**
1106         * An oid represented as a URI
1107         */
1108        OID, 
1109        /**
1110         * An integer with a value that is positive (e.g. >0)
1111         */
1112        POSITIVEINT, 
1113        /**
1114         * A sequence of Unicode characters
1115         */
1116        STRING, 
1117        /**
1118         * A time during the day, with no date specified
1119         */
1120        TIME, 
1121        /**
1122         * An integer with a value that is not negative (e.g. >= 0)
1123         */
1124        UNSIGNEDINT, 
1125        /**
1126         * String of characters used to identify a name or a resource
1127         */
1128        URI, 
1129        /**
1130         * A UUID, represented as a URI
1131         */
1132        UUID, 
1133        /**
1134         * XHTML format, as defined by W3C, but restricted usage (mainly, no active content)
1135         */
1136        XHTML, 
1137        /**
1138         * added to help the parsers
1139         */
1140        NULL;
1141        public static DataType fromCode(String codeString) throws FHIRException {
1142            if (codeString == null || "".equals(codeString))
1143                return null;
1144        if ("Address".equals(codeString))
1145          return ADDRESS;
1146        if ("Age".equals(codeString))
1147          return AGE;
1148        if ("Annotation".equals(codeString))
1149          return ANNOTATION;
1150        if ("Attachment".equals(codeString))
1151          return ATTACHMENT;
1152        if ("BackboneElement".equals(codeString))
1153          return BACKBONEELEMENT;
1154        if ("CodeableConcept".equals(codeString))
1155          return CODEABLECONCEPT;
1156        if ("Coding".equals(codeString))
1157          return CODING;
1158        if ("ContactPoint".equals(codeString))
1159          return CONTACTPOINT;
1160        if ("Count".equals(codeString))
1161          return COUNT;
1162        if ("Distance".equals(codeString))
1163          return DISTANCE;
1164        if ("Duration".equals(codeString))
1165          return DURATION;
1166        if ("Element".equals(codeString))
1167          return ELEMENT;
1168        if ("ElementDefinition".equals(codeString))
1169          return ELEMENTDEFINITION;
1170        if ("Extension".equals(codeString))
1171          return EXTENSION;
1172        if ("HumanName".equals(codeString))
1173          return HUMANNAME;
1174        if ("Identifier".equals(codeString))
1175          return IDENTIFIER;
1176        if ("Meta".equals(codeString))
1177          return META;
1178        if ("Money".equals(codeString))
1179          return MONEY;
1180        if ("Narrative".equals(codeString))
1181          return NARRATIVE;
1182        if ("Period".equals(codeString))
1183          return PERIOD;
1184        if ("Quantity".equals(codeString))
1185          return QUANTITY;
1186        if ("Range".equals(codeString))
1187          return RANGE;
1188        if ("Ratio".equals(codeString))
1189          return RATIO;
1190        if ("Reference".equals(codeString))
1191          return REFERENCE;
1192        if ("SampledData".equals(codeString))
1193          return SAMPLEDDATA;
1194        if ("Signature".equals(codeString))
1195          return SIGNATURE;
1196        if ("SimpleQuantity".equals(codeString))
1197          return SIMPLEQUANTITY;
1198        if ("Timing".equals(codeString))
1199          return TIMING;
1200        if ("base64Binary".equals(codeString))
1201          return BASE64BINARY;
1202        if ("boolean".equals(codeString))
1203          return BOOLEAN;
1204        if ("code".equals(codeString))
1205          return CODE;
1206        if ("date".equals(codeString))
1207          return DATE;
1208        if ("dateTime".equals(codeString))
1209          return DATETIME;
1210        if ("decimal".equals(codeString))
1211          return DECIMAL;
1212        if ("id".equals(codeString))
1213          return ID;
1214        if ("instant".equals(codeString))
1215          return INSTANT;
1216        if ("integer".equals(codeString))
1217          return INTEGER;
1218        if ("markdown".equals(codeString))
1219          return MARKDOWN;
1220        if ("oid".equals(codeString))
1221          return OID;
1222        if ("positiveInt".equals(codeString))
1223          return POSITIVEINT;
1224        if ("string".equals(codeString))
1225          return STRING;
1226        if ("time".equals(codeString))
1227          return TIME;
1228        if ("unsignedInt".equals(codeString))
1229          return UNSIGNEDINT;
1230        if ("uri".equals(codeString))
1231          return URI;
1232        if ("uuid".equals(codeString))
1233          return UUID;
1234        if ("xhtml".equals(codeString))
1235          return XHTML;
1236        throw new FHIRException("Unknown DataType code '"+codeString+"'");
1237        }
1238        public String toCode() {
1239          switch (this) {
1240            case ADDRESS: return "Address";
1241            case AGE: return "Age";
1242            case ANNOTATION: return "Annotation";
1243            case ATTACHMENT: return "Attachment";
1244            case BACKBONEELEMENT: return "BackboneElement";
1245            case CODEABLECONCEPT: return "CodeableConcept";
1246            case CODING: return "Coding";
1247            case CONTACTPOINT: return "ContactPoint";
1248            case COUNT: return "Count";
1249            case DISTANCE: return "Distance";
1250            case DURATION: return "Duration";
1251            case ELEMENT: return "Element";
1252            case ELEMENTDEFINITION: return "ElementDefinition";
1253            case EXTENSION: return "Extension";
1254            case HUMANNAME: return "HumanName";
1255            case IDENTIFIER: return "Identifier";
1256            case META: return "Meta";
1257            case MONEY: return "Money";
1258            case NARRATIVE: return "Narrative";
1259            case PERIOD: return "Period";
1260            case QUANTITY: return "Quantity";
1261            case RANGE: return "Range";
1262            case RATIO: return "Ratio";
1263            case REFERENCE: return "Reference";
1264            case SAMPLEDDATA: return "SampledData";
1265            case SIGNATURE: return "Signature";
1266            case SIMPLEQUANTITY: return "SimpleQuantity";
1267            case TIMING: return "Timing";
1268            case BASE64BINARY: return "base64Binary";
1269            case BOOLEAN: return "boolean";
1270            case CODE: return "code";
1271            case DATE: return "date";
1272            case DATETIME: return "dateTime";
1273            case DECIMAL: return "decimal";
1274            case ID: return "id";
1275            case INSTANT: return "instant";
1276            case INTEGER: return "integer";
1277            case MARKDOWN: return "markdown";
1278            case OID: return "oid";
1279            case POSITIVEINT: return "positiveInt";
1280            case STRING: return "string";
1281            case TIME: return "time";
1282            case UNSIGNEDINT: return "unsignedInt";
1283            case URI: return "uri";
1284            case UUID: return "uuid";
1285            case XHTML: return "xhtml";
1286            case NULL: return null;
1287            default: return "?";
1288          }
1289        }
1290        public String getSystem() {
1291          switch (this) {
1292            case ADDRESS: return "http://hl7.org/fhir/data-types";
1293            case AGE: return "http://hl7.org/fhir/data-types";
1294            case ANNOTATION: return "http://hl7.org/fhir/data-types";
1295            case ATTACHMENT: return "http://hl7.org/fhir/data-types";
1296            case BACKBONEELEMENT: return "http://hl7.org/fhir/data-types";
1297            case CODEABLECONCEPT: return "http://hl7.org/fhir/data-types";
1298            case CODING: return "http://hl7.org/fhir/data-types";
1299            case CONTACTPOINT: return "http://hl7.org/fhir/data-types";
1300            case COUNT: return "http://hl7.org/fhir/data-types";
1301            case DISTANCE: return "http://hl7.org/fhir/data-types";
1302            case DURATION: return "http://hl7.org/fhir/data-types";
1303            case ELEMENT: return "http://hl7.org/fhir/data-types";
1304            case ELEMENTDEFINITION: return "http://hl7.org/fhir/data-types";
1305            case EXTENSION: return "http://hl7.org/fhir/data-types";
1306            case HUMANNAME: return "http://hl7.org/fhir/data-types";
1307            case IDENTIFIER: return "http://hl7.org/fhir/data-types";
1308            case META: return "http://hl7.org/fhir/data-types";
1309            case MONEY: return "http://hl7.org/fhir/data-types";
1310            case NARRATIVE: return "http://hl7.org/fhir/data-types";
1311            case PERIOD: return "http://hl7.org/fhir/data-types";
1312            case QUANTITY: return "http://hl7.org/fhir/data-types";
1313            case RANGE: return "http://hl7.org/fhir/data-types";
1314            case RATIO: return "http://hl7.org/fhir/data-types";
1315            case REFERENCE: return "http://hl7.org/fhir/data-types";
1316            case SAMPLEDDATA: return "http://hl7.org/fhir/data-types";
1317            case SIGNATURE: return "http://hl7.org/fhir/data-types";
1318            case SIMPLEQUANTITY: return "http://hl7.org/fhir/data-types";
1319            case TIMING: return "http://hl7.org/fhir/data-types";
1320            case BASE64BINARY: return "http://hl7.org/fhir/data-types";
1321            case BOOLEAN: return "http://hl7.org/fhir/data-types";
1322            case CODE: return "http://hl7.org/fhir/data-types";
1323            case DATE: return "http://hl7.org/fhir/data-types";
1324            case DATETIME: return "http://hl7.org/fhir/data-types";
1325            case DECIMAL: return "http://hl7.org/fhir/data-types";
1326            case ID: return "http://hl7.org/fhir/data-types";
1327            case INSTANT: return "http://hl7.org/fhir/data-types";
1328            case INTEGER: return "http://hl7.org/fhir/data-types";
1329            case MARKDOWN: return "http://hl7.org/fhir/data-types";
1330            case OID: return "http://hl7.org/fhir/data-types";
1331            case POSITIVEINT: return "http://hl7.org/fhir/data-types";
1332            case STRING: return "http://hl7.org/fhir/data-types";
1333            case TIME: return "http://hl7.org/fhir/data-types";
1334            case UNSIGNEDINT: return "http://hl7.org/fhir/data-types";
1335            case URI: return "http://hl7.org/fhir/data-types";
1336            case UUID: return "http://hl7.org/fhir/data-types";
1337            case XHTML: return "http://hl7.org/fhir/data-types";
1338            case NULL: return null;
1339            default: return "?";
1340          }
1341        }
1342        public String getDefinition() {
1343          switch (this) {
1344            case ADDRESS: return "There is a variety of postal address formats defined around the world. This format defines a superset that is the basis for all addresses around the world.";
1345            case AGE: return "";
1346            case ANNOTATION: return "A  text note which also  contains information about who made the statement and when.";
1347            case ATTACHMENT: return "For referring to data content defined in other formats.";
1348            case BACKBONEELEMENT: return "Base definition for all elements that are defined inside a resource - but not those in a data type.";
1349            case CODEABLECONCEPT: return "A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text.";
1350            case CODING: return "A reference to a code defined by a terminology system.";
1351            case CONTACTPOINT: return "Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc.";
1352            case COUNT: return "";
1353            case DISTANCE: return "";
1354            case DURATION: return "";
1355            case ELEMENT: return "Base definition for all elements in a resource.";
1356            case ELEMENTDEFINITION: return "Captures constraints on each element within the resource, profile, or extension.";
1357            case EXTENSION: return "Optional Extensions Element - found in all resources.";
1358            case HUMANNAME: return "A human's name with the ability to identify parts and usage.";
1359            case IDENTIFIER: return "A technical identifier - identifies some entity uniquely and unambiguously.";
1360            case META: return "The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource.";
1361            case MONEY: return "";
1362            case NARRATIVE: return "A human-readable formatted text, including images.";
1363            case PERIOD: return "A time period defined by a start and end date and optionally time.";
1364            case QUANTITY: return "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.";
1365            case RANGE: return "A set of ordered Quantities defined by a low and high limit.";
1366            case RATIO: return "A relationship of two Quantity values - expressed as a numerator and a denominator.";
1367            case REFERENCE: return "A reference from one resource to another.";
1368            case SAMPLEDDATA: return "A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data.";
1369            case SIGNATURE: return "A digital signature along with supporting context. The signature may be electronic/cryptographic in nature, or a graphical image representing a hand-written signature, or a signature process. Different Signature approaches have different utilities.";
1370            case SIMPLEQUANTITY: return "";
1371            case TIMING: return "Specifies an event that may occur multiple times. Timing schedules are used to record when things are 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.";
1372            case BASE64BINARY: return "A stream of bytes";
1373            case BOOLEAN: return "Value of \"true\" or \"false\"";
1374            case CODE: return "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";
1375            case DATE: return "A date or partial date (e.g. just year or year + month). There is no time zone. The format is a union of the schema types gYear, gYearMonth and date.  Dates SHALL be valid dates.";
1376            case DATETIME: return "A date, date-time or partial date (e.g. just year or year + month).  If hours and minutes are specified, a time zone 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.";
1377            case DECIMAL: return "A rational number with implicit precision";
1378            case ID: return "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.";
1379            case INSTANT: return "An instant in time - known at least to the second";
1380            case INTEGER: return "A whole number";
1381            case MARKDOWN: return "A string that may contain markdown syntax for optional processing by a mark down presentation engine";
1382            case OID: return "An oid represented as a URI";
1383            case POSITIVEINT: return "An integer with a value that is positive (e.g. >0)";
1384            case STRING: return "A sequence of Unicode characters";
1385            case TIME: return "A time during the day, with no date specified";
1386            case UNSIGNEDINT: return "An integer with a value that is not negative (e.g. >= 0)";
1387            case URI: return "String of characters used to identify a name or a resource";
1388            case UUID: return "A UUID, represented as a URI";
1389            case XHTML: return "XHTML format, as defined by W3C, but restricted usage (mainly, no active content)";
1390            case NULL: return null;
1391            default: return "?";
1392          }
1393        }
1394        public String getDisplay() {
1395          switch (this) {
1396            case ADDRESS: return "Address";
1397            case AGE: return "Age";
1398            case ANNOTATION: return "Annotation";
1399            case ATTACHMENT: return "Attachment";
1400            case BACKBONEELEMENT: return "BackboneElement";
1401            case CODEABLECONCEPT: return "CodeableConcept";
1402            case CODING: return "Coding";
1403            case CONTACTPOINT: return "ContactPoint";
1404            case COUNT: return "Count";
1405            case DISTANCE: return "Distance";
1406            case DURATION: return "Duration";
1407            case ELEMENT: return "Element";
1408            case ELEMENTDEFINITION: return "ElementDefinition";
1409            case EXTENSION: return "Extension";
1410            case HUMANNAME: return "HumanName";
1411            case IDENTIFIER: return "Identifier";
1412            case META: return "Meta";
1413            case MONEY: return "Money";
1414            case NARRATIVE: return "Narrative";
1415            case PERIOD: return "Period";
1416            case QUANTITY: return "Quantity";
1417            case RANGE: return "Range";
1418            case RATIO: return "Ratio";
1419            case REFERENCE: return "Reference";
1420            case SAMPLEDDATA: return "SampledData";
1421            case SIGNATURE: return "Signature";
1422            case SIMPLEQUANTITY: return "SimpleQuantity";
1423            case TIMING: return "Timing";
1424            case BASE64BINARY: return "base64Binary";
1425            case BOOLEAN: return "boolean";
1426            case CODE: return "code";
1427            case DATE: return "date";
1428            case DATETIME: return "dateTime";
1429            case DECIMAL: return "decimal";
1430            case ID: return "id";
1431            case INSTANT: return "instant";
1432            case INTEGER: return "integer";
1433            case MARKDOWN: return "markdown";
1434            case OID: return "oid";
1435            case POSITIVEINT: return "positiveInt";
1436            case STRING: return "string";
1437            case TIME: return "time";
1438            case UNSIGNEDINT: return "unsignedInt";
1439            case URI: return "uri";
1440            case UUID: return "uuid";
1441            case XHTML: return "XHTML";
1442            case NULL: return null;
1443            default: return "?";
1444          }
1445        }
1446    }
1447
1448  public static class DataTypeEnumFactory implements EnumFactory<DataType> {
1449    public DataType fromCode(String codeString) throws IllegalArgumentException {
1450      if (codeString == null || "".equals(codeString))
1451            if (codeString == null || "".equals(codeString))
1452                return null;
1453        if ("Address".equals(codeString))
1454          return DataType.ADDRESS;
1455        if ("Age".equals(codeString))
1456          return DataType.AGE;
1457        if ("Annotation".equals(codeString))
1458          return DataType.ANNOTATION;
1459        if ("Attachment".equals(codeString))
1460          return DataType.ATTACHMENT;
1461        if ("BackboneElement".equals(codeString))
1462          return DataType.BACKBONEELEMENT;
1463        if ("CodeableConcept".equals(codeString))
1464          return DataType.CODEABLECONCEPT;
1465        if ("Coding".equals(codeString))
1466          return DataType.CODING;
1467        if ("ContactPoint".equals(codeString))
1468          return DataType.CONTACTPOINT;
1469        if ("Count".equals(codeString))
1470          return DataType.COUNT;
1471        if ("Distance".equals(codeString))
1472          return DataType.DISTANCE;
1473        if ("Duration".equals(codeString))
1474          return DataType.DURATION;
1475        if ("Element".equals(codeString))
1476          return DataType.ELEMENT;
1477        if ("ElementDefinition".equals(codeString))
1478          return DataType.ELEMENTDEFINITION;
1479        if ("Extension".equals(codeString))
1480          return DataType.EXTENSION;
1481        if ("HumanName".equals(codeString))
1482          return DataType.HUMANNAME;
1483        if ("Identifier".equals(codeString))
1484          return DataType.IDENTIFIER;
1485        if ("Meta".equals(codeString))
1486          return DataType.META;
1487        if ("Money".equals(codeString))
1488          return DataType.MONEY;
1489        if ("Narrative".equals(codeString))
1490          return DataType.NARRATIVE;
1491        if ("Period".equals(codeString))
1492          return DataType.PERIOD;
1493        if ("Quantity".equals(codeString))
1494          return DataType.QUANTITY;
1495        if ("Range".equals(codeString))
1496          return DataType.RANGE;
1497        if ("Ratio".equals(codeString))
1498          return DataType.RATIO;
1499        if ("Reference".equals(codeString))
1500          return DataType.REFERENCE;
1501        if ("SampledData".equals(codeString))
1502          return DataType.SAMPLEDDATA;
1503        if ("Signature".equals(codeString))
1504          return DataType.SIGNATURE;
1505        if ("SimpleQuantity".equals(codeString))
1506          return DataType.SIMPLEQUANTITY;
1507        if ("Timing".equals(codeString))
1508          return DataType.TIMING;
1509        if ("base64Binary".equals(codeString))
1510          return DataType.BASE64BINARY;
1511        if ("boolean".equals(codeString))
1512          return DataType.BOOLEAN;
1513        if ("code".equals(codeString))
1514          return DataType.CODE;
1515        if ("date".equals(codeString))
1516          return DataType.DATE;
1517        if ("dateTime".equals(codeString))
1518          return DataType.DATETIME;
1519        if ("decimal".equals(codeString))
1520          return DataType.DECIMAL;
1521        if ("id".equals(codeString))
1522          return DataType.ID;
1523        if ("instant".equals(codeString))
1524          return DataType.INSTANT;
1525        if ("integer".equals(codeString))
1526          return DataType.INTEGER;
1527        if ("markdown".equals(codeString))
1528          return DataType.MARKDOWN;
1529        if ("oid".equals(codeString))
1530          return DataType.OID;
1531        if ("positiveInt".equals(codeString))
1532          return DataType.POSITIVEINT;
1533        if ("string".equals(codeString))
1534          return DataType.STRING;
1535        if ("time".equals(codeString))
1536          return DataType.TIME;
1537        if ("unsignedInt".equals(codeString))
1538          return DataType.UNSIGNEDINT;
1539        if ("uri".equals(codeString))
1540          return DataType.URI;
1541        if ("uuid".equals(codeString))
1542          return DataType.UUID;
1543        if ("xhtml".equals(codeString))
1544          return DataType.XHTML;
1545        throw new IllegalArgumentException("Unknown DataType code '"+codeString+"'");
1546        }
1547        public Enumeration<DataType> fromType(Base code) throws FHIRException {
1548          if (code == null || code.isEmpty())
1549            return null;
1550          String codeString = ((PrimitiveType) code).asStringValue();
1551          if (codeString == null || "".equals(codeString))
1552            return null;
1553        if ("Address".equals(codeString))
1554          return new Enumeration<DataType>(this, DataType.ADDRESS);
1555        if ("Age".equals(codeString))
1556          return new Enumeration<DataType>(this, DataType.AGE);
1557        if ("Annotation".equals(codeString))
1558          return new Enumeration<DataType>(this, DataType.ANNOTATION);
1559        if ("Attachment".equals(codeString))
1560          return new Enumeration<DataType>(this, DataType.ATTACHMENT);
1561        if ("BackboneElement".equals(codeString))
1562          return new Enumeration<DataType>(this, DataType.BACKBONEELEMENT);
1563        if ("CodeableConcept".equals(codeString))
1564          return new Enumeration<DataType>(this, DataType.CODEABLECONCEPT);
1565        if ("Coding".equals(codeString))
1566          return new Enumeration<DataType>(this, DataType.CODING);
1567        if ("ContactPoint".equals(codeString))
1568          return new Enumeration<DataType>(this, DataType.CONTACTPOINT);
1569        if ("Count".equals(codeString))
1570          return new Enumeration<DataType>(this, DataType.COUNT);
1571        if ("Distance".equals(codeString))
1572          return new Enumeration<DataType>(this, DataType.DISTANCE);
1573        if ("Duration".equals(codeString))
1574          return new Enumeration<DataType>(this, DataType.DURATION);
1575        if ("Element".equals(codeString))
1576          return new Enumeration<DataType>(this, DataType.ELEMENT);
1577        if ("ElementDefinition".equals(codeString))
1578          return new Enumeration<DataType>(this, DataType.ELEMENTDEFINITION);
1579        if ("Extension".equals(codeString))
1580          return new Enumeration<DataType>(this, DataType.EXTENSION);
1581        if ("HumanName".equals(codeString))
1582          return new Enumeration<DataType>(this, DataType.HUMANNAME);
1583        if ("Identifier".equals(codeString))
1584          return new Enumeration<DataType>(this, DataType.IDENTIFIER);
1585        if ("Meta".equals(codeString))
1586          return new Enumeration<DataType>(this, DataType.META);
1587        if ("Money".equals(codeString))
1588          return new Enumeration<DataType>(this, DataType.MONEY);
1589        if ("Narrative".equals(codeString))
1590          return new Enumeration<DataType>(this, DataType.NARRATIVE);
1591        if ("Period".equals(codeString))
1592          return new Enumeration<DataType>(this, DataType.PERIOD);
1593        if ("Quantity".equals(codeString))
1594          return new Enumeration<DataType>(this, DataType.QUANTITY);
1595        if ("Range".equals(codeString))
1596          return new Enumeration<DataType>(this, DataType.RANGE);
1597        if ("Ratio".equals(codeString))
1598          return new Enumeration<DataType>(this, DataType.RATIO);
1599        if ("Reference".equals(codeString))
1600          return new Enumeration<DataType>(this, DataType.REFERENCE);
1601        if ("SampledData".equals(codeString))
1602          return new Enumeration<DataType>(this, DataType.SAMPLEDDATA);
1603        if ("Signature".equals(codeString))
1604          return new Enumeration<DataType>(this, DataType.SIGNATURE);
1605        if ("SimpleQuantity".equals(codeString))
1606          return new Enumeration<DataType>(this, DataType.SIMPLEQUANTITY);
1607        if ("Timing".equals(codeString))
1608          return new Enumeration<DataType>(this, DataType.TIMING);
1609        if ("base64Binary".equals(codeString))
1610          return new Enumeration<DataType>(this, DataType.BASE64BINARY);
1611        if ("boolean".equals(codeString))
1612          return new Enumeration<DataType>(this, DataType.BOOLEAN);
1613        if ("code".equals(codeString))
1614          return new Enumeration<DataType>(this, DataType.CODE);
1615        if ("date".equals(codeString))
1616          return new Enumeration<DataType>(this, DataType.DATE);
1617        if ("dateTime".equals(codeString))
1618          return new Enumeration<DataType>(this, DataType.DATETIME);
1619        if ("decimal".equals(codeString))
1620          return new Enumeration<DataType>(this, DataType.DECIMAL);
1621        if ("id".equals(codeString))
1622          return new Enumeration<DataType>(this, DataType.ID);
1623        if ("instant".equals(codeString))
1624          return new Enumeration<DataType>(this, DataType.INSTANT);
1625        if ("integer".equals(codeString))
1626          return new Enumeration<DataType>(this, DataType.INTEGER);
1627        if ("markdown".equals(codeString))
1628          return new Enumeration<DataType>(this, DataType.MARKDOWN);
1629        if ("oid".equals(codeString))
1630          return new Enumeration<DataType>(this, DataType.OID);
1631        if ("positiveInt".equals(codeString))
1632          return new Enumeration<DataType>(this, DataType.POSITIVEINT);
1633        if ("string".equals(codeString))
1634          return new Enumeration<DataType>(this, DataType.STRING);
1635        if ("time".equals(codeString))
1636          return new Enumeration<DataType>(this, DataType.TIME);
1637        if ("unsignedInt".equals(codeString))
1638          return new Enumeration<DataType>(this, DataType.UNSIGNEDINT);
1639        if ("uri".equals(codeString))
1640          return new Enumeration<DataType>(this, DataType.URI);
1641        if ("uuid".equals(codeString))
1642          return new Enumeration<DataType>(this, DataType.UUID);
1643        if ("xhtml".equals(codeString))
1644          return new Enumeration<DataType>(this, DataType.XHTML);
1645        throw new FHIRException("Unknown DataType code '"+codeString+"'");
1646        }
1647    public String toCode(DataType code) {
1648      if (code == DataType.ADDRESS)
1649        return "Address";
1650      if (code == DataType.AGE)
1651        return "Age";
1652      if (code == DataType.ANNOTATION)
1653        return "Annotation";
1654      if (code == DataType.ATTACHMENT)
1655        return "Attachment";
1656      if (code == DataType.BACKBONEELEMENT)
1657        return "BackboneElement";
1658      if (code == DataType.CODEABLECONCEPT)
1659        return "CodeableConcept";
1660      if (code == DataType.CODING)
1661        return "Coding";
1662      if (code == DataType.CONTACTPOINT)
1663        return "ContactPoint";
1664      if (code == DataType.COUNT)
1665        return "Count";
1666      if (code == DataType.DISTANCE)
1667        return "Distance";
1668      if (code == DataType.DURATION)
1669        return "Duration";
1670      if (code == DataType.ELEMENT)
1671        return "Element";
1672      if (code == DataType.ELEMENTDEFINITION)
1673        return "ElementDefinition";
1674      if (code == DataType.EXTENSION)
1675        return "Extension";
1676      if (code == DataType.HUMANNAME)
1677        return "HumanName";
1678      if (code == DataType.IDENTIFIER)
1679        return "Identifier";
1680      if (code == DataType.META)
1681        return "Meta";
1682      if (code == DataType.MONEY)
1683        return "Money";
1684      if (code == DataType.NARRATIVE)
1685        return "Narrative";
1686      if (code == DataType.PERIOD)
1687        return "Period";
1688      if (code == DataType.QUANTITY)
1689        return "Quantity";
1690      if (code == DataType.RANGE)
1691        return "Range";
1692      if (code == DataType.RATIO)
1693        return "Ratio";
1694      if (code == DataType.REFERENCE)
1695        return "Reference";
1696      if (code == DataType.SAMPLEDDATA)
1697        return "SampledData";
1698      if (code == DataType.SIGNATURE)
1699        return "Signature";
1700      if (code == DataType.SIMPLEQUANTITY)
1701        return "SimpleQuantity";
1702      if (code == DataType.TIMING)
1703        return "Timing";
1704      if (code == DataType.BASE64BINARY)
1705        return "base64Binary";
1706      if (code == DataType.BOOLEAN)
1707        return "boolean";
1708      if (code == DataType.CODE)
1709        return "code";
1710      if (code == DataType.DATE)
1711        return "date";
1712      if (code == DataType.DATETIME)
1713        return "dateTime";
1714      if (code == DataType.DECIMAL)
1715        return "decimal";
1716      if (code == DataType.ID)
1717        return "id";
1718      if (code == DataType.INSTANT)
1719        return "instant";
1720      if (code == DataType.INTEGER)
1721        return "integer";
1722      if (code == DataType.MARKDOWN)
1723        return "markdown";
1724      if (code == DataType.OID)
1725        return "oid";
1726      if (code == DataType.POSITIVEINT)
1727        return "positiveInt";
1728      if (code == DataType.STRING)
1729        return "string";
1730      if (code == DataType.TIME)
1731        return "time";
1732      if (code == DataType.UNSIGNEDINT)
1733        return "unsignedInt";
1734      if (code == DataType.URI)
1735        return "uri";
1736      if (code == DataType.UUID)
1737        return "uuid";
1738      if (code == DataType.XHTML)
1739        return "xhtml";
1740      return "?";
1741      }
1742    }
1743
1744    public enum DocumentReferenceStatus {
1745        /**
1746         * This is the current reference for this document.
1747         */
1748        CURRENT, 
1749        /**
1750         * This reference has been superseded by another reference.
1751         */
1752        SUPERSEDED, 
1753        /**
1754         * This reference was created in error.
1755         */
1756        ENTEREDINERROR, 
1757        /**
1758         * added to help the parsers
1759         */
1760        NULL;
1761        public static DocumentReferenceStatus fromCode(String codeString) throws FHIRException {
1762            if (codeString == null || "".equals(codeString))
1763                return null;
1764        if ("current".equals(codeString))
1765          return CURRENT;
1766        if ("superseded".equals(codeString))
1767          return SUPERSEDED;
1768        if ("entered-in-error".equals(codeString))
1769          return ENTEREDINERROR;
1770        throw new FHIRException("Unknown DocumentReferenceStatus code '"+codeString+"'");
1771        }
1772        public String toCode() {
1773          switch (this) {
1774            case CURRENT: return "current";
1775            case SUPERSEDED: return "superseded";
1776            case ENTEREDINERROR: return "entered-in-error";
1777            case NULL: return null;
1778            default: return "?";
1779          }
1780        }
1781        public String getSystem() {
1782          switch (this) {
1783            case CURRENT: return "http://hl7.org/fhir/document-reference-status";
1784            case SUPERSEDED: return "http://hl7.org/fhir/document-reference-status";
1785            case ENTEREDINERROR: return "http://hl7.org/fhir/document-reference-status";
1786            case NULL: return null;
1787            default: return "?";
1788          }
1789        }
1790        public String getDefinition() {
1791          switch (this) {
1792            case CURRENT: return "This is the current reference for this document.";
1793            case SUPERSEDED: return "This reference has been superseded by another reference.";
1794            case ENTEREDINERROR: return "This reference was created in error.";
1795            case NULL: return null;
1796            default: return "?";
1797          }
1798        }
1799        public String getDisplay() {
1800          switch (this) {
1801            case CURRENT: return "Current";
1802            case SUPERSEDED: return "Superseded";
1803            case ENTEREDINERROR: return "Entered in Error";
1804            case NULL: return null;
1805            default: return "?";
1806          }
1807        }
1808    }
1809
1810  public static class DocumentReferenceStatusEnumFactory implements EnumFactory<DocumentReferenceStatus> {
1811    public DocumentReferenceStatus fromCode(String codeString) throws IllegalArgumentException {
1812      if (codeString == null || "".equals(codeString))
1813            if (codeString == null || "".equals(codeString))
1814                return null;
1815        if ("current".equals(codeString))
1816          return DocumentReferenceStatus.CURRENT;
1817        if ("superseded".equals(codeString))
1818          return DocumentReferenceStatus.SUPERSEDED;
1819        if ("entered-in-error".equals(codeString))
1820          return DocumentReferenceStatus.ENTEREDINERROR;
1821        throw new IllegalArgumentException("Unknown DocumentReferenceStatus code '"+codeString+"'");
1822        }
1823        public Enumeration<DocumentReferenceStatus> fromType(Base code) throws FHIRException {
1824          if (code == null || code.isEmpty())
1825            return null;
1826          String codeString = ((PrimitiveType) code).asStringValue();
1827          if (codeString == null || "".equals(codeString))
1828            return null;
1829        if ("current".equals(codeString))
1830          return new Enumeration<DocumentReferenceStatus>(this, DocumentReferenceStatus.CURRENT);
1831        if ("superseded".equals(codeString))
1832          return new Enumeration<DocumentReferenceStatus>(this, DocumentReferenceStatus.SUPERSEDED);
1833        if ("entered-in-error".equals(codeString))
1834          return new Enumeration<DocumentReferenceStatus>(this, DocumentReferenceStatus.ENTEREDINERROR);
1835        throw new FHIRException("Unknown DocumentReferenceStatus code '"+codeString+"'");
1836        }
1837    public String toCode(DocumentReferenceStatus code) {
1838      if (code == DocumentReferenceStatus.CURRENT)
1839        return "current";
1840      if (code == DocumentReferenceStatus.SUPERSEDED)
1841        return "superseded";
1842      if (code == DocumentReferenceStatus.ENTEREDINERROR)
1843        return "entered-in-error";
1844      return "?";
1845      }
1846    }
1847
1848    public enum FHIRDefinedType {
1849        /**
1850         * There is a variety of postal address formats defined around the world. This format defines a superset that is the basis for all addresses around the world.
1851         */
1852        ADDRESS, 
1853        /**
1854         * null
1855         */
1856        AGE, 
1857        /**
1858         * A  text note which also  contains information about who made the statement and when.
1859         */
1860        ANNOTATION, 
1861        /**
1862         * For referring to data content defined in other formats.
1863         */
1864        ATTACHMENT, 
1865        /**
1866         * Base definition for all elements that are defined inside a resource - but not those in a data type.
1867         */
1868        BACKBONEELEMENT, 
1869        /**
1870         * A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text.
1871         */
1872        CODEABLECONCEPT, 
1873        /**
1874         * A reference to a code defined by a terminology system.
1875         */
1876        CODING, 
1877        /**
1878         * Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc.
1879         */
1880        CONTACTPOINT, 
1881        /**
1882         * null
1883         */
1884        COUNT, 
1885        /**
1886         * null
1887         */
1888        DISTANCE, 
1889        /**
1890         * null
1891         */
1892        DURATION, 
1893        /**
1894         * Base definition for all elements in a resource.
1895         */
1896        ELEMENT, 
1897        /**
1898         * Captures constraints on each element within the resource, profile, or extension.
1899         */
1900        ELEMENTDEFINITION, 
1901        /**
1902         * Optional Extensions Element - found in all resources.
1903         */
1904        EXTENSION, 
1905        /**
1906         * A human's name with the ability to identify parts and usage.
1907         */
1908        HUMANNAME, 
1909        /**
1910         * A technical identifier - identifies some entity uniquely and unambiguously.
1911         */
1912        IDENTIFIER, 
1913        /**
1914         * The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource.
1915         */
1916        META, 
1917        /**
1918         * null
1919         */
1920        MONEY, 
1921        /**
1922         * A human-readable formatted text, including images.
1923         */
1924        NARRATIVE, 
1925        /**
1926         * A time period defined by a start and end date and optionally time.
1927         */
1928        PERIOD, 
1929        /**
1930         * 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.
1931         */
1932        QUANTITY, 
1933        /**
1934         * A set of ordered Quantities defined by a low and high limit.
1935         */
1936        RANGE, 
1937        /**
1938         * A relationship of two Quantity values - expressed as a numerator and a denominator.
1939         */
1940        RATIO, 
1941        /**
1942         * A reference from one resource to another.
1943         */
1944        REFERENCE, 
1945        /**
1946         * A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data.
1947         */
1948        SAMPLEDDATA, 
1949        /**
1950         * A digital signature along with supporting context. The signature may be electronic/cryptographic in nature, or a graphical image representing a hand-written signature, or a signature process. Different Signature approaches have different utilities.
1951         */
1952        SIGNATURE, 
1953        /**
1954         * null
1955         */
1956        SIMPLEQUANTITY, 
1957        /**
1958         * Specifies an event that may occur multiple times. Timing schedules are used to record when things are 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.
1959         */
1960        TIMING, 
1961        /**
1962         * A stream of bytes
1963         */
1964        BASE64BINARY, 
1965        /**
1966         * Value of "true" or "false"
1967         */
1968        BOOLEAN, 
1969        /**
1970         * 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
1971         */
1972        CODE, 
1973        /**
1974         * A date or partial date (e.g. just year or year + month). There is no time zone. The format is a union of the schema types gYear, gYearMonth and date.  Dates SHALL be valid dates.
1975         */
1976        DATE, 
1977        /**
1978         * A date, date-time or partial date (e.g. just year or year + month).  If hours and minutes are specified, a time zone 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.
1979         */
1980        DATETIME, 
1981        /**
1982         * A rational number with implicit precision
1983         */
1984        DECIMAL, 
1985        /**
1986         * 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.
1987         */
1988        ID, 
1989        /**
1990         * An instant in time - known at least to the second
1991         */
1992        INSTANT, 
1993        /**
1994         * A whole number
1995         */
1996        INTEGER, 
1997        /**
1998         * A string that may contain markdown syntax for optional processing by a mark down presentation engine
1999         */
2000        MARKDOWN, 
2001        /**
2002         * An oid represented as a URI
2003         */
2004        OID, 
2005        /**
2006         * An integer with a value that is positive (e.g. >0)
2007         */
2008        POSITIVEINT, 
2009        /**
2010         * A sequence of Unicode characters
2011         */
2012        STRING, 
2013        /**
2014         * A time during the day, with no date specified
2015         */
2016        TIME, 
2017        /**
2018         * An integer with a value that is not negative (e.g. >= 0)
2019         */
2020        UNSIGNEDINT, 
2021        /**
2022         * String of characters used to identify a name or a resource
2023         */
2024        URI, 
2025        /**
2026         * A UUID, represented as a URI
2027         */
2028        UUID, 
2029        /**
2030         * XHTML format, as defined by W3C, but restricted usage (mainly, no active content)
2031         */
2032        XHTML, 
2033        /**
2034         * A financial tool for tracking value accrued for a particular purpose.  In the healthcare field, used to track charges for a patient, cost centres, etc.
2035         */
2036        ACCOUNT, 
2037        /**
2038         * Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance.
2039         */
2040        ALLERGYINTOLERANCE, 
2041        /**
2042         * 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).
2043         */
2044        APPOINTMENT, 
2045        /**
2046         * A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection.
2047         */
2048        APPOINTMENTRESPONSE, 
2049        /**
2050         * A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.
2051         */
2052        AUDITEVENT, 
2053        /**
2054         * 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.
2055         */
2056        BASIC, 
2057        /**
2058         * A binary resource can contain any content, whether text, image, pdf, zip archive, etc.
2059         */
2060        BINARY, 
2061        /**
2062         * Record details about the anatomical location of a specimen or body part.  This resource may be used when a coded concept does not provide the necessary detail needed for the use case.
2063         */
2064        BODYSITE, 
2065        /**
2066         * A container for a collection of resources.
2067         */
2068        BUNDLE, 
2069        /**
2070         * 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.
2071         */
2072        CAREPLAN, 
2073        /**
2074         * A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.
2075         */
2076        CLAIM, 
2077        /**
2078         * This resource provides the adjudication details from the processing of a Claim resource.
2079         */
2080        CLAIMRESPONSE, 
2081        /**
2082         * 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.
2083         */
2084        CLINICALIMPRESSION, 
2085        /**
2086         * An occurrence of information being transmitted; e.g. an alert that was sent to a responsible provider, a public health agency was notified about a reportable condition.
2087         */
2088        COMMUNICATION, 
2089        /**
2090         * 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.
2091         */
2092        COMMUNICATIONREQUEST, 
2093        /**
2094         * A set of healthcare-related information that is assembled together into a single logical document 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. While a Composition defines the structure, it does not actually contain the content: rather the full content of a document is contained in a Bundle, of which the Composition is the first resource contained.
2095         */
2096        COMPOSITION, 
2097        /**
2098         * A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models.
2099         */
2100        CONCEPTMAP, 
2101        /**
2102         * Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a diagnosis during an encounter; populating a problem list or a summary statement, such as a discharge summary.
2103         */
2104        CONDITION, 
2105        /**
2106         * A conformance statement is a set of capabilities of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.
2107         */
2108        CONFORMANCE, 
2109        /**
2110         * A formal agreement between parties regarding the conduct of business, exchange of information or other matters.
2111         */
2112        CONTRACT, 
2113        /**
2114         * Financial instrument which may be used to pay for or reimburse health care products and services.
2115         */
2116        COVERAGE, 
2117        /**
2118         * The formal description of a single piece of information that can be gathered and reported.
2119         */
2120        DATAELEMENT, 
2121        /**
2122         * 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, etc.
2123         */
2124        DETECTEDISSUE, 
2125        /**
2126         * This resource identifies an instance of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device.  Medical devices includes durable (reusable) medical equipment, implantable devices, as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health.  Non-medical devices may include items such as a machine, cellphone, computer, application, etc.
2127         */
2128        DEVICE, 
2129        /**
2130         * Describes the characteristics, operational status and capabilities of a medical-related component of a medical device.
2131         */
2132        DEVICECOMPONENT, 
2133        /**
2134         * Describes a measurement, calculation or setting capability of a medical device.
2135         */
2136        DEVICEMETRIC, 
2137        /**
2138         * Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker.
2139         */
2140        DEVICEUSEREQUEST, 
2141        /**
2142         * A record of a device being used by a patient where the record is the result of a report from the patient or another clinician.
2143         */
2144        DEVICEUSESTATEMENT, 
2145        /**
2146         * A record of a request for a diagnostic investigation service to be performed.
2147         */
2148        DIAGNOSTICORDER, 
2149        /**
2150         * The findings and interpretation of diagnostic  tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretations, and formatted representation of diagnostic reports.
2151         */
2152        DIAGNOSTICREPORT, 
2153        /**
2154         * A manifest that defines a set of documents.
2155         */
2156        DOCUMENTMANIFEST, 
2157        /**
2158         * A reference to a document .
2159         */
2160        DOCUMENTREFERENCE, 
2161        /**
2162         * --- Abstract Type! ---A resource that includes narrative, extensions, and contained resources.
2163         */
2164        DOMAINRESOURCE, 
2165        /**
2166         * This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service.
2167         */
2168        ELIGIBILITYREQUEST, 
2169        /**
2170         * This resource provides eligibility and plan details from the processing of an Eligibility resource.
2171         */
2172        ELIGIBILITYRESPONSE, 
2173        /**
2174         * An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.
2175         */
2176        ENCOUNTER, 
2177        /**
2178         * This resource provides the insurance enrollment details to the insurer regarding a specified coverage.
2179         */
2180        ENROLLMENTREQUEST, 
2181        /**
2182         * This resource provides enrollment and plan details from the processing of an Enrollment resource.
2183         */
2184        ENROLLMENTRESPONSE, 
2185        /**
2186         * 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.
2187         */
2188        EPISODEOFCARE, 
2189        /**
2190         * 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.
2191         */
2192        EXPLANATIONOFBENEFIT, 
2193        /**
2194         * Significant health events and conditions for a person related to the patient relevant in the context of care for the patient.
2195         */
2196        FAMILYMEMBERHISTORY, 
2197        /**
2198         * Prospective warnings of potential issues when providing care to the patient.
2199         */
2200        FLAG, 
2201        /**
2202         * 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.
2203         */
2204        GOAL, 
2205        /**
2206         * 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.
2207         */
2208        GROUP, 
2209        /**
2210         * The details of a healthcare service available at a location.
2211         */
2212        HEALTHCARESERVICE, 
2213        /**
2214         * A manifest of a set of DICOM Service-Object Pair Instances (SOP Instances).  The referenced SOP Instances (images or other content) are for a single patient, and may be from one or more studies. The referenced SOP Instances have been selected for a purpose, such as quality assurance, conference, or consult. Reflecting that range of purposes, typical ImagingObjectSelection resources may include all SOP Instances in a study (perhaps for sharing through a Health Information Exchange); key images from multiple studies (for reference by a referring or treating physician); a multi-frame ultrasound instance ("cine" video clip) and a set of measurements taken from that instance (for inclusion in a teaching file); and so on.
2215         */
2216        IMAGINGOBJECTSELECTION, 
2217        /**
2218         * 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.
2219         */
2220        IMAGINGSTUDY, 
2221        /**
2222         * Describes the event of a patient being administered a vaccination or a record of a vaccination as reported by a patient, a clinician or another party and may include vaccine reaction information and what vaccination protocol was followed.
2223         */
2224        IMMUNIZATION, 
2225        /**
2226         * A patient's point-in-time immunization and recommendation (i.e. forecasting a patient's immunization eligibility according to a published schedule) with optional supporting justification.
2227         */
2228        IMMUNIZATIONRECOMMENDATION, 
2229        /**
2230         * A set of rules or how FHIR is used to solve a particular problem. 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.
2231         */
2232        IMPLEMENTATIONGUIDE, 
2233        /**
2234         * A set of information summarized from a list of other resources.
2235         */
2236        LIST, 
2237        /**
2238         * Details and position information for a physical place where services are provided  and resources and participants may be stored, found, contained or accommodated.
2239         */
2240        LOCATION, 
2241        /**
2242         * A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference.
2243         */
2244        MEDIA, 
2245        /**
2246         * This resource is primarily used for the identification and definition of a medication. It covers the ingredients and the packaging for a medication.
2247         */
2248        MEDICATION, 
2249        /**
2250         * 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.
2251         */
2252        MEDICATIONADMINISTRATION, 
2253        /**
2254         * 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.
2255         */
2256        MEDICATIONDISPENSE, 
2257        /**
2258         * An order for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called "MedicationOrder" rather than "MedicationPrescription" to generalize the use across inpatient and outpatient settings as well as for care plans, etc.
2259         */
2260        MEDICATIONORDER, 
2261        /**
2262         * 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 e.g. the patient's memory, from a prescription bottle,  or from a list of medications the patient, clinician or other party maintains 
2263
2264The primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication.  A medication statement 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.
2265         */
2266        MEDICATIONSTATEMENT, 
2267        /**
2268         * 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.
2269         */
2270        MESSAGEHEADER, 
2271        /**
2272         * 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.
2273         */
2274        NAMINGSYSTEM, 
2275        /**
2276         * A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.
2277         */
2278        NUTRITIONORDER, 
2279        /**
2280         * Measurements and simple assertions made about a patient, device or other subject.
2281         */
2282        OBSERVATION, 
2283        /**
2284         * A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction).
2285         */
2286        OPERATIONDEFINITION, 
2287        /**
2288         * A collection of error, warning or information messages that result from a system action.
2289         */
2290        OPERATIONOUTCOME, 
2291        /**
2292         * A request to perform an action.
2293         */
2294        ORDER, 
2295        /**
2296         * A response to an order.
2297         */
2298        ORDERRESPONSE, 
2299        /**
2300         * 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, etc.
2301         */
2302        ORGANIZATION, 
2303        /**
2304         * This special resource type is used to represent an operation request and response (operations.html). It has no other use, and there is no RESTful endpoint associated with it.
2305         */
2306        PARAMETERS, 
2307        /**
2308         * Demographics and other administrative information about an individual or animal receiving care or other health-related services.
2309         */
2310        PATIENT, 
2311        /**
2312         * This resource provides the status of the payment for goods and services rendered, and the request and response resource references.
2313         */
2314        PAYMENTNOTICE, 
2315        /**
2316         * This resource provides payment details and claim references supporting a bulk payment.
2317         */
2318        PAYMENTRECONCILIATION, 
2319        /**
2320         * Demographics and administrative information about a person independent of a specific health-related context.
2321         */
2322        PERSON, 
2323        /**
2324         * A person who is directly or indirectly involved in the provisioning of healthcare.
2325         */
2326        PRACTITIONER, 
2327        /**
2328         * An action that is or was performed on a patient. This can be a physical intervention like an operation, or less invasive like counseling or hypnotherapy.
2329         */
2330        PROCEDURE, 
2331        /**
2332         * A request for a procedure to be performed. May be a proposal or an order.
2333         */
2334        PROCEDUREREQUEST, 
2335        /**
2336         * This resource provides the target, request and response, and action details for an action to be performed by the target on or about existing resources.
2337         */
2338        PROCESSREQUEST, 
2339        /**
2340         * This resource provides processing status, errors and notes from the processing of a resource.
2341         */
2342        PROCESSRESPONSE, 
2343        /**
2344         * 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.
2345         */
2346        PROVENANCE, 
2347        /**
2348         * A structured set of questions intended to guide the collection of answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions.
2349         */
2350        QUESTIONNAIRE, 
2351        /**
2352         * 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 underlying questions.
2353         */
2354        QUESTIONNAIRERESPONSE, 
2355        /**
2356         * Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organization.
2357         */
2358        REFERRALREQUEST, 
2359        /**
2360         * Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process.
2361         */
2362        RELATEDPERSON, 
2363        /**
2364         * --- Abstract Type! ---This is the base resource type for everything.
2365         */
2366        RESOURCE, 
2367        /**
2368         * An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome.
2369         */
2370        RISKASSESSMENT, 
2371        /**
2372         * A container for slot(s) of time that may be available for booking appointments.
2373         */
2374        SCHEDULE, 
2375        /**
2376         * A search parameter that defines a named search item that can be used to search/filter on a resource.
2377         */
2378        SEARCHPARAMETER, 
2379        /**
2380         * A slot of time on a schedule that may be available for booking appointments.
2381         */
2382        SLOT, 
2383        /**
2384         * A sample to be used for analysis.
2385         */
2386        SPECIMEN, 
2387        /**
2388         * 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.
2389         */
2390        STRUCTUREDEFINITION, 
2391        /**
2392         * The subscription resource is used to define a push based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined "channel" so that another system is able to take an appropriate action.
2393         */
2394        SUBSCRIPTION, 
2395        /**
2396         * A homogeneous material with a definite composition.
2397         */
2398        SUBSTANCE, 
2399        /**
2400         * Record of delivery of what is supplied.
2401         */
2402        SUPPLYDELIVERY, 
2403        /**
2404         * A record of a request for a medication, substance or device used in the healthcare setting.
2405         */
2406        SUPPLYREQUEST, 
2407        /**
2408         * TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine compliance against the FHIR specification.
2409         */
2410        TESTSCRIPT, 
2411        /**
2412         * A value set specifies a set of codes drawn from one or more code systems.
2413         */
2414        VALUESET, 
2415        /**
2416         * An authorization for the supply of glasses and/or contact lenses to a patient.
2417         */
2418        VISIONPRESCRIPTION, 
2419        /**
2420         * added to help the parsers
2421         */
2422        NULL;
2423        public static FHIRDefinedType fromCode(String codeString) throws FHIRException {
2424            if (codeString == null || "".equals(codeString))
2425                return null;
2426        if ("Address".equals(codeString))
2427          return ADDRESS;
2428        if ("Age".equals(codeString))
2429          return AGE;
2430        if ("Annotation".equals(codeString))
2431          return ANNOTATION;
2432        if ("Attachment".equals(codeString))
2433          return ATTACHMENT;
2434        if ("BackboneElement".equals(codeString))
2435          return BACKBONEELEMENT;
2436        if ("CodeableConcept".equals(codeString))
2437          return CODEABLECONCEPT;
2438        if ("Coding".equals(codeString))
2439          return CODING;
2440        if ("ContactPoint".equals(codeString))
2441          return CONTACTPOINT;
2442        if ("Count".equals(codeString))
2443          return COUNT;
2444        if ("Distance".equals(codeString))
2445          return DISTANCE;
2446        if ("Duration".equals(codeString))
2447          return DURATION;
2448        if ("Element".equals(codeString))
2449          return ELEMENT;
2450        if ("ElementDefinition".equals(codeString))
2451          return ELEMENTDEFINITION;
2452        if ("Extension".equals(codeString))
2453          return EXTENSION;
2454        if ("HumanName".equals(codeString))
2455          return HUMANNAME;
2456        if ("Identifier".equals(codeString))
2457          return IDENTIFIER;
2458        if ("Meta".equals(codeString))
2459          return META;
2460        if ("Money".equals(codeString))
2461          return MONEY;
2462        if ("Narrative".equals(codeString))
2463          return NARRATIVE;
2464        if ("Period".equals(codeString))
2465          return PERIOD;
2466        if ("Quantity".equals(codeString))
2467          return QUANTITY;
2468        if ("Range".equals(codeString))
2469          return RANGE;
2470        if ("Ratio".equals(codeString))
2471          return RATIO;
2472        if ("Reference".equals(codeString))
2473          return REFERENCE;
2474        if ("SampledData".equals(codeString))
2475          return SAMPLEDDATA;
2476        if ("Signature".equals(codeString))
2477          return SIGNATURE;
2478        if ("SimpleQuantity".equals(codeString))
2479          return SIMPLEQUANTITY;
2480        if ("Timing".equals(codeString))
2481          return TIMING;
2482        if ("base64Binary".equals(codeString))
2483          return BASE64BINARY;
2484        if ("boolean".equals(codeString))
2485          return BOOLEAN;
2486        if ("code".equals(codeString))
2487          return CODE;
2488        if ("date".equals(codeString))
2489          return DATE;
2490        if ("dateTime".equals(codeString))
2491          return DATETIME;
2492        if ("decimal".equals(codeString))
2493          return DECIMAL;
2494        if ("id".equals(codeString))
2495          return ID;
2496        if ("instant".equals(codeString))
2497          return INSTANT;
2498        if ("integer".equals(codeString))
2499          return INTEGER;
2500        if ("markdown".equals(codeString))
2501          return MARKDOWN;
2502        if ("oid".equals(codeString))
2503          return OID;
2504        if ("positiveInt".equals(codeString))
2505          return POSITIVEINT;
2506        if ("string".equals(codeString))
2507          return STRING;
2508        if ("time".equals(codeString))
2509          return TIME;
2510        if ("unsignedInt".equals(codeString))
2511          return UNSIGNEDINT;
2512        if ("uri".equals(codeString))
2513          return URI;
2514        if ("uuid".equals(codeString))
2515          return UUID;
2516        if ("xhtml".equals(codeString))
2517          return XHTML;
2518        if ("Account".equals(codeString))
2519          return ACCOUNT;
2520        if ("AllergyIntolerance".equals(codeString))
2521          return ALLERGYINTOLERANCE;
2522        if ("Appointment".equals(codeString))
2523          return APPOINTMENT;
2524        if ("AppointmentResponse".equals(codeString))
2525          return APPOINTMENTRESPONSE;
2526        if ("AuditEvent".equals(codeString))
2527          return AUDITEVENT;
2528        if ("Basic".equals(codeString))
2529          return BASIC;
2530        if ("Binary".equals(codeString))
2531          return BINARY;
2532        if ("BodySite".equals(codeString))
2533          return BODYSITE;
2534        if ("Bundle".equals(codeString))
2535          return BUNDLE;
2536        if ("CarePlan".equals(codeString))
2537          return CAREPLAN;
2538        if ("Claim".equals(codeString))
2539          return CLAIM;
2540        if ("ClaimResponse".equals(codeString))
2541          return CLAIMRESPONSE;
2542        if ("ClinicalImpression".equals(codeString))
2543          return CLINICALIMPRESSION;
2544        if ("Communication".equals(codeString))
2545          return COMMUNICATION;
2546        if ("CommunicationRequest".equals(codeString))
2547          return COMMUNICATIONREQUEST;
2548        if ("Composition".equals(codeString))
2549          return COMPOSITION;
2550        if ("ConceptMap".equals(codeString))
2551          return CONCEPTMAP;
2552        if ("Condition".equals(codeString))
2553          return CONDITION;
2554        if ("Conformance".equals(codeString))
2555          return CONFORMANCE;
2556        if ("Contract".equals(codeString))
2557          return CONTRACT;
2558        if ("Coverage".equals(codeString))
2559          return COVERAGE;
2560        if ("DataElement".equals(codeString))
2561          return DATAELEMENT;
2562        if ("DetectedIssue".equals(codeString))
2563          return DETECTEDISSUE;
2564        if ("Device".equals(codeString))
2565          return DEVICE;
2566        if ("DeviceComponent".equals(codeString))
2567          return DEVICECOMPONENT;
2568        if ("DeviceMetric".equals(codeString))
2569          return DEVICEMETRIC;
2570        if ("DeviceUseRequest".equals(codeString))
2571          return DEVICEUSEREQUEST;
2572        if ("DeviceUseStatement".equals(codeString))
2573          return DEVICEUSESTATEMENT;
2574        if ("DiagnosticOrder".equals(codeString))
2575          return DIAGNOSTICORDER;
2576        if ("DiagnosticReport".equals(codeString))
2577          return DIAGNOSTICREPORT;
2578        if ("DocumentManifest".equals(codeString))
2579          return DOCUMENTMANIFEST;
2580        if ("DocumentReference".equals(codeString))
2581          return DOCUMENTREFERENCE;
2582        if ("DomainResource".equals(codeString))
2583          return DOMAINRESOURCE;
2584        if ("EligibilityRequest".equals(codeString))
2585          return ELIGIBILITYREQUEST;
2586        if ("EligibilityResponse".equals(codeString))
2587          return ELIGIBILITYRESPONSE;
2588        if ("Encounter".equals(codeString))
2589          return ENCOUNTER;
2590        if ("EnrollmentRequest".equals(codeString))
2591          return ENROLLMENTREQUEST;
2592        if ("EnrollmentResponse".equals(codeString))
2593          return ENROLLMENTRESPONSE;
2594        if ("EpisodeOfCare".equals(codeString))
2595          return EPISODEOFCARE;
2596        if ("ExplanationOfBenefit".equals(codeString))
2597          return EXPLANATIONOFBENEFIT;
2598        if ("FamilyMemberHistory".equals(codeString))
2599          return FAMILYMEMBERHISTORY;
2600        if ("Flag".equals(codeString))
2601          return FLAG;
2602        if ("Goal".equals(codeString))
2603          return GOAL;
2604        if ("Group".equals(codeString))
2605          return GROUP;
2606        if ("HealthcareService".equals(codeString))
2607          return HEALTHCARESERVICE;
2608        if ("ImagingObjectSelection".equals(codeString))
2609          return IMAGINGOBJECTSELECTION;
2610        if ("ImagingStudy".equals(codeString))
2611          return IMAGINGSTUDY;
2612        if ("Immunization".equals(codeString))
2613          return IMMUNIZATION;
2614        if ("ImmunizationRecommendation".equals(codeString))
2615          return IMMUNIZATIONRECOMMENDATION;
2616        if ("ImplementationGuide".equals(codeString))
2617          return IMPLEMENTATIONGUIDE;
2618        if ("List".equals(codeString))
2619          return LIST;
2620        if ("Location".equals(codeString))
2621          return LOCATION;
2622        if ("Media".equals(codeString))
2623          return MEDIA;
2624        if ("Medication".equals(codeString))
2625          return MEDICATION;
2626        if ("MedicationAdministration".equals(codeString))
2627          return MEDICATIONADMINISTRATION;
2628        if ("MedicationDispense".equals(codeString))
2629          return MEDICATIONDISPENSE;
2630        if ("MedicationOrder".equals(codeString))
2631          return MEDICATIONORDER;
2632        if ("MedicationStatement".equals(codeString))
2633          return MEDICATIONSTATEMENT;
2634        if ("MessageHeader".equals(codeString))
2635          return MESSAGEHEADER;
2636        if ("NamingSystem".equals(codeString))
2637          return NAMINGSYSTEM;
2638        if ("NutritionOrder".equals(codeString))
2639          return NUTRITIONORDER;
2640        if ("Observation".equals(codeString))
2641          return OBSERVATION;
2642        if ("OperationDefinition".equals(codeString))
2643          return OPERATIONDEFINITION;
2644        if ("OperationOutcome".equals(codeString))
2645          return OPERATIONOUTCOME;
2646        if ("Order".equals(codeString))
2647          return ORDER;
2648        if ("OrderResponse".equals(codeString))
2649          return ORDERRESPONSE;
2650        if ("Organization".equals(codeString))
2651          return ORGANIZATION;
2652        if ("Parameters".equals(codeString))
2653          return PARAMETERS;
2654        if ("Patient".equals(codeString))
2655          return PATIENT;
2656        if ("PaymentNotice".equals(codeString))
2657          return PAYMENTNOTICE;
2658        if ("PaymentReconciliation".equals(codeString))
2659          return PAYMENTRECONCILIATION;
2660        if ("Person".equals(codeString))
2661          return PERSON;
2662        if ("Practitioner".equals(codeString))
2663          return PRACTITIONER;
2664        if ("Procedure".equals(codeString))
2665          return PROCEDURE;
2666        if ("ProcedureRequest".equals(codeString))
2667          return PROCEDUREREQUEST;
2668        if ("ProcessRequest".equals(codeString))
2669          return PROCESSREQUEST;
2670        if ("ProcessResponse".equals(codeString))
2671          return PROCESSRESPONSE;
2672        if ("Provenance".equals(codeString))
2673          return PROVENANCE;
2674        if ("Questionnaire".equals(codeString))
2675          return QUESTIONNAIRE;
2676        if ("QuestionnaireResponse".equals(codeString))
2677          return QUESTIONNAIRERESPONSE;
2678        if ("ReferralRequest".equals(codeString))
2679          return REFERRALREQUEST;
2680        if ("RelatedPerson".equals(codeString))
2681          return RELATEDPERSON;
2682        if ("Resource".equals(codeString))
2683          return RESOURCE;
2684        if ("RiskAssessment".equals(codeString))
2685          return RISKASSESSMENT;
2686        if ("Schedule".equals(codeString))
2687          return SCHEDULE;
2688        if ("SearchParameter".equals(codeString))
2689          return SEARCHPARAMETER;
2690        if ("Slot".equals(codeString))
2691          return SLOT;
2692        if ("Specimen".equals(codeString))
2693          return SPECIMEN;
2694        if ("StructureDefinition".equals(codeString))
2695          return STRUCTUREDEFINITION;
2696        if ("Subscription".equals(codeString))
2697          return SUBSCRIPTION;
2698        if ("Substance".equals(codeString))
2699          return SUBSTANCE;
2700        if ("SupplyDelivery".equals(codeString))
2701          return SUPPLYDELIVERY;
2702        if ("SupplyRequest".equals(codeString))
2703          return SUPPLYREQUEST;
2704        if ("TestScript".equals(codeString))
2705          return TESTSCRIPT;
2706        if ("ValueSet".equals(codeString))
2707          return VALUESET;
2708        if ("VisionPrescription".equals(codeString))
2709          return VISIONPRESCRIPTION;
2710        throw new FHIRException("Unknown FHIRDefinedType code '"+codeString+"'");
2711        }
2712        public String toCode() {
2713          switch (this) {
2714            case ADDRESS: return "Address";
2715            case AGE: return "Age";
2716            case ANNOTATION: return "Annotation";
2717            case ATTACHMENT: return "Attachment";
2718            case BACKBONEELEMENT: return "BackboneElement";
2719            case CODEABLECONCEPT: return "CodeableConcept";
2720            case CODING: return "Coding";
2721            case CONTACTPOINT: return "ContactPoint";
2722            case COUNT: return "Count";
2723            case DISTANCE: return "Distance";
2724            case DURATION: return "Duration";
2725            case ELEMENT: return "Element";
2726            case ELEMENTDEFINITION: return "ElementDefinition";
2727            case EXTENSION: return "Extension";
2728            case HUMANNAME: return "HumanName";
2729            case IDENTIFIER: return "Identifier";
2730            case META: return "Meta";
2731            case MONEY: return "Money";
2732            case NARRATIVE: return "Narrative";
2733            case PERIOD: return "Period";
2734            case QUANTITY: return "Quantity";
2735            case RANGE: return "Range";
2736            case RATIO: return "Ratio";
2737            case REFERENCE: return "Reference";
2738            case SAMPLEDDATA: return "SampledData";
2739            case SIGNATURE: return "Signature";
2740            case SIMPLEQUANTITY: return "SimpleQuantity";
2741            case TIMING: return "Timing";
2742            case BASE64BINARY: return "base64Binary";
2743            case BOOLEAN: return "boolean";
2744            case CODE: return "code";
2745            case DATE: return "date";
2746            case DATETIME: return "dateTime";
2747            case DECIMAL: return "decimal";
2748            case ID: return "id";
2749            case INSTANT: return "instant";
2750            case INTEGER: return "integer";
2751            case MARKDOWN: return "markdown";
2752            case OID: return "oid";
2753            case POSITIVEINT: return "positiveInt";
2754            case STRING: return "string";
2755            case TIME: return "time";
2756            case UNSIGNEDINT: return "unsignedInt";
2757            case URI: return "uri";
2758            case UUID: return "uuid";
2759            case XHTML: return "xhtml";
2760            case ACCOUNT: return "Account";
2761            case ALLERGYINTOLERANCE: return "AllergyIntolerance";
2762            case APPOINTMENT: return "Appointment";
2763            case APPOINTMENTRESPONSE: return "AppointmentResponse";
2764            case AUDITEVENT: return "AuditEvent";
2765            case BASIC: return "Basic";
2766            case BINARY: return "Binary";
2767            case BODYSITE: return "BodySite";
2768            case BUNDLE: return "Bundle";
2769            case CAREPLAN: return "CarePlan";
2770            case CLAIM: return "Claim";
2771            case CLAIMRESPONSE: return "ClaimResponse";
2772            case CLINICALIMPRESSION: return "ClinicalImpression";
2773            case COMMUNICATION: return "Communication";
2774            case COMMUNICATIONREQUEST: return "CommunicationRequest";
2775            case COMPOSITION: return "Composition";
2776            case CONCEPTMAP: return "ConceptMap";
2777            case CONDITION: return "Condition";
2778            case CONFORMANCE: return "Conformance";
2779            case CONTRACT: return "Contract";
2780            case COVERAGE: return "Coverage";
2781            case DATAELEMENT: return "DataElement";
2782            case DETECTEDISSUE: return "DetectedIssue";
2783            case DEVICE: return "Device";
2784            case DEVICECOMPONENT: return "DeviceComponent";
2785            case DEVICEMETRIC: return "DeviceMetric";
2786            case DEVICEUSEREQUEST: return "DeviceUseRequest";
2787            case DEVICEUSESTATEMENT: return "DeviceUseStatement";
2788            case DIAGNOSTICORDER: return "DiagnosticOrder";
2789            case DIAGNOSTICREPORT: return "DiagnosticReport";
2790            case DOCUMENTMANIFEST: return "DocumentManifest";
2791            case DOCUMENTREFERENCE: return "DocumentReference";
2792            case DOMAINRESOURCE: return "DomainResource";
2793            case ELIGIBILITYREQUEST: return "EligibilityRequest";
2794            case ELIGIBILITYRESPONSE: return "EligibilityResponse";
2795            case ENCOUNTER: return "Encounter";
2796            case ENROLLMENTREQUEST: return "EnrollmentRequest";
2797            case ENROLLMENTRESPONSE: return "EnrollmentResponse";
2798            case EPISODEOFCARE: return "EpisodeOfCare";
2799            case EXPLANATIONOFBENEFIT: return "ExplanationOfBenefit";
2800            case FAMILYMEMBERHISTORY: return "FamilyMemberHistory";
2801            case FLAG: return "Flag";
2802            case GOAL: return "Goal";
2803            case GROUP: return "Group";
2804            case HEALTHCARESERVICE: return "HealthcareService";
2805            case IMAGINGOBJECTSELECTION: return "ImagingObjectSelection";
2806            case IMAGINGSTUDY: return "ImagingStudy";
2807            case IMMUNIZATION: return "Immunization";
2808            case IMMUNIZATIONRECOMMENDATION: return "ImmunizationRecommendation";
2809            case IMPLEMENTATIONGUIDE: return "ImplementationGuide";
2810            case LIST: return "List";
2811            case LOCATION: return "Location";
2812            case MEDIA: return "Media";
2813            case MEDICATION: return "Medication";
2814            case MEDICATIONADMINISTRATION: return "MedicationAdministration";
2815            case MEDICATIONDISPENSE: return "MedicationDispense";
2816            case MEDICATIONORDER: return "MedicationOrder";
2817            case MEDICATIONSTATEMENT: return "MedicationStatement";
2818            case MESSAGEHEADER: return "MessageHeader";
2819            case NAMINGSYSTEM: return "NamingSystem";
2820            case NUTRITIONORDER: return "NutritionOrder";
2821            case OBSERVATION: return "Observation";
2822            case OPERATIONDEFINITION: return "OperationDefinition";
2823            case OPERATIONOUTCOME: return "OperationOutcome";
2824            case ORDER: return "Order";
2825            case ORDERRESPONSE: return "OrderResponse";
2826            case ORGANIZATION: return "Organization";
2827            case PARAMETERS: return "Parameters";
2828            case PATIENT: return "Patient";
2829            case PAYMENTNOTICE: return "PaymentNotice";
2830            case PAYMENTRECONCILIATION: return "PaymentReconciliation";
2831            case PERSON: return "Person";
2832            case PRACTITIONER: return "Practitioner";
2833            case PROCEDURE: return "Procedure";
2834            case PROCEDUREREQUEST: return "ProcedureRequest";
2835            case PROCESSREQUEST: return "ProcessRequest";
2836            case PROCESSRESPONSE: return "ProcessResponse";
2837            case PROVENANCE: return "Provenance";
2838            case QUESTIONNAIRE: return "Questionnaire";
2839            case QUESTIONNAIRERESPONSE: return "QuestionnaireResponse";
2840            case REFERRALREQUEST: return "ReferralRequest";
2841            case RELATEDPERSON: return "RelatedPerson";
2842            case RESOURCE: return "Resource";
2843            case RISKASSESSMENT: return "RiskAssessment";
2844            case SCHEDULE: return "Schedule";
2845            case SEARCHPARAMETER: return "SearchParameter";
2846            case SLOT: return "Slot";
2847            case SPECIMEN: return "Specimen";
2848            case STRUCTUREDEFINITION: return "StructureDefinition";
2849            case SUBSCRIPTION: return "Subscription";
2850            case SUBSTANCE: return "Substance";
2851            case SUPPLYDELIVERY: return "SupplyDelivery";
2852            case SUPPLYREQUEST: return "SupplyRequest";
2853            case TESTSCRIPT: return "TestScript";
2854            case VALUESET: return "ValueSet";
2855            case VISIONPRESCRIPTION: return "VisionPrescription";
2856            case NULL: return null;
2857            default: return "?";
2858          }
2859        }
2860        public String getSystem() {
2861          switch (this) {
2862            case ADDRESS: return "http://hl7.org/fhir/data-types";
2863            case AGE: return "http://hl7.org/fhir/data-types";
2864            case ANNOTATION: return "http://hl7.org/fhir/data-types";
2865            case ATTACHMENT: return "http://hl7.org/fhir/data-types";
2866            case BACKBONEELEMENT: return "http://hl7.org/fhir/data-types";
2867            case CODEABLECONCEPT: return "http://hl7.org/fhir/data-types";
2868            case CODING: return "http://hl7.org/fhir/data-types";
2869            case CONTACTPOINT: return "http://hl7.org/fhir/data-types";
2870            case COUNT: return "http://hl7.org/fhir/data-types";
2871            case DISTANCE: return "http://hl7.org/fhir/data-types";
2872            case DURATION: return "http://hl7.org/fhir/data-types";
2873            case ELEMENT: return "http://hl7.org/fhir/data-types";
2874            case ELEMENTDEFINITION: return "http://hl7.org/fhir/data-types";
2875            case EXTENSION: return "http://hl7.org/fhir/data-types";
2876            case HUMANNAME: return "http://hl7.org/fhir/data-types";
2877            case IDENTIFIER: return "http://hl7.org/fhir/data-types";
2878            case META: return "http://hl7.org/fhir/data-types";
2879            case MONEY: return "http://hl7.org/fhir/data-types";
2880            case NARRATIVE: return "http://hl7.org/fhir/data-types";
2881            case PERIOD: return "http://hl7.org/fhir/data-types";
2882            case QUANTITY: return "http://hl7.org/fhir/data-types";
2883            case RANGE: return "http://hl7.org/fhir/data-types";
2884            case RATIO: return "http://hl7.org/fhir/data-types";
2885            case REFERENCE: return "http://hl7.org/fhir/data-types";
2886            case SAMPLEDDATA: return "http://hl7.org/fhir/data-types";
2887            case SIGNATURE: return "http://hl7.org/fhir/data-types";
2888            case SIMPLEQUANTITY: return "http://hl7.org/fhir/data-types";
2889            case TIMING: return "http://hl7.org/fhir/data-types";
2890            case BASE64BINARY: return "http://hl7.org/fhir/data-types";
2891            case BOOLEAN: return "http://hl7.org/fhir/data-types";
2892            case CODE: return "http://hl7.org/fhir/data-types";
2893            case DATE: return "http://hl7.org/fhir/data-types";
2894            case DATETIME: return "http://hl7.org/fhir/data-types";
2895            case DECIMAL: return "http://hl7.org/fhir/data-types";
2896            case ID: return "http://hl7.org/fhir/data-types";
2897            case INSTANT: return "http://hl7.org/fhir/data-types";
2898            case INTEGER: return "http://hl7.org/fhir/data-types";
2899            case MARKDOWN: return "http://hl7.org/fhir/data-types";
2900            case OID: return "http://hl7.org/fhir/data-types";
2901            case POSITIVEINT: return "http://hl7.org/fhir/data-types";
2902            case STRING: return "http://hl7.org/fhir/data-types";
2903            case TIME: return "http://hl7.org/fhir/data-types";
2904            case UNSIGNEDINT: return "http://hl7.org/fhir/data-types";
2905            case URI: return "http://hl7.org/fhir/data-types";
2906            case UUID: return "http://hl7.org/fhir/data-types";
2907            case XHTML: return "http://hl7.org/fhir/data-types";
2908            case ACCOUNT: return "http://hl7.org/fhir/resource-types";
2909            case ALLERGYINTOLERANCE: return "http://hl7.org/fhir/resource-types";
2910            case APPOINTMENT: return "http://hl7.org/fhir/resource-types";
2911            case APPOINTMENTRESPONSE: return "http://hl7.org/fhir/resource-types";
2912            case AUDITEVENT: return "http://hl7.org/fhir/resource-types";
2913            case BASIC: return "http://hl7.org/fhir/resource-types";
2914            case BINARY: return "http://hl7.org/fhir/resource-types";
2915            case BODYSITE: return "http://hl7.org/fhir/resource-types";
2916            case BUNDLE: return "http://hl7.org/fhir/resource-types";
2917            case CAREPLAN: return "http://hl7.org/fhir/resource-types";
2918            case CLAIM: return "http://hl7.org/fhir/resource-types";
2919            case CLAIMRESPONSE: return "http://hl7.org/fhir/resource-types";
2920            case CLINICALIMPRESSION: return "http://hl7.org/fhir/resource-types";
2921            case COMMUNICATION: return "http://hl7.org/fhir/resource-types";
2922            case COMMUNICATIONREQUEST: return "http://hl7.org/fhir/resource-types";
2923            case COMPOSITION: return "http://hl7.org/fhir/resource-types";
2924            case CONCEPTMAP: return "http://hl7.org/fhir/resource-types";
2925            case CONDITION: return "http://hl7.org/fhir/resource-types";
2926            case CONFORMANCE: return "http://hl7.org/fhir/resource-types";
2927            case CONTRACT: return "http://hl7.org/fhir/resource-types";
2928            case COVERAGE: return "http://hl7.org/fhir/resource-types";
2929            case DATAELEMENT: return "http://hl7.org/fhir/resource-types";
2930            case DETECTEDISSUE: return "http://hl7.org/fhir/resource-types";
2931            case DEVICE: return "http://hl7.org/fhir/resource-types";
2932            case DEVICECOMPONENT: return "http://hl7.org/fhir/resource-types";
2933            case DEVICEMETRIC: return "http://hl7.org/fhir/resource-types";
2934            case DEVICEUSEREQUEST: return "http://hl7.org/fhir/resource-types";
2935            case DEVICEUSESTATEMENT: return "http://hl7.org/fhir/resource-types";
2936            case DIAGNOSTICORDER: return "http://hl7.org/fhir/resource-types";
2937            case DIAGNOSTICREPORT: return "http://hl7.org/fhir/resource-types";
2938            case DOCUMENTMANIFEST: return "http://hl7.org/fhir/resource-types";
2939            case DOCUMENTREFERENCE: return "http://hl7.org/fhir/resource-types";
2940            case DOMAINRESOURCE: return "http://hl7.org/fhir/resource-types";
2941            case ELIGIBILITYREQUEST: return "http://hl7.org/fhir/resource-types";
2942            case ELIGIBILITYRESPONSE: return "http://hl7.org/fhir/resource-types";
2943            case ENCOUNTER: return "http://hl7.org/fhir/resource-types";
2944            case ENROLLMENTREQUEST: return "http://hl7.org/fhir/resource-types";
2945            case ENROLLMENTRESPONSE: return "http://hl7.org/fhir/resource-types";
2946            case EPISODEOFCARE: return "http://hl7.org/fhir/resource-types";
2947            case EXPLANATIONOFBENEFIT: return "http://hl7.org/fhir/resource-types";
2948            case FAMILYMEMBERHISTORY: return "http://hl7.org/fhir/resource-types";
2949            case FLAG: return "http://hl7.org/fhir/resource-types";
2950            case GOAL: return "http://hl7.org/fhir/resource-types";
2951            case GROUP: return "http://hl7.org/fhir/resource-types";
2952            case HEALTHCARESERVICE: return "http://hl7.org/fhir/resource-types";
2953            case IMAGINGOBJECTSELECTION: return "http://hl7.org/fhir/resource-types";
2954            case IMAGINGSTUDY: return "http://hl7.org/fhir/resource-types";
2955            case IMMUNIZATION: return "http://hl7.org/fhir/resource-types";
2956            case IMMUNIZATIONRECOMMENDATION: return "http://hl7.org/fhir/resource-types";
2957            case IMPLEMENTATIONGUIDE: return "http://hl7.org/fhir/resource-types";
2958            case LIST: return "http://hl7.org/fhir/resource-types";
2959            case LOCATION: return "http://hl7.org/fhir/resource-types";
2960            case MEDIA: return "http://hl7.org/fhir/resource-types";
2961            case MEDICATION: return "http://hl7.org/fhir/resource-types";
2962            case MEDICATIONADMINISTRATION: return "http://hl7.org/fhir/resource-types";
2963            case MEDICATIONDISPENSE: return "http://hl7.org/fhir/resource-types";
2964            case MEDICATIONORDER: return "http://hl7.org/fhir/resource-types";
2965            case MEDICATIONSTATEMENT: return "http://hl7.org/fhir/resource-types";
2966            case MESSAGEHEADER: return "http://hl7.org/fhir/resource-types";
2967            case NAMINGSYSTEM: return "http://hl7.org/fhir/resource-types";
2968            case NUTRITIONORDER: return "http://hl7.org/fhir/resource-types";
2969            case OBSERVATION: return "http://hl7.org/fhir/resource-types";
2970            case OPERATIONDEFINITION: return "http://hl7.org/fhir/resource-types";
2971            case OPERATIONOUTCOME: return "http://hl7.org/fhir/resource-types";
2972            case ORDER: return "http://hl7.org/fhir/resource-types";
2973            case ORDERRESPONSE: return "http://hl7.org/fhir/resource-types";
2974            case ORGANIZATION: return "http://hl7.org/fhir/resource-types";
2975            case PARAMETERS: return "http://hl7.org/fhir/resource-types";
2976            case PATIENT: return "http://hl7.org/fhir/resource-types";
2977            case PAYMENTNOTICE: return "http://hl7.org/fhir/resource-types";
2978            case PAYMENTRECONCILIATION: return "http://hl7.org/fhir/resource-types";
2979            case PERSON: return "http://hl7.org/fhir/resource-types";
2980            case PRACTITIONER: return "http://hl7.org/fhir/resource-types";
2981            case PROCEDURE: return "http://hl7.org/fhir/resource-types";
2982            case PROCEDUREREQUEST: return "http://hl7.org/fhir/resource-types";
2983            case PROCESSREQUEST: return "http://hl7.org/fhir/resource-types";
2984            case PROCESSRESPONSE: return "http://hl7.org/fhir/resource-types";
2985            case PROVENANCE: return "http://hl7.org/fhir/resource-types";
2986            case QUESTIONNAIRE: return "http://hl7.org/fhir/resource-types";
2987            case QUESTIONNAIRERESPONSE: return "http://hl7.org/fhir/resource-types";
2988            case REFERRALREQUEST: return "http://hl7.org/fhir/resource-types";
2989            case RELATEDPERSON: return "http://hl7.org/fhir/resource-types";
2990            case RESOURCE: return "http://hl7.org/fhir/resource-types";
2991            case RISKASSESSMENT: return "http://hl7.org/fhir/resource-types";
2992            case SCHEDULE: return "http://hl7.org/fhir/resource-types";
2993            case SEARCHPARAMETER: return "http://hl7.org/fhir/resource-types";
2994            case SLOT: return "http://hl7.org/fhir/resource-types";
2995            case SPECIMEN: return "http://hl7.org/fhir/resource-types";
2996            case STRUCTUREDEFINITION: return "http://hl7.org/fhir/resource-types";
2997            case SUBSCRIPTION: return "http://hl7.org/fhir/resource-types";
2998            case SUBSTANCE: return "http://hl7.org/fhir/resource-types";
2999            case SUPPLYDELIVERY: return "http://hl7.org/fhir/resource-types";
3000            case SUPPLYREQUEST: return "http://hl7.org/fhir/resource-types";
3001            case TESTSCRIPT: return "http://hl7.org/fhir/resource-types";
3002            case VALUESET: return "http://hl7.org/fhir/resource-types";
3003            case VISIONPRESCRIPTION: return "http://hl7.org/fhir/resource-types";
3004            case NULL: return null;
3005            default: return "?";
3006          }
3007        }
3008        public String getDefinition() {
3009          switch (this) {
3010            case ADDRESS: return "There is a variety of postal address formats defined around the world. This format defines a superset that is the basis for all addresses around the world.";
3011            case AGE: return "";
3012            case ANNOTATION: return "A  text note which also  contains information about who made the statement and when.";
3013            case ATTACHMENT: return "For referring to data content defined in other formats.";
3014            case BACKBONEELEMENT: return "Base definition for all elements that are defined inside a resource - but not those in a data type.";
3015            case CODEABLECONCEPT: return "A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text.";
3016            case CODING: return "A reference to a code defined by a terminology system.";
3017            case CONTACTPOINT: return "Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc.";
3018            case COUNT: return "";
3019            case DISTANCE: return "";
3020            case DURATION: return "";
3021            case ELEMENT: return "Base definition for all elements in a resource.";
3022            case ELEMENTDEFINITION: return "Captures constraints on each element within the resource, profile, or extension.";
3023            case EXTENSION: return "Optional Extensions Element - found in all resources.";
3024            case HUMANNAME: return "A human's name with the ability to identify parts and usage.";
3025            case IDENTIFIER: return "A technical identifier - identifies some entity uniquely and unambiguously.";
3026            case META: return "The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource.";
3027            case MONEY: return "";
3028            case NARRATIVE: return "A human-readable formatted text, including images.";
3029            case PERIOD: return "A time period defined by a start and end date and optionally time.";
3030            case QUANTITY: return "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.";
3031            case RANGE: return "A set of ordered Quantities defined by a low and high limit.";
3032            case RATIO: return "A relationship of two Quantity values - expressed as a numerator and a denominator.";
3033            case REFERENCE: return "A reference from one resource to another.";
3034            case SAMPLEDDATA: return "A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data.";
3035            case SIGNATURE: return "A digital signature along with supporting context. The signature may be electronic/cryptographic in nature, or a graphical image representing a hand-written signature, or a signature process. Different Signature approaches have different utilities.";
3036            case SIMPLEQUANTITY: return "";
3037            case TIMING: return "Specifies an event that may occur multiple times. Timing schedules are used to record when things are 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.";
3038            case BASE64BINARY: return "A stream of bytes";
3039            case BOOLEAN: return "Value of \"true\" or \"false\"";
3040            case CODE: return "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";
3041            case DATE: return "A date or partial date (e.g. just year or year + month). There is no time zone. The format is a union of the schema types gYear, gYearMonth and date.  Dates SHALL be valid dates.";
3042            case DATETIME: return "A date, date-time or partial date (e.g. just year or year + month).  If hours and minutes are specified, a time zone 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.";
3043            case DECIMAL: return "A rational number with implicit precision";
3044            case ID: return "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.";
3045            case INSTANT: return "An instant in time - known at least to the second";
3046            case INTEGER: return "A whole number";
3047            case MARKDOWN: return "A string that may contain markdown syntax for optional processing by a mark down presentation engine";
3048            case OID: return "An oid represented as a URI";
3049            case POSITIVEINT: return "An integer with a value that is positive (e.g. >0)";
3050            case STRING: return "A sequence of Unicode characters";
3051            case TIME: return "A time during the day, with no date specified";
3052            case UNSIGNEDINT: return "An integer with a value that is not negative (e.g. >= 0)";
3053            case URI: return "String of characters used to identify a name or a resource";
3054            case UUID: return "A UUID, represented as a URI";
3055            case XHTML: return "XHTML format, as defined by W3C, but restricted usage (mainly, no active content)";
3056            case ACCOUNT: return "A financial tool for tracking value accrued for a particular purpose.  In the healthcare field, used to track charges for a patient, cost centres, etc.";
3057            case ALLERGYINTOLERANCE: return "Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance.";
3058            case APPOINTMENT: return "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).";
3059            case APPOINTMENTRESPONSE: return "A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection.";
3060            case AUDITEVENT: return "A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.";
3061            case BASIC: return "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.";
3062            case BINARY: return "A binary resource can contain any content, whether text, image, pdf, zip archive, etc.";
3063            case BODYSITE: return "Record details about the anatomical location of a specimen or body part.  This resource may be used when a coded concept does not provide the necessary detail needed for the use case.";
3064            case BUNDLE: return "A container for a collection of resources.";
3065            case CAREPLAN: return "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.";
3066            case CLAIM: return "A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.";
3067            case CLAIMRESPONSE: return "This resource provides the adjudication details from the processing of a Claim resource.";
3068            case CLINICALIMPRESSION: return "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.";
3069            case COMMUNICATION: return "An occurrence of information being transmitted; e.g. an alert that was sent to a responsible provider, a public health agency was notified about a reportable condition.";
3070            case COMMUNICATIONREQUEST: return "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.";
3071            case COMPOSITION: return "A set of healthcare-related information that is assembled together into a single logical document 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. While a Composition defines the structure, it does not actually contain the content: rather the full content of a document is contained in a Bundle, of which the Composition is the first resource contained.";
3072            case CONCEPTMAP: return "A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models.";
3073            case CONDITION: return "Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a diagnosis during an encounter; populating a problem list or a summary statement, such as a discharge summary.";
3074            case CONFORMANCE: return "A conformance statement is a set of capabilities of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.";
3075            case CONTRACT: return "A formal agreement between parties regarding the conduct of business, exchange of information or other matters.";
3076            case COVERAGE: return "Financial instrument which may be used to pay for or reimburse health care products and services.";
3077            case DATAELEMENT: return "The formal description of a single piece of information that can be gathered and reported.";
3078            case DETECTEDISSUE: return "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, etc.";
3079            case DEVICE: return "This resource identifies an instance of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device.  Medical devices includes durable (reusable) medical equipment, implantable devices, as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health.  Non-medical devices may include items such as a machine, cellphone, computer, application, etc.";
3080            case DEVICECOMPONENT: return "Describes the characteristics, operational status and capabilities of a medical-related component of a medical device.";
3081            case DEVICEMETRIC: return "Describes a measurement, calculation or setting capability of a medical device.";
3082            case DEVICEUSEREQUEST: return "Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker.";
3083            case DEVICEUSESTATEMENT: return "A record of a device being used by a patient where the record is the result of a report from the patient or another clinician.";
3084            case DIAGNOSTICORDER: return "A record of a request for a diagnostic investigation service to be performed.";
3085            case DIAGNOSTICREPORT: return "The findings and interpretation of diagnostic  tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretations, and formatted representation of diagnostic reports.";
3086            case DOCUMENTMANIFEST: return "A manifest that defines a set of documents.";
3087            case DOCUMENTREFERENCE: return "A reference to a document .";
3088            case DOMAINRESOURCE: return "--- Abstract Type! ---A resource that includes narrative, extensions, and contained resources.";
3089            case ELIGIBILITYREQUEST: return "This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service.";
3090            case ELIGIBILITYRESPONSE: return "This resource provides eligibility and plan details from the processing of an Eligibility resource.";
3091            case ENCOUNTER: return "An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.";
3092            case ENROLLMENTREQUEST: return "This resource provides the insurance enrollment details to the insurer regarding a specified coverage.";
3093            case ENROLLMENTRESPONSE: return "This resource provides enrollment and plan details from the processing of an Enrollment resource.";
3094            case EPISODEOFCARE: return "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.";
3095            case EXPLANATIONOFBENEFIT: return "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.";
3096            case FAMILYMEMBERHISTORY: return "Significant health events and conditions for a person related to the patient relevant in the context of care for the patient.";
3097            case FLAG: return "Prospective warnings of potential issues when providing care to the patient.";
3098            case GOAL: return "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.";
3099            case GROUP: return "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.";
3100            case HEALTHCARESERVICE: return "The details of a healthcare service available at a location.";
3101            case IMAGINGOBJECTSELECTION: return "A manifest of a set of DICOM Service-Object Pair Instances (SOP Instances).  The referenced SOP Instances (images or other content) are for a single patient, and may be from one or more studies. The referenced SOP Instances have been selected for a purpose, such as quality assurance, conference, or consult. Reflecting that range of purposes, typical ImagingObjectSelection resources may include all SOP Instances in a study (perhaps for sharing through a Health Information Exchange); key images from multiple studies (for reference by a referring or treating physician); a multi-frame ultrasound instance (\"cine\" video clip) and a set of measurements taken from that instance (for inclusion in a teaching file); and so on.";
3102            case IMAGINGSTUDY: return "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.";
3103            case IMMUNIZATION: return "Describes the event of a patient being administered a vaccination or a record of a vaccination as reported by a patient, a clinician or another party and may include vaccine reaction information and what vaccination protocol was followed.";
3104            case IMMUNIZATIONRECOMMENDATION: return "A patient's point-in-time immunization and recommendation (i.e. forecasting a patient's immunization eligibility according to a published schedule) with optional supporting justification.";
3105            case IMPLEMENTATIONGUIDE: return "A set of rules or how FHIR is used to solve a particular problem. 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.";
3106            case LIST: return "A set of information summarized from a list of other resources.";
3107            case LOCATION: return "Details and position information for a physical place where services are provided  and resources and participants may be stored, found, contained or accommodated.";
3108            case MEDIA: return "A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference.";
3109            case MEDICATION: return "This resource is primarily used for the identification and definition of a medication. It covers the ingredients and the packaging for a medication.";
3110            case MEDICATIONADMINISTRATION: return "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.";
3111            case MEDICATIONDISPENSE: return "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.";
3112            case MEDICATIONORDER: return "An order for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called \"MedicationOrder\" rather than \"MedicationPrescription\" to generalize the use across inpatient and outpatient settings as well as for care plans, etc.";
3113            case MEDICATIONSTATEMENT: return "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 e.g. the patient's memory, from a prescription bottle,  or from a list of medications the patient, clinician or other party maintains \r\rThe primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication.  A medication statement 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.";
3114            case MESSAGEHEADER: return "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.";
3115            case NAMINGSYSTEM: return "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.";
3116            case NUTRITIONORDER: return "A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.";
3117            case OBSERVATION: return "Measurements and simple assertions made about a patient, device or other subject.";
3118            case OPERATIONDEFINITION: return "A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction).";
3119            case OPERATIONOUTCOME: return "A collection of error, warning or information messages that result from a system action.";
3120            case ORDER: return "A request to perform an action.";
3121            case ORDERRESPONSE: return "A response to an order.";
3122            case ORGANIZATION: return "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, etc.";
3123            case PARAMETERS: return "This special resource type is used to represent an operation request and response (operations.html). It has no other use, and there is no RESTful endpoint associated with it.";
3124            case PATIENT: return "Demographics and other administrative information about an individual or animal receiving care or other health-related services.";
3125            case PAYMENTNOTICE: return "This resource provides the status of the payment for goods and services rendered, and the request and response resource references.";
3126            case PAYMENTRECONCILIATION: return "This resource provides payment details and claim references supporting a bulk payment.";
3127            case PERSON: return "Demographics and administrative information about a person independent of a specific health-related context.";
3128            case PRACTITIONER: return "A person who is directly or indirectly involved in the provisioning of healthcare.";
3129            case PROCEDURE: return "An action that is or was performed on a patient. This can be a physical intervention like an operation, or less invasive like counseling or hypnotherapy.";
3130            case PROCEDUREREQUEST: return "A request for a procedure to be performed. May be a proposal or an order.";
3131            case PROCESSREQUEST: return "This resource provides the target, request and response, and action details for an action to be performed by the target on or about existing resources.";
3132            case PROCESSRESPONSE: return "This resource provides processing status, errors and notes from the processing of a resource.";
3133            case PROVENANCE: return "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.";
3134            case QUESTIONNAIRE: return "A structured set of questions intended to guide the collection of answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions.";
3135            case QUESTIONNAIRERESPONSE: return "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 underlying questions.";
3136            case REFERRALREQUEST: return "Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organization.";
3137            case RELATEDPERSON: return "Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process.";
3138            case RESOURCE: return "--- Abstract Type! ---This is the base resource type for everything.";
3139            case RISKASSESSMENT: return "An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome.";
3140            case SCHEDULE: return "A container for slot(s) of time that may be available for booking appointments.";
3141            case SEARCHPARAMETER: return "A search parameter that defines a named search item that can be used to search/filter on a resource.";
3142            case SLOT: return "A slot of time on a schedule that may be available for booking appointments.";
3143            case SPECIMEN: return "A sample to be used for analysis.";
3144            case STRUCTUREDEFINITION: return "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.";
3145            case SUBSCRIPTION: return "The subscription resource is used to define a push based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined \"channel\" so that another system is able to take an appropriate action.";
3146            case SUBSTANCE: return "A homogeneous material with a definite composition.";
3147            case SUPPLYDELIVERY: return "Record of delivery of what is supplied.";
3148            case SUPPLYREQUEST: return "A record of a request for a medication, substance or device used in the healthcare setting.";
3149            case TESTSCRIPT: return "TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine compliance against the FHIR specification.";
3150            case VALUESET: return "A value set specifies a set of codes drawn from one or more code systems.";
3151            case VISIONPRESCRIPTION: return "An authorization for the supply of glasses and/or contact lenses to a patient.";
3152            case NULL: return null;
3153            default: return "?";
3154          }
3155        }
3156        public String getDisplay() {
3157          switch (this) {
3158            case ADDRESS: return "Address";
3159            case AGE: return "Age";
3160            case ANNOTATION: return "Annotation";
3161            case ATTACHMENT: return "Attachment";
3162            case BACKBONEELEMENT: return "BackboneElement";
3163            case CODEABLECONCEPT: return "CodeableConcept";
3164            case CODING: return "Coding";
3165            case CONTACTPOINT: return "ContactPoint";
3166            case COUNT: return "Count";
3167            case DISTANCE: return "Distance";
3168            case DURATION: return "Duration";
3169            case ELEMENT: return "Element";
3170            case ELEMENTDEFINITION: return "ElementDefinition";
3171            case EXTENSION: return "Extension";
3172            case HUMANNAME: return "HumanName";
3173            case IDENTIFIER: return "Identifier";
3174            case META: return "Meta";
3175            case MONEY: return "Money";
3176            case NARRATIVE: return "Narrative";
3177            case PERIOD: return "Period";
3178            case QUANTITY: return "Quantity";
3179            case RANGE: return "Range";
3180            case RATIO: return "Ratio";
3181            case REFERENCE: return "Reference";
3182            case SAMPLEDDATA: return "SampledData";
3183            case SIGNATURE: return "Signature";
3184            case SIMPLEQUANTITY: return "SimpleQuantity";
3185            case TIMING: return "Timing";
3186            case BASE64BINARY: return "base64Binary";
3187            case BOOLEAN: return "boolean";
3188            case CODE: return "code";
3189            case DATE: return "date";
3190            case DATETIME: return "dateTime";
3191            case DECIMAL: return "decimal";
3192            case ID: return "id";
3193            case INSTANT: return "instant";
3194            case INTEGER: return "integer";
3195            case MARKDOWN: return "markdown";
3196            case OID: return "oid";
3197            case POSITIVEINT: return "positiveInt";
3198            case STRING: return "string";
3199            case TIME: return "time";
3200            case UNSIGNEDINT: return "unsignedInt";
3201            case URI: return "uri";
3202            case UUID: return "uuid";
3203            case XHTML: return "XHTML";
3204            case ACCOUNT: return "Account";
3205            case ALLERGYINTOLERANCE: return "AllergyIntolerance";
3206            case APPOINTMENT: return "Appointment";
3207            case APPOINTMENTRESPONSE: return "AppointmentResponse";
3208            case AUDITEVENT: return "AuditEvent";
3209            case BASIC: return "Basic";
3210            case BINARY: return "Binary";
3211            case BODYSITE: return "BodySite";
3212            case BUNDLE: return "Bundle";
3213            case CAREPLAN: return "CarePlan";
3214            case CLAIM: return "Claim";
3215            case CLAIMRESPONSE: return "ClaimResponse";
3216            case CLINICALIMPRESSION: return "ClinicalImpression";
3217            case COMMUNICATION: return "Communication";
3218            case COMMUNICATIONREQUEST: return "CommunicationRequest";
3219            case COMPOSITION: return "Composition";
3220            case CONCEPTMAP: return "ConceptMap";
3221            case CONDITION: return "Condition";
3222            case CONFORMANCE: return "Conformance";
3223            case CONTRACT: return "Contract";
3224            case COVERAGE: return "Coverage";
3225            case DATAELEMENT: return "DataElement";
3226            case DETECTEDISSUE: return "DetectedIssue";
3227            case DEVICE: return "Device";
3228            case DEVICECOMPONENT: return "DeviceComponent";
3229            case DEVICEMETRIC: return "DeviceMetric";
3230            case DEVICEUSEREQUEST: return "DeviceUseRequest";
3231            case DEVICEUSESTATEMENT: return "DeviceUseStatement";
3232            case DIAGNOSTICORDER: return "DiagnosticOrder";
3233            case DIAGNOSTICREPORT: return "DiagnosticReport";
3234            case DOCUMENTMANIFEST: return "DocumentManifest";
3235            case DOCUMENTREFERENCE: return "DocumentReference";
3236            case DOMAINRESOURCE: return "DomainResource";
3237            case ELIGIBILITYREQUEST: return "EligibilityRequest";
3238            case ELIGIBILITYRESPONSE: return "EligibilityResponse";
3239            case ENCOUNTER: return "Encounter";
3240            case ENROLLMENTREQUEST: return "EnrollmentRequest";
3241            case ENROLLMENTRESPONSE: return "EnrollmentResponse";
3242            case EPISODEOFCARE: return "EpisodeOfCare";
3243            case EXPLANATIONOFBENEFIT: return "ExplanationOfBenefit";
3244            case FAMILYMEMBERHISTORY: return "FamilyMemberHistory";
3245            case FLAG: return "Flag";
3246            case GOAL: return "Goal";
3247            case GROUP: return "Group";
3248            case HEALTHCARESERVICE: return "HealthcareService";
3249            case IMAGINGOBJECTSELECTION: return "ImagingObjectSelection";
3250            case IMAGINGSTUDY: return "ImagingStudy";
3251            case IMMUNIZATION: return "Immunization";
3252            case IMMUNIZATIONRECOMMENDATION: return "ImmunizationRecommendation";
3253            case IMPLEMENTATIONGUIDE: return "ImplementationGuide";
3254            case LIST: return "List";
3255            case LOCATION: return "Location";
3256            case MEDIA: return "Media";
3257            case MEDICATION: return "Medication";
3258            case MEDICATIONADMINISTRATION: return "MedicationAdministration";
3259            case MEDICATIONDISPENSE: return "MedicationDispense";
3260            case MEDICATIONORDER: return "MedicationOrder";
3261            case MEDICATIONSTATEMENT: return "MedicationStatement";
3262            case MESSAGEHEADER: return "MessageHeader";
3263            case NAMINGSYSTEM: return "NamingSystem";
3264            case NUTRITIONORDER: return "NutritionOrder";
3265            case OBSERVATION: return "Observation";
3266            case OPERATIONDEFINITION: return "OperationDefinition";
3267            case OPERATIONOUTCOME: return "OperationOutcome";
3268            case ORDER: return "Order";
3269            case ORDERRESPONSE: return "OrderResponse";
3270            case ORGANIZATION: return "Organization";
3271            case PARAMETERS: return "Parameters";
3272            case PATIENT: return "Patient";
3273            case PAYMENTNOTICE: return "PaymentNotice";
3274            case PAYMENTRECONCILIATION: return "PaymentReconciliation";
3275            case PERSON: return "Person";
3276            case PRACTITIONER: return "Practitioner";
3277            case PROCEDURE: return "Procedure";
3278            case PROCEDUREREQUEST: return "ProcedureRequest";
3279            case PROCESSREQUEST: return "ProcessRequest";
3280            case PROCESSRESPONSE: return "ProcessResponse";
3281            case PROVENANCE: return "Provenance";
3282            case QUESTIONNAIRE: return "Questionnaire";
3283            case QUESTIONNAIRERESPONSE: return "QuestionnaireResponse";
3284            case REFERRALREQUEST: return "ReferralRequest";
3285            case RELATEDPERSON: return "RelatedPerson";
3286            case RESOURCE: return "Resource";
3287            case RISKASSESSMENT: return "RiskAssessment";
3288            case SCHEDULE: return "Schedule";
3289            case SEARCHPARAMETER: return "SearchParameter";
3290            case SLOT: return "Slot";
3291            case SPECIMEN: return "Specimen";
3292            case STRUCTUREDEFINITION: return "StructureDefinition";
3293            case SUBSCRIPTION: return "Subscription";
3294            case SUBSTANCE: return "Substance";
3295            case SUPPLYDELIVERY: return "SupplyDelivery";
3296            case SUPPLYREQUEST: return "SupplyRequest";
3297            case TESTSCRIPT: return "TestScript";
3298            case VALUESET: return "ValueSet";
3299            case VISIONPRESCRIPTION: return "VisionPrescription";
3300            case NULL: return null;
3301            default: return "?";
3302          }
3303        }
3304    }
3305
3306  public static class FHIRDefinedTypeEnumFactory implements EnumFactory<FHIRDefinedType> {
3307    public FHIRDefinedType fromCode(String codeString) throws IllegalArgumentException {
3308      if (codeString == null || "".equals(codeString))
3309            if (codeString == null || "".equals(codeString))
3310                return null;
3311        if ("Address".equals(codeString))
3312          return FHIRDefinedType.ADDRESS;
3313        if ("Age".equals(codeString))
3314          return FHIRDefinedType.AGE;
3315        if ("Annotation".equals(codeString))
3316          return FHIRDefinedType.ANNOTATION;
3317        if ("Attachment".equals(codeString))
3318          return FHIRDefinedType.ATTACHMENT;
3319        if ("BackboneElement".equals(codeString))
3320          return FHIRDefinedType.BACKBONEELEMENT;
3321        if ("CodeableConcept".equals(codeString))
3322          return FHIRDefinedType.CODEABLECONCEPT;
3323        if ("Coding".equals(codeString))
3324          return FHIRDefinedType.CODING;
3325        if ("ContactPoint".equals(codeString))
3326          return FHIRDefinedType.CONTACTPOINT;
3327        if ("Count".equals(codeString))
3328          return FHIRDefinedType.COUNT;
3329        if ("Distance".equals(codeString))
3330          return FHIRDefinedType.DISTANCE;
3331        if ("Duration".equals(codeString))
3332          return FHIRDefinedType.DURATION;
3333        if ("Element".equals(codeString))
3334          return FHIRDefinedType.ELEMENT;
3335        if ("ElementDefinition".equals(codeString))
3336          return FHIRDefinedType.ELEMENTDEFINITION;
3337        if ("Extension".equals(codeString))
3338          return FHIRDefinedType.EXTENSION;
3339        if ("HumanName".equals(codeString))
3340          return FHIRDefinedType.HUMANNAME;
3341        if ("Identifier".equals(codeString))
3342          return FHIRDefinedType.IDENTIFIER;
3343        if ("Meta".equals(codeString))
3344          return FHIRDefinedType.META;
3345        if ("Money".equals(codeString))
3346          return FHIRDefinedType.MONEY;
3347        if ("Narrative".equals(codeString))
3348          return FHIRDefinedType.NARRATIVE;
3349        if ("Period".equals(codeString))
3350          return FHIRDefinedType.PERIOD;
3351        if ("Quantity".equals(codeString))
3352          return FHIRDefinedType.QUANTITY;
3353        if ("Range".equals(codeString))
3354          return FHIRDefinedType.RANGE;
3355        if ("Ratio".equals(codeString))
3356          return FHIRDefinedType.RATIO;
3357        if ("Reference".equals(codeString))
3358          return FHIRDefinedType.REFERENCE;
3359        if ("SampledData".equals(codeString))
3360          return FHIRDefinedType.SAMPLEDDATA;
3361        if ("Signature".equals(codeString))
3362          return FHIRDefinedType.SIGNATURE;
3363        if ("SimpleQuantity".equals(codeString))
3364          return FHIRDefinedType.SIMPLEQUANTITY;
3365        if ("Timing".equals(codeString))
3366          return FHIRDefinedType.TIMING;
3367        if ("base64Binary".equals(codeString))
3368          return FHIRDefinedType.BASE64BINARY;
3369        if ("boolean".equals(codeString))
3370          return FHIRDefinedType.BOOLEAN;
3371        if ("code".equals(codeString))
3372          return FHIRDefinedType.CODE;
3373        if ("date".equals(codeString))
3374          return FHIRDefinedType.DATE;
3375        if ("dateTime".equals(codeString))
3376          return FHIRDefinedType.DATETIME;
3377        if ("decimal".equals(codeString))
3378          return FHIRDefinedType.DECIMAL;
3379        if ("id".equals(codeString))
3380          return FHIRDefinedType.ID;
3381        if ("instant".equals(codeString))
3382          return FHIRDefinedType.INSTANT;
3383        if ("integer".equals(codeString))
3384          return FHIRDefinedType.INTEGER;
3385        if ("markdown".equals(codeString))
3386          return FHIRDefinedType.MARKDOWN;
3387        if ("oid".equals(codeString))
3388          return FHIRDefinedType.OID;
3389        if ("positiveInt".equals(codeString))
3390          return FHIRDefinedType.POSITIVEINT;
3391        if ("string".equals(codeString))
3392          return FHIRDefinedType.STRING;
3393        if ("time".equals(codeString))
3394          return FHIRDefinedType.TIME;
3395        if ("unsignedInt".equals(codeString))
3396          return FHIRDefinedType.UNSIGNEDINT;
3397        if ("uri".equals(codeString))
3398          return FHIRDefinedType.URI;
3399        if ("uuid".equals(codeString))
3400          return FHIRDefinedType.UUID;
3401        if ("xhtml".equals(codeString))
3402          return FHIRDefinedType.XHTML;
3403        if ("Account".equals(codeString))
3404          return FHIRDefinedType.ACCOUNT;
3405        if ("AllergyIntolerance".equals(codeString))
3406          return FHIRDefinedType.ALLERGYINTOLERANCE;
3407        if ("Appointment".equals(codeString))
3408          return FHIRDefinedType.APPOINTMENT;
3409        if ("AppointmentResponse".equals(codeString))
3410          return FHIRDefinedType.APPOINTMENTRESPONSE;
3411        if ("AuditEvent".equals(codeString))
3412          return FHIRDefinedType.AUDITEVENT;
3413        if ("Basic".equals(codeString))
3414          return FHIRDefinedType.BASIC;
3415        if ("Binary".equals(codeString))
3416          return FHIRDefinedType.BINARY;
3417        if ("BodySite".equals(codeString))
3418          return FHIRDefinedType.BODYSITE;
3419        if ("Bundle".equals(codeString))
3420          return FHIRDefinedType.BUNDLE;
3421        if ("CarePlan".equals(codeString))
3422          return FHIRDefinedType.CAREPLAN;
3423        if ("Claim".equals(codeString))
3424          return FHIRDefinedType.CLAIM;
3425        if ("ClaimResponse".equals(codeString))
3426          return FHIRDefinedType.CLAIMRESPONSE;
3427        if ("ClinicalImpression".equals(codeString))
3428          return FHIRDefinedType.CLINICALIMPRESSION;
3429        if ("Communication".equals(codeString))
3430          return FHIRDefinedType.COMMUNICATION;
3431        if ("CommunicationRequest".equals(codeString))
3432          return FHIRDefinedType.COMMUNICATIONREQUEST;
3433        if ("Composition".equals(codeString))
3434          return FHIRDefinedType.COMPOSITION;
3435        if ("ConceptMap".equals(codeString))
3436          return FHIRDefinedType.CONCEPTMAP;
3437        if ("Condition".equals(codeString))
3438          return FHIRDefinedType.CONDITION;
3439        if ("Conformance".equals(codeString))
3440          return FHIRDefinedType.CONFORMANCE;
3441        if ("Contract".equals(codeString))
3442          return FHIRDefinedType.CONTRACT;
3443        if ("Coverage".equals(codeString))
3444          return FHIRDefinedType.COVERAGE;
3445        if ("DataElement".equals(codeString))
3446          return FHIRDefinedType.DATAELEMENT;
3447        if ("DetectedIssue".equals(codeString))
3448          return FHIRDefinedType.DETECTEDISSUE;
3449        if ("Device".equals(codeString))
3450          return FHIRDefinedType.DEVICE;
3451        if ("DeviceComponent".equals(codeString))
3452          return FHIRDefinedType.DEVICECOMPONENT;
3453        if ("DeviceMetric".equals(codeString))
3454          return FHIRDefinedType.DEVICEMETRIC;
3455        if ("DeviceUseRequest".equals(codeString))
3456          return FHIRDefinedType.DEVICEUSEREQUEST;
3457        if ("DeviceUseStatement".equals(codeString))
3458          return FHIRDefinedType.DEVICEUSESTATEMENT;
3459        if ("DiagnosticOrder".equals(codeString))
3460          return FHIRDefinedType.DIAGNOSTICORDER;
3461        if ("DiagnosticReport".equals(codeString))
3462          return FHIRDefinedType.DIAGNOSTICREPORT;
3463        if ("DocumentManifest".equals(codeString))
3464          return FHIRDefinedType.DOCUMENTMANIFEST;
3465        if ("DocumentReference".equals(codeString))
3466          return FHIRDefinedType.DOCUMENTREFERENCE;
3467        if ("DomainResource".equals(codeString))
3468          return FHIRDefinedType.DOMAINRESOURCE;
3469        if ("EligibilityRequest".equals(codeString))
3470          return FHIRDefinedType.ELIGIBILITYREQUEST;
3471        if ("EligibilityResponse".equals(codeString))
3472          return FHIRDefinedType.ELIGIBILITYRESPONSE;
3473        if ("Encounter".equals(codeString))
3474          return FHIRDefinedType.ENCOUNTER;
3475        if ("EnrollmentRequest".equals(codeString))
3476          return FHIRDefinedType.ENROLLMENTREQUEST;
3477        if ("EnrollmentResponse".equals(codeString))
3478          return FHIRDefinedType.ENROLLMENTRESPONSE;
3479        if ("EpisodeOfCare".equals(codeString))
3480          return FHIRDefinedType.EPISODEOFCARE;
3481        if ("ExplanationOfBenefit".equals(codeString))
3482          return FHIRDefinedType.EXPLANATIONOFBENEFIT;
3483        if ("FamilyMemberHistory".equals(codeString))
3484          return FHIRDefinedType.FAMILYMEMBERHISTORY;
3485        if ("Flag".equals(codeString))
3486          return FHIRDefinedType.FLAG;
3487        if ("Goal".equals(codeString))
3488          return FHIRDefinedType.GOAL;
3489        if ("Group".equals(codeString))
3490          return FHIRDefinedType.GROUP;
3491        if ("HealthcareService".equals(codeString))
3492          return FHIRDefinedType.HEALTHCARESERVICE;
3493        if ("ImagingObjectSelection".equals(codeString))
3494          return FHIRDefinedType.IMAGINGOBJECTSELECTION;
3495        if ("ImagingStudy".equals(codeString))
3496          return FHIRDefinedType.IMAGINGSTUDY;
3497        if ("Immunization".equals(codeString))
3498          return FHIRDefinedType.IMMUNIZATION;
3499        if ("ImmunizationRecommendation".equals(codeString))
3500          return FHIRDefinedType.IMMUNIZATIONRECOMMENDATION;
3501        if ("ImplementationGuide".equals(codeString))
3502          return FHIRDefinedType.IMPLEMENTATIONGUIDE;
3503        if ("List".equals(codeString))
3504          return FHIRDefinedType.LIST;
3505        if ("Location".equals(codeString))
3506          return FHIRDefinedType.LOCATION;
3507        if ("Media".equals(codeString))
3508          return FHIRDefinedType.MEDIA;
3509        if ("Medication".equals(codeString))
3510          return FHIRDefinedType.MEDICATION;
3511        if ("MedicationAdministration".equals(codeString))
3512          return FHIRDefinedType.MEDICATIONADMINISTRATION;
3513        if ("MedicationDispense".equals(codeString))
3514          return FHIRDefinedType.MEDICATIONDISPENSE;
3515        if ("MedicationOrder".equals(codeString))
3516          return FHIRDefinedType.MEDICATIONORDER;
3517        if ("MedicationStatement".equals(codeString))
3518          return FHIRDefinedType.MEDICATIONSTATEMENT;
3519        if ("MessageHeader".equals(codeString))
3520          return FHIRDefinedType.MESSAGEHEADER;
3521        if ("NamingSystem".equals(codeString))
3522          return FHIRDefinedType.NAMINGSYSTEM;
3523        if ("NutritionOrder".equals(codeString))
3524          return FHIRDefinedType.NUTRITIONORDER;
3525        if ("Observation".equals(codeString))
3526          return FHIRDefinedType.OBSERVATION;
3527        if ("OperationDefinition".equals(codeString))
3528          return FHIRDefinedType.OPERATIONDEFINITION;
3529        if ("OperationOutcome".equals(codeString))
3530          return FHIRDefinedType.OPERATIONOUTCOME;
3531        if ("Order".equals(codeString))
3532          return FHIRDefinedType.ORDER;
3533        if ("OrderResponse".equals(codeString))
3534          return FHIRDefinedType.ORDERRESPONSE;
3535        if ("Organization".equals(codeString))
3536          return FHIRDefinedType.ORGANIZATION;
3537        if ("Parameters".equals(codeString))
3538          return FHIRDefinedType.PARAMETERS;
3539        if ("Patient".equals(codeString))
3540          return FHIRDefinedType.PATIENT;
3541        if ("PaymentNotice".equals(codeString))
3542          return FHIRDefinedType.PAYMENTNOTICE;
3543        if ("PaymentReconciliation".equals(codeString))
3544          return FHIRDefinedType.PAYMENTRECONCILIATION;
3545        if ("Person".equals(codeString))
3546          return FHIRDefinedType.PERSON;
3547        if ("Practitioner".equals(codeString))
3548          return FHIRDefinedType.PRACTITIONER;
3549        if ("Procedure".equals(codeString))
3550          return FHIRDefinedType.PROCEDURE;
3551        if ("ProcedureRequest".equals(codeString))
3552          return FHIRDefinedType.PROCEDUREREQUEST;
3553        if ("ProcessRequest".equals(codeString))
3554          return FHIRDefinedType.PROCESSREQUEST;
3555        if ("ProcessResponse".equals(codeString))
3556          return FHIRDefinedType.PROCESSRESPONSE;
3557        if ("Provenance".equals(codeString))
3558          return FHIRDefinedType.PROVENANCE;
3559        if ("Questionnaire".equals(codeString))
3560          return FHIRDefinedType.QUESTIONNAIRE;
3561        if ("QuestionnaireResponse".equals(codeString))
3562          return FHIRDefinedType.QUESTIONNAIRERESPONSE;
3563        if ("ReferralRequest".equals(codeString))
3564          return FHIRDefinedType.REFERRALREQUEST;
3565        if ("RelatedPerson".equals(codeString))
3566          return FHIRDefinedType.RELATEDPERSON;
3567        if ("Resource".equals(codeString))
3568          return FHIRDefinedType.RESOURCE;
3569        if ("RiskAssessment".equals(codeString))
3570          return FHIRDefinedType.RISKASSESSMENT;
3571        if ("Schedule".equals(codeString))
3572          return FHIRDefinedType.SCHEDULE;
3573        if ("SearchParameter".equals(codeString))
3574          return FHIRDefinedType.SEARCHPARAMETER;
3575        if ("Slot".equals(codeString))
3576          return FHIRDefinedType.SLOT;
3577        if ("Specimen".equals(codeString))
3578          return FHIRDefinedType.SPECIMEN;
3579        if ("StructureDefinition".equals(codeString))
3580          return FHIRDefinedType.STRUCTUREDEFINITION;
3581        if ("Subscription".equals(codeString))
3582          return FHIRDefinedType.SUBSCRIPTION;
3583        if ("Substance".equals(codeString))
3584          return FHIRDefinedType.SUBSTANCE;
3585        if ("SupplyDelivery".equals(codeString))
3586          return FHIRDefinedType.SUPPLYDELIVERY;
3587        if ("SupplyRequest".equals(codeString))
3588          return FHIRDefinedType.SUPPLYREQUEST;
3589        if ("TestScript".equals(codeString))
3590          return FHIRDefinedType.TESTSCRIPT;
3591        if ("ValueSet".equals(codeString))
3592          return FHIRDefinedType.VALUESET;
3593        if ("VisionPrescription".equals(codeString))
3594          return FHIRDefinedType.VISIONPRESCRIPTION;
3595        throw new IllegalArgumentException("Unknown FHIRDefinedType code '"+codeString+"'");
3596        }
3597        public Enumeration<FHIRDefinedType> fromType(Base code) throws FHIRException {
3598          if (code == null || code.isEmpty())
3599            return null;
3600          String codeString = ((PrimitiveType) code).asStringValue();
3601          if (codeString == null || "".equals(codeString))
3602            return null;
3603        if ("Address".equals(codeString))
3604          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.ADDRESS);
3605        if ("Age".equals(codeString))
3606          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.AGE);
3607        if ("Annotation".equals(codeString))
3608          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.ANNOTATION);
3609        if ("Attachment".equals(codeString))
3610          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.ATTACHMENT);
3611        if ("BackboneElement".equals(codeString))
3612          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.BACKBONEELEMENT);
3613        if ("CodeableConcept".equals(codeString))
3614          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.CODEABLECONCEPT);
3615        if ("Coding".equals(codeString))
3616          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.CODING);
3617        if ("ContactPoint".equals(codeString))
3618          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.CONTACTPOINT);
3619        if ("Count".equals(codeString))
3620          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.COUNT);
3621        if ("Distance".equals(codeString))
3622          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.DISTANCE);
3623        if ("Duration".equals(codeString))
3624          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.DURATION);
3625        if ("Element".equals(codeString))
3626          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.ELEMENT);
3627        if ("ElementDefinition".equals(codeString))
3628          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.ELEMENTDEFINITION);
3629        if ("Extension".equals(codeString))
3630          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.EXTENSION);
3631        if ("HumanName".equals(codeString))
3632          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.HUMANNAME);
3633        if ("Identifier".equals(codeString))
3634          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.IDENTIFIER);
3635        if ("Meta".equals(codeString))
3636          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.META);
3637        if ("Money".equals(codeString))
3638          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.MONEY);
3639        if ("Narrative".equals(codeString))
3640          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.NARRATIVE);
3641        if ("Period".equals(codeString))
3642          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.PERIOD);
3643        if ("Quantity".equals(codeString))
3644          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.QUANTITY);
3645        if ("Range".equals(codeString))
3646          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.RANGE);
3647        if ("Ratio".equals(codeString))
3648          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.RATIO);
3649        if ("Reference".equals(codeString))
3650          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.REFERENCE);
3651        if ("SampledData".equals(codeString))
3652          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.SAMPLEDDATA);
3653        if ("Signature".equals(codeString))
3654          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.SIGNATURE);
3655        if ("SimpleQuantity".equals(codeString))
3656          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.SIMPLEQUANTITY);
3657        if ("Timing".equals(codeString))
3658          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.TIMING);
3659        if ("base64Binary".equals(codeString))
3660          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.BASE64BINARY);
3661        if ("boolean".equals(codeString))
3662          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.BOOLEAN);
3663        if ("code".equals(codeString))
3664          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.CODE);
3665        if ("date".equals(codeString))
3666          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.DATE);
3667        if ("dateTime".equals(codeString))
3668          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.DATETIME);
3669        if ("decimal".equals(codeString))
3670          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.DECIMAL);
3671        if ("id".equals(codeString))
3672          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.ID);
3673        if ("instant".equals(codeString))
3674          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.INSTANT);
3675        if ("integer".equals(codeString))
3676          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.INTEGER);
3677        if ("markdown".equals(codeString))
3678          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.MARKDOWN);
3679        if ("oid".equals(codeString))
3680          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.OID);
3681        if ("positiveInt".equals(codeString))
3682          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.POSITIVEINT);
3683        if ("string".equals(codeString))
3684          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.STRING);
3685        if ("time".equals(codeString))
3686          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.TIME);
3687        if ("unsignedInt".equals(codeString))
3688          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.UNSIGNEDINT);
3689        if ("uri".equals(codeString))
3690          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.URI);
3691        if ("uuid".equals(codeString))
3692          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.UUID);
3693        if ("xhtml".equals(codeString))
3694          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.XHTML);
3695        if ("Account".equals(codeString))
3696          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.ACCOUNT);
3697        if ("AllergyIntolerance".equals(codeString))
3698          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.ALLERGYINTOLERANCE);
3699        if ("Appointment".equals(codeString))
3700          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.APPOINTMENT);
3701        if ("AppointmentResponse".equals(codeString))
3702          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.APPOINTMENTRESPONSE);
3703        if ("AuditEvent".equals(codeString))
3704          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.AUDITEVENT);
3705        if ("Basic".equals(codeString))
3706          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.BASIC);
3707        if ("Binary".equals(codeString))
3708          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.BINARY);
3709        if ("BodySite".equals(codeString))
3710          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.BODYSITE);
3711        if ("Bundle".equals(codeString))
3712          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.BUNDLE);
3713        if ("CarePlan".equals(codeString))
3714          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.CAREPLAN);
3715        if ("Claim".equals(codeString))
3716          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.CLAIM);
3717        if ("ClaimResponse".equals(codeString))
3718          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.CLAIMRESPONSE);
3719        if ("ClinicalImpression".equals(codeString))
3720          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.CLINICALIMPRESSION);
3721        if ("Communication".equals(codeString))
3722          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.COMMUNICATION);
3723        if ("CommunicationRequest".equals(codeString))
3724          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.COMMUNICATIONREQUEST);
3725        if ("Composition".equals(codeString))
3726          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.COMPOSITION);
3727        if ("ConceptMap".equals(codeString))
3728          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.CONCEPTMAP);
3729        if ("Condition".equals(codeString))
3730          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.CONDITION);
3731        if ("Conformance".equals(codeString))
3732          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.CONFORMANCE);
3733        if ("Contract".equals(codeString))
3734          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.CONTRACT);
3735        if ("Coverage".equals(codeString))
3736          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.COVERAGE);
3737        if ("DataElement".equals(codeString))
3738          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.DATAELEMENT);
3739        if ("DetectedIssue".equals(codeString))
3740          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.DETECTEDISSUE);
3741        if ("Device".equals(codeString))
3742          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.DEVICE);
3743        if ("DeviceComponent".equals(codeString))
3744          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.DEVICECOMPONENT);
3745        if ("DeviceMetric".equals(codeString))
3746          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.DEVICEMETRIC);
3747        if ("DeviceUseRequest".equals(codeString))
3748          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.DEVICEUSEREQUEST);
3749        if ("DeviceUseStatement".equals(codeString))
3750          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.DEVICEUSESTATEMENT);
3751        if ("DiagnosticOrder".equals(codeString))
3752          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.DIAGNOSTICORDER);
3753        if ("DiagnosticReport".equals(codeString))
3754          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.DIAGNOSTICREPORT);
3755        if ("DocumentManifest".equals(codeString))
3756          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.DOCUMENTMANIFEST);
3757        if ("DocumentReference".equals(codeString))
3758          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.DOCUMENTREFERENCE);
3759        if ("DomainResource".equals(codeString))
3760          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.DOMAINRESOURCE);
3761        if ("EligibilityRequest".equals(codeString))
3762          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.ELIGIBILITYREQUEST);
3763        if ("EligibilityResponse".equals(codeString))
3764          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.ELIGIBILITYRESPONSE);
3765        if ("Encounter".equals(codeString))
3766          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.ENCOUNTER);
3767        if ("EnrollmentRequest".equals(codeString))
3768          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.ENROLLMENTREQUEST);
3769        if ("EnrollmentResponse".equals(codeString))
3770          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.ENROLLMENTRESPONSE);
3771        if ("EpisodeOfCare".equals(codeString))
3772          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.EPISODEOFCARE);
3773        if ("ExplanationOfBenefit".equals(codeString))
3774          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.EXPLANATIONOFBENEFIT);
3775        if ("FamilyMemberHistory".equals(codeString))
3776          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.FAMILYMEMBERHISTORY);
3777        if ("Flag".equals(codeString))
3778          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.FLAG);
3779        if ("Goal".equals(codeString))
3780          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.GOAL);
3781        if ("Group".equals(codeString))
3782          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.GROUP);
3783        if ("HealthcareService".equals(codeString))
3784          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.HEALTHCARESERVICE);
3785        if ("ImagingObjectSelection".equals(codeString))
3786          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.IMAGINGOBJECTSELECTION);
3787        if ("ImagingStudy".equals(codeString))
3788          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.IMAGINGSTUDY);
3789        if ("Immunization".equals(codeString))
3790          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.IMMUNIZATION);
3791        if ("ImmunizationRecommendation".equals(codeString))
3792          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.IMMUNIZATIONRECOMMENDATION);
3793        if ("ImplementationGuide".equals(codeString))
3794          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.IMPLEMENTATIONGUIDE);
3795        if ("List".equals(codeString))
3796          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.LIST);
3797        if ("Location".equals(codeString))
3798          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.LOCATION);
3799        if ("Media".equals(codeString))
3800          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.MEDIA);
3801        if ("Medication".equals(codeString))
3802          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.MEDICATION);
3803        if ("MedicationAdministration".equals(codeString))
3804          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.MEDICATIONADMINISTRATION);
3805        if ("MedicationDispense".equals(codeString))
3806          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.MEDICATIONDISPENSE);
3807        if ("MedicationOrder".equals(codeString))
3808          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.MEDICATIONORDER);
3809        if ("MedicationStatement".equals(codeString))
3810          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.MEDICATIONSTATEMENT);
3811        if ("MessageHeader".equals(codeString))
3812          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.MESSAGEHEADER);
3813        if ("NamingSystem".equals(codeString))
3814          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.NAMINGSYSTEM);
3815        if ("NutritionOrder".equals(codeString))
3816          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.NUTRITIONORDER);
3817        if ("Observation".equals(codeString))
3818          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.OBSERVATION);
3819        if ("OperationDefinition".equals(codeString))
3820          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.OPERATIONDEFINITION);
3821        if ("OperationOutcome".equals(codeString))
3822          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.OPERATIONOUTCOME);
3823        if ("Order".equals(codeString))
3824          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.ORDER);
3825        if ("OrderResponse".equals(codeString))
3826          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.ORDERRESPONSE);
3827        if ("Organization".equals(codeString))
3828          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.ORGANIZATION);
3829        if ("Parameters".equals(codeString))
3830          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.PARAMETERS);
3831        if ("Patient".equals(codeString))
3832          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.PATIENT);
3833        if ("PaymentNotice".equals(codeString))
3834          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.PAYMENTNOTICE);
3835        if ("PaymentReconciliation".equals(codeString))
3836          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.PAYMENTRECONCILIATION);
3837        if ("Person".equals(codeString))
3838          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.PERSON);
3839        if ("Practitioner".equals(codeString))
3840          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.PRACTITIONER);
3841        if ("Procedure".equals(codeString))
3842          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.PROCEDURE);
3843        if ("ProcedureRequest".equals(codeString))
3844          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.PROCEDUREREQUEST);
3845        if ("ProcessRequest".equals(codeString))
3846          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.PROCESSREQUEST);
3847        if ("ProcessResponse".equals(codeString))
3848          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.PROCESSRESPONSE);
3849        if ("Provenance".equals(codeString))
3850          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.PROVENANCE);
3851        if ("Questionnaire".equals(codeString))
3852          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.QUESTIONNAIRE);
3853        if ("QuestionnaireResponse".equals(codeString))
3854          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.QUESTIONNAIRERESPONSE);
3855        if ("ReferralRequest".equals(codeString))
3856          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.REFERRALREQUEST);
3857        if ("RelatedPerson".equals(codeString))
3858          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.RELATEDPERSON);
3859        if ("Resource".equals(codeString))
3860          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.RESOURCE);
3861        if ("RiskAssessment".equals(codeString))
3862          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.RISKASSESSMENT);
3863        if ("Schedule".equals(codeString))
3864          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.SCHEDULE);
3865        if ("SearchParameter".equals(codeString))
3866          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.SEARCHPARAMETER);
3867        if ("Slot".equals(codeString))
3868          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.SLOT);
3869        if ("Specimen".equals(codeString))
3870          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.SPECIMEN);
3871        if ("StructureDefinition".equals(codeString))
3872          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.STRUCTUREDEFINITION);
3873        if ("Subscription".equals(codeString))
3874          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.SUBSCRIPTION);
3875        if ("Substance".equals(codeString))
3876          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.SUBSTANCE);
3877        if ("SupplyDelivery".equals(codeString))
3878          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.SUPPLYDELIVERY);
3879        if ("SupplyRequest".equals(codeString))
3880          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.SUPPLYREQUEST);
3881        if ("TestScript".equals(codeString))
3882          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.TESTSCRIPT);
3883        if ("ValueSet".equals(codeString))
3884          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.VALUESET);
3885        if ("VisionPrescription".equals(codeString))
3886          return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.VISIONPRESCRIPTION);
3887        throw new FHIRException("Unknown FHIRDefinedType code '"+codeString+"'");
3888        }
3889    public String toCode(FHIRDefinedType code) {
3890      if (code == FHIRDefinedType.ADDRESS)
3891        return "Address";
3892      if (code == FHIRDefinedType.AGE)
3893        return "Age";
3894      if (code == FHIRDefinedType.ANNOTATION)
3895        return "Annotation";
3896      if (code == FHIRDefinedType.ATTACHMENT)
3897        return "Attachment";
3898      if (code == FHIRDefinedType.BACKBONEELEMENT)
3899        return "BackboneElement";
3900      if (code == FHIRDefinedType.CODEABLECONCEPT)
3901        return "CodeableConcept";
3902      if (code == FHIRDefinedType.CODING)
3903        return "Coding";
3904      if (code == FHIRDefinedType.CONTACTPOINT)
3905        return "ContactPoint";
3906      if (code == FHIRDefinedType.COUNT)
3907        return "Count";
3908      if (code == FHIRDefinedType.DISTANCE)
3909        return "Distance";
3910      if (code == FHIRDefinedType.DURATION)
3911        return "Duration";
3912      if (code == FHIRDefinedType.ELEMENT)
3913        return "Element";
3914      if (code == FHIRDefinedType.ELEMENTDEFINITION)
3915        return "ElementDefinition";
3916      if (code == FHIRDefinedType.EXTENSION)
3917        return "Extension";
3918      if (code == FHIRDefinedType.HUMANNAME)
3919        return "HumanName";
3920      if (code == FHIRDefinedType.IDENTIFIER)
3921        return "Identifier";
3922      if (code == FHIRDefinedType.META)
3923        return "Meta";
3924      if (code == FHIRDefinedType.MONEY)
3925        return "Money";
3926      if (code == FHIRDefinedType.NARRATIVE)
3927        return "Narrative";
3928      if (code == FHIRDefinedType.PERIOD)
3929        return "Period";
3930      if (code == FHIRDefinedType.QUANTITY)
3931        return "Quantity";
3932      if (code == FHIRDefinedType.RANGE)
3933        return "Range";
3934      if (code == FHIRDefinedType.RATIO)
3935        return "Ratio";
3936      if (code == FHIRDefinedType.REFERENCE)
3937        return "Reference";
3938      if (code == FHIRDefinedType.SAMPLEDDATA)
3939        return "SampledData";
3940      if (code == FHIRDefinedType.SIGNATURE)
3941        return "Signature";
3942      if (code == FHIRDefinedType.SIMPLEQUANTITY)
3943        return "SimpleQuantity";
3944      if (code == FHIRDefinedType.TIMING)
3945        return "Timing";
3946      if (code == FHIRDefinedType.BASE64BINARY)
3947        return "base64Binary";
3948      if (code == FHIRDefinedType.BOOLEAN)
3949        return "boolean";
3950      if (code == FHIRDefinedType.CODE)
3951        return "code";
3952      if (code == FHIRDefinedType.DATE)
3953        return "date";
3954      if (code == FHIRDefinedType.DATETIME)
3955        return "dateTime";
3956      if (code == FHIRDefinedType.DECIMAL)
3957        return "decimal";
3958      if (code == FHIRDefinedType.ID)
3959        return "id";
3960      if (code == FHIRDefinedType.INSTANT)
3961        return "instant";
3962      if (code == FHIRDefinedType.INTEGER)
3963        return "integer";
3964      if (code == FHIRDefinedType.MARKDOWN)
3965        return "markdown";
3966      if (code == FHIRDefinedType.OID)
3967        return "oid";
3968      if (code == FHIRDefinedType.POSITIVEINT)
3969        return "positiveInt";
3970      if (code == FHIRDefinedType.STRING)
3971        return "string";
3972      if (code == FHIRDefinedType.TIME)
3973        return "time";
3974      if (code == FHIRDefinedType.UNSIGNEDINT)
3975        return "unsignedInt";
3976      if (code == FHIRDefinedType.URI)
3977        return "uri";
3978      if (code == FHIRDefinedType.UUID)
3979        return "uuid";
3980      if (code == FHIRDefinedType.XHTML)
3981        return "xhtml";
3982      if (code == FHIRDefinedType.ACCOUNT)
3983        return "Account";
3984      if (code == FHIRDefinedType.ALLERGYINTOLERANCE)
3985        return "AllergyIntolerance";
3986      if (code == FHIRDefinedType.APPOINTMENT)
3987        return "Appointment";
3988      if (code == FHIRDefinedType.APPOINTMENTRESPONSE)
3989        return "AppointmentResponse";
3990      if (code == FHIRDefinedType.AUDITEVENT)
3991        return "AuditEvent";
3992      if (code == FHIRDefinedType.BASIC)
3993        return "Basic";
3994      if (code == FHIRDefinedType.BINARY)
3995        return "Binary";
3996      if (code == FHIRDefinedType.BODYSITE)
3997        return "BodySite";
3998      if (code == FHIRDefinedType.BUNDLE)
3999        return "Bundle";
4000      if (code == FHIRDefinedType.CAREPLAN)
4001        return "CarePlan";
4002      if (code == FHIRDefinedType.CLAIM)
4003        return "Claim";
4004      if (code == FHIRDefinedType.CLAIMRESPONSE)
4005        return "ClaimResponse";
4006      if (code == FHIRDefinedType.CLINICALIMPRESSION)
4007        return "ClinicalImpression";
4008      if (code == FHIRDefinedType.COMMUNICATION)
4009        return "Communication";
4010      if (code == FHIRDefinedType.COMMUNICATIONREQUEST)
4011        return "CommunicationRequest";
4012      if (code == FHIRDefinedType.COMPOSITION)
4013        return "Composition";
4014      if (code == FHIRDefinedType.CONCEPTMAP)
4015        return "ConceptMap";
4016      if (code == FHIRDefinedType.CONDITION)
4017        return "Condition";
4018      if (code == FHIRDefinedType.CONFORMANCE)
4019        return "Conformance";
4020      if (code == FHIRDefinedType.CONTRACT)
4021        return "Contract";
4022      if (code == FHIRDefinedType.COVERAGE)
4023        return "Coverage";
4024      if (code == FHIRDefinedType.DATAELEMENT)
4025        return "DataElement";
4026      if (code == FHIRDefinedType.DETECTEDISSUE)
4027        return "DetectedIssue";
4028      if (code == FHIRDefinedType.DEVICE)
4029        return "Device";
4030      if (code == FHIRDefinedType.DEVICECOMPONENT)
4031        return "DeviceComponent";
4032      if (code == FHIRDefinedType.DEVICEMETRIC)
4033        return "DeviceMetric";
4034      if (code == FHIRDefinedType.DEVICEUSEREQUEST)
4035        return "DeviceUseRequest";
4036      if (code == FHIRDefinedType.DEVICEUSESTATEMENT)
4037        return "DeviceUseStatement";
4038      if (code == FHIRDefinedType.DIAGNOSTICORDER)
4039        return "DiagnosticOrder";
4040      if (code == FHIRDefinedType.DIAGNOSTICREPORT)
4041        return "DiagnosticReport";
4042      if (code == FHIRDefinedType.DOCUMENTMANIFEST)
4043        return "DocumentManifest";
4044      if (code == FHIRDefinedType.DOCUMENTREFERENCE)
4045        return "DocumentReference";
4046      if (code == FHIRDefinedType.DOMAINRESOURCE)
4047        return "DomainResource";
4048      if (code == FHIRDefinedType.ELIGIBILITYREQUEST)
4049        return "EligibilityRequest";
4050      if (code == FHIRDefinedType.ELIGIBILITYRESPONSE)
4051        return "EligibilityResponse";
4052      if (code == FHIRDefinedType.ENCOUNTER)
4053        return "Encounter";
4054      if (code == FHIRDefinedType.ENROLLMENTREQUEST)
4055        return "EnrollmentRequest";
4056      if (code == FHIRDefinedType.ENROLLMENTRESPONSE)
4057        return "EnrollmentResponse";
4058      if (code == FHIRDefinedType.EPISODEOFCARE)
4059        return "EpisodeOfCare";
4060      if (code == FHIRDefinedType.EXPLANATIONOFBENEFIT)
4061        return "ExplanationOfBenefit";
4062      if (code == FHIRDefinedType.FAMILYMEMBERHISTORY)
4063        return "FamilyMemberHistory";
4064      if (code == FHIRDefinedType.FLAG)
4065        return "Flag";
4066      if (code == FHIRDefinedType.GOAL)
4067        return "Goal";
4068      if (code == FHIRDefinedType.GROUP)
4069        return "Group";
4070      if (code == FHIRDefinedType.HEALTHCARESERVICE)
4071        return "HealthcareService";
4072      if (code == FHIRDefinedType.IMAGINGOBJECTSELECTION)
4073        return "ImagingObjectSelection";
4074      if (code == FHIRDefinedType.IMAGINGSTUDY)
4075        return "ImagingStudy";
4076      if (code == FHIRDefinedType.IMMUNIZATION)
4077        return "Immunization";
4078      if (code == FHIRDefinedType.IMMUNIZATIONRECOMMENDATION)
4079        return "ImmunizationRecommendation";
4080      if (code == FHIRDefinedType.IMPLEMENTATIONGUIDE)
4081        return "ImplementationGuide";
4082      if (code == FHIRDefinedType.LIST)
4083        return "List";
4084      if (code == FHIRDefinedType.LOCATION)
4085        return "Location";
4086      if (code == FHIRDefinedType.MEDIA)
4087        return "Media";
4088      if (code == FHIRDefinedType.MEDICATION)
4089        return "Medication";
4090      if (code == FHIRDefinedType.MEDICATIONADMINISTRATION)
4091        return "MedicationAdministration";
4092      if (code == FHIRDefinedType.MEDICATIONDISPENSE)
4093        return "MedicationDispense";
4094      if (code == FHIRDefinedType.MEDICATIONORDER)
4095        return "MedicationOrder";
4096      if (code == FHIRDefinedType.MEDICATIONSTATEMENT)
4097        return "MedicationStatement";
4098      if (code == FHIRDefinedType.MESSAGEHEADER)
4099        return "MessageHeader";
4100      if (code == FHIRDefinedType.NAMINGSYSTEM)
4101        return "NamingSystem";
4102      if (code == FHIRDefinedType.NUTRITIONORDER)
4103        return "NutritionOrder";
4104      if (code == FHIRDefinedType.OBSERVATION)
4105        return "Observation";
4106      if (code == FHIRDefinedType.OPERATIONDEFINITION)
4107        return "OperationDefinition";
4108      if (code == FHIRDefinedType.OPERATIONOUTCOME)
4109        return "OperationOutcome";
4110      if (code == FHIRDefinedType.ORDER)
4111        return "Order";
4112      if (code == FHIRDefinedType.ORDERRESPONSE)
4113        return "OrderResponse";
4114      if (code == FHIRDefinedType.ORGANIZATION)
4115        return "Organization";
4116      if (code == FHIRDefinedType.PARAMETERS)
4117        return "Parameters";
4118      if (code == FHIRDefinedType.PATIENT)
4119        return "Patient";
4120      if (code == FHIRDefinedType.PAYMENTNOTICE)
4121        return "PaymentNotice";
4122      if (code == FHIRDefinedType.PAYMENTRECONCILIATION)
4123        return "PaymentReconciliation";
4124      if (code == FHIRDefinedType.PERSON)
4125        return "Person";
4126      if (code == FHIRDefinedType.PRACTITIONER)
4127        return "Practitioner";
4128      if (code == FHIRDefinedType.PROCEDURE)
4129        return "Procedure";
4130      if (code == FHIRDefinedType.PROCEDUREREQUEST)
4131        return "ProcedureRequest";
4132      if (code == FHIRDefinedType.PROCESSREQUEST)
4133        return "ProcessRequest";
4134      if (code == FHIRDefinedType.PROCESSRESPONSE)
4135        return "ProcessResponse";
4136      if (code == FHIRDefinedType.PROVENANCE)
4137        return "Provenance";
4138      if (code == FHIRDefinedType.QUESTIONNAIRE)
4139        return "Questionnaire";
4140      if (code == FHIRDefinedType.QUESTIONNAIRERESPONSE)
4141        return "QuestionnaireResponse";
4142      if (code == FHIRDefinedType.REFERRALREQUEST)
4143        return "ReferralRequest";
4144      if (code == FHIRDefinedType.RELATEDPERSON)
4145        return "RelatedPerson";
4146      if (code == FHIRDefinedType.RESOURCE)
4147        return "Resource";
4148      if (code == FHIRDefinedType.RISKASSESSMENT)
4149        return "RiskAssessment";
4150      if (code == FHIRDefinedType.SCHEDULE)
4151        return "Schedule";
4152      if (code == FHIRDefinedType.SEARCHPARAMETER)
4153        return "SearchParameter";
4154      if (code == FHIRDefinedType.SLOT)
4155        return "Slot";
4156      if (code == FHIRDefinedType.SPECIMEN)
4157        return "Specimen";
4158      if (code == FHIRDefinedType.STRUCTUREDEFINITION)
4159        return "StructureDefinition";
4160      if (code == FHIRDefinedType.SUBSCRIPTION)
4161        return "Subscription";
4162      if (code == FHIRDefinedType.SUBSTANCE)
4163        return "Substance";
4164      if (code == FHIRDefinedType.SUPPLYDELIVERY)
4165        return "SupplyDelivery";
4166      if (code == FHIRDefinedType.SUPPLYREQUEST)
4167        return "SupplyRequest";
4168      if (code == FHIRDefinedType.TESTSCRIPT)
4169        return "TestScript";
4170      if (code == FHIRDefinedType.VALUESET)
4171        return "ValueSet";
4172      if (code == FHIRDefinedType.VISIONPRESCRIPTION)
4173        return "VisionPrescription";
4174      return "?";
4175      }
4176    }
4177
4178    public enum MessageEvent {
4179        /**
4180         * Change the status of a Medication Administration to show that it is complete.
4181         */
4182        MEDICATIONADMINISTRATIONCOMPLETE, 
4183        /**
4184         * Someone wishes to record that the record of administration of a medication is in error and should be ignored.
4185         */
4186        MEDICATIONADMINISTRATIONNULLIFICATION, 
4187        /**
4188         * Indicates that a medication has been recorded against the patient's record.
4189         */
4190        MEDICATIONADMINISTRATIONRECORDING, 
4191        /**
4192         * Update a Medication Administration record.
4193         */
4194        MEDICATIONADMINISTRATIONUPDATE, 
4195        /**
4196         * Notification of a change to an administrative resource (either create or update). Note that there is no delete, though some administrative resources have status or period elements for this use.
4197         */
4198        ADMINNOTIFY, 
4199        /**
4200         * Provide a diagnostic report, or update a previously provided diagnostic report.
4201         */
4202        DIAGNOSTICREPORTPROVIDE, 
4203        /**
4204         * Provide a simple observation or update a previously provided simple observation.
4205         */
4206        OBSERVATIONPROVIDE, 
4207        /**
4208         * Notification that two patient records actually identify the same patient.
4209         */
4210        PATIENTLINK, 
4211        /**
4212         * Notification that previous advice that two patient records concern the same patient is now considered incorrect.
4213         */
4214        PATIENTUNLINK, 
4215        /**
4216         * The definition of a value set is used to create a simple collection of codes suitable for use for data entry or validation. An expanded value set will be returned, or an error message.
4217         */
4218        VALUESETEXPAND, 
4219        /**
4220         * added to help the parsers
4221         */
4222        NULL;
4223        public static MessageEvent fromCode(String codeString) throws FHIRException {
4224            if (codeString == null || "".equals(codeString))
4225                return null;
4226        if ("MedicationAdministration-Complete".equals(codeString))
4227          return MEDICATIONADMINISTRATIONCOMPLETE;
4228        if ("MedicationAdministration-Nullification".equals(codeString))
4229          return MEDICATIONADMINISTRATIONNULLIFICATION;
4230        if ("MedicationAdministration-Recording".equals(codeString))
4231          return MEDICATIONADMINISTRATIONRECORDING;
4232        if ("MedicationAdministration-Update".equals(codeString))
4233          return MEDICATIONADMINISTRATIONUPDATE;
4234        if ("admin-notify".equals(codeString))
4235          return ADMINNOTIFY;
4236        if ("diagnosticreport-provide".equals(codeString))
4237          return DIAGNOSTICREPORTPROVIDE;
4238        if ("observation-provide".equals(codeString))
4239          return OBSERVATIONPROVIDE;
4240        if ("patient-link".equals(codeString))
4241          return PATIENTLINK;
4242        if ("patient-unlink".equals(codeString))
4243          return PATIENTUNLINK;
4244        if ("valueset-expand".equals(codeString))
4245          return VALUESETEXPAND;
4246        throw new FHIRException("Unknown MessageEvent code '"+codeString+"'");
4247        }
4248        public String toCode() {
4249          switch (this) {
4250            case MEDICATIONADMINISTRATIONCOMPLETE: return "MedicationAdministration-Complete";
4251            case MEDICATIONADMINISTRATIONNULLIFICATION: return "MedicationAdministration-Nullification";
4252            case MEDICATIONADMINISTRATIONRECORDING: return "MedicationAdministration-Recording";
4253            case MEDICATIONADMINISTRATIONUPDATE: return "MedicationAdministration-Update";
4254            case ADMINNOTIFY: return "admin-notify";
4255            case DIAGNOSTICREPORTPROVIDE: return "diagnosticreport-provide";
4256            case OBSERVATIONPROVIDE: return "observation-provide";
4257            case PATIENTLINK: return "patient-link";
4258            case PATIENTUNLINK: return "patient-unlink";
4259            case VALUESETEXPAND: return "valueset-expand";
4260            case NULL: return null;
4261            default: return "?";
4262          }
4263        }
4264        public String getSystem() {
4265          switch (this) {
4266            case MEDICATIONADMINISTRATIONCOMPLETE: return "http://hl7.org/fhir/message-events";
4267            case MEDICATIONADMINISTRATIONNULLIFICATION: return "http://hl7.org/fhir/message-events";
4268            case MEDICATIONADMINISTRATIONRECORDING: return "http://hl7.org/fhir/message-events";
4269            case MEDICATIONADMINISTRATIONUPDATE: return "http://hl7.org/fhir/message-events";
4270            case ADMINNOTIFY: return "http://hl7.org/fhir/message-events";
4271            case DIAGNOSTICREPORTPROVIDE: return "http://hl7.org/fhir/message-events";
4272            case OBSERVATIONPROVIDE: return "http://hl7.org/fhir/message-events";
4273            case PATIENTLINK: return "http://hl7.org/fhir/message-events";
4274            case PATIENTUNLINK: return "http://hl7.org/fhir/message-events";
4275            case VALUESETEXPAND: return "http://hl7.org/fhir/message-events";
4276            case NULL: return null;
4277            default: return "?";
4278          }
4279        }
4280        public String getDefinition() {
4281          switch (this) {
4282            case MEDICATIONADMINISTRATIONCOMPLETE: return "Change the status of a Medication Administration to show that it is complete.";
4283            case MEDICATIONADMINISTRATIONNULLIFICATION: return "Someone wishes to record that the record of administration of a medication is in error and should be ignored.";
4284            case MEDICATIONADMINISTRATIONRECORDING: return "Indicates that a medication has been recorded against the patient's record.";
4285            case MEDICATIONADMINISTRATIONUPDATE: return "Update a Medication Administration record.";
4286            case ADMINNOTIFY: return "Notification of a change to an administrative resource (either create or update). Note that there is no delete, though some administrative resources have status or period elements for this use.";
4287            case DIAGNOSTICREPORTPROVIDE: return "Provide a diagnostic report, or update a previously provided diagnostic report.";
4288            case OBSERVATIONPROVIDE: return "Provide a simple observation or update a previously provided simple observation.";
4289            case PATIENTLINK: return "Notification that two patient records actually identify the same patient.";
4290            case PATIENTUNLINK: return "Notification that previous advice that two patient records concern the same patient is now considered incorrect.";
4291            case VALUESETEXPAND: return "The definition of a value set is used to create a simple collection of codes suitable for use for data entry or validation. An expanded value set will be returned, or an error message.";
4292            case NULL: return null;
4293            default: return "?";
4294          }
4295        }
4296        public String getDisplay() {
4297          switch (this) {
4298            case MEDICATIONADMINISTRATIONCOMPLETE: return "MedicationAdministration-Complete";
4299            case MEDICATIONADMINISTRATIONNULLIFICATION: return "MedicationAdministration-Nullification";
4300            case MEDICATIONADMINISTRATIONRECORDING: return "MedicationAdministration-Recording";
4301            case MEDICATIONADMINISTRATIONUPDATE: return "MedicationAdministration-Update";
4302            case ADMINNOTIFY: return "admin-notify";
4303            case DIAGNOSTICREPORTPROVIDE: return "diagnosticreport-provide";
4304            case OBSERVATIONPROVIDE: return "observation-provide";
4305            case PATIENTLINK: return "patient-link";
4306            case PATIENTUNLINK: return "patient-unlink";
4307            case VALUESETEXPAND: return "valueset-expand";
4308            case NULL: return null;
4309            default: return "?";
4310          }
4311        }
4312    }
4313
4314  public static class MessageEventEnumFactory implements EnumFactory<MessageEvent> {
4315    public MessageEvent fromCode(String codeString) throws IllegalArgumentException {
4316      if (codeString == null || "".equals(codeString))
4317            if (codeString == null || "".equals(codeString))
4318                return null;
4319        if ("MedicationAdministration-Complete".equals(codeString))
4320          return MessageEvent.MEDICATIONADMINISTRATIONCOMPLETE;
4321        if ("MedicationAdministration-Nullification".equals(codeString))
4322          return MessageEvent.MEDICATIONADMINISTRATIONNULLIFICATION;
4323        if ("MedicationAdministration-Recording".equals(codeString))
4324          return MessageEvent.MEDICATIONADMINISTRATIONRECORDING;
4325        if ("MedicationAdministration-Update".equals(codeString))
4326          return MessageEvent.MEDICATIONADMINISTRATIONUPDATE;
4327        if ("admin-notify".equals(codeString))
4328          return MessageEvent.ADMINNOTIFY;
4329        if ("diagnosticreport-provide".equals(codeString))
4330          return MessageEvent.DIAGNOSTICREPORTPROVIDE;
4331        if ("observation-provide".equals(codeString))
4332          return MessageEvent.OBSERVATIONPROVIDE;
4333        if ("patient-link".equals(codeString))
4334          return MessageEvent.PATIENTLINK;
4335        if ("patient-unlink".equals(codeString))
4336          return MessageEvent.PATIENTUNLINK;
4337        if ("valueset-expand".equals(codeString))
4338          return MessageEvent.VALUESETEXPAND;
4339        throw new IllegalArgumentException("Unknown MessageEvent code '"+codeString+"'");
4340        }
4341        public Enumeration<MessageEvent> fromType(Base code) throws FHIRException {
4342          if (code == null || code.isEmpty())
4343            return null;
4344          String codeString = ((PrimitiveType) code).asStringValue();
4345          if (codeString == null || "".equals(codeString))
4346            return null;
4347        if ("MedicationAdministration-Complete".equals(codeString))
4348          return new Enumeration<MessageEvent>(this, MessageEvent.MEDICATIONADMINISTRATIONCOMPLETE);
4349        if ("MedicationAdministration-Nullification".equals(codeString))
4350          return new Enumeration<MessageEvent>(this, MessageEvent.MEDICATIONADMINISTRATIONNULLIFICATION);
4351        if ("MedicationAdministration-Recording".equals(codeString))
4352          return new Enumeration<MessageEvent>(this, MessageEvent.MEDICATIONADMINISTRATIONRECORDING);
4353        if ("MedicationAdministration-Update".equals(codeString))
4354          return new Enumeration<MessageEvent>(this, MessageEvent.MEDICATIONADMINISTRATIONUPDATE);
4355        if ("admin-notify".equals(codeString))
4356          return new Enumeration<MessageEvent>(this, MessageEvent.ADMINNOTIFY);
4357        if ("diagnosticreport-provide".equals(codeString))
4358          return new Enumeration<MessageEvent>(this, MessageEvent.DIAGNOSTICREPORTPROVIDE);
4359        if ("observation-provide".equals(codeString))
4360          return new Enumeration<MessageEvent>(this, MessageEvent.OBSERVATIONPROVIDE);
4361        if ("patient-link".equals(codeString))
4362          return new Enumeration<MessageEvent>(this, MessageEvent.PATIENTLINK);
4363        if ("patient-unlink".equals(codeString))
4364          return new Enumeration<MessageEvent>(this, MessageEvent.PATIENTUNLINK);
4365        if ("valueset-expand".equals(codeString))
4366          return new Enumeration<MessageEvent>(this, MessageEvent.VALUESETEXPAND);
4367        throw new FHIRException("Unknown MessageEvent code '"+codeString+"'");
4368        }
4369    public String toCode(MessageEvent code) {
4370      if (code == MessageEvent.MEDICATIONADMINISTRATIONCOMPLETE)
4371        return "MedicationAdministration-Complete";
4372      if (code == MessageEvent.MEDICATIONADMINISTRATIONNULLIFICATION)
4373        return "MedicationAdministration-Nullification";
4374      if (code == MessageEvent.MEDICATIONADMINISTRATIONRECORDING)
4375        return "MedicationAdministration-Recording";
4376      if (code == MessageEvent.MEDICATIONADMINISTRATIONUPDATE)
4377        return "MedicationAdministration-Update";
4378      if (code == MessageEvent.ADMINNOTIFY)
4379        return "admin-notify";
4380      if (code == MessageEvent.DIAGNOSTICREPORTPROVIDE)
4381        return "diagnosticreport-provide";
4382      if (code == MessageEvent.OBSERVATIONPROVIDE)
4383        return "observation-provide";
4384      if (code == MessageEvent.PATIENTLINK)
4385        return "patient-link";
4386      if (code == MessageEvent.PATIENTUNLINK)
4387        return "patient-unlink";
4388      if (code == MessageEvent.VALUESETEXPAND)
4389        return "valueset-expand";
4390      return "?";
4391      }
4392    }
4393
4394    public enum NoteType {
4395        /**
4396         * Display the note.
4397         */
4398        DISPLAY, 
4399        /**
4400         * Print the note on the form.
4401         */
4402        PRINT, 
4403        /**
4404         * Print the note for the operator.
4405         */
4406        PRINTOPER, 
4407        /**
4408         * added to help the parsers
4409         */
4410        NULL;
4411        public static NoteType fromCode(String codeString) throws FHIRException {
4412            if (codeString == null || "".equals(codeString))
4413                return null;
4414        if ("display".equals(codeString))
4415          return DISPLAY;
4416        if ("print".equals(codeString))
4417          return PRINT;
4418        if ("printoper".equals(codeString))
4419          return PRINTOPER;
4420        throw new FHIRException("Unknown NoteType code '"+codeString+"'");
4421        }
4422        public String toCode() {
4423          switch (this) {
4424            case DISPLAY: return "display";
4425            case PRINT: return "print";
4426            case PRINTOPER: return "printoper";
4427            case NULL: return null;
4428            default: return "?";
4429          }
4430        }
4431        public String getSystem() {
4432          switch (this) {
4433            case DISPLAY: return "http://hl7.org/fhir/note-type";
4434            case PRINT: return "http://hl7.org/fhir/note-type";
4435            case PRINTOPER: return "http://hl7.org/fhir/note-type";
4436            case NULL: return null;
4437            default: return "?";
4438          }
4439        }
4440        public String getDefinition() {
4441          switch (this) {
4442            case DISPLAY: return "Display the note.";
4443            case PRINT: return "Print the note on the form.";
4444            case PRINTOPER: return "Print the note for the operator.";
4445            case NULL: return null;
4446            default: return "?";
4447          }
4448        }
4449        public String getDisplay() {
4450          switch (this) {
4451            case DISPLAY: return "Display";
4452            case PRINT: return "Print (Form)";
4453            case PRINTOPER: return "Print (Operator)";
4454            case NULL: return null;
4455            default: return "?";
4456          }
4457        }
4458    }
4459
4460  public static class NoteTypeEnumFactory implements EnumFactory<NoteType> {
4461    public NoteType fromCode(String codeString) throws IllegalArgumentException {
4462      if (codeString == null || "".equals(codeString))
4463            if (codeString == null || "".equals(codeString))
4464                return null;
4465        if ("display".equals(codeString))
4466          return NoteType.DISPLAY;
4467        if ("print".equals(codeString))
4468          return NoteType.PRINT;
4469        if ("printoper".equals(codeString))
4470          return NoteType.PRINTOPER;
4471        throw new IllegalArgumentException("Unknown NoteType code '"+codeString+"'");
4472        }
4473        public Enumeration<NoteType> fromType(Base code) throws FHIRException {
4474          if (code == null || code.isEmpty())
4475            return null;
4476          String codeString = ((PrimitiveType) code).asStringValue();
4477          if (codeString == null || "".equals(codeString))
4478            return null;
4479        if ("display".equals(codeString))
4480          return new Enumeration<NoteType>(this, NoteType.DISPLAY);
4481        if ("print".equals(codeString))
4482          return new Enumeration<NoteType>(this, NoteType.PRINT);
4483        if ("printoper".equals(codeString))
4484          return new Enumeration<NoteType>(this, NoteType.PRINTOPER);
4485        throw new FHIRException("Unknown NoteType code '"+codeString+"'");
4486        }
4487    public String toCode(NoteType code) {
4488      if (code == NoteType.DISPLAY)
4489        return "display";
4490      if (code == NoteType.PRINT)
4491        return "print";
4492      if (code == NoteType.PRINTOPER)
4493        return "printoper";
4494      return "?";
4495      }
4496    }
4497
4498    public enum RemittanceOutcome {
4499        /**
4500         * The processing completed without errors.
4501         */
4502        COMPLETE, 
4503        /**
4504         * The processing identified errors.
4505         */
4506        ERROR, 
4507        /**
4508         * added to help the parsers
4509         */
4510        NULL;
4511        public static RemittanceOutcome fromCode(String codeString) throws FHIRException {
4512            if (codeString == null || "".equals(codeString))
4513                return null;
4514        if ("complete".equals(codeString))
4515          return COMPLETE;
4516        if ("error".equals(codeString))
4517          return ERROR;
4518        throw new FHIRException("Unknown RemittanceOutcome code '"+codeString+"'");
4519        }
4520        public String toCode() {
4521          switch (this) {
4522            case COMPLETE: return "complete";
4523            case ERROR: return "error";
4524            case NULL: return null;
4525            default: return "?";
4526          }
4527        }
4528        public String getSystem() {
4529          switch (this) {
4530            case COMPLETE: return "http://hl7.org/fhir/remittance-outcome";
4531            case ERROR: return "http://hl7.org/fhir/remittance-outcome";
4532            case NULL: return null;
4533            default: return "?";
4534          }
4535        }
4536        public String getDefinition() {
4537          switch (this) {
4538            case COMPLETE: return "The processing completed without errors.";
4539            case ERROR: return "The processing identified errors.";
4540            case NULL: return null;
4541            default: return "?";
4542          }
4543        }
4544        public String getDisplay() {
4545          switch (this) {
4546            case COMPLETE: return "Complete";
4547            case ERROR: return "Error";
4548            case NULL: return null;
4549            default: return "?";
4550          }
4551        }
4552    }
4553
4554  public static class RemittanceOutcomeEnumFactory implements EnumFactory<RemittanceOutcome> {
4555    public RemittanceOutcome fromCode(String codeString) throws IllegalArgumentException {
4556      if (codeString == null || "".equals(codeString))
4557            if (codeString == null || "".equals(codeString))
4558                return null;
4559        if ("complete".equals(codeString))
4560          return RemittanceOutcome.COMPLETE;
4561        if ("error".equals(codeString))
4562          return RemittanceOutcome.ERROR;
4563        throw new IllegalArgumentException("Unknown RemittanceOutcome code '"+codeString+"'");
4564        }
4565        public Enumeration<RemittanceOutcome> fromType(Base code) throws FHIRException {
4566          if (code == null || code.isEmpty())
4567            return null;
4568          String codeString = ((PrimitiveType) code).asStringValue();
4569          if (codeString == null || "".equals(codeString))
4570            return null;
4571        if ("complete".equals(codeString))
4572          return new Enumeration<RemittanceOutcome>(this, RemittanceOutcome.COMPLETE);
4573        if ("error".equals(codeString))
4574          return new Enumeration<RemittanceOutcome>(this, RemittanceOutcome.ERROR);
4575        throw new FHIRException("Unknown RemittanceOutcome code '"+codeString+"'");
4576        }
4577    public String toCode(RemittanceOutcome code) {
4578      if (code == RemittanceOutcome.COMPLETE)
4579        return "complete";
4580      if (code == RemittanceOutcome.ERROR)
4581        return "error";
4582      return "?";
4583      }
4584    }
4585
4586    public enum ResourceType {
4587        /**
4588         * A financial tool for tracking value accrued for a particular purpose.  In the healthcare field, used to track charges for a patient, cost centres, etc.
4589         */
4590        ACCOUNT, 
4591        /**
4592         * Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance.
4593         */
4594        ALLERGYINTOLERANCE, 
4595        /**
4596         * 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).
4597         */
4598        APPOINTMENT, 
4599        /**
4600         * A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection.
4601         */
4602        APPOINTMENTRESPONSE, 
4603        /**
4604         * A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.
4605         */
4606        AUDITEVENT, 
4607        /**
4608         * 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.
4609         */
4610        BASIC, 
4611        /**
4612         * A binary resource can contain any content, whether text, image, pdf, zip archive, etc.
4613         */
4614        BINARY, 
4615        /**
4616         * Record details about the anatomical location of a specimen or body part.  This resource may be used when a coded concept does not provide the necessary detail needed for the use case.
4617         */
4618        BODYSITE, 
4619        /**
4620         * A container for a collection of resources.
4621         */
4622        BUNDLE, 
4623        /**
4624         * 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.
4625         */
4626        CAREPLAN, 
4627        /**
4628         * A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.
4629         */
4630        CLAIM, 
4631        /**
4632         * This resource provides the adjudication details from the processing of a Claim resource.
4633         */
4634        CLAIMRESPONSE, 
4635        /**
4636         * 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.
4637         */
4638        CLINICALIMPRESSION, 
4639        /**
4640         * An occurrence of information being transmitted; e.g. an alert that was sent to a responsible provider, a public health agency was notified about a reportable condition.
4641         */
4642        COMMUNICATION, 
4643        /**
4644         * 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.
4645         */
4646        COMMUNICATIONREQUEST, 
4647        /**
4648         * A set of healthcare-related information that is assembled together into a single logical document 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. While a Composition defines the structure, it does not actually contain the content: rather the full content of a document is contained in a Bundle, of which the Composition is the first resource contained.
4649         */
4650        COMPOSITION, 
4651        /**
4652         * A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models.
4653         */
4654        CONCEPTMAP, 
4655        /**
4656         * Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a diagnosis during an encounter; populating a problem list or a summary statement, such as a discharge summary.
4657         */
4658        CONDITION, 
4659        /**
4660         * A conformance statement is a set of capabilities of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.
4661         */
4662        CONFORMANCE, 
4663        /**
4664         * A formal agreement between parties regarding the conduct of business, exchange of information or other matters.
4665         */
4666        CONTRACT, 
4667        /**
4668         * Financial instrument which may be used to pay for or reimburse health care products and services.
4669         */
4670        COVERAGE, 
4671        /**
4672         * The formal description of a single piece of information that can be gathered and reported.
4673         */
4674        DATAELEMENT, 
4675        /**
4676         * 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, etc.
4677         */
4678        DETECTEDISSUE, 
4679        /**
4680         * This resource identifies an instance of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device.  Medical devices includes durable (reusable) medical equipment, implantable devices, as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health.  Non-medical devices may include items such as a machine, cellphone, computer, application, etc.
4681         */
4682        DEVICE, 
4683        /**
4684         * Describes the characteristics, operational status and capabilities of a medical-related component of a medical device.
4685         */
4686        DEVICECOMPONENT, 
4687        /**
4688         * Describes a measurement, calculation or setting capability of a medical device.
4689         */
4690        DEVICEMETRIC, 
4691        /**
4692         * Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker.
4693         */
4694        DEVICEUSEREQUEST, 
4695        /**
4696         * A record of a device being used by a patient where the record is the result of a report from the patient or another clinician.
4697         */
4698        DEVICEUSESTATEMENT, 
4699        /**
4700         * A record of a request for a diagnostic investigation service to be performed.
4701         */
4702        DIAGNOSTICORDER, 
4703        /**
4704         * The findings and interpretation of diagnostic  tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretations, and formatted representation of diagnostic reports.
4705         */
4706        DIAGNOSTICREPORT, 
4707        /**
4708         * A manifest that defines a set of documents.
4709         */
4710        DOCUMENTMANIFEST, 
4711        /**
4712         * A reference to a document .
4713         */
4714        DOCUMENTREFERENCE, 
4715        /**
4716         * --- Abstract Type! ---A resource that includes narrative, extensions, and contained resources.
4717         */
4718        DOMAINRESOURCE, 
4719        /**
4720         * This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service.
4721         */
4722        ELIGIBILITYREQUEST, 
4723        /**
4724         * This resource provides eligibility and plan details from the processing of an Eligibility resource.
4725         */
4726        ELIGIBILITYRESPONSE, 
4727        /**
4728         * An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.
4729         */
4730        ENCOUNTER, 
4731        /**
4732         * This resource provides the insurance enrollment details to the insurer regarding a specified coverage.
4733         */
4734        ENROLLMENTREQUEST, 
4735        /**
4736         * This resource provides enrollment and plan details from the processing of an Enrollment resource.
4737         */
4738        ENROLLMENTRESPONSE, 
4739        /**
4740         * 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.
4741         */
4742        EPISODEOFCARE, 
4743        /**
4744         * 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.
4745         */
4746        EXPLANATIONOFBENEFIT, 
4747        /**
4748         * Significant health events and conditions for a person related to the patient relevant in the context of care for the patient.
4749         */
4750        FAMILYMEMBERHISTORY, 
4751        /**
4752         * Prospective warnings of potential issues when providing care to the patient.
4753         */
4754        FLAG, 
4755        /**
4756         * 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.
4757         */
4758        GOAL, 
4759        /**
4760         * 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.
4761         */
4762        GROUP, 
4763        /**
4764         * The details of a healthcare service available at a location.
4765         */
4766        HEALTHCARESERVICE, 
4767        /**
4768         * A manifest of a set of DICOM Service-Object Pair Instances (SOP Instances).  The referenced SOP Instances (images or other content) are for a single patient, and may be from one or more studies. The referenced SOP Instances have been selected for a purpose, such as quality assurance, conference, or consult. Reflecting that range of purposes, typical ImagingObjectSelection resources may include all SOP Instances in a study (perhaps for sharing through a Health Information Exchange); key images from multiple studies (for reference by a referring or treating physician); a multi-frame ultrasound instance ("cine" video clip) and a set of measurements taken from that instance (for inclusion in a teaching file); and so on.
4769         */
4770        IMAGINGOBJECTSELECTION, 
4771        /**
4772         * 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.
4773         */
4774        IMAGINGSTUDY, 
4775        /**
4776         * Describes the event of a patient being administered a vaccination or a record of a vaccination as reported by a patient, a clinician or another party and may include vaccine reaction information and what vaccination protocol was followed.
4777         */
4778        IMMUNIZATION, 
4779        /**
4780         * A patient's point-in-time immunization and recommendation (i.e. forecasting a patient's immunization eligibility according to a published schedule) with optional supporting justification.
4781         */
4782        IMMUNIZATIONRECOMMENDATION, 
4783        /**
4784         * A set of rules or how FHIR is used to solve a particular problem. 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.
4785         */
4786        IMPLEMENTATIONGUIDE, 
4787        /**
4788         * A set of information summarized from a list of other resources.
4789         */
4790        LIST, 
4791        /**
4792         * Details and position information for a physical place where services are provided  and resources and participants may be stored, found, contained or accommodated.
4793         */
4794        LOCATION, 
4795        /**
4796         * A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference.
4797         */
4798        MEDIA, 
4799        /**
4800         * This resource is primarily used for the identification and definition of a medication. It covers the ingredients and the packaging for a medication.
4801         */
4802        MEDICATION, 
4803        /**
4804         * 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.
4805         */
4806        MEDICATIONADMINISTRATION, 
4807        /**
4808         * 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.
4809         */
4810        MEDICATIONDISPENSE, 
4811        /**
4812         * An order for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called "MedicationOrder" rather than "MedicationPrescription" to generalize the use across inpatient and outpatient settings as well as for care plans, etc.
4813         */
4814        MEDICATIONORDER, 
4815        /**
4816         * 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 e.g. the patient's memory, from a prescription bottle,  or from a list of medications the patient, clinician or other party maintains 
4817
4818The primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication.  A medication statement 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.
4819         */
4820        MEDICATIONSTATEMENT, 
4821        /**
4822         * 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.
4823         */
4824        MESSAGEHEADER, 
4825        /**
4826         * 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.
4827         */
4828        NAMINGSYSTEM, 
4829        /**
4830         * A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.
4831         */
4832        NUTRITIONORDER, 
4833        /**
4834         * Measurements and simple assertions made about a patient, device or other subject.
4835         */
4836        OBSERVATION, 
4837        /**
4838         * A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction).
4839         */
4840        OPERATIONDEFINITION, 
4841        /**
4842         * A collection of error, warning or information messages that result from a system action.
4843         */
4844        OPERATIONOUTCOME, 
4845        /**
4846         * A request to perform an action.
4847         */
4848        ORDER, 
4849        /**
4850         * A response to an order.
4851         */
4852        ORDERRESPONSE, 
4853        /**
4854         * 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, etc.
4855         */
4856        ORGANIZATION, 
4857        /**
4858         * This special resource type is used to represent an operation request and response (operations.html). It has no other use, and there is no RESTful endpoint associated with it.
4859         */
4860        PARAMETERS, 
4861        /**
4862         * Demographics and other administrative information about an individual or animal receiving care or other health-related services.
4863         */
4864        PATIENT, 
4865        /**
4866         * This resource provides the status of the payment for goods and services rendered, and the request and response resource references.
4867         */
4868        PAYMENTNOTICE, 
4869        /**
4870         * This resource provides payment details and claim references supporting a bulk payment.
4871         */
4872        PAYMENTRECONCILIATION, 
4873        /**
4874         * Demographics and administrative information about a person independent of a specific health-related context.
4875         */
4876        PERSON, 
4877        /**
4878         * A person who is directly or indirectly involved in the provisioning of healthcare.
4879         */
4880        PRACTITIONER, 
4881        /**
4882         * An action that is or was performed on a patient. This can be a physical intervention like an operation, or less invasive like counseling or hypnotherapy.
4883         */
4884        PROCEDURE, 
4885        /**
4886         * A request for a procedure to be performed. May be a proposal or an order.
4887         */
4888        PROCEDUREREQUEST, 
4889        /**
4890         * This resource provides the target, request and response, and action details for an action to be performed by the target on or about existing resources.
4891         */
4892        PROCESSREQUEST, 
4893        /**
4894         * This resource provides processing status, errors and notes from the processing of a resource.
4895         */
4896        PROCESSRESPONSE, 
4897        /**
4898         * 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.
4899         */
4900        PROVENANCE, 
4901        /**
4902         * A structured set of questions intended to guide the collection of answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions.
4903         */
4904        QUESTIONNAIRE, 
4905        /**
4906         * 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 underlying questions.
4907         */
4908        QUESTIONNAIRERESPONSE, 
4909        /**
4910         * Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organization.
4911         */
4912        REFERRALREQUEST, 
4913        /**
4914         * Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process.
4915         */
4916        RELATEDPERSON, 
4917        /**
4918         * --- Abstract Type! ---This is the base resource type for everything.
4919         */
4920        RESOURCE, 
4921        /**
4922         * An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome.
4923         */
4924        RISKASSESSMENT, 
4925        /**
4926         * A container for slot(s) of time that may be available for booking appointments.
4927         */
4928        SCHEDULE, 
4929        /**
4930         * A search parameter that defines a named search item that can be used to search/filter on a resource.
4931         */
4932        SEARCHPARAMETER, 
4933        /**
4934         * A slot of time on a schedule that may be available for booking appointments.
4935         */
4936        SLOT, 
4937        /**
4938         * A sample to be used for analysis.
4939         */
4940        SPECIMEN, 
4941        /**
4942         * 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.
4943         */
4944        STRUCTUREDEFINITION, 
4945        /**
4946         * The subscription resource is used to define a push based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined "channel" so that another system is able to take an appropriate action.
4947         */
4948        SUBSCRIPTION, 
4949        /**
4950         * A homogeneous material with a definite composition.
4951         */
4952        SUBSTANCE, 
4953        /**
4954         * Record of delivery of what is supplied.
4955         */
4956        SUPPLYDELIVERY, 
4957        /**
4958         * A record of a request for a medication, substance or device used in the healthcare setting.
4959         */
4960        SUPPLYREQUEST, 
4961        /**
4962         * TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine compliance against the FHIR specification.
4963         */
4964        TESTSCRIPT, 
4965        /**
4966         * A value set specifies a set of codes drawn from one or more code systems.
4967         */
4968        VALUESET, 
4969        /**
4970         * An authorization for the supply of glasses and/or contact lenses to a patient.
4971         */
4972        VISIONPRESCRIPTION, 
4973        /**
4974         * added to help the parsers
4975         */
4976        NULL;
4977        public static ResourceType fromCode(String codeString) throws FHIRException {
4978            if (codeString == null || "".equals(codeString))
4979                return null;
4980        if ("Account".equals(codeString))
4981          return ACCOUNT;
4982        if ("AllergyIntolerance".equals(codeString))
4983          return ALLERGYINTOLERANCE;
4984        if ("Appointment".equals(codeString))
4985          return APPOINTMENT;
4986        if ("AppointmentResponse".equals(codeString))
4987          return APPOINTMENTRESPONSE;
4988        if ("AuditEvent".equals(codeString))
4989          return AUDITEVENT;
4990        if ("Basic".equals(codeString))
4991          return BASIC;
4992        if ("Binary".equals(codeString))
4993          return BINARY;
4994        if ("BodySite".equals(codeString))
4995          return BODYSITE;
4996        if ("Bundle".equals(codeString))
4997          return BUNDLE;
4998        if ("CarePlan".equals(codeString))
4999          return CAREPLAN;
5000        if ("Claim".equals(codeString))
5001          return CLAIM;
5002        if ("ClaimResponse".equals(codeString))
5003          return CLAIMRESPONSE;
5004        if ("ClinicalImpression".equals(codeString))
5005          return CLINICALIMPRESSION;
5006        if ("Communication".equals(codeString))
5007          return COMMUNICATION;
5008        if ("CommunicationRequest".equals(codeString))
5009          return COMMUNICATIONREQUEST;
5010        if ("Composition".equals(codeString))
5011          return COMPOSITION;
5012        if ("ConceptMap".equals(codeString))
5013          return CONCEPTMAP;
5014        if ("Condition".equals(codeString))
5015          return CONDITION;
5016        if ("Conformance".equals(codeString))
5017          return CONFORMANCE;
5018        if ("Contract".equals(codeString))
5019          return CONTRACT;
5020        if ("Coverage".equals(codeString))
5021          return COVERAGE;
5022        if ("DataElement".equals(codeString))
5023          return DATAELEMENT;
5024        if ("DetectedIssue".equals(codeString))
5025          return DETECTEDISSUE;
5026        if ("Device".equals(codeString))
5027          return DEVICE;
5028        if ("DeviceComponent".equals(codeString))
5029          return DEVICECOMPONENT;
5030        if ("DeviceMetric".equals(codeString))
5031          return DEVICEMETRIC;
5032        if ("DeviceUseRequest".equals(codeString))
5033          return DEVICEUSEREQUEST;
5034        if ("DeviceUseStatement".equals(codeString))
5035          return DEVICEUSESTATEMENT;
5036        if ("DiagnosticOrder".equals(codeString))
5037          return DIAGNOSTICORDER;
5038        if ("DiagnosticReport".equals(codeString))
5039          return DIAGNOSTICREPORT;
5040        if ("DocumentManifest".equals(codeString))
5041          return DOCUMENTMANIFEST;
5042        if ("DocumentReference".equals(codeString))
5043          return DOCUMENTREFERENCE;
5044        if ("DomainResource".equals(codeString))
5045          return DOMAINRESOURCE;
5046        if ("EligibilityRequest".equals(codeString))
5047          return ELIGIBILITYREQUEST;
5048        if ("EligibilityResponse".equals(codeString))
5049          return ELIGIBILITYRESPONSE;
5050        if ("Encounter".equals(codeString))
5051          return ENCOUNTER;
5052        if ("EnrollmentRequest".equals(codeString))
5053          return ENROLLMENTREQUEST;
5054        if ("EnrollmentResponse".equals(codeString))
5055          return ENROLLMENTRESPONSE;
5056        if ("EpisodeOfCare".equals(codeString))
5057          return EPISODEOFCARE;
5058        if ("ExplanationOfBenefit".equals(codeString))
5059          return EXPLANATIONOFBENEFIT;
5060        if ("FamilyMemberHistory".equals(codeString))
5061          return FAMILYMEMBERHISTORY;
5062        if ("Flag".equals(codeString))
5063          return FLAG;
5064        if ("Goal".equals(codeString))
5065          return GOAL;
5066        if ("Group".equals(codeString))
5067          return GROUP;
5068        if ("HealthcareService".equals(codeString))
5069          return HEALTHCARESERVICE;
5070        if ("ImagingObjectSelection".equals(codeString))
5071          return IMAGINGOBJECTSELECTION;
5072        if ("ImagingStudy".equals(codeString))
5073          return IMAGINGSTUDY;
5074        if ("Immunization".equals(codeString))
5075          return IMMUNIZATION;
5076        if ("ImmunizationRecommendation".equals(codeString))
5077          return IMMUNIZATIONRECOMMENDATION;
5078        if ("ImplementationGuide".equals(codeString))
5079          return IMPLEMENTATIONGUIDE;
5080        if ("List".equals(codeString))
5081          return LIST;
5082        if ("Location".equals(codeString))
5083          return LOCATION;
5084        if ("Media".equals(codeString))
5085          return MEDIA;
5086        if ("Medication".equals(codeString))
5087          return MEDICATION;
5088        if ("MedicationAdministration".equals(codeString))
5089          return MEDICATIONADMINISTRATION;
5090        if ("MedicationDispense".equals(codeString))
5091          return MEDICATIONDISPENSE;
5092        if ("MedicationOrder".equals(codeString))
5093          return MEDICATIONORDER;
5094        if ("MedicationStatement".equals(codeString))
5095          return MEDICATIONSTATEMENT;
5096        if ("MessageHeader".equals(codeString))
5097          return MESSAGEHEADER;
5098        if ("NamingSystem".equals(codeString))
5099          return NAMINGSYSTEM;
5100        if ("NutritionOrder".equals(codeString))
5101          return NUTRITIONORDER;
5102        if ("Observation".equals(codeString))
5103          return OBSERVATION;
5104        if ("OperationDefinition".equals(codeString))
5105          return OPERATIONDEFINITION;
5106        if ("OperationOutcome".equals(codeString))
5107          return OPERATIONOUTCOME;
5108        if ("Order".equals(codeString))
5109          return ORDER;
5110        if ("OrderResponse".equals(codeString))
5111          return ORDERRESPONSE;
5112        if ("Organization".equals(codeString))
5113          return ORGANIZATION;
5114        if ("Parameters".equals(codeString))
5115          return PARAMETERS;
5116        if ("Patient".equals(codeString))
5117          return PATIENT;
5118        if ("PaymentNotice".equals(codeString))
5119          return PAYMENTNOTICE;
5120        if ("PaymentReconciliation".equals(codeString))
5121          return PAYMENTRECONCILIATION;
5122        if ("Person".equals(codeString))
5123          return PERSON;
5124        if ("Practitioner".equals(codeString))
5125          return PRACTITIONER;
5126        if ("Procedure".equals(codeString))
5127          return PROCEDURE;
5128        if ("ProcedureRequest".equals(codeString))
5129          return PROCEDUREREQUEST;
5130        if ("ProcessRequest".equals(codeString))
5131          return PROCESSREQUEST;
5132        if ("ProcessResponse".equals(codeString))
5133          return PROCESSRESPONSE;
5134        if ("Provenance".equals(codeString))
5135          return PROVENANCE;
5136        if ("Questionnaire".equals(codeString))
5137          return QUESTIONNAIRE;
5138        if ("QuestionnaireResponse".equals(codeString))
5139          return QUESTIONNAIRERESPONSE;
5140        if ("ReferralRequest".equals(codeString))
5141          return REFERRALREQUEST;
5142        if ("RelatedPerson".equals(codeString))
5143          return RELATEDPERSON;
5144        if ("Resource".equals(codeString))
5145          return RESOURCE;
5146        if ("RiskAssessment".equals(codeString))
5147          return RISKASSESSMENT;
5148        if ("Schedule".equals(codeString))
5149          return SCHEDULE;
5150        if ("SearchParameter".equals(codeString))
5151          return SEARCHPARAMETER;
5152        if ("Slot".equals(codeString))
5153          return SLOT;
5154        if ("Specimen".equals(codeString))
5155          return SPECIMEN;
5156        if ("StructureDefinition".equals(codeString))
5157          return STRUCTUREDEFINITION;
5158        if ("Subscription".equals(codeString))
5159          return SUBSCRIPTION;
5160        if ("Substance".equals(codeString))
5161          return SUBSTANCE;
5162        if ("SupplyDelivery".equals(codeString))
5163          return SUPPLYDELIVERY;
5164        if ("SupplyRequest".equals(codeString))
5165          return SUPPLYREQUEST;
5166        if ("TestScript".equals(codeString))
5167          return TESTSCRIPT;
5168        if ("ValueSet".equals(codeString))
5169          return VALUESET;
5170        if ("VisionPrescription".equals(codeString))
5171          return VISIONPRESCRIPTION;
5172        throw new FHIRException("Unknown ResourceType code '"+codeString+"'");
5173        }
5174        public String toCode() {
5175          switch (this) {
5176            case ACCOUNT: return "Account";
5177            case ALLERGYINTOLERANCE: return "AllergyIntolerance";
5178            case APPOINTMENT: return "Appointment";
5179            case APPOINTMENTRESPONSE: return "AppointmentResponse";
5180            case AUDITEVENT: return "AuditEvent";
5181            case BASIC: return "Basic";
5182            case BINARY: return "Binary";
5183            case BODYSITE: return "BodySite";
5184            case BUNDLE: return "Bundle";
5185            case CAREPLAN: return "CarePlan";
5186            case CLAIM: return "Claim";
5187            case CLAIMRESPONSE: return "ClaimResponse";
5188            case CLINICALIMPRESSION: return "ClinicalImpression";
5189            case COMMUNICATION: return "Communication";
5190            case COMMUNICATIONREQUEST: return "CommunicationRequest";
5191            case COMPOSITION: return "Composition";
5192            case CONCEPTMAP: return "ConceptMap";
5193            case CONDITION: return "Condition";
5194            case CONFORMANCE: return "Conformance";
5195            case CONTRACT: return "Contract";
5196            case COVERAGE: return "Coverage";
5197            case DATAELEMENT: return "DataElement";
5198            case DETECTEDISSUE: return "DetectedIssue";
5199            case DEVICE: return "Device";
5200            case DEVICECOMPONENT: return "DeviceComponent";
5201            case DEVICEMETRIC: return "DeviceMetric";
5202            case DEVICEUSEREQUEST: return "DeviceUseRequest";
5203            case DEVICEUSESTATEMENT: return "DeviceUseStatement";
5204            case DIAGNOSTICORDER: return "DiagnosticOrder";
5205            case DIAGNOSTICREPORT: return "DiagnosticReport";
5206            case DOCUMENTMANIFEST: return "DocumentManifest";
5207            case DOCUMENTREFERENCE: return "DocumentReference";
5208            case DOMAINRESOURCE: return "DomainResource";
5209            case ELIGIBILITYREQUEST: return "EligibilityRequest";
5210            case ELIGIBILITYRESPONSE: return "EligibilityResponse";
5211            case ENCOUNTER: return "Encounter";
5212            case ENROLLMENTREQUEST: return "EnrollmentRequest";
5213            case ENROLLMENTRESPONSE: return "EnrollmentResponse";
5214            case EPISODEOFCARE: return "EpisodeOfCare";
5215            case EXPLANATIONOFBENEFIT: return "ExplanationOfBenefit";
5216            case FAMILYMEMBERHISTORY: return "FamilyMemberHistory";
5217            case FLAG: return "Flag";
5218            case GOAL: return "Goal";
5219            case GROUP: return "Group";
5220            case HEALTHCARESERVICE: return "HealthcareService";
5221            case IMAGINGOBJECTSELECTION: return "ImagingObjectSelection";
5222            case IMAGINGSTUDY: return "ImagingStudy";
5223            case IMMUNIZATION: return "Immunization";
5224            case IMMUNIZATIONRECOMMENDATION: return "ImmunizationRecommendation";
5225            case IMPLEMENTATIONGUIDE: return "ImplementationGuide";
5226            case LIST: return "List";
5227            case LOCATION: return "Location";
5228            case MEDIA: return "Media";
5229            case MEDICATION: return "Medication";
5230            case MEDICATIONADMINISTRATION: return "MedicationAdministration";
5231            case MEDICATIONDISPENSE: return "MedicationDispense";
5232            case MEDICATIONORDER: return "MedicationOrder";
5233            case MEDICATIONSTATEMENT: return "MedicationStatement";
5234            case MESSAGEHEADER: return "MessageHeader";
5235            case NAMINGSYSTEM: return "NamingSystem";
5236            case NUTRITIONORDER: return "NutritionOrder";
5237            case OBSERVATION: return "Observation";
5238            case OPERATIONDEFINITION: return "OperationDefinition";
5239            case OPERATIONOUTCOME: return "OperationOutcome";
5240            case ORDER: return "Order";
5241            case ORDERRESPONSE: return "OrderResponse";
5242            case ORGANIZATION: return "Organization";
5243            case PARAMETERS: return "Parameters";
5244            case PATIENT: return "Patient";
5245            case PAYMENTNOTICE: return "PaymentNotice";
5246            case PAYMENTRECONCILIATION: return "PaymentReconciliation";
5247            case PERSON: return "Person";
5248            case PRACTITIONER: return "Practitioner";
5249            case PROCEDURE: return "Procedure";
5250            case PROCEDUREREQUEST: return "ProcedureRequest";
5251            case PROCESSREQUEST: return "ProcessRequest";
5252            case PROCESSRESPONSE: return "ProcessResponse";
5253            case PROVENANCE: return "Provenance";
5254            case QUESTIONNAIRE: return "Questionnaire";
5255            case QUESTIONNAIRERESPONSE: return "QuestionnaireResponse";
5256            case REFERRALREQUEST: return "ReferralRequest";
5257            case RELATEDPERSON: return "RelatedPerson";
5258            case RESOURCE: return "Resource";
5259            case RISKASSESSMENT: return "RiskAssessment";
5260            case SCHEDULE: return "Schedule";
5261            case SEARCHPARAMETER: return "SearchParameter";
5262            case SLOT: return "Slot";
5263            case SPECIMEN: return "Specimen";
5264            case STRUCTUREDEFINITION: return "StructureDefinition";
5265            case SUBSCRIPTION: return "Subscription";
5266            case SUBSTANCE: return "Substance";
5267            case SUPPLYDELIVERY: return "SupplyDelivery";
5268            case SUPPLYREQUEST: return "SupplyRequest";
5269            case TESTSCRIPT: return "TestScript";
5270            case VALUESET: return "ValueSet";
5271            case VISIONPRESCRIPTION: return "VisionPrescription";
5272            case NULL: return null;
5273            default: return "?";
5274          }
5275        }
5276        public String getSystem() {
5277          switch (this) {
5278            case ACCOUNT: return "http://hl7.org/fhir/resource-types";
5279            case ALLERGYINTOLERANCE: return "http://hl7.org/fhir/resource-types";
5280            case APPOINTMENT: return "http://hl7.org/fhir/resource-types";
5281            case APPOINTMENTRESPONSE: return "http://hl7.org/fhir/resource-types";
5282            case AUDITEVENT: return "http://hl7.org/fhir/resource-types";
5283            case BASIC: return "http://hl7.org/fhir/resource-types";
5284            case BINARY: return "http://hl7.org/fhir/resource-types";
5285            case BODYSITE: return "http://hl7.org/fhir/resource-types";
5286            case BUNDLE: return "http://hl7.org/fhir/resource-types";
5287            case CAREPLAN: return "http://hl7.org/fhir/resource-types";
5288            case CLAIM: return "http://hl7.org/fhir/resource-types";
5289            case CLAIMRESPONSE: return "http://hl7.org/fhir/resource-types";
5290            case CLINICALIMPRESSION: return "http://hl7.org/fhir/resource-types";
5291            case COMMUNICATION: return "http://hl7.org/fhir/resource-types";
5292            case COMMUNICATIONREQUEST: return "http://hl7.org/fhir/resource-types";
5293            case COMPOSITION: return "http://hl7.org/fhir/resource-types";
5294            case CONCEPTMAP: return "http://hl7.org/fhir/resource-types";
5295            case CONDITION: return "http://hl7.org/fhir/resource-types";
5296            case CONFORMANCE: return "http://hl7.org/fhir/resource-types";
5297            case CONTRACT: return "http://hl7.org/fhir/resource-types";
5298            case COVERAGE: return "http://hl7.org/fhir/resource-types";
5299            case DATAELEMENT: return "http://hl7.org/fhir/resource-types";
5300            case DETECTEDISSUE: return "http://hl7.org/fhir/resource-types";
5301            case DEVICE: return "http://hl7.org/fhir/resource-types";
5302            case DEVICECOMPONENT: return "http://hl7.org/fhir/resource-types";
5303            case DEVICEMETRIC: return "http://hl7.org/fhir/resource-types";
5304            case DEVICEUSEREQUEST: return "http://hl7.org/fhir/resource-types";
5305            case DEVICEUSESTATEMENT: return "http://hl7.org/fhir/resource-types";
5306            case DIAGNOSTICORDER: return "http://hl7.org/fhir/resource-types";
5307            case DIAGNOSTICREPORT: return "http://hl7.org/fhir/resource-types";
5308            case DOCUMENTMANIFEST: return "http://hl7.org/fhir/resource-types";
5309            case DOCUMENTREFERENCE: return "http://hl7.org/fhir/resource-types";
5310            case DOMAINRESOURCE: return "http://hl7.org/fhir/resource-types";
5311            case ELIGIBILITYREQUEST: return "http://hl7.org/fhir/resource-types";
5312            case ELIGIBILITYRESPONSE: return "http://hl7.org/fhir/resource-types";
5313            case ENCOUNTER: return "http://hl7.org/fhir/resource-types";
5314            case ENROLLMENTREQUEST: return "http://hl7.org/fhir/resource-types";
5315            case ENROLLMENTRESPONSE: return "http://hl7.org/fhir/resource-types";
5316            case EPISODEOFCARE: return "http://hl7.org/fhir/resource-types";
5317            case EXPLANATIONOFBENEFIT: return "http://hl7.org/fhir/resource-types";
5318            case FAMILYMEMBERHISTORY: return "http://hl7.org/fhir/resource-types";
5319            case FLAG: return "http://hl7.org/fhir/resource-types";
5320            case GOAL: return "http://hl7.org/fhir/resource-types";
5321            case GROUP: return "http://hl7.org/fhir/resource-types";
5322            case HEALTHCARESERVICE: return "http://hl7.org/fhir/resource-types";
5323            case IMAGINGOBJECTSELECTION: return "http://hl7.org/fhir/resource-types";
5324            case IMAGINGSTUDY: return "http://hl7.org/fhir/resource-types";
5325            case IMMUNIZATION: return "http://hl7.org/fhir/resource-types";
5326            case IMMUNIZATIONRECOMMENDATION: return "http://hl7.org/fhir/resource-types";
5327            case IMPLEMENTATIONGUIDE: return "http://hl7.org/fhir/resource-types";
5328            case LIST: return "http://hl7.org/fhir/resource-types";
5329            case LOCATION: return "http://hl7.org/fhir/resource-types";
5330            case MEDIA: return "http://hl7.org/fhir/resource-types";
5331            case MEDICATION: return "http://hl7.org/fhir/resource-types";
5332            case MEDICATIONADMINISTRATION: return "http://hl7.org/fhir/resource-types";
5333            case MEDICATIONDISPENSE: return "http://hl7.org/fhir/resource-types";
5334            case MEDICATIONORDER: return "http://hl7.org/fhir/resource-types";
5335            case MEDICATIONSTATEMENT: return "http://hl7.org/fhir/resource-types";
5336            case MESSAGEHEADER: return "http://hl7.org/fhir/resource-types";
5337            case NAMINGSYSTEM: return "http://hl7.org/fhir/resource-types";
5338            case NUTRITIONORDER: return "http://hl7.org/fhir/resource-types";
5339            case OBSERVATION: return "http://hl7.org/fhir/resource-types";
5340            case OPERATIONDEFINITION: return "http://hl7.org/fhir/resource-types";
5341            case OPERATIONOUTCOME: return "http://hl7.org/fhir/resource-types";
5342            case ORDER: return "http://hl7.org/fhir/resource-types";
5343            case ORDERRESPONSE: return "http://hl7.org/fhir/resource-types";
5344            case ORGANIZATION: return "http://hl7.org/fhir/resource-types";
5345            case PARAMETERS: return "http://hl7.org/fhir/resource-types";
5346            case PATIENT: return "http://hl7.org/fhir/resource-types";
5347            case PAYMENTNOTICE: return "http://hl7.org/fhir/resource-types";
5348            case PAYMENTRECONCILIATION: return "http://hl7.org/fhir/resource-types";
5349            case PERSON: return "http://hl7.org/fhir/resource-types";
5350            case PRACTITIONER: return "http://hl7.org/fhir/resource-types";
5351            case PROCEDURE: return "http://hl7.org/fhir/resource-types";
5352            case PROCEDUREREQUEST: return "http://hl7.org/fhir/resource-types";
5353            case PROCESSREQUEST: return "http://hl7.org/fhir/resource-types";
5354            case PROCESSRESPONSE: return "http://hl7.org/fhir/resource-types";
5355            case PROVENANCE: return "http://hl7.org/fhir/resource-types";
5356            case QUESTIONNAIRE: return "http://hl7.org/fhir/resource-types";
5357            case QUESTIONNAIRERESPONSE: return "http://hl7.org/fhir/resource-types";
5358            case REFERRALREQUEST: return "http://hl7.org/fhir/resource-types";
5359            case RELATEDPERSON: return "http://hl7.org/fhir/resource-types";
5360            case RESOURCE: return "http://hl7.org/fhir/resource-types";
5361            case RISKASSESSMENT: return "http://hl7.org/fhir/resource-types";
5362            case SCHEDULE: return "http://hl7.org/fhir/resource-types";
5363            case SEARCHPARAMETER: return "http://hl7.org/fhir/resource-types";
5364            case SLOT: return "http://hl7.org/fhir/resource-types";
5365            case SPECIMEN: return "http://hl7.org/fhir/resource-types";
5366            case STRUCTUREDEFINITION: return "http://hl7.org/fhir/resource-types";
5367            case SUBSCRIPTION: return "http://hl7.org/fhir/resource-types";
5368            case SUBSTANCE: return "http://hl7.org/fhir/resource-types";
5369            case SUPPLYDELIVERY: return "http://hl7.org/fhir/resource-types";
5370            case SUPPLYREQUEST: return "http://hl7.org/fhir/resource-types";
5371            case TESTSCRIPT: return "http://hl7.org/fhir/resource-types";
5372            case VALUESET: return "http://hl7.org/fhir/resource-types";
5373            case VISIONPRESCRIPTION: return "http://hl7.org/fhir/resource-types";
5374            case NULL: return null;
5375            default: return "?";
5376          }
5377        }
5378        public String getDefinition() {
5379          switch (this) {
5380            case ACCOUNT: return "A financial tool for tracking value accrued for a particular purpose.  In the healthcare field, used to track charges for a patient, cost centres, etc.";
5381            case ALLERGYINTOLERANCE: return "Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance.";
5382            case APPOINTMENT: return "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).";
5383            case APPOINTMENTRESPONSE: return "A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection.";
5384            case AUDITEVENT: return "A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.";
5385            case BASIC: return "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.";
5386            case BINARY: return "A binary resource can contain any content, whether text, image, pdf, zip archive, etc.";
5387            case BODYSITE: return "Record details about the anatomical location of a specimen or body part.  This resource may be used when a coded concept does not provide the necessary detail needed for the use case.";
5388            case BUNDLE: return "A container for a collection of resources.";
5389            case CAREPLAN: return "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.";
5390            case CLAIM: return "A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.";
5391            case CLAIMRESPONSE: return "This resource provides the adjudication details from the processing of a Claim resource.";
5392            case CLINICALIMPRESSION: return "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.";
5393            case COMMUNICATION: return "An occurrence of information being transmitted; e.g. an alert that was sent to a responsible provider, a public health agency was notified about a reportable condition.";
5394            case COMMUNICATIONREQUEST: return "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.";
5395            case COMPOSITION: return "A set of healthcare-related information that is assembled together into a single logical document 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. While a Composition defines the structure, it does not actually contain the content: rather the full content of a document is contained in a Bundle, of which the Composition is the first resource contained.";
5396            case CONCEPTMAP: return "A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models.";
5397            case CONDITION: return "Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a diagnosis during an encounter; populating a problem list or a summary statement, such as a discharge summary.";
5398            case CONFORMANCE: return "A conformance statement is a set of capabilities of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.";
5399            case CONTRACT: return "A formal agreement between parties regarding the conduct of business, exchange of information or other matters.";
5400            case COVERAGE: return "Financial instrument which may be used to pay for or reimburse health care products and services.";
5401            case DATAELEMENT: return "The formal description of a single piece of information that can be gathered and reported.";
5402            case DETECTEDISSUE: return "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, etc.";
5403            case DEVICE: return "This resource identifies an instance of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device.  Medical devices includes durable (reusable) medical equipment, implantable devices, as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health.  Non-medical devices may include items such as a machine, cellphone, computer, application, etc.";
5404            case DEVICECOMPONENT: return "Describes the characteristics, operational status and capabilities of a medical-related component of a medical device.";
5405            case DEVICEMETRIC: return "Describes a measurement, calculation or setting capability of a medical device.";
5406            case DEVICEUSEREQUEST: return "Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker.";
5407            case DEVICEUSESTATEMENT: return "A record of a device being used by a patient where the record is the result of a report from the patient or another clinician.";
5408            case DIAGNOSTICORDER: return "A record of a request for a diagnostic investigation service to be performed.";
5409            case DIAGNOSTICREPORT: return "The findings and interpretation of diagnostic  tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretations, and formatted representation of diagnostic reports.";
5410            case DOCUMENTMANIFEST: return "A manifest that defines a set of documents.";
5411            case DOCUMENTREFERENCE: return "A reference to a document .";
5412            case DOMAINRESOURCE: return "--- Abstract Type! ---A resource that includes narrative, extensions, and contained resources.";
5413            case ELIGIBILITYREQUEST: return "This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service.";
5414            case ELIGIBILITYRESPONSE: return "This resource provides eligibility and plan details from the processing of an Eligibility resource.";
5415            case ENCOUNTER: return "An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.";
5416            case ENROLLMENTREQUEST: return "This resource provides the insurance enrollment details to the insurer regarding a specified coverage.";
5417            case ENROLLMENTRESPONSE: return "This resource provides enrollment and plan details from the processing of an Enrollment resource.";
5418            case EPISODEOFCARE: return "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.";
5419            case EXPLANATIONOFBENEFIT: return "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.";
5420            case FAMILYMEMBERHISTORY: return "Significant health events and conditions for a person related to the patient relevant in the context of care for the patient.";
5421            case FLAG: return "Prospective warnings of potential issues when providing care to the patient.";
5422            case GOAL: return "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.";
5423            case GROUP: return "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.";
5424            case HEALTHCARESERVICE: return "The details of a healthcare service available at a location.";
5425            case IMAGINGOBJECTSELECTION: return "A manifest of a set of DICOM Service-Object Pair Instances (SOP Instances).  The referenced SOP Instances (images or other content) are for a single patient, and may be from one or more studies. The referenced SOP Instances have been selected for a purpose, such as quality assurance, conference, or consult. Reflecting that range of purposes, typical ImagingObjectSelection resources may include all SOP Instances in a study (perhaps for sharing through a Health Information Exchange); key images from multiple studies (for reference by a referring or treating physician); a multi-frame ultrasound instance (\"cine\" video clip) and a set of measurements taken from that instance (for inclusion in a teaching file); and so on.";
5426            case IMAGINGSTUDY: return "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.";
5427            case IMMUNIZATION: return "Describes the event of a patient being administered a vaccination or a record of a vaccination as reported by a patient, a clinician or another party and may include vaccine reaction information and what vaccination protocol was followed.";
5428            case IMMUNIZATIONRECOMMENDATION: return "A patient's point-in-time immunization and recommendation (i.e. forecasting a patient's immunization eligibility according to a published schedule) with optional supporting justification.";
5429            case IMPLEMENTATIONGUIDE: return "A set of rules or how FHIR is used to solve a particular problem. 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.";
5430            case LIST: return "A set of information summarized from a list of other resources.";
5431            case LOCATION: return "Details and position information for a physical place where services are provided  and resources and participants may be stored, found, contained or accommodated.";
5432            case MEDIA: return "A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference.";
5433            case MEDICATION: return "This resource is primarily used for the identification and definition of a medication. It covers the ingredients and the packaging for a medication.";
5434            case MEDICATIONADMINISTRATION: return "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.";
5435            case MEDICATIONDISPENSE: return "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.";
5436            case MEDICATIONORDER: return "An order for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called \"MedicationOrder\" rather than \"MedicationPrescription\" to generalize the use across inpatient and outpatient settings as well as for care plans, etc.";
5437            case MEDICATIONSTATEMENT: return "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 e.g. the patient's memory, from a prescription bottle,  or from a list of medications the patient, clinician or other party maintains \r\rThe primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication.  A medication statement 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.";
5438            case MESSAGEHEADER: return "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.";
5439            case NAMINGSYSTEM: return "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.";
5440            case NUTRITIONORDER: return "A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.";
5441            case OBSERVATION: return "Measurements and simple assertions made about a patient, device or other subject.";
5442            case OPERATIONDEFINITION: return "A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction).";
5443            case OPERATIONOUTCOME: return "A collection of error, warning or information messages that result from a system action.";
5444            case ORDER: return "A request to perform an action.";
5445            case ORDERRESPONSE: return "A response to an order.";
5446            case ORGANIZATION: return "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, etc.";
5447            case PARAMETERS: return "This special resource type is used to represent an operation request and response (operations.html). It has no other use, and there is no RESTful endpoint associated with it.";
5448            case PATIENT: return "Demographics and other administrative information about an individual or animal receiving care or other health-related services.";
5449            case PAYMENTNOTICE: return "This resource provides the status of the payment for goods and services rendered, and the request and response resource references.";
5450            case PAYMENTRECONCILIATION: return "This resource provides payment details and claim references supporting a bulk payment.";
5451            case PERSON: return "Demographics and administrative information about a person independent of a specific health-related context.";
5452            case PRACTITIONER: return "A person who is directly or indirectly involved in the provisioning of healthcare.";
5453            case PROCEDURE: return "An action that is or was performed on a patient. This can be a physical intervention like an operation, or less invasive like counseling or hypnotherapy.";
5454            case PROCEDUREREQUEST: return "A request for a procedure to be performed. May be a proposal or an order.";
5455            case PROCESSREQUEST: return "This resource provides the target, request and response, and action details for an action to be performed by the target on or about existing resources.";
5456            case PROCESSRESPONSE: return "This resource provides processing status, errors and notes from the processing of a resource.";
5457            case PROVENANCE: return "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.";
5458            case QUESTIONNAIRE: return "A structured set of questions intended to guide the collection of answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions.";
5459            case QUESTIONNAIRERESPONSE: return "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 underlying questions.";
5460            case REFERRALREQUEST: return "Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organization.";
5461            case RELATEDPERSON: return "Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process.";
5462            case RESOURCE: return "--- Abstract Type! ---This is the base resource type for everything.";
5463            case RISKASSESSMENT: return "An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome.";
5464            case SCHEDULE: return "A container for slot(s) of time that may be available for booking appointments.";
5465            case SEARCHPARAMETER: return "A search parameter that defines a named search item that can be used to search/filter on a resource.";
5466            case SLOT: return "A slot of time on a schedule that may be available for booking appointments.";
5467            case SPECIMEN: return "A sample to be used for analysis.";
5468            case STRUCTUREDEFINITION: return "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.";
5469            case SUBSCRIPTION: return "The subscription resource is used to define a push based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined \"channel\" so that another system is able to take an appropriate action.";
5470            case SUBSTANCE: return "A homogeneous material with a definite composition.";
5471            case SUPPLYDELIVERY: return "Record of delivery of what is supplied.";
5472            case SUPPLYREQUEST: return "A record of a request for a medication, substance or device used in the healthcare setting.";
5473            case TESTSCRIPT: return "TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine compliance against the FHIR specification.";
5474            case VALUESET: return "A value set specifies a set of codes drawn from one or more code systems.";
5475            case VISIONPRESCRIPTION: return "An authorization for the supply of glasses and/or contact lenses to a patient.";
5476            case NULL: return null;
5477            default: return "?";
5478          }
5479        }
5480        public String getDisplay() {
5481          switch (this) {
5482            case ACCOUNT: return "Account";
5483            case ALLERGYINTOLERANCE: return "AllergyIntolerance";
5484            case APPOINTMENT: return "Appointment";
5485            case APPOINTMENTRESPONSE: return "AppointmentResponse";
5486            case AUDITEVENT: return "AuditEvent";
5487            case BASIC: return "Basic";
5488            case BINARY: return "Binary";
5489            case BODYSITE: return "BodySite";
5490            case BUNDLE: return "Bundle";
5491            case CAREPLAN: return "CarePlan";
5492            case CLAIM: return "Claim";
5493            case CLAIMRESPONSE: return "ClaimResponse";
5494            case CLINICALIMPRESSION: return "ClinicalImpression";
5495            case COMMUNICATION: return "Communication";
5496            case COMMUNICATIONREQUEST: return "CommunicationRequest";
5497            case COMPOSITION: return "Composition";
5498            case CONCEPTMAP: return "ConceptMap";
5499            case CONDITION: return "Condition";
5500            case CONFORMANCE: return "Conformance";
5501            case CONTRACT: return "Contract";
5502            case COVERAGE: return "Coverage";
5503            case DATAELEMENT: return "DataElement";
5504            case DETECTEDISSUE: return "DetectedIssue";
5505            case DEVICE: return "Device";
5506            case DEVICECOMPONENT: return "DeviceComponent";
5507            case DEVICEMETRIC: return "DeviceMetric";
5508            case DEVICEUSEREQUEST: return "DeviceUseRequest";
5509            case DEVICEUSESTATEMENT: return "DeviceUseStatement";
5510            case DIAGNOSTICORDER: return "DiagnosticOrder";
5511            case DIAGNOSTICREPORT: return "DiagnosticReport";
5512            case DOCUMENTMANIFEST: return "DocumentManifest";
5513            case DOCUMENTREFERENCE: return "DocumentReference";
5514            case DOMAINRESOURCE: return "DomainResource";
5515            case ELIGIBILITYREQUEST: return "EligibilityRequest";
5516            case ELIGIBILITYRESPONSE: return "EligibilityResponse";
5517            case ENCOUNTER: return "Encounter";
5518            case ENROLLMENTREQUEST: return "EnrollmentRequest";
5519            case ENROLLMENTRESPONSE: return "EnrollmentResponse";
5520            case EPISODEOFCARE: return "EpisodeOfCare";
5521            case EXPLANATIONOFBENEFIT: return "ExplanationOfBenefit";
5522            case FAMILYMEMBERHISTORY: return "FamilyMemberHistory";
5523            case FLAG: return "Flag";
5524            case GOAL: return "Goal";
5525            case GROUP: return "Group";
5526            case HEALTHCARESERVICE: return "HealthcareService";
5527            case IMAGINGOBJECTSELECTION: return "ImagingObjectSelection";
5528            case IMAGINGSTUDY: return "ImagingStudy";
5529            case IMMUNIZATION: return "Immunization";
5530            case IMMUNIZATIONRECOMMENDATION: return "ImmunizationRecommendation";
5531            case IMPLEMENTATIONGUIDE: return "ImplementationGuide";
5532            case LIST: return "List";
5533            case LOCATION: return "Location";
5534            case MEDIA: return "Media";
5535            case MEDICATION: return "Medication";
5536            case MEDICATIONADMINISTRATION: return "MedicationAdministration";
5537            case MEDICATIONDISPENSE: return "MedicationDispense";
5538            case MEDICATIONORDER: return "MedicationOrder";
5539            case MEDICATIONSTATEMENT: return "MedicationStatement";
5540            case MESSAGEHEADER: return "MessageHeader";
5541            case NAMINGSYSTEM: return "NamingSystem";
5542            case NUTRITIONORDER: return "NutritionOrder";
5543            case OBSERVATION: return "Observation";
5544            case OPERATIONDEFINITION: return "OperationDefinition";
5545            case OPERATIONOUTCOME: return "OperationOutcome";
5546            case ORDER: return "Order";
5547            case ORDERRESPONSE: return "OrderResponse";
5548            case ORGANIZATION: return "Organization";
5549            case PARAMETERS: return "Parameters";
5550            case PATIENT: return "Patient";
5551            case PAYMENTNOTICE: return "PaymentNotice";
5552            case PAYMENTRECONCILIATION: return "PaymentReconciliation";
5553            case PERSON: return "Person";
5554            case PRACTITIONER: return "Practitioner";
5555            case PROCEDURE: return "Procedure";
5556            case PROCEDUREREQUEST: return "ProcedureRequest";
5557            case PROCESSREQUEST: return "ProcessRequest";
5558            case PROCESSRESPONSE: return "ProcessResponse";
5559            case PROVENANCE: return "Provenance";
5560            case QUESTIONNAIRE: return "Questionnaire";
5561            case QUESTIONNAIRERESPONSE: return "QuestionnaireResponse";
5562            case REFERRALREQUEST: return "ReferralRequest";
5563            case RELATEDPERSON: return "RelatedPerson";
5564            case RESOURCE: return "Resource";
5565            case RISKASSESSMENT: return "RiskAssessment";
5566            case SCHEDULE: return "Schedule";
5567            case SEARCHPARAMETER: return "SearchParameter";
5568            case SLOT: return "Slot";
5569            case SPECIMEN: return "Specimen";
5570            case STRUCTUREDEFINITION: return "StructureDefinition";
5571            case SUBSCRIPTION: return "Subscription";
5572            case SUBSTANCE: return "Substance";
5573            case SUPPLYDELIVERY: return "SupplyDelivery";
5574            case SUPPLYREQUEST: return "SupplyRequest";
5575            case TESTSCRIPT: return "TestScript";
5576            case VALUESET: return "ValueSet";
5577            case VISIONPRESCRIPTION: return "VisionPrescription";
5578            case NULL: return null;
5579            default: return "?";
5580          }
5581        }
5582    }
5583
5584  public static class ResourceTypeEnumFactory implements EnumFactory<ResourceType> {
5585    public ResourceType fromCode(String codeString) throws IllegalArgumentException {
5586      if (codeString == null || "".equals(codeString))
5587            if (codeString == null || "".equals(codeString))
5588                return null;
5589        if ("Account".equals(codeString))
5590          return ResourceType.ACCOUNT;
5591        if ("AllergyIntolerance".equals(codeString))
5592          return ResourceType.ALLERGYINTOLERANCE;
5593        if ("Appointment".equals(codeString))
5594          return ResourceType.APPOINTMENT;
5595        if ("AppointmentResponse".equals(codeString))
5596          return ResourceType.APPOINTMENTRESPONSE;
5597        if ("AuditEvent".equals(codeString))
5598          return ResourceType.AUDITEVENT;
5599        if ("Basic".equals(codeString))
5600          return ResourceType.BASIC;
5601        if ("Binary".equals(codeString))
5602          return ResourceType.BINARY;
5603        if ("BodySite".equals(codeString))
5604          return ResourceType.BODYSITE;
5605        if ("Bundle".equals(codeString))
5606          return ResourceType.BUNDLE;
5607        if ("CarePlan".equals(codeString))
5608          return ResourceType.CAREPLAN;
5609        if ("Claim".equals(codeString))
5610          return ResourceType.CLAIM;
5611        if ("ClaimResponse".equals(codeString))
5612          return ResourceType.CLAIMRESPONSE;
5613        if ("ClinicalImpression".equals(codeString))
5614          return ResourceType.CLINICALIMPRESSION;
5615        if ("Communication".equals(codeString))
5616          return ResourceType.COMMUNICATION;
5617        if ("CommunicationRequest".equals(codeString))
5618          return ResourceType.COMMUNICATIONREQUEST;
5619        if ("Composition".equals(codeString))
5620          return ResourceType.COMPOSITION;
5621        if ("ConceptMap".equals(codeString))
5622          return ResourceType.CONCEPTMAP;
5623        if ("Condition".equals(codeString))
5624          return ResourceType.CONDITION;
5625        if ("Conformance".equals(codeString))
5626          return ResourceType.CONFORMANCE;
5627        if ("Contract".equals(codeString))
5628          return ResourceType.CONTRACT;
5629        if ("Coverage".equals(codeString))
5630          return ResourceType.COVERAGE;
5631        if ("DataElement".equals(codeString))
5632          return ResourceType.DATAELEMENT;
5633        if ("DetectedIssue".equals(codeString))
5634          return ResourceType.DETECTEDISSUE;
5635        if ("Device".equals(codeString))
5636          return ResourceType.DEVICE;
5637        if ("DeviceComponent".equals(codeString))
5638          return ResourceType.DEVICECOMPONENT;
5639        if ("DeviceMetric".equals(codeString))
5640          return ResourceType.DEVICEMETRIC;
5641        if ("DeviceUseRequest".equals(codeString))
5642          return ResourceType.DEVICEUSEREQUEST;
5643        if ("DeviceUseStatement".equals(codeString))
5644          return ResourceType.DEVICEUSESTATEMENT;
5645        if ("DiagnosticOrder".equals(codeString))
5646          return ResourceType.DIAGNOSTICORDER;
5647        if ("DiagnosticReport".equals(codeString))
5648          return ResourceType.DIAGNOSTICREPORT;
5649        if ("DocumentManifest".equals(codeString))
5650          return ResourceType.DOCUMENTMANIFEST;
5651        if ("DocumentReference".equals(codeString))
5652          return ResourceType.DOCUMENTREFERENCE;
5653        if ("DomainResource".equals(codeString))
5654          return ResourceType.DOMAINRESOURCE;
5655        if ("EligibilityRequest".equals(codeString))
5656          return ResourceType.ELIGIBILITYREQUEST;
5657        if ("EligibilityResponse".equals(codeString))
5658          return ResourceType.ELIGIBILITYRESPONSE;
5659        if ("Encounter".equals(codeString))
5660          return ResourceType.ENCOUNTER;
5661        if ("EnrollmentRequest".equals(codeString))
5662          return ResourceType.ENROLLMENTREQUEST;
5663        if ("EnrollmentResponse".equals(codeString))
5664          return ResourceType.ENROLLMENTRESPONSE;
5665        if ("EpisodeOfCare".equals(codeString))
5666          return ResourceType.EPISODEOFCARE;
5667        if ("ExplanationOfBenefit".equals(codeString))
5668          return ResourceType.EXPLANATIONOFBENEFIT;
5669        if ("FamilyMemberHistory".equals(codeString))
5670          return ResourceType.FAMILYMEMBERHISTORY;
5671        if ("Flag".equals(codeString))
5672          return ResourceType.FLAG;
5673        if ("Goal".equals(codeString))
5674          return ResourceType.GOAL;
5675        if ("Group".equals(codeString))
5676          return ResourceType.GROUP;
5677        if ("HealthcareService".equals(codeString))
5678          return ResourceType.HEALTHCARESERVICE;
5679        if ("ImagingObjectSelection".equals(codeString))
5680          return ResourceType.IMAGINGOBJECTSELECTION;
5681        if ("ImagingStudy".equals(codeString))
5682          return ResourceType.IMAGINGSTUDY;
5683        if ("Immunization".equals(codeString))
5684          return ResourceType.IMMUNIZATION;
5685        if ("ImmunizationRecommendation".equals(codeString))
5686          return ResourceType.IMMUNIZATIONRECOMMENDATION;
5687        if ("ImplementationGuide".equals(codeString))
5688          return ResourceType.IMPLEMENTATIONGUIDE;
5689        if ("List".equals(codeString))
5690          return ResourceType.LIST;
5691        if ("Location".equals(codeString))
5692          return ResourceType.LOCATION;
5693        if ("Media".equals(codeString))
5694          return ResourceType.MEDIA;
5695        if ("Medication".equals(codeString))
5696          return ResourceType.MEDICATION;
5697        if ("MedicationAdministration".equals(codeString))
5698          return ResourceType.MEDICATIONADMINISTRATION;
5699        if ("MedicationDispense".equals(codeString))
5700          return ResourceType.MEDICATIONDISPENSE;
5701        if ("MedicationOrder".equals(codeString))
5702          return ResourceType.MEDICATIONORDER;
5703        if ("MedicationStatement".equals(codeString))
5704          return ResourceType.MEDICATIONSTATEMENT;
5705        if ("MessageHeader".equals(codeString))
5706          return ResourceType.MESSAGEHEADER;
5707        if ("NamingSystem".equals(codeString))
5708          return ResourceType.NAMINGSYSTEM;
5709        if ("NutritionOrder".equals(codeString))
5710          return ResourceType.NUTRITIONORDER;
5711        if ("Observation".equals(codeString))
5712          return ResourceType.OBSERVATION;
5713        if ("OperationDefinition".equals(codeString))
5714          return ResourceType.OPERATIONDEFINITION;
5715        if ("OperationOutcome".equals(codeString))
5716          return ResourceType.OPERATIONOUTCOME;
5717        if ("Order".equals(codeString))
5718          return ResourceType.ORDER;
5719        if ("OrderResponse".equals(codeString))
5720          return ResourceType.ORDERRESPONSE;
5721        if ("Organization".equals(codeString))
5722          return ResourceType.ORGANIZATION;
5723        if ("Parameters".equals(codeString))
5724          return ResourceType.PARAMETERS;
5725        if ("Patient".equals(codeString))
5726          return ResourceType.PATIENT;
5727        if ("PaymentNotice".equals(codeString))
5728          return ResourceType.PAYMENTNOTICE;
5729        if ("PaymentReconciliation".equals(codeString))
5730          return ResourceType.PAYMENTRECONCILIATION;
5731        if ("Person".equals(codeString))
5732          return ResourceType.PERSON;
5733        if ("Practitioner".equals(codeString))
5734          return ResourceType.PRACTITIONER;
5735        if ("Procedure".equals(codeString))
5736          return ResourceType.PROCEDURE;
5737        if ("ProcedureRequest".equals(codeString))
5738          return ResourceType.PROCEDUREREQUEST;
5739        if ("ProcessRequest".equals(codeString))
5740          return ResourceType.PROCESSREQUEST;
5741        if ("ProcessResponse".equals(codeString))
5742          return ResourceType.PROCESSRESPONSE;
5743        if ("Provenance".equals(codeString))
5744          return ResourceType.PROVENANCE;
5745        if ("Questionnaire".equals(codeString))
5746          return ResourceType.QUESTIONNAIRE;
5747        if ("QuestionnaireResponse".equals(codeString))
5748          return ResourceType.QUESTIONNAIRERESPONSE;
5749        if ("ReferralRequest".equals(codeString))
5750          return ResourceType.REFERRALREQUEST;
5751        if ("RelatedPerson".equals(codeString))
5752          return ResourceType.RELATEDPERSON;
5753        if ("Resource".equals(codeString))
5754          return ResourceType.RESOURCE;
5755        if ("RiskAssessment".equals(codeString))
5756          return ResourceType.RISKASSESSMENT;
5757        if ("Schedule".equals(codeString))
5758          return ResourceType.SCHEDULE;
5759        if ("SearchParameter".equals(codeString))
5760          return ResourceType.SEARCHPARAMETER;
5761        if ("Slot".equals(codeString))
5762          return ResourceType.SLOT;
5763        if ("Specimen".equals(codeString))
5764          return ResourceType.SPECIMEN;
5765        if ("StructureDefinition".equals(codeString))
5766          return ResourceType.STRUCTUREDEFINITION;
5767        if ("Subscription".equals(codeString))
5768          return ResourceType.SUBSCRIPTION;
5769        if ("Substance".equals(codeString))
5770          return ResourceType.SUBSTANCE;
5771        if ("SupplyDelivery".equals(codeString))
5772          return ResourceType.SUPPLYDELIVERY;
5773        if ("SupplyRequest".equals(codeString))
5774          return ResourceType.SUPPLYREQUEST;
5775        if ("TestScript".equals(codeString))
5776          return ResourceType.TESTSCRIPT;
5777        if ("ValueSet".equals(codeString))
5778          return ResourceType.VALUESET;
5779        if ("VisionPrescription".equals(codeString))
5780          return ResourceType.VISIONPRESCRIPTION;
5781        throw new IllegalArgumentException("Unknown ResourceType code '"+codeString+"'");
5782        }
5783        public Enumeration<ResourceType> fromType(Base code) throws FHIRException {
5784          if (code == null || code.isEmpty())
5785            return null;
5786          String codeString = ((PrimitiveType) code).asStringValue();
5787          if (codeString == null || "".equals(codeString))
5788            return null;
5789        if ("Account".equals(codeString))
5790          return new Enumeration<ResourceType>(this, ResourceType.ACCOUNT);
5791        if ("AllergyIntolerance".equals(codeString))
5792          return new Enumeration<ResourceType>(this, ResourceType.ALLERGYINTOLERANCE);
5793        if ("Appointment".equals(codeString))
5794          return new Enumeration<ResourceType>(this, ResourceType.APPOINTMENT);
5795        if ("AppointmentResponse".equals(codeString))
5796          return new Enumeration<ResourceType>(this, ResourceType.APPOINTMENTRESPONSE);
5797        if ("AuditEvent".equals(codeString))
5798          return new Enumeration<ResourceType>(this, ResourceType.AUDITEVENT);
5799        if ("Basic".equals(codeString))
5800          return new Enumeration<ResourceType>(this, ResourceType.BASIC);
5801        if ("Binary".equals(codeString))
5802          return new Enumeration<ResourceType>(this, ResourceType.BINARY);
5803        if ("BodySite".equals(codeString))
5804          return new Enumeration<ResourceType>(this, ResourceType.BODYSITE);
5805        if ("Bundle".equals(codeString))
5806          return new Enumeration<ResourceType>(this, ResourceType.BUNDLE);
5807        if ("CarePlan".equals(codeString))
5808          return new Enumeration<ResourceType>(this, ResourceType.CAREPLAN);
5809        if ("Claim".equals(codeString))
5810          return new Enumeration<ResourceType>(this, ResourceType.CLAIM);
5811        if ("ClaimResponse".equals(codeString))
5812          return new Enumeration<ResourceType>(this, ResourceType.CLAIMRESPONSE);
5813        if ("ClinicalImpression".equals(codeString))
5814          return new Enumeration<ResourceType>(this, ResourceType.CLINICALIMPRESSION);
5815        if ("Communication".equals(codeString))
5816          return new Enumeration<ResourceType>(this, ResourceType.COMMUNICATION);
5817        if ("CommunicationRequest".equals(codeString))
5818          return new Enumeration<ResourceType>(this, ResourceType.COMMUNICATIONREQUEST);
5819        if ("Composition".equals(codeString))
5820          return new Enumeration<ResourceType>(this, ResourceType.COMPOSITION);
5821        if ("ConceptMap".equals(codeString))
5822          return new Enumeration<ResourceType>(this, ResourceType.CONCEPTMAP);
5823        if ("Condition".equals(codeString))
5824          return new Enumeration<ResourceType>(this, ResourceType.CONDITION);
5825        if ("Conformance".equals(codeString))
5826          return new Enumeration<ResourceType>(this, ResourceType.CONFORMANCE);
5827        if ("Contract".equals(codeString))
5828          return new Enumeration<ResourceType>(this, ResourceType.CONTRACT);
5829        if ("Coverage".equals(codeString))
5830          return new Enumeration<ResourceType>(this, ResourceType.COVERAGE);
5831        if ("DataElement".equals(codeString))
5832          return new Enumeration<ResourceType>(this, ResourceType.DATAELEMENT);
5833        if ("DetectedIssue".equals(codeString))
5834          return new Enumeration<ResourceType>(this, ResourceType.DETECTEDISSUE);
5835        if ("Device".equals(codeString))
5836          return new Enumeration<ResourceType>(this, ResourceType.DEVICE);
5837        if ("DeviceComponent".equals(codeString))
5838          return new Enumeration<ResourceType>(this, ResourceType.DEVICECOMPONENT);
5839        if ("DeviceMetric".equals(codeString))
5840          return new Enumeration<ResourceType>(this, ResourceType.DEVICEMETRIC);
5841        if ("DeviceUseRequest".equals(codeString))
5842          return new Enumeration<ResourceType>(this, ResourceType.DEVICEUSEREQUEST);
5843        if ("DeviceUseStatement".equals(codeString))
5844          return new Enumeration<ResourceType>(this, ResourceType.DEVICEUSESTATEMENT);
5845        if ("DiagnosticOrder".equals(codeString))
5846          return new Enumeration<ResourceType>(this, ResourceType.DIAGNOSTICORDER);
5847        if ("DiagnosticReport".equals(codeString))
5848          return new Enumeration<ResourceType>(this, ResourceType.DIAGNOSTICREPORT);
5849        if ("DocumentManifest".equals(codeString))
5850          return new Enumeration<ResourceType>(this, ResourceType.DOCUMENTMANIFEST);
5851        if ("DocumentReference".equals(codeString))
5852          return new Enumeration<ResourceType>(this, ResourceType.DOCUMENTREFERENCE);
5853        if ("DomainResource".equals(codeString))
5854          return new Enumeration<ResourceType>(this, ResourceType.DOMAINRESOURCE);
5855        if ("EligibilityRequest".equals(codeString))
5856          return new Enumeration<ResourceType>(this, ResourceType.ELIGIBILITYREQUEST);
5857        if ("EligibilityResponse".equals(codeString))
5858          return new Enumeration<ResourceType>(this, ResourceType.ELIGIBILITYRESPONSE);
5859        if ("Encounter".equals(codeString))
5860          return new Enumeration<ResourceType>(this, ResourceType.ENCOUNTER);
5861        if ("EnrollmentRequest".equals(codeString))
5862          return new Enumeration<ResourceType>(this, ResourceType.ENROLLMENTREQUEST);
5863        if ("EnrollmentResponse".equals(codeString))
5864          return new Enumeration<ResourceType>(this, ResourceType.ENROLLMENTRESPONSE);
5865        if ("EpisodeOfCare".equals(codeString))
5866          return new Enumeration<ResourceType>(this, ResourceType.EPISODEOFCARE);
5867        if ("ExplanationOfBenefit".equals(codeString))
5868          return new Enumeration<ResourceType>(this, ResourceType.EXPLANATIONOFBENEFIT);
5869        if ("FamilyMemberHistory".equals(codeString))
5870          return new Enumeration<ResourceType>(this, ResourceType.FAMILYMEMBERHISTORY);
5871        if ("Flag".equals(codeString))
5872          return new Enumeration<ResourceType>(this, ResourceType.FLAG);
5873        if ("Goal".equals(codeString))
5874          return new Enumeration<ResourceType>(this, ResourceType.GOAL);
5875        if ("Group".equals(codeString))
5876          return new Enumeration<ResourceType>(this, ResourceType.GROUP);
5877        if ("HealthcareService".equals(codeString))
5878          return new Enumeration<ResourceType>(this, ResourceType.HEALTHCARESERVICE);
5879        if ("ImagingObjectSelection".equals(codeString))
5880          return new Enumeration<ResourceType>(this, ResourceType.IMAGINGOBJECTSELECTION);
5881        if ("ImagingStudy".equals(codeString))
5882          return new Enumeration<ResourceType>(this, ResourceType.IMAGINGSTUDY);
5883        if ("Immunization".equals(codeString))
5884          return new Enumeration<ResourceType>(this, ResourceType.IMMUNIZATION);
5885        if ("ImmunizationRecommendation".equals(codeString))
5886          return new Enumeration<ResourceType>(this, ResourceType.IMMUNIZATIONRECOMMENDATION);
5887        if ("ImplementationGuide".equals(codeString))
5888          return new Enumeration<ResourceType>(this, ResourceType.IMPLEMENTATIONGUIDE);
5889        if ("List".equals(codeString))
5890          return new Enumeration<ResourceType>(this, ResourceType.LIST);
5891        if ("Location".equals(codeString))
5892          return new Enumeration<ResourceType>(this, ResourceType.LOCATION);
5893        if ("Media".equals(codeString))
5894          return new Enumeration<ResourceType>(this, ResourceType.MEDIA);
5895        if ("Medication".equals(codeString))
5896          return new Enumeration<ResourceType>(this, ResourceType.MEDICATION);
5897        if ("MedicationAdministration".equals(codeString))
5898          return new Enumeration<ResourceType>(this, ResourceType.MEDICATIONADMINISTRATION);
5899        if ("MedicationDispense".equals(codeString))
5900          return new Enumeration<ResourceType>(this, ResourceType.MEDICATIONDISPENSE);
5901        if ("MedicationOrder".equals(codeString))
5902          return new Enumeration<ResourceType>(this, ResourceType.MEDICATIONORDER);
5903        if ("MedicationStatement".equals(codeString))
5904          return new Enumeration<ResourceType>(this, ResourceType.MEDICATIONSTATEMENT);
5905        if ("MessageHeader".equals(codeString))
5906          return new Enumeration<ResourceType>(this, ResourceType.MESSAGEHEADER);
5907        if ("NamingSystem".equals(codeString))
5908          return new Enumeration<ResourceType>(this, ResourceType.NAMINGSYSTEM);
5909        if ("NutritionOrder".equals(codeString))
5910          return new Enumeration<ResourceType>(this, ResourceType.NUTRITIONORDER);
5911        if ("Observation".equals(codeString))
5912          return new Enumeration<ResourceType>(this, ResourceType.OBSERVATION);
5913        if ("OperationDefinition".equals(codeString))
5914          return new Enumeration<ResourceType>(this, ResourceType.OPERATIONDEFINITION);
5915        if ("OperationOutcome".equals(codeString))
5916          return new Enumeration<ResourceType>(this, ResourceType.OPERATIONOUTCOME);
5917        if ("Order".equals(codeString))
5918          return new Enumeration<ResourceType>(this, ResourceType.ORDER);
5919        if ("OrderResponse".equals(codeString))
5920          return new Enumeration<ResourceType>(this, ResourceType.ORDERRESPONSE);
5921        if ("Organization".equals(codeString))
5922          return new Enumeration<ResourceType>(this, ResourceType.ORGANIZATION);
5923        if ("Parameters".equals(codeString))
5924          return new Enumeration<ResourceType>(this, ResourceType.PARAMETERS);
5925        if ("Patient".equals(codeString))
5926          return new Enumeration<ResourceType>(this, ResourceType.PATIENT);
5927        if ("PaymentNotice".equals(codeString))
5928          return new Enumeration<ResourceType>(this, ResourceType.PAYMENTNOTICE);
5929        if ("PaymentReconciliation".equals(codeString))
5930          return new Enumeration<ResourceType>(this, ResourceType.PAYMENTRECONCILIATION);
5931        if ("Person".equals(codeString))
5932          return new Enumeration<ResourceType>(this, ResourceType.PERSON);
5933        if ("Practitioner".equals(codeString))
5934          return new Enumeration<ResourceType>(this, ResourceType.PRACTITIONER);
5935        if ("Procedure".equals(codeString))
5936          return new Enumeration<ResourceType>(this, ResourceType.PROCEDURE);
5937        if ("ProcedureRequest".equals(codeString))
5938          return new Enumeration<ResourceType>(this, ResourceType.PROCEDUREREQUEST);
5939        if ("ProcessRequest".equals(codeString))
5940          return new Enumeration<ResourceType>(this, ResourceType.PROCESSREQUEST);
5941        if ("ProcessResponse".equals(codeString))
5942          return new Enumeration<ResourceType>(this, ResourceType.PROCESSRESPONSE);
5943        if ("Provenance".equals(codeString))
5944          return new Enumeration<ResourceType>(this, ResourceType.PROVENANCE);
5945        if ("Questionnaire".equals(codeString))
5946          return new Enumeration<ResourceType>(this, ResourceType.QUESTIONNAIRE);
5947        if ("QuestionnaireResponse".equals(codeString))
5948          return new Enumeration<ResourceType>(this, ResourceType.QUESTIONNAIRERESPONSE);
5949        if ("ReferralRequest".equals(codeString))
5950          return new Enumeration<ResourceType>(this, ResourceType.REFERRALREQUEST);
5951        if ("RelatedPerson".equals(codeString))
5952          return new Enumeration<ResourceType>(this, ResourceType.RELATEDPERSON);
5953        if ("Resource".equals(codeString))
5954          return new Enumeration<ResourceType>(this, ResourceType.RESOURCE);
5955        if ("RiskAssessment".equals(codeString))
5956          return new Enumeration<ResourceType>(this, ResourceType.RISKASSESSMENT);
5957        if ("Schedule".equals(codeString))
5958          return new Enumeration<ResourceType>(this, ResourceType.SCHEDULE);
5959        if ("SearchParameter".equals(codeString))
5960          return new Enumeration<ResourceType>(this, ResourceType.SEARCHPARAMETER);
5961        if ("Slot".equals(codeString))
5962          return new Enumeration<ResourceType>(this, ResourceType.SLOT);
5963        if ("Specimen".equals(codeString))
5964          return new Enumeration<ResourceType>(this, ResourceType.SPECIMEN);
5965        if ("StructureDefinition".equals(codeString))
5966          return new Enumeration<ResourceType>(this, ResourceType.STRUCTUREDEFINITION);
5967        if ("Subscription".equals(codeString))
5968          return new Enumeration<ResourceType>(this, ResourceType.SUBSCRIPTION);
5969        if ("Substance".equals(codeString))
5970          return new Enumeration<ResourceType>(this, ResourceType.SUBSTANCE);
5971        if ("SupplyDelivery".equals(codeString))
5972          return new Enumeration<ResourceType>(this, ResourceType.SUPPLYDELIVERY);
5973        if ("SupplyRequest".equals(codeString))
5974          return new Enumeration<ResourceType>(this, ResourceType.SUPPLYREQUEST);
5975        if ("TestScript".equals(codeString))
5976          return new Enumeration<ResourceType>(this, ResourceType.TESTSCRIPT);
5977        if ("ValueSet".equals(codeString))
5978          return new Enumeration<ResourceType>(this, ResourceType.VALUESET);
5979        if ("VisionPrescription".equals(codeString))
5980          return new Enumeration<ResourceType>(this, ResourceType.VISIONPRESCRIPTION);
5981        throw new FHIRException("Unknown ResourceType code '"+codeString+"'");
5982        }
5983    public String toCode(ResourceType code) {
5984      if (code == ResourceType.ACCOUNT)
5985        return "Account";
5986      if (code == ResourceType.ALLERGYINTOLERANCE)
5987        return "AllergyIntolerance";
5988      if (code == ResourceType.APPOINTMENT)
5989        return "Appointment";
5990      if (code == ResourceType.APPOINTMENTRESPONSE)
5991        return "AppointmentResponse";
5992      if (code == ResourceType.AUDITEVENT)
5993        return "AuditEvent";
5994      if (code == ResourceType.BASIC)
5995        return "Basic";
5996      if (code == ResourceType.BINARY)
5997        return "Binary";
5998      if (code == ResourceType.BODYSITE)
5999        return "BodySite";
6000      if (code == ResourceType.BUNDLE)
6001        return "Bundle";
6002      if (code == ResourceType.CAREPLAN)
6003        return "CarePlan";
6004      if (code == ResourceType.CLAIM)
6005        return "Claim";
6006      if (code == ResourceType.CLAIMRESPONSE)
6007        return "ClaimResponse";
6008      if (code == ResourceType.CLINICALIMPRESSION)
6009        return "ClinicalImpression";
6010      if (code == ResourceType.COMMUNICATION)
6011        return "Communication";
6012      if (code == ResourceType.COMMUNICATIONREQUEST)
6013        return "CommunicationRequest";
6014      if (code == ResourceType.COMPOSITION)
6015        return "Composition";
6016      if (code == ResourceType.CONCEPTMAP)
6017        return "ConceptMap";
6018      if (code == ResourceType.CONDITION)
6019        return "Condition";
6020      if (code == ResourceType.CONFORMANCE)
6021        return "Conformance";
6022      if (code == ResourceType.CONTRACT)
6023        return "Contract";
6024      if (code == ResourceType.COVERAGE)
6025        return "Coverage";
6026      if (code == ResourceType.DATAELEMENT)
6027        return "DataElement";
6028      if (code == ResourceType.DETECTEDISSUE)
6029        return "DetectedIssue";
6030      if (code == ResourceType.DEVICE)
6031        return "Device";
6032      if (code == ResourceType.DEVICECOMPONENT)
6033        return "DeviceComponent";
6034      if (code == ResourceType.DEVICEMETRIC)
6035        return "DeviceMetric";
6036      if (code == ResourceType.DEVICEUSEREQUEST)
6037        return "DeviceUseRequest";
6038      if (code == ResourceType.DEVICEUSESTATEMENT)
6039        return "DeviceUseStatement";
6040      if (code == ResourceType.DIAGNOSTICORDER)
6041        return "DiagnosticOrder";
6042      if (code == ResourceType.DIAGNOSTICREPORT)
6043        return "DiagnosticReport";
6044      if (code == ResourceType.DOCUMENTMANIFEST)
6045        return "DocumentManifest";
6046      if (code == ResourceType.DOCUMENTREFERENCE)
6047        return "DocumentReference";
6048      if (code == ResourceType.DOMAINRESOURCE)
6049        return "DomainResource";
6050      if (code == ResourceType.ELIGIBILITYREQUEST)
6051        return "EligibilityRequest";
6052      if (code == ResourceType.ELIGIBILITYRESPONSE)
6053        return "EligibilityResponse";
6054      if (code == ResourceType.ENCOUNTER)
6055        return "Encounter";
6056      if (code == ResourceType.ENROLLMENTREQUEST)
6057        return "EnrollmentRequest";
6058      if (code == ResourceType.ENROLLMENTRESPONSE)
6059        return "EnrollmentResponse";
6060      if (code == ResourceType.EPISODEOFCARE)
6061        return "EpisodeOfCare";
6062      if (code == ResourceType.EXPLANATIONOFBENEFIT)
6063        return "ExplanationOfBenefit";
6064      if (code == ResourceType.FAMILYMEMBERHISTORY)
6065        return "FamilyMemberHistory";
6066      if (code == ResourceType.FLAG)
6067        return "Flag";
6068      if (code == ResourceType.GOAL)
6069        return "Goal";
6070      if (code == ResourceType.GROUP)
6071        return "Group";
6072      if (code == ResourceType.HEALTHCARESERVICE)
6073        return "HealthcareService";
6074      if (code == ResourceType.IMAGINGOBJECTSELECTION)
6075        return "ImagingObjectSelection";
6076      if (code == ResourceType.IMAGINGSTUDY)
6077        return "ImagingStudy";
6078      if (code == ResourceType.IMMUNIZATION)
6079        return "Immunization";
6080      if (code == ResourceType.IMMUNIZATIONRECOMMENDATION)
6081        return "ImmunizationRecommendation";
6082      if (code == ResourceType.IMPLEMENTATIONGUIDE)
6083        return "ImplementationGuide";
6084      if (code == ResourceType.LIST)
6085        return "List";
6086      if (code == ResourceType.LOCATION)
6087        return "Location";
6088      if (code == ResourceType.MEDIA)
6089        return "Media";
6090      if (code == ResourceType.MEDICATION)
6091        return "Medication";
6092      if (code == ResourceType.MEDICATIONADMINISTRATION)
6093        return "MedicationAdministration";
6094      if (code == ResourceType.MEDICATIONDISPENSE)
6095        return "MedicationDispense";
6096      if (code == ResourceType.MEDICATIONORDER)
6097        return "MedicationOrder";
6098      if (code == ResourceType.MEDICATIONSTATEMENT)
6099        return "MedicationStatement";
6100      if (code == ResourceType.MESSAGEHEADER)
6101        return "MessageHeader";
6102      if (code == ResourceType.NAMINGSYSTEM)
6103        return "NamingSystem";
6104      if (code == ResourceType.NUTRITIONORDER)
6105        return "NutritionOrder";
6106      if (code == ResourceType.OBSERVATION)
6107        return "Observation";
6108      if (code == ResourceType.OPERATIONDEFINITION)
6109        return "OperationDefinition";
6110      if (code == ResourceType.OPERATIONOUTCOME)
6111        return "OperationOutcome";
6112      if (code == ResourceType.ORDER)
6113        return "Order";
6114      if (code == ResourceType.ORDERRESPONSE)
6115        return "OrderResponse";
6116      if (code == ResourceType.ORGANIZATION)
6117        return "Organization";
6118      if (code == ResourceType.PARAMETERS)
6119        return "Parameters";
6120      if (code == ResourceType.PATIENT)
6121        return "Patient";
6122      if (code == ResourceType.PAYMENTNOTICE)
6123        return "PaymentNotice";
6124      if (code == ResourceType.PAYMENTRECONCILIATION)
6125        return "PaymentReconciliation";
6126      if (code == ResourceType.PERSON)
6127        return "Person";
6128      if (code == ResourceType.PRACTITIONER)
6129        return "Practitioner";
6130      if (code == ResourceType.PROCEDURE)
6131        return "Procedure";
6132      if (code == ResourceType.PROCEDUREREQUEST)
6133        return "ProcedureRequest";
6134      if (code == ResourceType.PROCESSREQUEST)
6135        return "ProcessRequest";
6136      if (code == ResourceType.PROCESSRESPONSE)
6137        return "ProcessResponse";
6138      if (code == ResourceType.PROVENANCE)
6139        return "Provenance";
6140      if (code == ResourceType.QUESTIONNAIRE)
6141        return "Questionnaire";
6142      if (code == ResourceType.QUESTIONNAIRERESPONSE)
6143        return "QuestionnaireResponse";
6144      if (code == ResourceType.REFERRALREQUEST)
6145        return "ReferralRequest";
6146      if (code == ResourceType.RELATEDPERSON)
6147        return "RelatedPerson";
6148      if (code == ResourceType.RESOURCE)
6149        return "Resource";
6150      if (code == ResourceType.RISKASSESSMENT)
6151        return "RiskAssessment";
6152      if (code == ResourceType.SCHEDULE)
6153        return "Schedule";
6154      if (code == ResourceType.SEARCHPARAMETER)
6155        return "SearchParameter";
6156      if (code == ResourceType.SLOT)
6157        return "Slot";
6158      if (code == ResourceType.SPECIMEN)
6159        return "Specimen";
6160      if (code == ResourceType.STRUCTUREDEFINITION)
6161        return "StructureDefinition";
6162      if (code == ResourceType.SUBSCRIPTION)
6163        return "Subscription";
6164      if (code == ResourceType.SUBSTANCE)
6165        return "Substance";
6166      if (code == ResourceType.SUPPLYDELIVERY)
6167        return "SupplyDelivery";
6168      if (code == ResourceType.SUPPLYREQUEST)
6169        return "SupplyRequest";
6170      if (code == ResourceType.TESTSCRIPT)
6171        return "TestScript";
6172      if (code == ResourceType.VALUESET)
6173        return "ValueSet";
6174      if (code == ResourceType.VISIONPRESCRIPTION)
6175        return "VisionPrescription";
6176      return "?";
6177      }
6178    }
6179
6180    public enum SearchParamType {
6181        /**
6182         * Search parameter SHALL be a number (a whole number, or a decimal).
6183         */
6184        NUMBER, 
6185        /**
6186         * Search parameter is on a date/time. The date format is the standard XML format, though other formats may be supported.
6187         */
6188        DATE, 
6189        /**
6190         * Search parameter is a simple string, like a name part. Search is case-insensitive and accent-insensitive. May match just the start of a string. String parameters may contain spaces.
6191         */
6192        STRING, 
6193        /**
6194         * Search parameter on a coded element or identifier. May be used to search through the text, displayname, code and code/codesystem (for codes) and label, system and key (for identifier). Its value is either a string or a pair of namespace and value, separated by a "|", depending on the modifier used.
6195         */
6196        TOKEN, 
6197        /**
6198         * A reference to another resource.
6199         */
6200        REFERENCE, 
6201        /**
6202         * A composite search parameter that combines a search on two values together.
6203         */
6204        COMPOSITE, 
6205        /**
6206         * A search parameter that searches on a quantity.
6207         */
6208        QUANTITY, 
6209        /**
6210         * A search parameter that searches on a URI (RFC 3986).
6211         */
6212        URI, 
6213        /**
6214         * added to help the parsers
6215         */
6216        NULL;
6217        public static SearchParamType fromCode(String codeString) throws FHIRException {
6218            if (codeString == null || "".equals(codeString))
6219                return null;
6220        if ("number".equals(codeString))
6221          return NUMBER;
6222        if ("date".equals(codeString))
6223          return DATE;
6224        if ("string".equals(codeString))
6225          return STRING;
6226        if ("token".equals(codeString))
6227          return TOKEN;
6228        if ("reference".equals(codeString))
6229          return REFERENCE;
6230        if ("composite".equals(codeString))
6231          return COMPOSITE;
6232        if ("quantity".equals(codeString))
6233          return QUANTITY;
6234        if ("uri".equals(codeString))
6235          return URI;
6236        throw new FHIRException("Unknown SearchParamType code '"+codeString+"'");
6237        }
6238        public String toCode() {
6239          switch (this) {
6240            case NUMBER: return "number";
6241            case DATE: return "date";
6242            case STRING: return "string";
6243            case TOKEN: return "token";
6244            case REFERENCE: return "reference";
6245            case COMPOSITE: return "composite";
6246            case QUANTITY: return "quantity";
6247            case URI: return "uri";
6248            case NULL: return null;
6249            default: return "?";
6250          }
6251        }
6252        public String getSystem() {
6253          switch (this) {
6254            case NUMBER: return "http://hl7.org/fhir/search-param-type";
6255            case DATE: return "http://hl7.org/fhir/search-param-type";
6256            case STRING: return "http://hl7.org/fhir/search-param-type";
6257            case TOKEN: return "http://hl7.org/fhir/search-param-type";
6258            case REFERENCE: return "http://hl7.org/fhir/search-param-type";
6259            case COMPOSITE: return "http://hl7.org/fhir/search-param-type";
6260            case QUANTITY: return "http://hl7.org/fhir/search-param-type";
6261            case URI: return "http://hl7.org/fhir/search-param-type";
6262            case NULL: return null;
6263            default: return "?";
6264          }
6265        }
6266        public String getDefinition() {
6267          switch (this) {
6268            case NUMBER: return "Search parameter SHALL be a number (a whole number, or a decimal).";
6269            case DATE: return "Search parameter is on a date/time. The date format is the standard XML format, though other formats may be supported.";
6270            case STRING: return "Search parameter is a simple string, like a name part. Search is case-insensitive and accent-insensitive. May match just the start of a string. String parameters may contain spaces.";
6271            case TOKEN: return "Search parameter on a coded element or identifier. May be used to search through the text, displayname, code and code/codesystem (for codes) and label, system and key (for identifier). Its value is either a string or a pair of namespace and value, separated by a \"|\", depending on the modifier used.";
6272            case REFERENCE: return "A reference to another resource.";
6273            case COMPOSITE: return "A composite search parameter that combines a search on two values together.";
6274            case QUANTITY: return "A search parameter that searches on a quantity.";
6275            case URI: return "A search parameter that searches on a URI (RFC 3986).";
6276            case NULL: return null;
6277            default: return "?";
6278          }
6279        }
6280        public String getDisplay() {
6281          switch (this) {
6282            case NUMBER: return "Number";
6283            case DATE: return "Date/DateTime";
6284            case STRING: return "String";
6285            case TOKEN: return "Token";
6286            case REFERENCE: return "Reference";
6287            case COMPOSITE: return "Composite";
6288            case QUANTITY: return "Quantity";
6289            case URI: return "URI";
6290            case NULL: return null;
6291            default: return "?";
6292          }
6293        }
6294    }
6295
6296  public static class SearchParamTypeEnumFactory implements EnumFactory<SearchParamType> {
6297    public SearchParamType fromCode(String codeString) throws IllegalArgumentException {
6298      if (codeString == null || "".equals(codeString))
6299            if (codeString == null || "".equals(codeString))
6300                return null;
6301        if ("number".equals(codeString))
6302          return SearchParamType.NUMBER;
6303        if ("date".equals(codeString))
6304          return SearchParamType.DATE;
6305        if ("string".equals(codeString))
6306          return SearchParamType.STRING;
6307        if ("token".equals(codeString))
6308          return SearchParamType.TOKEN;
6309        if ("reference".equals(codeString))
6310          return SearchParamType.REFERENCE;
6311        if ("composite".equals(codeString))
6312          return SearchParamType.COMPOSITE;
6313        if ("quantity".equals(codeString))
6314          return SearchParamType.QUANTITY;
6315        if ("uri".equals(codeString))
6316          return SearchParamType.URI;
6317        throw new IllegalArgumentException("Unknown SearchParamType code '"+codeString+"'");
6318        }
6319        public Enumeration<SearchParamType> fromType(Base code) throws FHIRException {
6320          if (code == null || code.isEmpty())
6321            return null;
6322          String codeString = ((PrimitiveType) code).asStringValue();
6323          if (codeString == null || "".equals(codeString))
6324            return null;
6325        if ("number".equals(codeString))
6326          return new Enumeration<SearchParamType>(this, SearchParamType.NUMBER);
6327        if ("date".equals(codeString))
6328          return new Enumeration<SearchParamType>(this, SearchParamType.DATE);
6329        if ("string".equals(codeString))
6330          return new Enumeration<SearchParamType>(this, SearchParamType.STRING);
6331        if ("token".equals(codeString))
6332          return new Enumeration<SearchParamType>(this, SearchParamType.TOKEN);
6333        if ("reference".equals(codeString))
6334          return new Enumeration<SearchParamType>(this, SearchParamType.REFERENCE);
6335        if ("composite".equals(codeString))
6336          return new Enumeration<SearchParamType>(this, SearchParamType.COMPOSITE);
6337        if ("quantity".equals(codeString))
6338          return new Enumeration<SearchParamType>(this, SearchParamType.QUANTITY);
6339        if ("uri".equals(codeString))
6340          return new Enumeration<SearchParamType>(this, SearchParamType.URI);
6341        throw new FHIRException("Unknown SearchParamType code '"+codeString+"'");
6342        }
6343    public String toCode(SearchParamType code) {
6344      if (code == SearchParamType.NUMBER)
6345        return "number";
6346      if (code == SearchParamType.DATE)
6347        return "date";
6348      if (code == SearchParamType.STRING)
6349        return "string";
6350      if (code == SearchParamType.TOKEN)
6351        return "token";
6352      if (code == SearchParamType.REFERENCE)
6353        return "reference";
6354      if (code == SearchParamType.COMPOSITE)
6355        return "composite";
6356      if (code == SearchParamType.QUANTITY)
6357        return "quantity";
6358      if (code == SearchParamType.URI)
6359        return "uri";
6360      return "?";
6361      }
6362    }
6363
6364    public enum SpecialValues {
6365        /**
6366         * Boolean true.
6367         */
6368        TRUE, 
6369        /**
6370         * Boolean false.
6371         */
6372        FALSE, 
6373        /**
6374         * The content is greater than zero, but too small to be quantified.
6375         */
6376        TRACE, 
6377        /**
6378         * The specific quantity is not known, but is known to be non-zero and is not specified because it makes up the bulk of the material.
6379         */
6380        SUFFICIENT, 
6381        /**
6382         * The value is no longer available.
6383         */
6384        WITHDRAWN, 
6385        /**
6386         * The are no known applicable values in this context.
6387         */
6388        NILKNOWN, 
6389        /**
6390         * added to help the parsers
6391         */
6392        NULL;
6393        public static SpecialValues fromCode(String codeString) throws FHIRException {
6394            if (codeString == null || "".equals(codeString))
6395                return null;
6396        if ("true".equals(codeString))
6397          return TRUE;
6398        if ("false".equals(codeString))
6399          return FALSE;
6400        if ("trace".equals(codeString))
6401          return TRACE;
6402        if ("sufficient".equals(codeString))
6403          return SUFFICIENT;
6404        if ("withdrawn".equals(codeString))
6405          return WITHDRAWN;
6406        if ("nil-known".equals(codeString))
6407          return NILKNOWN;
6408        throw new FHIRException("Unknown SpecialValues code '"+codeString+"'");
6409        }
6410        public String toCode() {
6411          switch (this) {
6412            case TRUE: return "true";
6413            case FALSE: return "false";
6414            case TRACE: return "trace";
6415            case SUFFICIENT: return "sufficient";
6416            case WITHDRAWN: return "withdrawn";
6417            case NILKNOWN: return "nil-known";
6418            case NULL: return null;
6419            default: return "?";
6420          }
6421        }
6422        public String getSystem() {
6423          switch (this) {
6424            case TRUE: return "http://hl7.org/fhir/special-values";
6425            case FALSE: return "http://hl7.org/fhir/special-values";
6426            case TRACE: return "http://hl7.org/fhir/special-values";
6427            case SUFFICIENT: return "http://hl7.org/fhir/special-values";
6428            case WITHDRAWN: return "http://hl7.org/fhir/special-values";
6429            case NILKNOWN: return "http://hl7.org/fhir/special-values";
6430            case NULL: return null;
6431            default: return "?";
6432          }
6433        }
6434        public String getDefinition() {
6435          switch (this) {
6436            case TRUE: return "Boolean true.";
6437            case FALSE: return "Boolean false.";
6438            case TRACE: return "The content is greater than zero, but too small to be quantified.";
6439            case SUFFICIENT: return "The specific quantity is not known, but is known to be non-zero and is not specified because it makes up the bulk of the material.";
6440            case WITHDRAWN: return "The value is no longer available.";
6441            case NILKNOWN: return "The are no known applicable values in this context.";
6442            case NULL: return null;
6443            default: return "?";
6444          }
6445        }
6446        public String getDisplay() {
6447          switch (this) {
6448            case TRUE: return "true";
6449            case FALSE: return "false";
6450            case TRACE: return "Trace Amount Detected";
6451            case SUFFICIENT: return "Sufficient Quantity";
6452            case WITHDRAWN: return "Value Withdrawn";
6453            case NILKNOWN: return "Nil Known";
6454            case NULL: return null;
6455            default: return "?";
6456          }
6457        }
6458    }
6459
6460  public static class SpecialValuesEnumFactory implements EnumFactory<SpecialValues> {
6461    public SpecialValues fromCode(String codeString) throws IllegalArgumentException {
6462      if (codeString == null || "".equals(codeString))
6463            if (codeString == null || "".equals(codeString))
6464                return null;
6465        if ("true".equals(codeString))
6466          return SpecialValues.TRUE;
6467        if ("false".equals(codeString))
6468          return SpecialValues.FALSE;
6469        if ("trace".equals(codeString))
6470          return SpecialValues.TRACE;
6471        if ("sufficient".equals(codeString))
6472          return SpecialValues.SUFFICIENT;
6473        if ("withdrawn".equals(codeString))
6474          return SpecialValues.WITHDRAWN;
6475        if ("nil-known".equals(codeString))
6476          return SpecialValues.NILKNOWN;
6477        throw new IllegalArgumentException("Unknown SpecialValues code '"+codeString+"'");
6478        }
6479        public Enumeration<SpecialValues> fromType(Base code) throws FHIRException {
6480          if (code == null || code.isEmpty())
6481            return null;
6482          String codeString = ((PrimitiveType) code).asStringValue();
6483          if (codeString == null || "".equals(codeString))
6484            return null;
6485        if ("true".equals(codeString))
6486          return new Enumeration<SpecialValues>(this, SpecialValues.TRUE);
6487        if ("false".equals(codeString))
6488          return new Enumeration<SpecialValues>(this, SpecialValues.FALSE);
6489        if ("trace".equals(codeString))
6490          return new Enumeration<SpecialValues>(this, SpecialValues.TRACE);
6491        if ("sufficient".equals(codeString))
6492          return new Enumeration<SpecialValues>(this, SpecialValues.SUFFICIENT);
6493        if ("withdrawn".equals(codeString))
6494          return new Enumeration<SpecialValues>(this, SpecialValues.WITHDRAWN);
6495        if ("nil-known".equals(codeString))
6496          return new Enumeration<SpecialValues>(this, SpecialValues.NILKNOWN);
6497        throw new FHIRException("Unknown SpecialValues code '"+codeString+"'");
6498        }
6499    public String toCode(SpecialValues code) {
6500      if (code == SpecialValues.TRUE)
6501        return "true";
6502      if (code == SpecialValues.FALSE)
6503        return "false";
6504      if (code == SpecialValues.TRACE)
6505        return "trace";
6506      if (code == SpecialValues.SUFFICIENT)
6507        return "sufficient";
6508      if (code == SpecialValues.WITHDRAWN)
6509        return "withdrawn";
6510      if (code == SpecialValues.NILKNOWN)
6511        return "nil-known";
6512      return "?";
6513      }
6514    }
6515
6516
6517}