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
032import org.hl7.fhir.exceptions.FHIRException;
033
034public class Enumerations {
035
036// In here: 
037//   AdministrativeGender: The gender of a person used for administrative purposes.
038//   AgeUnits: A valueSet of UCUM codes for representing age value units.
039//   BindingStrength: Indication of the degree of conformance expectations associated with a binding.
040//   ConceptMapEquivalence: The degree of equivalence between concepts.
041//   ConformanceResourceStatus: The lifecycle status of a Value Set or Concept Map.
042//   DataAbsentReason: Used to specify why the normally expected content of the data element is missing.
043//   DataType: The type of an element - one of the FHIR data types.
044//   DocumentReferenceStatus: The status of the document reference.
045//   FHIRDefinedType: Either a resource or a data type.
046//   MessageEvent: One of the message events defined as part of FHIR.
047//   NoteType: The presentation types of notes.
048//   RemittanceOutcome: The outcome of the processing.
049//   ResourceType: One of the resource types defined as part of FHIR.
050//   SearchParamType: Data types allowed to be used for search parameters.
051//   SpecialValues: A set of generally useful codes defined so they can be included in value sets.
052
053  public enum AdministrativeGender {
054    /**
055     * Male
056     */
057    MALE,
058    /**
059     * Female
060     */
061    FEMALE,
062    /**
063     * Other
064     */
065    OTHER,
066    /**
067     * Unknown
068     */
069    UNKNOWN,
070    /**
071     * added to help the parsers
072     */
073    NULL;
074
075    public static AdministrativeGender fromCode(String codeString) throws FHIRException {
076      if (codeString == null || "".equals(codeString))
077        return null;
078      if ("male".equals(codeString))
079        return MALE;
080      if ("female".equals(codeString))
081        return FEMALE;
082      if ("other".equals(codeString))
083        return OTHER;
084      if ("unknown".equals(codeString))
085        return UNKNOWN;
086      throw new FHIRException("Unknown AdministrativeGender code '" + codeString + "'");
087    }
088
089    public String toCode() {
090      switch (this) {
091      case MALE:
092        return "male";
093      case FEMALE:
094        return "female";
095      case OTHER:
096        return "other";
097      case UNKNOWN:
098        return "unknown";
099      case NULL:
100        return null;
101      default:
102        return "?";
103      }
104    }
105
106    public String getSystem() {
107      switch (this) {
108      case MALE:
109        return "http://hl7.org/fhir/administrative-gender";
110      case FEMALE:
111        return "http://hl7.org/fhir/administrative-gender";
112      case OTHER:
113        return "http://hl7.org/fhir/administrative-gender";
114      case UNKNOWN:
115        return "http://hl7.org/fhir/administrative-gender";
116      case NULL:
117        return null;
118      default:
119        return "?";
120      }
121    }
122
123    public String getDefinition() {
124      switch (this) {
125      case MALE:
126        return "Male";
127      case FEMALE:
128        return "Female";
129      case OTHER:
130        return "Other";
131      case UNKNOWN:
132        return "Unknown";
133      case NULL:
134        return null;
135      default:
136        return "?";
137      }
138    }
139
140    public String getDisplay() {
141      switch (this) {
142      case MALE:
143        return "Male";
144      case FEMALE:
145        return "Female";
146      case OTHER:
147        return "Other";
148      case UNKNOWN:
149        return "Unknown";
150      case NULL:
151        return null;
152      default:
153        return "?";
154      }
155    }
156  }
157
158  public static class AdministrativeGenderEnumFactory implements EnumFactory<AdministrativeGender> {
159    public AdministrativeGender fromCode(String codeString) throws IllegalArgumentException {
160      if (codeString == null || "".equals(codeString))
161        if (codeString == null || "".equals(codeString))
162          return null;
163      if ("male".equals(codeString))
164        return AdministrativeGender.MALE;
165      if ("female".equals(codeString))
166        return AdministrativeGender.FEMALE;
167      if ("other".equals(codeString))
168        return AdministrativeGender.OTHER;
169      if ("unknown".equals(codeString))
170        return AdministrativeGender.UNKNOWN;
171      throw new IllegalArgumentException("Unknown AdministrativeGender code '" + codeString + "'");
172    }
173
174    public Enumeration<AdministrativeGender> fromType(Base code) throws FHIRException {
175      if (code == null || code.isEmpty())
176        return null;
177      String codeString = ((PrimitiveType) code).asStringValue();
178      if (codeString == null || "".equals(codeString))
179        return null;
180      if ("male".equals(codeString))
181        return new Enumeration<AdministrativeGender>(this, AdministrativeGender.MALE);
182      if ("female".equals(codeString))
183        return new Enumeration<AdministrativeGender>(this, AdministrativeGender.FEMALE);
184      if ("other".equals(codeString))
185        return new Enumeration<AdministrativeGender>(this, AdministrativeGender.OTHER);
186      if ("unknown".equals(codeString))
187        return new Enumeration<AdministrativeGender>(this, AdministrativeGender.UNKNOWN);
188      throw new FHIRException("Unknown AdministrativeGender code '" + codeString + "'");
189    }
190
191    public String toCode(AdministrativeGender code) {
192      if (code == AdministrativeGender.MALE)
193        return "male";
194      if (code == AdministrativeGender.FEMALE)
195        return "female";
196      if (code == AdministrativeGender.OTHER)
197        return "other";
198      if (code == AdministrativeGender.UNKNOWN)
199        return "unknown";
200      return "?";
201    }
202  }
203
204  public enum AgeUnits {
205    /**
206     * null
207     */
208    MIN,
209    /**
210     * null
211     */
212    H,
213    /**
214     * null
215     */
216    D,
217    /**
218     * null
219     */
220    WK,
221    /**
222     * null
223     */
224    MO,
225    /**
226     * null
227     */
228    A,
229    /**
230     * added to help the parsers
231     */
232    NULL;
233
234    public static AgeUnits fromCode(String codeString) throws FHIRException {
235      if (codeString == null || "".equals(codeString))
236        return null;
237      if ("min".equals(codeString))
238        return MIN;
239      if ("h".equals(codeString))
240        return H;
241      if ("d".equals(codeString))
242        return D;
243      if ("wk".equals(codeString))
244        return WK;
245      if ("mo".equals(codeString))
246        return MO;
247      if ("a".equals(codeString))
248        return A;
249      throw new FHIRException("Unknown AgeUnits code '" + codeString + "'");
250    }
251
252    public String toCode() {
253      switch (this) {
254      case MIN:
255        return "min";
256      case H:
257        return "h";
258      case D:
259        return "d";
260      case WK:
261        return "wk";
262      case MO:
263        return "mo";
264      case A:
265        return "a";
266      case NULL:
267        return null;
268      default:
269        return "?";
270      }
271    }
272
273    public String getSystem() {
274      switch (this) {
275      case MIN:
276        return "http://unitsofmeasure.org";
277      case H:
278        return "http://unitsofmeasure.org";
279      case D:
280        return "http://unitsofmeasure.org";
281      case WK:
282        return "http://unitsofmeasure.org";
283      case MO:
284        return "http://unitsofmeasure.org";
285      case A:
286        return "http://unitsofmeasure.org";
287      case NULL:
288        return null;
289      default:
290        return "?";
291      }
292    }
293
294    public String getDefinition() {
295      switch (this) {
296      case MIN:
297        return "";
298      case H:
299        return "";
300      case D:
301        return "";
302      case WK:
303        return "";
304      case MO:
305        return "";
306      case A:
307        return "";
308      case NULL:
309        return null;
310      default:
311        return "?";
312      }
313    }
314
315    public String getDisplay() {
316      switch (this) {
317      case MIN:
318        return "Minute";
319      case H:
320        return "Hour";
321      case D:
322        return "Day";
323      case WK:
324        return "Week";
325      case MO:
326        return "Month";
327      case A:
328        return "Year";
329      case NULL:
330        return null;
331      default:
332        return "?";
333      }
334    }
335  }
336
337  public static class AgeUnitsEnumFactory implements EnumFactory<AgeUnits> {
338    public AgeUnits fromCode(String codeString) throws IllegalArgumentException {
339      if (codeString == null || "".equals(codeString))
340        if (codeString == null || "".equals(codeString))
341          return null;
342      if ("min".equals(codeString))
343        return AgeUnits.MIN;
344      if ("h".equals(codeString))
345        return AgeUnits.H;
346      if ("d".equals(codeString))
347        return AgeUnits.D;
348      if ("wk".equals(codeString))
349        return AgeUnits.WK;
350      if ("mo".equals(codeString))
351        return AgeUnits.MO;
352      if ("a".equals(codeString))
353        return AgeUnits.A;
354      throw new IllegalArgumentException("Unknown AgeUnits code '" + codeString + "'");
355    }
356
357    public Enumeration<AgeUnits> fromType(Base code) throws FHIRException {
358      if (code == null || code.isEmpty())
359        return null;
360      String codeString = ((PrimitiveType) code).asStringValue();
361      if (codeString == null || "".equals(codeString))
362        return null;
363      if ("min".equals(codeString))
364        return new Enumeration<AgeUnits>(this, AgeUnits.MIN);
365      if ("h".equals(codeString))
366        return new Enumeration<AgeUnits>(this, AgeUnits.H);
367      if ("d".equals(codeString))
368        return new Enumeration<AgeUnits>(this, AgeUnits.D);
369      if ("wk".equals(codeString))
370        return new Enumeration<AgeUnits>(this, AgeUnits.WK);
371      if ("mo".equals(codeString))
372        return new Enumeration<AgeUnits>(this, AgeUnits.MO);
373      if ("a".equals(codeString))
374        return new Enumeration<AgeUnits>(this, AgeUnits.A);
375      throw new FHIRException("Unknown AgeUnits code '" + codeString + "'");
376    }
377
378    public String toCode(AgeUnits code) {
379      if (code == AgeUnits.MIN)
380        return "min";
381      if (code == AgeUnits.H)
382        return "h";
383      if (code == AgeUnits.D)
384        return "d";
385      if (code == AgeUnits.WK)
386        return "wk";
387      if (code == AgeUnits.MO)
388        return "mo";
389      if (code == AgeUnits.A)
390        return "a";
391      return "?";
392    }
393  }
394
395  public enum BindingStrength {
396    /**
397     * To be conformant, instances of this element SHALL include a code from the
398     * specified value set.
399     */
400    REQUIRED,
401    /**
402     * To be conformant, instances of this element SHALL include a code from the
403     * specified value set if any of the codes within the value set can apply to the
404     * concept being communicated. If the valueset does not cover the concept (based
405     * on human review), alternate codings (or, data type allowing, text) may be
406     * included instead.
407     */
408    EXTENSIBLE,
409    /**
410     * Instances are encouraged to draw from the specified codes for
411     * interoperability purposes but are not required to do so to be considered
412     * conformant.
413     */
414    PREFERRED,
415    /**
416     * Instances are not expected or even encouraged to draw from the specified
417     * value set. The value set merely provides examples of the types of concepts
418     * intended to be included.
419     */
420    EXAMPLE,
421    /**
422     * added to help the parsers
423     */
424    NULL;
425
426    public static BindingStrength fromCode(String codeString) throws FHIRException {
427      if (codeString == null || "".equals(codeString))
428        return null;
429      if ("required".equals(codeString))
430        return REQUIRED;
431      if ("extensible".equals(codeString))
432        return EXTENSIBLE;
433      if ("preferred".equals(codeString))
434        return PREFERRED;
435      if ("example".equals(codeString))
436        return EXAMPLE;
437      throw new FHIRException("Unknown BindingStrength code '" + codeString + "'");
438    }
439
440    public String toCode() {
441      switch (this) {
442      case REQUIRED:
443        return "required";
444      case EXTENSIBLE:
445        return "extensible";
446      case PREFERRED:
447        return "preferred";
448      case EXAMPLE:
449        return "example";
450      case NULL:
451        return null;
452      default:
453        return "?";
454      }
455    }
456
457    public String getSystem() {
458      switch (this) {
459      case REQUIRED:
460        return "http://hl7.org/fhir/binding-strength";
461      case EXTENSIBLE:
462        return "http://hl7.org/fhir/binding-strength";
463      case PREFERRED:
464        return "http://hl7.org/fhir/binding-strength";
465      case EXAMPLE:
466        return "http://hl7.org/fhir/binding-strength";
467      case NULL:
468        return null;
469      default:
470        return "?";
471      }
472    }
473
474    public String getDefinition() {
475      switch (this) {
476      case REQUIRED:
477        return "To be conformant, instances of this element SHALL include a code from the specified value set.";
478      case EXTENSIBLE:
479        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.";
480      case PREFERRED:
481        return "Instances are encouraged to draw from the specified codes for interoperability purposes but are not required to do so to be considered conformant.";
482      case EXAMPLE:
483        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.";
484      case NULL:
485        return null;
486      default:
487        return "?";
488      }
489    }
490
491    public String getDisplay() {
492      switch (this) {
493      case REQUIRED:
494        return "Required";
495      case EXTENSIBLE:
496        return "Extensible";
497      case PREFERRED:
498        return "Preferred";
499      case EXAMPLE:
500        return "Example";
501      case NULL:
502        return null;
503      default:
504        return "?";
505      }
506    }
507  }
508
509  public static class BindingStrengthEnumFactory implements EnumFactory<BindingStrength> {
510    public BindingStrength fromCode(String codeString) throws IllegalArgumentException {
511      if (codeString == null || "".equals(codeString))
512        if (codeString == null || "".equals(codeString))
513          return null;
514      if ("required".equals(codeString))
515        return BindingStrength.REQUIRED;
516      if ("extensible".equals(codeString))
517        return BindingStrength.EXTENSIBLE;
518      if ("preferred".equals(codeString))
519        return BindingStrength.PREFERRED;
520      if ("example".equals(codeString))
521        return BindingStrength.EXAMPLE;
522      throw new IllegalArgumentException("Unknown BindingStrength code '" + codeString + "'");
523    }
524
525    public Enumeration<BindingStrength> fromType(Base code) throws FHIRException {
526      if (code == null || code.isEmpty())
527        return null;
528      String codeString = ((PrimitiveType) code).asStringValue();
529      if (codeString == null || "".equals(codeString))
530        return null;
531      if ("required".equals(codeString))
532        return new Enumeration<BindingStrength>(this, BindingStrength.REQUIRED);
533      if ("extensible".equals(codeString))
534        return new Enumeration<BindingStrength>(this, BindingStrength.EXTENSIBLE);
535      if ("preferred".equals(codeString))
536        return new Enumeration<BindingStrength>(this, BindingStrength.PREFERRED);
537      if ("example".equals(codeString))
538        return new Enumeration<BindingStrength>(this, BindingStrength.EXAMPLE);
539      throw new FHIRException("Unknown BindingStrength code '" + codeString + "'");
540    }
541
542    public String toCode(BindingStrength code) {
543      if (code == BindingStrength.REQUIRED)
544        return "required";
545      if (code == BindingStrength.EXTENSIBLE)
546        return "extensible";
547      if (code == BindingStrength.PREFERRED)
548        return "preferred";
549      if (code == BindingStrength.EXAMPLE)
550        return "example";
551      return "?";
552    }
553  }
554
555  public enum ConceptMapEquivalence {
556    /**
557     * The definitions of the concepts mean the same thing (including when
558     * structural implications of meaning are considered) (i.e. extensionally
559     * identical).
560     */
561    EQUIVALENT,
562    /**
563     * The definitions of the concepts are exactly the same (i.e. only grammatical
564     * differences) and structural implications of meaning are identical or
565     * irrelevant (i.e. intentionally identical).
566     */
567    EQUAL,
568    /**
569     * The target mapping is wider in meaning than the source concept.
570     */
571    WIDER,
572    /**
573     * The target mapping subsumes the meaning of the source concept (e.g. the
574     * source is-a target).
575     */
576    SUBSUMES,
577    /**
578     * The target mapping is narrower in meaning that the source concept. The sense
579     * in which the mapping is narrower SHALL be described in the comments in this
580     * case, and applications should be careful when attempting to use these
581     * mappings operationally.
582     */
583    NARROWER,
584    /**
585     * The target mapping specializes the meaning of the source concept (e.g. the
586     * target is-a source).
587     */
588    SPECIALIZES,
589    /**
590     * The target mapping overlaps with the source concept, but both source and
591     * target cover additional meaning, or the definitions are imprecise and it is
592     * uncertain whether they have the same boundaries to their meaning. The sense
593     * in which the mapping is narrower SHALL be described in the comments in this
594     * case, and applications should be careful when attempting to use these
595     * mappings operationally.
596     */
597    INEXACT,
598    /**
599     * There is no match for this concept in the destination concept system.
600     */
601    UNMATCHED,
602    /**
603     * This is an explicit assertion that there is no mapping between the source and
604     * target concept.
605     */
606    DISJOINT,
607    /**
608     * added to help the parsers
609     */
610    NULL;
611
612    public static ConceptMapEquivalence fromCode(String codeString) throws FHIRException {
613      if (codeString == null || "".equals(codeString))
614        return null;
615      if ("equivalent".equals(codeString))
616        return EQUIVALENT;
617      if ("equal".equals(codeString))
618        return EQUAL;
619      if ("wider".equals(codeString))
620        return WIDER;
621      if ("subsumes".equals(codeString))
622        return SUBSUMES;
623      if ("narrower".equals(codeString))
624        return NARROWER;
625      if ("specializes".equals(codeString))
626        return SPECIALIZES;
627      if ("inexact".equals(codeString))
628        return INEXACT;
629      if ("unmatched".equals(codeString))
630        return UNMATCHED;
631      if ("disjoint".equals(codeString))
632        return DISJOINT;
633      throw new FHIRException("Unknown ConceptMapEquivalence code '" + codeString + "'");
634    }
635
636    public String toCode() {
637      switch (this) {
638      case EQUIVALENT:
639        return "equivalent";
640      case EQUAL:
641        return "equal";
642      case WIDER:
643        return "wider";
644      case SUBSUMES:
645        return "subsumes";
646      case NARROWER:
647        return "narrower";
648      case SPECIALIZES:
649        return "specializes";
650      case INEXACT:
651        return "inexact";
652      case UNMATCHED:
653        return "unmatched";
654      case DISJOINT:
655        return "disjoint";
656      case NULL:
657        return null;
658      default:
659        return "?";
660      }
661    }
662
663    public String getSystem() {
664      switch (this) {
665      case EQUIVALENT:
666        return "http://hl7.org/fhir/concept-map-equivalence";
667      case EQUAL:
668        return "http://hl7.org/fhir/concept-map-equivalence";
669      case WIDER:
670        return "http://hl7.org/fhir/concept-map-equivalence";
671      case SUBSUMES:
672        return "http://hl7.org/fhir/concept-map-equivalence";
673      case NARROWER:
674        return "http://hl7.org/fhir/concept-map-equivalence";
675      case SPECIALIZES:
676        return "http://hl7.org/fhir/concept-map-equivalence";
677      case INEXACT:
678        return "http://hl7.org/fhir/concept-map-equivalence";
679      case UNMATCHED:
680        return "http://hl7.org/fhir/concept-map-equivalence";
681      case DISJOINT:
682        return "http://hl7.org/fhir/concept-map-equivalence";
683      case NULL:
684        return null;
685      default:
686        return "?";
687      }
688    }
689
690    public String getDefinition() {
691      switch (this) {
692      case EQUIVALENT:
693        return "The definitions of the concepts mean the same thing (including when structural implications of meaning are considered) (i.e. extensionally identical).";
694      case EQUAL:
695        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).";
696      case WIDER:
697        return "The target mapping is wider in meaning than the source concept.";
698      case SUBSUMES:
699        return "The target mapping subsumes the meaning of the source concept (e.g. the source is-a target).";
700      case NARROWER:
701        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.";
702      case SPECIALIZES:
703        return "The target mapping specializes the meaning of the source concept (e.g. the target is-a source).";
704      case INEXACT:
705        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.";
706      case UNMATCHED:
707        return "There is no match for this concept in the destination concept system.";
708      case DISJOINT:
709        return "This is an explicit assertion that there is no mapping between the source and target concept.";
710      case NULL:
711        return null;
712      default:
713        return "?";
714      }
715    }
716
717    public String getDisplay() {
718      switch (this) {
719      case EQUIVALENT:
720        return "Equivalent";
721      case EQUAL:
722        return "Equal";
723      case WIDER:
724        return "Wider";
725      case SUBSUMES:
726        return "Subsumes";
727      case NARROWER:
728        return "Narrower";
729      case SPECIALIZES:
730        return "Specializes";
731      case INEXACT:
732        return "Inexact";
733      case UNMATCHED:
734        return "Unmatched";
735      case DISJOINT:
736        return "Disjoint";
737      case NULL:
738        return null;
739      default:
740        return "?";
741      }
742    }
743  }
744
745  public static class ConceptMapEquivalenceEnumFactory implements EnumFactory<ConceptMapEquivalence> {
746    public ConceptMapEquivalence fromCode(String codeString) throws IllegalArgumentException {
747      if (codeString == null || "".equals(codeString))
748        if (codeString == null || "".equals(codeString))
749          return null;
750      if ("equivalent".equals(codeString))
751        return ConceptMapEquivalence.EQUIVALENT;
752      if ("equal".equals(codeString))
753        return ConceptMapEquivalence.EQUAL;
754      if ("wider".equals(codeString))
755        return ConceptMapEquivalence.WIDER;
756      if ("subsumes".equals(codeString))
757        return ConceptMapEquivalence.SUBSUMES;
758      if ("narrower".equals(codeString))
759        return ConceptMapEquivalence.NARROWER;
760      if ("specializes".equals(codeString))
761        return ConceptMapEquivalence.SPECIALIZES;
762      if ("inexact".equals(codeString))
763        return ConceptMapEquivalence.INEXACT;
764      if ("unmatched".equals(codeString))
765        return ConceptMapEquivalence.UNMATCHED;
766      if ("disjoint".equals(codeString))
767        return ConceptMapEquivalence.DISJOINT;
768      throw new IllegalArgumentException("Unknown ConceptMapEquivalence code '" + codeString + "'");
769    }
770
771    public Enumeration<ConceptMapEquivalence> fromType(Base code) throws FHIRException {
772      if (code == null || code.isEmpty())
773        return null;
774      String codeString = ((PrimitiveType) code).asStringValue();
775      if (codeString == null || "".equals(codeString))
776        return null;
777      if ("equivalent".equals(codeString))
778        return new Enumeration<ConceptMapEquivalence>(this, ConceptMapEquivalence.EQUIVALENT);
779      if ("equal".equals(codeString))
780        return new Enumeration<ConceptMapEquivalence>(this, ConceptMapEquivalence.EQUAL);
781      if ("wider".equals(codeString))
782        return new Enumeration<ConceptMapEquivalence>(this, ConceptMapEquivalence.WIDER);
783      if ("subsumes".equals(codeString))
784        return new Enumeration<ConceptMapEquivalence>(this, ConceptMapEquivalence.SUBSUMES);
785      if ("narrower".equals(codeString))
786        return new Enumeration<ConceptMapEquivalence>(this, ConceptMapEquivalence.NARROWER);
787      if ("specializes".equals(codeString))
788        return new Enumeration<ConceptMapEquivalence>(this, ConceptMapEquivalence.SPECIALIZES);
789      if ("inexact".equals(codeString))
790        return new Enumeration<ConceptMapEquivalence>(this, ConceptMapEquivalence.INEXACT);
791      if ("unmatched".equals(codeString))
792        return new Enumeration<ConceptMapEquivalence>(this, ConceptMapEquivalence.UNMATCHED);
793      if ("disjoint".equals(codeString))
794        return new Enumeration<ConceptMapEquivalence>(this, ConceptMapEquivalence.DISJOINT);
795      throw new FHIRException("Unknown ConceptMapEquivalence code '" + codeString + "'");
796    }
797
798    public String toCode(ConceptMapEquivalence code) {
799      if (code == ConceptMapEquivalence.EQUIVALENT)
800        return "equivalent";
801      if (code == ConceptMapEquivalence.EQUAL)
802        return "equal";
803      if (code == ConceptMapEquivalence.WIDER)
804        return "wider";
805      if (code == ConceptMapEquivalence.SUBSUMES)
806        return "subsumes";
807      if (code == ConceptMapEquivalence.NARROWER)
808        return "narrower";
809      if (code == ConceptMapEquivalence.SPECIALIZES)
810        return "specializes";
811      if (code == ConceptMapEquivalence.INEXACT)
812        return "inexact";
813      if (code == ConceptMapEquivalence.UNMATCHED)
814        return "unmatched";
815      if (code == ConceptMapEquivalence.DISJOINT)
816        return "disjoint";
817      return "?";
818    }
819  }
820
821  public enum ConformanceResourceStatus {
822    /**
823     * This resource is still under development.
824     */
825    DRAFT,
826    /**
827     * This resource is ready for normal use.
828     */
829    ACTIVE,
830    /**
831     * This resource has been withdrawn or superseded and should no longer be used.
832     */
833    RETIRED,
834    /**
835     * added to help the parsers
836     */
837    NULL;
838
839    public static ConformanceResourceStatus fromCode(String codeString) throws FHIRException {
840      if (codeString == null || "".equals(codeString))
841        return null;
842      if ("draft".equals(codeString))
843        return DRAFT;
844      if ("active".equals(codeString))
845        return ACTIVE;
846      if ("retired".equals(codeString))
847        return RETIRED;
848      throw new FHIRException("Unknown ConformanceResourceStatus code '" + codeString + "'");
849    }
850
851    public String toCode() {
852      switch (this) {
853      case DRAFT:
854        return "draft";
855      case ACTIVE:
856        return "active";
857      case RETIRED:
858        return "retired";
859      case NULL:
860        return null;
861      default:
862        return "?";
863      }
864    }
865
866    public String getSystem() {
867      switch (this) {
868      case DRAFT:
869        return "http://hl7.org/fhir/conformance-resource-status";
870      case ACTIVE:
871        return "http://hl7.org/fhir/conformance-resource-status";
872      case RETIRED:
873        return "http://hl7.org/fhir/conformance-resource-status";
874      case NULL:
875        return null;
876      default:
877        return "?";
878      }
879    }
880
881    public String getDefinition() {
882      switch (this) {
883      case DRAFT:
884        return "This resource is still under development.";
885      case ACTIVE:
886        return "This resource is ready for normal use.";
887      case RETIRED:
888        return "This resource has been withdrawn or superseded and should no longer be used.";
889      case NULL:
890        return null;
891      default:
892        return "?";
893      }
894    }
895
896    public String getDisplay() {
897      switch (this) {
898      case DRAFT:
899        return "Draft";
900      case ACTIVE:
901        return "Active";
902      case RETIRED:
903        return "Retired";
904      case NULL:
905        return null;
906      default:
907        return "?";
908      }
909    }
910  }
911
912  public static class ConformanceResourceStatusEnumFactory implements EnumFactory<ConformanceResourceStatus> {
913    public ConformanceResourceStatus fromCode(String codeString) throws IllegalArgumentException {
914      if (codeString == null || "".equals(codeString))
915        if (codeString == null || "".equals(codeString))
916          return null;
917      if ("draft".equals(codeString))
918        return ConformanceResourceStatus.DRAFT;
919      if ("active".equals(codeString))
920        return ConformanceResourceStatus.ACTIVE;
921      if ("retired".equals(codeString))
922        return ConformanceResourceStatus.RETIRED;
923      throw new IllegalArgumentException("Unknown ConformanceResourceStatus code '" + codeString + "'");
924    }
925
926    public Enumeration<ConformanceResourceStatus> fromType(Base code) throws FHIRException {
927      if (code == null || code.isEmpty())
928        return null;
929      String codeString = ((PrimitiveType) code).asStringValue();
930      if (codeString == null || "".equals(codeString))
931        return null;
932      if ("draft".equals(codeString))
933        return new Enumeration<ConformanceResourceStatus>(this, ConformanceResourceStatus.DRAFT);
934      if ("active".equals(codeString))
935        return new Enumeration<ConformanceResourceStatus>(this, ConformanceResourceStatus.ACTIVE);
936      if ("retired".equals(codeString))
937        return new Enumeration<ConformanceResourceStatus>(this, ConformanceResourceStatus.RETIRED);
938      throw new FHIRException("Unknown ConformanceResourceStatus code '" + codeString + "'");
939    }
940
941    public String toCode(ConformanceResourceStatus code) {
942      if (code == ConformanceResourceStatus.DRAFT)
943        return "draft";
944      if (code == ConformanceResourceStatus.ACTIVE)
945        return "active";
946      if (code == ConformanceResourceStatus.RETIRED)
947        return "retired";
948      return "?";
949    }
950  }
951
952  public enum DataAbsentReason {
953    /**
954     * The value is not known.
955     */
956    UNKNOWN,
957    /**
958     * The source human does not know the value.
959     */
960    ASKED,
961    /**
962     * There is reason to expect (from the workflow) that the value may become
963     * known.
964     */
965    TEMP,
966    /**
967     * The workflow didn't lead to this value being known.
968     */
969    NOTASKED,
970    /**
971     * The information is not available due to security, privacy or related reasons.
972     */
973    MASKED,
974    /**
975     * The source system wasn't capable of supporting this element.
976     */
977    UNSUPPORTED,
978    /**
979     * The content of the data is represented in the resource narrative.
980     */
981    ASTEXT,
982    /**
983     * Some system or workflow process error means that the information is not
984     * available.
985     */
986    ERROR,
987    /**
988     * NaN, standing for not a number, is a numeric data type value representing an
989     * undefined or unrepresentable value.
990     */
991    NAN,
992    /**
993     * added to help the parsers
994     */
995    NULL;
996
997    public static DataAbsentReason fromCode(String codeString) throws FHIRException {
998      if (codeString == null || "".equals(codeString))
999        return null;
1000      if ("unknown".equals(codeString))
1001        return UNKNOWN;
1002      if ("asked".equals(codeString))
1003        return ASKED;
1004      if ("temp".equals(codeString))
1005        return TEMP;
1006      if ("not-asked".equals(codeString))
1007        return NOTASKED;
1008      if ("masked".equals(codeString))
1009        return MASKED;
1010      if ("unsupported".equals(codeString))
1011        return UNSUPPORTED;
1012      if ("astext".equals(codeString))
1013        return ASTEXT;
1014      if ("error".equals(codeString))
1015        return ERROR;
1016      if ("NaN".equals(codeString))
1017        return NAN;
1018      throw new FHIRException("Unknown DataAbsentReason code '" + codeString + "'");
1019    }
1020
1021    public String toCode() {
1022      switch (this) {
1023      case UNKNOWN:
1024        return "unknown";
1025      case ASKED:
1026        return "asked";
1027      case TEMP:
1028        return "temp";
1029      case NOTASKED:
1030        return "not-asked";
1031      case MASKED:
1032        return "masked";
1033      case UNSUPPORTED:
1034        return "unsupported";
1035      case ASTEXT:
1036        return "astext";
1037      case ERROR:
1038        return "error";
1039      case NAN:
1040        return "NaN";
1041      case NULL:
1042        return null;
1043      default:
1044        return "?";
1045      }
1046    }
1047
1048    public String getSystem() {
1049      switch (this) {
1050      case UNKNOWN:
1051        return "http://hl7.org/fhir/data-absent-reason";
1052      case ASKED:
1053        return "http://hl7.org/fhir/data-absent-reason";
1054      case TEMP:
1055        return "http://hl7.org/fhir/data-absent-reason";
1056      case NOTASKED:
1057        return "http://hl7.org/fhir/data-absent-reason";
1058      case MASKED:
1059        return "http://hl7.org/fhir/data-absent-reason";
1060      case UNSUPPORTED:
1061        return "http://hl7.org/fhir/data-absent-reason";
1062      case ASTEXT:
1063        return "http://hl7.org/fhir/data-absent-reason";
1064      case ERROR:
1065        return "http://hl7.org/fhir/data-absent-reason";
1066      case NAN:
1067        return "http://hl7.org/fhir/data-absent-reason";
1068      case NULL:
1069        return null;
1070      default:
1071        return "?";
1072      }
1073    }
1074
1075    public String getDefinition() {
1076      switch (this) {
1077      case UNKNOWN:
1078        return "The value is not known.";
1079      case ASKED:
1080        return "The source human does not know the value.";
1081      case TEMP:
1082        return "There is reason to expect (from the workflow) that the value may become known.";
1083      case NOTASKED:
1084        return "The workflow didn't lead to this value being known.";
1085      case MASKED:
1086        return "The information is not available due to security, privacy or related reasons.";
1087      case UNSUPPORTED:
1088        return "The source system wasn't capable of supporting this element.";
1089      case ASTEXT:
1090        return "The content of the data is represented in the resource narrative.";
1091      case ERROR:
1092        return "Some system or workflow process error means that the information is not available.";
1093      case NAN:
1094        return "NaN, standing for not a number, is a numeric data type value representing an undefined or unrepresentable value.";
1095      case NULL:
1096        return null;
1097      default:
1098        return "?";
1099      }
1100    }
1101
1102    public String getDisplay() {
1103      switch (this) {
1104      case UNKNOWN:
1105        return "Unknown";
1106      case ASKED:
1107        return "Asked";
1108      case TEMP:
1109        return "Temp";
1110      case NOTASKED:
1111        return "Not Asked";
1112      case MASKED:
1113        return "Masked";
1114      case UNSUPPORTED:
1115        return "Unsupported";
1116      case ASTEXT:
1117        return "As Text";
1118      case ERROR:
1119        return "Error";
1120      case NAN:
1121        return "Not a Number";
1122      case NULL:
1123        return null;
1124      default:
1125        return "?";
1126      }
1127    }
1128  }
1129
1130  public static class DataAbsentReasonEnumFactory implements EnumFactory<DataAbsentReason> {
1131    public DataAbsentReason fromCode(String codeString) throws IllegalArgumentException {
1132      if (codeString == null || "".equals(codeString))
1133        if (codeString == null || "".equals(codeString))
1134          return null;
1135      if ("unknown".equals(codeString))
1136        return DataAbsentReason.UNKNOWN;
1137      if ("asked".equals(codeString))
1138        return DataAbsentReason.ASKED;
1139      if ("temp".equals(codeString))
1140        return DataAbsentReason.TEMP;
1141      if ("not-asked".equals(codeString))
1142        return DataAbsentReason.NOTASKED;
1143      if ("masked".equals(codeString))
1144        return DataAbsentReason.MASKED;
1145      if ("unsupported".equals(codeString))
1146        return DataAbsentReason.UNSUPPORTED;
1147      if ("astext".equals(codeString))
1148        return DataAbsentReason.ASTEXT;
1149      if ("error".equals(codeString))
1150        return DataAbsentReason.ERROR;
1151      if ("NaN".equals(codeString))
1152        return DataAbsentReason.NAN;
1153      throw new IllegalArgumentException("Unknown DataAbsentReason code '" + codeString + "'");
1154    }
1155
1156    public Enumeration<DataAbsentReason> fromType(Base code) throws FHIRException {
1157      if (code == null || code.isEmpty())
1158        return null;
1159      String codeString = ((PrimitiveType) code).asStringValue();
1160      if (codeString == null || "".equals(codeString))
1161        return null;
1162      if ("unknown".equals(codeString))
1163        return new Enumeration<DataAbsentReason>(this, DataAbsentReason.UNKNOWN);
1164      if ("asked".equals(codeString))
1165        return new Enumeration<DataAbsentReason>(this, DataAbsentReason.ASKED);
1166      if ("temp".equals(codeString))
1167        return new Enumeration<DataAbsentReason>(this, DataAbsentReason.TEMP);
1168      if ("not-asked".equals(codeString))
1169        return new Enumeration<DataAbsentReason>(this, DataAbsentReason.NOTASKED);
1170      if ("masked".equals(codeString))
1171        return new Enumeration<DataAbsentReason>(this, DataAbsentReason.MASKED);
1172      if ("unsupported".equals(codeString))
1173        return new Enumeration<DataAbsentReason>(this, DataAbsentReason.UNSUPPORTED);
1174      if ("astext".equals(codeString))
1175        return new Enumeration<DataAbsentReason>(this, DataAbsentReason.ASTEXT);
1176      if ("error".equals(codeString))
1177        return new Enumeration<DataAbsentReason>(this, DataAbsentReason.ERROR);
1178      if ("NaN".equals(codeString))
1179        return new Enumeration<DataAbsentReason>(this, DataAbsentReason.NAN);
1180      throw new FHIRException("Unknown DataAbsentReason code '" + codeString + "'");
1181    }
1182
1183    public String toCode(DataAbsentReason code) {
1184      if (code == DataAbsentReason.UNKNOWN)
1185        return "unknown";
1186      if (code == DataAbsentReason.ASKED)
1187        return "asked";
1188      if (code == DataAbsentReason.TEMP)
1189        return "temp";
1190      if (code == DataAbsentReason.NOTASKED)
1191        return "not-asked";
1192      if (code == DataAbsentReason.MASKED)
1193        return "masked";
1194      if (code == DataAbsentReason.UNSUPPORTED)
1195        return "unsupported";
1196      if (code == DataAbsentReason.ASTEXT)
1197        return "astext";
1198      if (code == DataAbsentReason.ERROR)
1199        return "error";
1200      if (code == DataAbsentReason.NAN)
1201        return "NaN";
1202      return "?";
1203    }
1204  }
1205
1206  public enum DataType {
1207    /**
1208     * There is a variety of postal address formats defined around the world. This
1209     * format defines a superset that is the basis for all addresses around the
1210     * world.
1211     */
1212    ADDRESS,
1213    /**
1214     * null
1215     */
1216    AGE,
1217    /**
1218     * A text note which also contains information about who made the statement and
1219     * when.
1220     */
1221    ANNOTATION,
1222    /**
1223     * For referring to data content defined in other formats.
1224     */
1225    ATTACHMENT,
1226    /**
1227     * Base definition for all elements that are defined inside a resource - but not
1228     * those in a data type.
1229     */
1230    BACKBONEELEMENT,
1231    /**
1232     * A concept that may be defined by a formal reference to a terminology or
1233     * ontology or may be provided by text.
1234     */
1235    CODEABLECONCEPT,
1236    /**
1237     * A reference to a code defined by a terminology system.
1238     */
1239    CODING,
1240    /**
1241     * Details for all kinds of technology mediated contact points for a person or
1242     * organization, including telephone, email, etc.
1243     */
1244    CONTACTPOINT,
1245    /**
1246     * null
1247     */
1248    COUNT,
1249    /**
1250     * null
1251     */
1252    DISTANCE,
1253    /**
1254     * null
1255     */
1256    DURATION,
1257    /**
1258     * Base definition for all elements in a resource.
1259     */
1260    ELEMENT,
1261    /**
1262     * Captures constraints on each element within the resource, profile, or
1263     * extension.
1264     */
1265    ELEMENTDEFINITION,
1266    /**
1267     * Optional Extensions Element - found in all resources.
1268     */
1269    EXTENSION,
1270    /**
1271     * A human's name with the ability to identify parts and usage.
1272     */
1273    HUMANNAME,
1274    /**
1275     * A technical identifier - identifies some entity uniquely and unambiguously.
1276     */
1277    IDENTIFIER,
1278    /**
1279     * The metadata about a resource. This is content in the resource that is
1280     * maintained by the infrastructure. Changes to the content may not always be
1281     * associated with version changes to the resource.
1282     */
1283    META,
1284    /**
1285     * null
1286     */
1287    MONEY,
1288    /**
1289     * A human-readable formatted text, including images.
1290     */
1291    NARRATIVE,
1292    /**
1293     * A time period defined by a start and end date and optionally time.
1294     */
1295    PERIOD,
1296    /**
1297     * A measured amount (or an amount that can potentially be measured). Note that
1298     * measured amounts include amounts that are not precisely quantified, including
1299     * amounts involving arbitrary units and floating currencies.
1300     */
1301    QUANTITY,
1302    /**
1303     * A set of ordered Quantities defined by a low and high limit.
1304     */
1305    RANGE,
1306    /**
1307     * A relationship of two Quantity values - expressed as a numerator and a
1308     * denominator.
1309     */
1310    RATIO,
1311    /**
1312     * A reference from one resource to another.
1313     */
1314    REFERENCE,
1315    /**
1316     * A series of measurements taken by a device, with upper and lower limits.
1317     * There may be more than one dimension in the data.
1318     */
1319    SAMPLEDDATA,
1320    /**
1321     * A digital signature along with supporting context. The signature may be
1322     * electronic/cryptographic in nature, or a graphical image representing a
1323     * hand-written signature, or a signature process. Different Signature
1324     * approaches have different utilities.
1325     */
1326    SIGNATURE,
1327    /**
1328     * null
1329     */
1330    SIMPLEQUANTITY,
1331    /**
1332     * Specifies an event that may occur multiple times. Timing schedules are used
1333     * to record when things are expected or requested to occur. The most common
1334     * usage is in dosage instructions for medications. They are also used when
1335     * planning care of various kinds.
1336     */
1337    TIMING,
1338    /**
1339     * A stream of bytes
1340     */
1341    BASE64BINARY,
1342    /**
1343     * Value of "true" or "false"
1344     */
1345    BOOLEAN,
1346    /**
1347     * A string which has at least one character and no leading or trailing
1348     * whitespace and where there is no whitespace other than single spaces in the
1349     * contents
1350     */
1351    CODE,
1352    /**
1353     * A date or partial date (e.g. just year or year + month). There is no time
1354     * zone. The format is a union of the schema types gYear, gYearMonth and date.
1355     * Dates SHALL be valid dates.
1356     */
1357    DATE,
1358    /**
1359     * A date, date-time or partial date (e.g. just year or year + month). If hours
1360     * and minutes are specified, a time zone SHALL be populated. The format is a
1361     * union of the schema types gYear, gYearMonth, date and dateTime. Seconds must
1362     * be provided due to schema type constraints but may be zero-filled and may be
1363     * ignored. Dates SHALL be valid dates.
1364     */
1365    DATETIME,
1366    /**
1367     * A rational number with implicit precision
1368     */
1369    DECIMAL,
1370    /**
1371     * Any combination of letters, numerals, "-" and ".", with a length limit of 64
1372     * characters. (This might be an integer, an unprefixed OID, UUID or any other
1373     * identifier pattern that meets these constraints.) Ids are case-insensitive.
1374     */
1375    ID,
1376    /**
1377     * An instant in time - known at least to the second
1378     */
1379    INSTANT,
1380    /**
1381     * A whole number
1382     */
1383    INTEGER,
1384    /**
1385     * A string that may contain markdown syntax for optional processing by a mark
1386     * down presentation engine
1387     */
1388    MARKDOWN,
1389    /**
1390     * An oid represented as a URI
1391     */
1392    OID,
1393    /**
1394     * An integer with a value that is positive (e.g. >0)
1395     */
1396    POSITIVEINT,
1397    /**
1398     * A sequence of Unicode characters
1399     */
1400    STRING,
1401    /**
1402     * A time during the day, with no date specified
1403     */
1404    TIME,
1405    /**
1406     * An integer with a value that is not negative (e.g. >= 0)
1407     */
1408    UNSIGNEDINT,
1409    /**
1410     * String of characters used to identify a name or a resource
1411     */
1412    URI,
1413    /**
1414     * A UUID, represented as a URI
1415     */
1416    UUID,
1417    /**
1418     * XHTML format, as defined by W3C, but restricted usage (mainly, no active
1419     * content)
1420     */
1421    XHTML,
1422    /**
1423     * added to help the parsers
1424     */
1425    NULL;
1426
1427    public static DataType fromCode(String codeString) throws FHIRException {
1428      if (codeString == null || "".equals(codeString))
1429        return null;
1430      if ("Address".equals(codeString))
1431        return ADDRESS;
1432      if ("Age".equals(codeString))
1433        return AGE;
1434      if ("Annotation".equals(codeString))
1435        return ANNOTATION;
1436      if ("Attachment".equals(codeString))
1437        return ATTACHMENT;
1438      if ("BackboneElement".equals(codeString))
1439        return BACKBONEELEMENT;
1440      if ("CodeableConcept".equals(codeString))
1441        return CODEABLECONCEPT;
1442      if ("Coding".equals(codeString))
1443        return CODING;
1444      if ("ContactPoint".equals(codeString))
1445        return CONTACTPOINT;
1446      if ("Count".equals(codeString))
1447        return COUNT;
1448      if ("Distance".equals(codeString))
1449        return DISTANCE;
1450      if ("Duration".equals(codeString))
1451        return DURATION;
1452      if ("Element".equals(codeString))
1453        return ELEMENT;
1454      if ("ElementDefinition".equals(codeString))
1455        return ELEMENTDEFINITION;
1456      if ("Extension".equals(codeString))
1457        return EXTENSION;
1458      if ("HumanName".equals(codeString))
1459        return HUMANNAME;
1460      if ("Identifier".equals(codeString))
1461        return IDENTIFIER;
1462      if ("Meta".equals(codeString))
1463        return META;
1464      if ("Money".equals(codeString))
1465        return MONEY;
1466      if ("Narrative".equals(codeString))
1467        return NARRATIVE;
1468      if ("Period".equals(codeString))
1469        return PERIOD;
1470      if ("Quantity".equals(codeString))
1471        return QUANTITY;
1472      if ("Range".equals(codeString))
1473        return RANGE;
1474      if ("Ratio".equals(codeString))
1475        return RATIO;
1476      if ("Reference".equals(codeString))
1477        return REFERENCE;
1478      if ("SampledData".equals(codeString))
1479        return SAMPLEDDATA;
1480      if ("Signature".equals(codeString))
1481        return SIGNATURE;
1482      if ("SimpleQuantity".equals(codeString))
1483        return SIMPLEQUANTITY;
1484      if ("Timing".equals(codeString))
1485        return TIMING;
1486      if ("base64Binary".equals(codeString))
1487        return BASE64BINARY;
1488      if ("boolean".equals(codeString))
1489        return BOOLEAN;
1490      if ("code".equals(codeString))
1491        return CODE;
1492      if ("date".equals(codeString))
1493        return DATE;
1494      if ("dateTime".equals(codeString))
1495        return DATETIME;
1496      if ("decimal".equals(codeString))
1497        return DECIMAL;
1498      if ("id".equals(codeString))
1499        return ID;
1500      if ("instant".equals(codeString))
1501        return INSTANT;
1502      if ("integer".equals(codeString))
1503        return INTEGER;
1504      if ("markdown".equals(codeString))
1505        return MARKDOWN;
1506      if ("oid".equals(codeString))
1507        return OID;
1508      if ("positiveInt".equals(codeString))
1509        return POSITIVEINT;
1510      if ("string".equals(codeString))
1511        return STRING;
1512      if ("time".equals(codeString))
1513        return TIME;
1514      if ("unsignedInt".equals(codeString))
1515        return UNSIGNEDINT;
1516      if ("uri".equals(codeString))
1517        return URI;
1518      if ("uuid".equals(codeString))
1519        return UUID;
1520      if ("xhtml".equals(codeString))
1521        return XHTML;
1522      throw new FHIRException("Unknown DataType code '" + codeString + "'");
1523    }
1524
1525    public String toCode() {
1526      switch (this) {
1527      case ADDRESS:
1528        return "Address";
1529      case AGE:
1530        return "Age";
1531      case ANNOTATION:
1532        return "Annotation";
1533      case ATTACHMENT:
1534        return "Attachment";
1535      case BACKBONEELEMENT:
1536        return "BackboneElement";
1537      case CODEABLECONCEPT:
1538        return "CodeableConcept";
1539      case CODING:
1540        return "Coding";
1541      case CONTACTPOINT:
1542        return "ContactPoint";
1543      case COUNT:
1544        return "Count";
1545      case DISTANCE:
1546        return "Distance";
1547      case DURATION:
1548        return "Duration";
1549      case ELEMENT:
1550        return "Element";
1551      case ELEMENTDEFINITION:
1552        return "ElementDefinition";
1553      case EXTENSION:
1554        return "Extension";
1555      case HUMANNAME:
1556        return "HumanName";
1557      case IDENTIFIER:
1558        return "Identifier";
1559      case META:
1560        return "Meta";
1561      case MONEY:
1562        return "Money";
1563      case NARRATIVE:
1564        return "Narrative";
1565      case PERIOD:
1566        return "Period";
1567      case QUANTITY:
1568        return "Quantity";
1569      case RANGE:
1570        return "Range";
1571      case RATIO:
1572        return "Ratio";
1573      case REFERENCE:
1574        return "Reference";
1575      case SAMPLEDDATA:
1576        return "SampledData";
1577      case SIGNATURE:
1578        return "Signature";
1579      case SIMPLEQUANTITY:
1580        return "SimpleQuantity";
1581      case TIMING:
1582        return "Timing";
1583      case BASE64BINARY:
1584        return "base64Binary";
1585      case BOOLEAN:
1586        return "boolean";
1587      case CODE:
1588        return "code";
1589      case DATE:
1590        return "date";
1591      case DATETIME:
1592        return "dateTime";
1593      case DECIMAL:
1594        return "decimal";
1595      case ID:
1596        return "id";
1597      case INSTANT:
1598        return "instant";
1599      case INTEGER:
1600        return "integer";
1601      case MARKDOWN:
1602        return "markdown";
1603      case OID:
1604        return "oid";
1605      case POSITIVEINT:
1606        return "positiveInt";
1607      case STRING:
1608        return "string";
1609      case TIME:
1610        return "time";
1611      case UNSIGNEDINT:
1612        return "unsignedInt";
1613      case URI:
1614        return "uri";
1615      case UUID:
1616        return "uuid";
1617      case XHTML:
1618        return "xhtml";
1619      case NULL:
1620        return null;
1621      default:
1622        return "?";
1623      }
1624    }
1625
1626    public String getSystem() {
1627      switch (this) {
1628      case ADDRESS:
1629        return "http://hl7.org/fhir/data-types";
1630      case AGE:
1631        return "http://hl7.org/fhir/data-types";
1632      case ANNOTATION:
1633        return "http://hl7.org/fhir/data-types";
1634      case ATTACHMENT:
1635        return "http://hl7.org/fhir/data-types";
1636      case BACKBONEELEMENT:
1637        return "http://hl7.org/fhir/data-types";
1638      case CODEABLECONCEPT:
1639        return "http://hl7.org/fhir/data-types";
1640      case CODING:
1641        return "http://hl7.org/fhir/data-types";
1642      case CONTACTPOINT:
1643        return "http://hl7.org/fhir/data-types";
1644      case COUNT:
1645        return "http://hl7.org/fhir/data-types";
1646      case DISTANCE:
1647        return "http://hl7.org/fhir/data-types";
1648      case DURATION:
1649        return "http://hl7.org/fhir/data-types";
1650      case ELEMENT:
1651        return "http://hl7.org/fhir/data-types";
1652      case ELEMENTDEFINITION:
1653        return "http://hl7.org/fhir/data-types";
1654      case EXTENSION:
1655        return "http://hl7.org/fhir/data-types";
1656      case HUMANNAME:
1657        return "http://hl7.org/fhir/data-types";
1658      case IDENTIFIER:
1659        return "http://hl7.org/fhir/data-types";
1660      case META:
1661        return "http://hl7.org/fhir/data-types";
1662      case MONEY:
1663        return "http://hl7.org/fhir/data-types";
1664      case NARRATIVE:
1665        return "http://hl7.org/fhir/data-types";
1666      case PERIOD:
1667        return "http://hl7.org/fhir/data-types";
1668      case QUANTITY:
1669        return "http://hl7.org/fhir/data-types";
1670      case RANGE:
1671        return "http://hl7.org/fhir/data-types";
1672      case RATIO:
1673        return "http://hl7.org/fhir/data-types";
1674      case REFERENCE:
1675        return "http://hl7.org/fhir/data-types";
1676      case SAMPLEDDATA:
1677        return "http://hl7.org/fhir/data-types";
1678      case SIGNATURE:
1679        return "http://hl7.org/fhir/data-types";
1680      case SIMPLEQUANTITY:
1681        return "http://hl7.org/fhir/data-types";
1682      case TIMING:
1683        return "http://hl7.org/fhir/data-types";
1684      case BASE64BINARY:
1685        return "http://hl7.org/fhir/data-types";
1686      case BOOLEAN:
1687        return "http://hl7.org/fhir/data-types";
1688      case CODE:
1689        return "http://hl7.org/fhir/data-types";
1690      case DATE:
1691        return "http://hl7.org/fhir/data-types";
1692      case DATETIME:
1693        return "http://hl7.org/fhir/data-types";
1694      case DECIMAL:
1695        return "http://hl7.org/fhir/data-types";
1696      case ID:
1697        return "http://hl7.org/fhir/data-types";
1698      case INSTANT:
1699        return "http://hl7.org/fhir/data-types";
1700      case INTEGER:
1701        return "http://hl7.org/fhir/data-types";
1702      case MARKDOWN:
1703        return "http://hl7.org/fhir/data-types";
1704      case OID:
1705        return "http://hl7.org/fhir/data-types";
1706      case POSITIVEINT:
1707        return "http://hl7.org/fhir/data-types";
1708      case STRING:
1709        return "http://hl7.org/fhir/data-types";
1710      case TIME:
1711        return "http://hl7.org/fhir/data-types";
1712      case UNSIGNEDINT:
1713        return "http://hl7.org/fhir/data-types";
1714      case URI:
1715        return "http://hl7.org/fhir/data-types";
1716      case UUID:
1717        return "http://hl7.org/fhir/data-types";
1718      case XHTML:
1719        return "http://hl7.org/fhir/data-types";
1720      case NULL:
1721        return null;
1722      default:
1723        return "?";
1724      }
1725    }
1726
1727    public String getDefinition() {
1728      switch (this) {
1729      case ADDRESS:
1730        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.";
1731      case AGE:
1732        return "";
1733      case ANNOTATION:
1734        return "A  text note which also  contains information about who made the statement and when.";
1735      case ATTACHMENT:
1736        return "For referring to data content defined in other formats.";
1737      case BACKBONEELEMENT:
1738        return "Base definition for all elements that are defined inside a resource - but not those in a data type.";
1739      case CODEABLECONCEPT:
1740        return "A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text.";
1741      case CODING:
1742        return "A reference to a code defined by a terminology system.";
1743      case CONTACTPOINT:
1744        return "Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc.";
1745      case COUNT:
1746        return "";
1747      case DISTANCE:
1748        return "";
1749      case DURATION:
1750        return "";
1751      case ELEMENT:
1752        return "Base definition for all elements in a resource.";
1753      case ELEMENTDEFINITION:
1754        return "Captures constraints on each element within the resource, profile, or extension.";
1755      case EXTENSION:
1756        return "Optional Extensions Element - found in all resources.";
1757      case HUMANNAME:
1758        return "A human's name with the ability to identify parts and usage.";
1759      case IDENTIFIER:
1760        return "A technical identifier - identifies some entity uniquely and unambiguously.";
1761      case META:
1762        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.";
1763      case MONEY:
1764        return "";
1765      case NARRATIVE:
1766        return "A human-readable formatted text, including images.";
1767      case PERIOD:
1768        return "A time period defined by a start and end date and optionally time.";
1769      case QUANTITY:
1770        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.";
1771      case RANGE:
1772        return "A set of ordered Quantities defined by a low and high limit.";
1773      case RATIO:
1774        return "A relationship of two Quantity values - expressed as a numerator and a denominator.";
1775      case REFERENCE:
1776        return "A reference from one resource to another.";
1777      case SAMPLEDDATA:
1778        return "A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data.";
1779      case SIGNATURE:
1780        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.";
1781      case SIMPLEQUANTITY:
1782        return "";
1783      case TIMING:
1784        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.";
1785      case BASE64BINARY:
1786        return "A stream of bytes";
1787      case BOOLEAN:
1788        return "Value of \"true\" or \"false\"";
1789      case CODE:
1790        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";
1791      case DATE:
1792        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.";
1793      case DATETIME:
1794        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.";
1795      case DECIMAL:
1796        return "A rational number with implicit precision";
1797      case ID:
1798        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.";
1799      case INSTANT:
1800        return "An instant in time - known at least to the second";
1801      case INTEGER:
1802        return "A whole number";
1803      case MARKDOWN:
1804        return "A string that may contain markdown syntax for optional processing by a mark down presentation engine";
1805      case OID:
1806        return "An oid represented as a URI";
1807      case POSITIVEINT:
1808        return "An integer with a value that is positive (e.g. >0)";
1809      case STRING:
1810        return "A sequence of Unicode characters";
1811      case TIME:
1812        return "A time during the day, with no date specified";
1813      case UNSIGNEDINT:
1814        return "An integer with a value that is not negative (e.g. >= 0)";
1815      case URI:
1816        return "String of characters used to identify a name or a resource";
1817      case UUID:
1818        return "A UUID, represented as a URI";
1819      case XHTML:
1820        return "XHTML format, as defined by W3C, but restricted usage (mainly, no active content)";
1821      case NULL:
1822        return null;
1823      default:
1824        return "?";
1825      }
1826    }
1827
1828    public String getDisplay() {
1829      switch (this) {
1830      case ADDRESS:
1831        return "Address";
1832      case AGE:
1833        return "Age";
1834      case ANNOTATION:
1835        return "Annotation";
1836      case ATTACHMENT:
1837        return "Attachment";
1838      case BACKBONEELEMENT:
1839        return "BackboneElement";
1840      case CODEABLECONCEPT:
1841        return "CodeableConcept";
1842      case CODING:
1843        return "Coding";
1844      case CONTACTPOINT:
1845        return "ContactPoint";
1846      case COUNT:
1847        return "Count";
1848      case DISTANCE:
1849        return "Distance";
1850      case DURATION:
1851        return "Duration";
1852      case ELEMENT:
1853        return "Element";
1854      case ELEMENTDEFINITION:
1855        return "ElementDefinition";
1856      case EXTENSION:
1857        return "Extension";
1858      case HUMANNAME:
1859        return "HumanName";
1860      case IDENTIFIER:
1861        return "Identifier";
1862      case META:
1863        return "Meta";
1864      case MONEY:
1865        return "Money";
1866      case NARRATIVE:
1867        return "Narrative";
1868      case PERIOD:
1869        return "Period";
1870      case QUANTITY:
1871        return "Quantity";
1872      case RANGE:
1873        return "Range";
1874      case RATIO:
1875        return "Ratio";
1876      case REFERENCE:
1877        return "Reference";
1878      case SAMPLEDDATA:
1879        return "SampledData";
1880      case SIGNATURE:
1881        return "Signature";
1882      case SIMPLEQUANTITY:
1883        return "SimpleQuantity";
1884      case TIMING:
1885        return "Timing";
1886      case BASE64BINARY:
1887        return "base64Binary";
1888      case BOOLEAN:
1889        return "boolean";
1890      case CODE:
1891        return "code";
1892      case DATE:
1893        return "date";
1894      case DATETIME:
1895        return "dateTime";
1896      case DECIMAL:
1897        return "decimal";
1898      case ID:
1899        return "id";
1900      case INSTANT:
1901        return "instant";
1902      case INTEGER:
1903        return "integer";
1904      case MARKDOWN:
1905        return "markdown";
1906      case OID:
1907        return "oid";
1908      case POSITIVEINT:
1909        return "positiveInt";
1910      case STRING:
1911        return "string";
1912      case TIME:
1913        return "time";
1914      case UNSIGNEDINT:
1915        return "unsignedInt";
1916      case URI:
1917        return "uri";
1918      case UUID:
1919        return "uuid";
1920      case XHTML:
1921        return "XHTML";
1922      case NULL:
1923        return null;
1924      default:
1925        return "?";
1926      }
1927    }
1928  }
1929
1930  public static class DataTypeEnumFactory implements EnumFactory<DataType> {
1931    public DataType fromCode(String codeString) throws IllegalArgumentException {
1932      if (codeString == null || "".equals(codeString))
1933        if (codeString == null || "".equals(codeString))
1934          return null;
1935      if ("Address".equals(codeString))
1936        return DataType.ADDRESS;
1937      if ("Age".equals(codeString))
1938        return DataType.AGE;
1939      if ("Annotation".equals(codeString))
1940        return DataType.ANNOTATION;
1941      if ("Attachment".equals(codeString))
1942        return DataType.ATTACHMENT;
1943      if ("BackboneElement".equals(codeString))
1944        return DataType.BACKBONEELEMENT;
1945      if ("CodeableConcept".equals(codeString))
1946        return DataType.CODEABLECONCEPT;
1947      if ("Coding".equals(codeString))
1948        return DataType.CODING;
1949      if ("ContactPoint".equals(codeString))
1950        return DataType.CONTACTPOINT;
1951      if ("Count".equals(codeString))
1952        return DataType.COUNT;
1953      if ("Distance".equals(codeString))
1954        return DataType.DISTANCE;
1955      if ("Duration".equals(codeString))
1956        return DataType.DURATION;
1957      if ("Element".equals(codeString))
1958        return DataType.ELEMENT;
1959      if ("ElementDefinition".equals(codeString))
1960        return DataType.ELEMENTDEFINITION;
1961      if ("Extension".equals(codeString))
1962        return DataType.EXTENSION;
1963      if ("HumanName".equals(codeString))
1964        return DataType.HUMANNAME;
1965      if ("Identifier".equals(codeString))
1966        return DataType.IDENTIFIER;
1967      if ("Meta".equals(codeString))
1968        return DataType.META;
1969      if ("Money".equals(codeString))
1970        return DataType.MONEY;
1971      if ("Narrative".equals(codeString))
1972        return DataType.NARRATIVE;
1973      if ("Period".equals(codeString))
1974        return DataType.PERIOD;
1975      if ("Quantity".equals(codeString))
1976        return DataType.QUANTITY;
1977      if ("Range".equals(codeString))
1978        return DataType.RANGE;
1979      if ("Ratio".equals(codeString))
1980        return DataType.RATIO;
1981      if ("Reference".equals(codeString))
1982        return DataType.REFERENCE;
1983      if ("SampledData".equals(codeString))
1984        return DataType.SAMPLEDDATA;
1985      if ("Signature".equals(codeString))
1986        return DataType.SIGNATURE;
1987      if ("SimpleQuantity".equals(codeString))
1988        return DataType.SIMPLEQUANTITY;
1989      if ("Timing".equals(codeString))
1990        return DataType.TIMING;
1991      if ("base64Binary".equals(codeString))
1992        return DataType.BASE64BINARY;
1993      if ("boolean".equals(codeString))
1994        return DataType.BOOLEAN;
1995      if ("code".equals(codeString))
1996        return DataType.CODE;
1997      if ("date".equals(codeString))
1998        return DataType.DATE;
1999      if ("dateTime".equals(codeString))
2000        return DataType.DATETIME;
2001      if ("decimal".equals(codeString))
2002        return DataType.DECIMAL;
2003      if ("id".equals(codeString))
2004        return DataType.ID;
2005      if ("instant".equals(codeString))
2006        return DataType.INSTANT;
2007      if ("integer".equals(codeString))
2008        return DataType.INTEGER;
2009      if ("markdown".equals(codeString))
2010        return DataType.MARKDOWN;
2011      if ("oid".equals(codeString))
2012        return DataType.OID;
2013      if ("positiveInt".equals(codeString))
2014        return DataType.POSITIVEINT;
2015      if ("string".equals(codeString))
2016        return DataType.STRING;
2017      if ("time".equals(codeString))
2018        return DataType.TIME;
2019      if ("unsignedInt".equals(codeString))
2020        return DataType.UNSIGNEDINT;
2021      if ("uri".equals(codeString))
2022        return DataType.URI;
2023      if ("uuid".equals(codeString))
2024        return DataType.UUID;
2025      if ("xhtml".equals(codeString))
2026        return DataType.XHTML;
2027      throw new IllegalArgumentException("Unknown DataType code '" + codeString + "'");
2028    }
2029
2030    public Enumeration<DataType> fromType(Base code) throws FHIRException {
2031      if (code == null || code.isEmpty())
2032        return null;
2033      String codeString = ((PrimitiveType) code).asStringValue();
2034      if (codeString == null || "".equals(codeString))
2035        return null;
2036      if ("Address".equals(codeString))
2037        return new Enumeration<DataType>(this, DataType.ADDRESS);
2038      if ("Age".equals(codeString))
2039        return new Enumeration<DataType>(this, DataType.AGE);
2040      if ("Annotation".equals(codeString))
2041        return new Enumeration<DataType>(this, DataType.ANNOTATION);
2042      if ("Attachment".equals(codeString))
2043        return new Enumeration<DataType>(this, DataType.ATTACHMENT);
2044      if ("BackboneElement".equals(codeString))
2045        return new Enumeration<DataType>(this, DataType.BACKBONEELEMENT);
2046      if ("CodeableConcept".equals(codeString))
2047        return new Enumeration<DataType>(this, DataType.CODEABLECONCEPT);
2048      if ("Coding".equals(codeString))
2049        return new Enumeration<DataType>(this, DataType.CODING);
2050      if ("ContactPoint".equals(codeString))
2051        return new Enumeration<DataType>(this, DataType.CONTACTPOINT);
2052      if ("Count".equals(codeString))
2053        return new Enumeration<DataType>(this, DataType.COUNT);
2054      if ("Distance".equals(codeString))
2055        return new Enumeration<DataType>(this, DataType.DISTANCE);
2056      if ("Duration".equals(codeString))
2057        return new Enumeration<DataType>(this, DataType.DURATION);
2058      if ("Element".equals(codeString))
2059        return new Enumeration<DataType>(this, DataType.ELEMENT);
2060      if ("ElementDefinition".equals(codeString))
2061        return new Enumeration<DataType>(this, DataType.ELEMENTDEFINITION);
2062      if ("Extension".equals(codeString))
2063        return new Enumeration<DataType>(this, DataType.EXTENSION);
2064      if ("HumanName".equals(codeString))
2065        return new Enumeration<DataType>(this, DataType.HUMANNAME);
2066      if ("Identifier".equals(codeString))
2067        return new Enumeration<DataType>(this, DataType.IDENTIFIER);
2068      if ("Meta".equals(codeString))
2069        return new Enumeration<DataType>(this, DataType.META);
2070      if ("Money".equals(codeString))
2071        return new Enumeration<DataType>(this, DataType.MONEY);
2072      if ("Narrative".equals(codeString))
2073        return new Enumeration<DataType>(this, DataType.NARRATIVE);
2074      if ("Period".equals(codeString))
2075        return new Enumeration<DataType>(this, DataType.PERIOD);
2076      if ("Quantity".equals(codeString))
2077        return new Enumeration<DataType>(this, DataType.QUANTITY);
2078      if ("Range".equals(codeString))
2079        return new Enumeration<DataType>(this, DataType.RANGE);
2080      if ("Ratio".equals(codeString))
2081        return new Enumeration<DataType>(this, DataType.RATIO);
2082      if ("Reference".equals(codeString))
2083        return new Enumeration<DataType>(this, DataType.REFERENCE);
2084      if ("SampledData".equals(codeString))
2085        return new Enumeration<DataType>(this, DataType.SAMPLEDDATA);
2086      if ("Signature".equals(codeString))
2087        return new Enumeration<DataType>(this, DataType.SIGNATURE);
2088      if ("SimpleQuantity".equals(codeString))
2089        return new Enumeration<DataType>(this, DataType.SIMPLEQUANTITY);
2090      if ("Timing".equals(codeString))
2091        return new Enumeration<DataType>(this, DataType.TIMING);
2092      if ("base64Binary".equals(codeString))
2093        return new Enumeration<DataType>(this, DataType.BASE64BINARY);
2094      if ("boolean".equals(codeString))
2095        return new Enumeration<DataType>(this, DataType.BOOLEAN);
2096      if ("code".equals(codeString))
2097        return new Enumeration<DataType>(this, DataType.CODE);
2098      if ("date".equals(codeString))
2099        return new Enumeration<DataType>(this, DataType.DATE);
2100      if ("dateTime".equals(codeString))
2101        return new Enumeration<DataType>(this, DataType.DATETIME);
2102      if ("decimal".equals(codeString))
2103        return new Enumeration<DataType>(this, DataType.DECIMAL);
2104      if ("id".equals(codeString))
2105        return new Enumeration<DataType>(this, DataType.ID);
2106      if ("instant".equals(codeString))
2107        return new Enumeration<DataType>(this, DataType.INSTANT);
2108      if ("integer".equals(codeString))
2109        return new Enumeration<DataType>(this, DataType.INTEGER);
2110      if ("markdown".equals(codeString))
2111        return new Enumeration<DataType>(this, DataType.MARKDOWN);
2112      if ("oid".equals(codeString))
2113        return new Enumeration<DataType>(this, DataType.OID);
2114      if ("positiveInt".equals(codeString))
2115        return new Enumeration<DataType>(this, DataType.POSITIVEINT);
2116      if ("string".equals(codeString))
2117        return new Enumeration<DataType>(this, DataType.STRING);
2118      if ("time".equals(codeString))
2119        return new Enumeration<DataType>(this, DataType.TIME);
2120      if ("unsignedInt".equals(codeString))
2121        return new Enumeration<DataType>(this, DataType.UNSIGNEDINT);
2122      if ("uri".equals(codeString))
2123        return new Enumeration<DataType>(this, DataType.URI);
2124      if ("uuid".equals(codeString))
2125        return new Enumeration<DataType>(this, DataType.UUID);
2126      if ("xhtml".equals(codeString))
2127        return new Enumeration<DataType>(this, DataType.XHTML);
2128      throw new FHIRException("Unknown DataType code '" + codeString + "'");
2129    }
2130
2131    public String toCode(DataType code) {
2132      if (code == DataType.ADDRESS)
2133        return "Address";
2134      if (code == DataType.AGE)
2135        return "Age";
2136      if (code == DataType.ANNOTATION)
2137        return "Annotation";
2138      if (code == DataType.ATTACHMENT)
2139        return "Attachment";
2140      if (code == DataType.BACKBONEELEMENT)
2141        return "BackboneElement";
2142      if (code == DataType.CODEABLECONCEPT)
2143        return "CodeableConcept";
2144      if (code == DataType.CODING)
2145        return "Coding";
2146      if (code == DataType.CONTACTPOINT)
2147        return "ContactPoint";
2148      if (code == DataType.COUNT)
2149        return "Count";
2150      if (code == DataType.DISTANCE)
2151        return "Distance";
2152      if (code == DataType.DURATION)
2153        return "Duration";
2154      if (code == DataType.ELEMENT)
2155        return "Element";
2156      if (code == DataType.ELEMENTDEFINITION)
2157        return "ElementDefinition";
2158      if (code == DataType.EXTENSION)
2159        return "Extension";
2160      if (code == DataType.HUMANNAME)
2161        return "HumanName";
2162      if (code == DataType.IDENTIFIER)
2163        return "Identifier";
2164      if (code == DataType.META)
2165        return "Meta";
2166      if (code == DataType.MONEY)
2167        return "Money";
2168      if (code == DataType.NARRATIVE)
2169        return "Narrative";
2170      if (code == DataType.PERIOD)
2171        return "Period";
2172      if (code == DataType.QUANTITY)
2173        return "Quantity";
2174      if (code == DataType.RANGE)
2175        return "Range";
2176      if (code == DataType.RATIO)
2177        return "Ratio";
2178      if (code == DataType.REFERENCE)
2179        return "Reference";
2180      if (code == DataType.SAMPLEDDATA)
2181        return "SampledData";
2182      if (code == DataType.SIGNATURE)
2183        return "Signature";
2184      if (code == DataType.SIMPLEQUANTITY)
2185        return "SimpleQuantity";
2186      if (code == DataType.TIMING)
2187        return "Timing";
2188      if (code == DataType.BASE64BINARY)
2189        return "base64Binary";
2190      if (code == DataType.BOOLEAN)
2191        return "boolean";
2192      if (code == DataType.CODE)
2193        return "code";
2194      if (code == DataType.DATE)
2195        return "date";
2196      if (code == DataType.DATETIME)
2197        return "dateTime";
2198      if (code == DataType.DECIMAL)
2199        return "decimal";
2200      if (code == DataType.ID)
2201        return "id";
2202      if (code == DataType.INSTANT)
2203        return "instant";
2204      if (code == DataType.INTEGER)
2205        return "integer";
2206      if (code == DataType.MARKDOWN)
2207        return "markdown";
2208      if (code == DataType.OID)
2209        return "oid";
2210      if (code == DataType.POSITIVEINT)
2211        return "positiveInt";
2212      if (code == DataType.STRING)
2213        return "string";
2214      if (code == DataType.TIME)
2215        return "time";
2216      if (code == DataType.UNSIGNEDINT)
2217        return "unsignedInt";
2218      if (code == DataType.URI)
2219        return "uri";
2220      if (code == DataType.UUID)
2221        return "uuid";
2222      if (code == DataType.XHTML)
2223        return "xhtml";
2224      return "?";
2225    }
2226  }
2227
2228  public enum DocumentReferenceStatus {
2229    /**
2230     * This is the current reference for this document.
2231     */
2232    CURRENT,
2233    /**
2234     * This reference has been superseded by another reference.
2235     */
2236    SUPERSEDED,
2237    /**
2238     * This reference was created in error.
2239     */
2240    ENTEREDINERROR,
2241    /**
2242     * added to help the parsers
2243     */
2244    NULL;
2245
2246    public static DocumentReferenceStatus fromCode(String codeString) throws FHIRException {
2247      if (codeString == null || "".equals(codeString))
2248        return null;
2249      if ("current".equals(codeString))
2250        return CURRENT;
2251      if ("superseded".equals(codeString))
2252        return SUPERSEDED;
2253      if ("entered-in-error".equals(codeString))
2254        return ENTEREDINERROR;
2255      throw new FHIRException("Unknown DocumentReferenceStatus code '" + codeString + "'");
2256    }
2257
2258    public String toCode() {
2259      switch (this) {
2260      case CURRENT:
2261        return "current";
2262      case SUPERSEDED:
2263        return "superseded";
2264      case ENTEREDINERROR:
2265        return "entered-in-error";
2266      case NULL:
2267        return null;
2268      default:
2269        return "?";
2270      }
2271    }
2272
2273    public String getSystem() {
2274      switch (this) {
2275      case CURRENT:
2276        return "http://hl7.org/fhir/document-reference-status";
2277      case SUPERSEDED:
2278        return "http://hl7.org/fhir/document-reference-status";
2279      case ENTEREDINERROR:
2280        return "http://hl7.org/fhir/document-reference-status";
2281      case NULL:
2282        return null;
2283      default:
2284        return "?";
2285      }
2286    }
2287
2288    public String getDefinition() {
2289      switch (this) {
2290      case CURRENT:
2291        return "This is the current reference for this document.";
2292      case SUPERSEDED:
2293        return "This reference has been superseded by another reference.";
2294      case ENTEREDINERROR:
2295        return "This reference was created in error.";
2296      case NULL:
2297        return null;
2298      default:
2299        return "?";
2300      }
2301    }
2302
2303    public String getDisplay() {
2304      switch (this) {
2305      case CURRENT:
2306        return "Current";
2307      case SUPERSEDED:
2308        return "Superseded";
2309      case ENTEREDINERROR:
2310        return "Entered in Error";
2311      case NULL:
2312        return null;
2313      default:
2314        return "?";
2315      }
2316    }
2317  }
2318
2319  public static class DocumentReferenceStatusEnumFactory implements EnumFactory<DocumentReferenceStatus> {
2320    public DocumentReferenceStatus fromCode(String codeString) throws IllegalArgumentException {
2321      if (codeString == null || "".equals(codeString))
2322        if (codeString == null || "".equals(codeString))
2323          return null;
2324      if ("current".equals(codeString))
2325        return DocumentReferenceStatus.CURRENT;
2326      if ("superseded".equals(codeString))
2327        return DocumentReferenceStatus.SUPERSEDED;
2328      if ("entered-in-error".equals(codeString))
2329        return DocumentReferenceStatus.ENTEREDINERROR;
2330      throw new IllegalArgumentException("Unknown DocumentReferenceStatus code '" + codeString + "'");
2331    }
2332
2333    public Enumeration<DocumentReferenceStatus> fromType(Base code) throws FHIRException {
2334      if (code == null || code.isEmpty())
2335        return null;
2336      String codeString = ((PrimitiveType) code).asStringValue();
2337      if (codeString == null || "".equals(codeString))
2338        return null;
2339      if ("current".equals(codeString))
2340        return new Enumeration<DocumentReferenceStatus>(this, DocumentReferenceStatus.CURRENT);
2341      if ("superseded".equals(codeString))
2342        return new Enumeration<DocumentReferenceStatus>(this, DocumentReferenceStatus.SUPERSEDED);
2343      if ("entered-in-error".equals(codeString))
2344        return new Enumeration<DocumentReferenceStatus>(this, DocumentReferenceStatus.ENTEREDINERROR);
2345      throw new FHIRException("Unknown DocumentReferenceStatus code '" + codeString + "'");
2346    }
2347
2348    public String toCode(DocumentReferenceStatus code) {
2349      if (code == DocumentReferenceStatus.CURRENT)
2350        return "current";
2351      if (code == DocumentReferenceStatus.SUPERSEDED)
2352        return "superseded";
2353      if (code == DocumentReferenceStatus.ENTEREDINERROR)
2354        return "entered-in-error";
2355      return "?";
2356    }
2357  }
2358
2359  public enum FHIRDefinedType {
2360    /**
2361     * There is a variety of postal address formats defined around the world. This
2362     * format defines a superset that is the basis for all addresses around the
2363     * world.
2364     */
2365    ADDRESS,
2366    /**
2367     * null
2368     */
2369    AGE,
2370    /**
2371     * A text note which also contains information about who made the statement and
2372     * when.
2373     */
2374    ANNOTATION,
2375    /**
2376     * For referring to data content defined in other formats.
2377     */
2378    ATTACHMENT,
2379    /**
2380     * Base definition for all elements that are defined inside a resource - but not
2381     * those in a data type.
2382     */
2383    BACKBONEELEMENT,
2384    /**
2385     * A concept that may be defined by a formal reference to a terminology or
2386     * ontology or may be provided by text.
2387     */
2388    CODEABLECONCEPT,
2389    /**
2390     * A reference to a code defined by a terminology system.
2391     */
2392    CODING,
2393    /**
2394     * Details for all kinds of technology mediated contact points for a person or
2395     * organization, including telephone, email, etc.
2396     */
2397    CONTACTPOINT,
2398    /**
2399     * null
2400     */
2401    COUNT,
2402    /**
2403     * null
2404     */
2405    DISTANCE,
2406    /**
2407     * null
2408     */
2409    DURATION,
2410    /**
2411     * Base definition for all elements in a resource.
2412     */
2413    ELEMENT,
2414    /**
2415     * Captures constraints on each element within the resource, profile, or
2416     * extension.
2417     */
2418    ELEMENTDEFINITION,
2419    /**
2420     * Optional Extensions Element - found in all resources.
2421     */
2422    EXTENSION,
2423    /**
2424     * A human's name with the ability to identify parts and usage.
2425     */
2426    HUMANNAME,
2427    /**
2428     * A technical identifier - identifies some entity uniquely and unambiguously.
2429     */
2430    IDENTIFIER,
2431    /**
2432     * The metadata about a resource. This is content in the resource that is
2433     * maintained by the infrastructure. Changes to the content may not always be
2434     * associated with version changes to the resource.
2435     */
2436    META,
2437    /**
2438     * null
2439     */
2440    MONEY,
2441    /**
2442     * A human-readable formatted text, including images.
2443     */
2444    NARRATIVE,
2445    /**
2446     * A time period defined by a start and end date and optionally time.
2447     */
2448    PERIOD,
2449    /**
2450     * A measured amount (or an amount that can potentially be measured). Note that
2451     * measured amounts include amounts that are not precisely quantified, including
2452     * amounts involving arbitrary units and floating currencies.
2453     */
2454    QUANTITY,
2455    /**
2456     * A set of ordered Quantities defined by a low and high limit.
2457     */
2458    RANGE,
2459    /**
2460     * A relationship of two Quantity values - expressed as a numerator and a
2461     * denominator.
2462     */
2463    RATIO,
2464    /**
2465     * A reference from one resource to another.
2466     */
2467    REFERENCE,
2468    /**
2469     * A series of measurements taken by a device, with upper and lower limits.
2470     * There may be more than one dimension in the data.
2471     */
2472    SAMPLEDDATA,
2473    /**
2474     * A digital signature along with supporting context. The signature may be
2475     * electronic/cryptographic in nature, or a graphical image representing a
2476     * hand-written signature, or a signature process. Different Signature
2477     * approaches have different utilities.
2478     */
2479    SIGNATURE,
2480    /**
2481     * null
2482     */
2483    SIMPLEQUANTITY,
2484    /**
2485     * Specifies an event that may occur multiple times. Timing schedules are used
2486     * to record when things are expected or requested to occur. The most common
2487     * usage is in dosage instructions for medications. They are also used when
2488     * planning care of various kinds.
2489     */
2490    TIMING,
2491    /**
2492     * A stream of bytes
2493     */
2494    BASE64BINARY,
2495    /**
2496     * Value of "true" or "false"
2497     */
2498    BOOLEAN,
2499    /**
2500     * A string which has at least one character and no leading or trailing
2501     * whitespace and where there is no whitespace other than single spaces in the
2502     * contents
2503     */
2504    CODE,
2505    /**
2506     * A date or partial date (e.g. just year or year + month). There is no time
2507     * zone. The format is a union of the schema types gYear, gYearMonth and date.
2508     * Dates SHALL be valid dates.
2509     */
2510    DATE,
2511    /**
2512     * A date, date-time or partial date (e.g. just year or year + month). If hours
2513     * and minutes are specified, a time zone SHALL be populated. The format is a
2514     * union of the schema types gYear, gYearMonth, date and dateTime. Seconds must
2515     * be provided due to schema type constraints but may be zero-filled and may be
2516     * ignored. Dates SHALL be valid dates.
2517     */
2518    DATETIME,
2519    /**
2520     * A rational number with implicit precision
2521     */
2522    DECIMAL,
2523    /**
2524     * Any combination of letters, numerals, "-" and ".", with a length limit of 64
2525     * characters. (This might be an integer, an unprefixed OID, UUID or any other
2526     * identifier pattern that meets these constraints.) Ids are case-insensitive.
2527     */
2528    ID,
2529    /**
2530     * An instant in time - known at least to the second
2531     */
2532    INSTANT,
2533    /**
2534     * A whole number
2535     */
2536    INTEGER,
2537    /**
2538     * A string that may contain markdown syntax for optional processing by a mark
2539     * down presentation engine
2540     */
2541    MARKDOWN,
2542    /**
2543     * An oid represented as a URI
2544     */
2545    OID,
2546    /**
2547     * An integer with a value that is positive (e.g. >0)
2548     */
2549    POSITIVEINT,
2550    /**
2551     * A sequence of Unicode characters
2552     */
2553    STRING,
2554    /**
2555     * A time during the day, with no date specified
2556     */
2557    TIME,
2558    /**
2559     * An integer with a value that is not negative (e.g. >= 0)
2560     */
2561    UNSIGNEDINT,
2562    /**
2563     * String of characters used to identify a name or a resource
2564     */
2565    URI,
2566    /**
2567     * A UUID, represented as a URI
2568     */
2569    UUID,
2570    /**
2571     * XHTML format, as defined by W3C, but restricted usage (mainly, no active
2572     * content)
2573     */
2574    XHTML,
2575    /**
2576     * A financial tool for tracking value accrued for a particular purpose. In the
2577     * healthcare field, used to track charges for a patient, cost centres, etc.
2578     */
2579    ACCOUNT,
2580    /**
2581     * Risk of harmful or undesirable, physiological response which is unique to an
2582     * individual and associated with exposure to a substance.
2583     */
2584    ALLERGYINTOLERANCE,
2585    /**
2586     * A booking of a healthcare event among patient(s), practitioner(s), related
2587     * person(s) and/or device(s) for a specific date/time. This may result in one
2588     * or more Encounter(s).
2589     */
2590    APPOINTMENT,
2591    /**
2592     * A reply to an appointment request for a patient and/or practitioner(s), such
2593     * as a confirmation or rejection.
2594     */
2595    APPOINTMENTRESPONSE,
2596    /**
2597     * A record of an event made for purposes of maintaining a security log. Typical
2598     * uses include detection of intrusion attempts and monitoring for inappropriate
2599     * usage.
2600     */
2601    AUDITEVENT,
2602    /**
2603     * Basic is used for handling concepts not yet defined in FHIR, narrative-only
2604     * resources that don't map to an existing resource, and custom resources not
2605     * appropriate for inclusion in the FHIR specification.
2606     */
2607    BASIC,
2608    /**
2609     * A binary resource can contain any content, whether text, image, pdf, zip
2610     * archive, etc.
2611     */
2612    BINARY,
2613    /**
2614     * Record details about the anatomical location of a specimen or body part. This
2615     * resource may be used when a coded concept does not provide the necessary
2616     * detail needed for the use case.
2617     */
2618    BODYSITE,
2619    /**
2620     * A container for a collection of resources.
2621     */
2622    BUNDLE,
2623    /**
2624     * Describes the intention of how one or more practitioners intend to deliver
2625     * care for a particular patient, group or community for a period of time,
2626     * possibly limited to care for a specific condition or set of conditions.
2627     */
2628    CAREPLAN,
2629    /**
2630     * A provider issued list of services and products provided, or to be provided,
2631     * to a patient which is provided to an insurer for payment recovery.
2632     */
2633    CLAIM,
2634    /**
2635     * This resource provides the adjudication details from the processing of a
2636     * Claim resource.
2637     */
2638    CLAIMRESPONSE,
2639    /**
2640     * A record of a clinical assessment performed to determine what problem(s) may
2641     * affect the patient and before planning the treatments or management
2642     * strategies that are best to manage a patient's condition. Assessments are
2643     * often 1:1 with a clinical consultation / encounter, but this varies greatly
2644     * depending on the clinical workflow. This resource is called
2645     * "ClinicalImpression" rather than "ClinicalAssessment" to avoid confusion with
2646     * the recording of assessment tools such as Apgar score.
2647     */
2648    CLINICALIMPRESSION,
2649    /**
2650     * An occurrence of information being transmitted; e.g. an alert that was sent
2651     * to a responsible provider, a public health agency was notified about a
2652     * reportable condition.
2653     */
2654    COMMUNICATION,
2655    /**
2656     * A request to convey information; e.g. the CDS system proposes that an alert
2657     * be sent to a responsible provider, the CDS system proposes that the public
2658     * health agency be notified about a reportable condition.
2659     */
2660    COMMUNICATIONREQUEST,
2661    /**
2662     * A set of healthcare-related information that is assembled together into a
2663     * single logical document that provides a single coherent statement of meaning,
2664     * establishes its own context and that has clinical attestation with regard to
2665     * who is making the statement. While a Composition defines the structure, it
2666     * does not actually contain the content: rather the full content of a document
2667     * is contained in a Bundle, of which the Composition is the first resource
2668     * contained.
2669     */
2670    COMPOSITION,
2671    /**
2672     * A statement of relationships from one set of concepts to one or more other
2673     * concepts - either code systems or data elements, or classes in class models.
2674     */
2675    CONCEPTMAP,
2676    /**
2677     * Use to record detailed information about conditions, problems or diagnoses
2678     * recognized by a clinician. There are many uses including: recording a
2679     * diagnosis during an encounter; populating a problem list or a summary
2680     * statement, such as a discharge summary.
2681     */
2682    CONDITION,
2683    /**
2684     * A conformance statement is a set of capabilities of a FHIR Server that may be
2685     * used as a statement of actual server functionality or a statement of required
2686     * or desired server implementation.
2687     */
2688    CONFORMANCE,
2689    /**
2690     * A formal agreement between parties regarding the conduct of business,
2691     * exchange of information or other matters.
2692     */
2693    CONTRACT,
2694    /**
2695     * Financial instrument which may be used to pay for or reimburse health care
2696     * products and services.
2697     */
2698    COVERAGE,
2699    /**
2700     * The formal description of a single piece of information that can be gathered
2701     * and reported.
2702     */
2703    DATAELEMENT,
2704    /**
2705     * Indicates an actual or potential clinical issue with or between one or more
2706     * active or proposed clinical actions for a patient; e.g. Drug-drug
2707     * interaction, Ineffective treatment frequency, Procedure-condition conflict,
2708     * etc.
2709     */
2710    DETECTEDISSUE,
2711    /**
2712     * This resource identifies an instance of a manufactured item that is used in
2713     * the provision of healthcare without being substantially changed through that
2714     * activity. The device may be a medical or non-medical device. Medical devices
2715     * includes durable (reusable) medical equipment, implantable devices, as well
2716     * as disposable equipment used for diagnostic, treatment, and research for
2717     * healthcare and public health. Non-medical devices may include items such as a
2718     * machine, cellphone, computer, application, etc.
2719     */
2720    DEVICE,
2721    /**
2722     * Describes the characteristics, operational status and capabilities of a
2723     * medical-related component of a medical device.
2724     */
2725    DEVICECOMPONENT,
2726    /**
2727     * Describes a measurement, calculation or setting capability of a medical
2728     * device.
2729     */
2730    DEVICEMETRIC,
2731    /**
2732     * Represents a request for a patient to employ a medical device. The device may
2733     * be an implantable device, or an external assistive device, such as a walker.
2734     */
2735    DEVICEUSEREQUEST,
2736    /**
2737     * A record of a device being used by a patient where the record is the result
2738     * of a report from the patient or another clinician.
2739     */
2740    DEVICEUSESTATEMENT,
2741    /**
2742     * A record of a request for a diagnostic investigation service to be performed.
2743     */
2744    DIAGNOSTICORDER,
2745    /**
2746     * The findings and interpretation of diagnostic tests performed on patients,
2747     * groups of patients, devices, and locations, and/or specimens derived from
2748     * these. The report includes clinical context such as requesting and provider
2749     * information, and some mix of atomic results, images, textual and coded
2750     * interpretations, and formatted representation of diagnostic reports.
2751     */
2752    DIAGNOSTICREPORT,
2753    /**
2754     * A manifest that defines a set of documents.
2755     */
2756    DOCUMENTMANIFEST,
2757    /**
2758     * A reference to a document .
2759     */
2760    DOCUMENTREFERENCE,
2761    /**
2762     * --- Abstract Type! ---A resource that includes narrative, extensions, and
2763     * contained resources.
2764     */
2765    DOMAINRESOURCE,
2766    /**
2767     * This resource provides the insurance eligibility details from the insurer
2768     * regarding a specified coverage and optionally some class of service.
2769     */
2770    ELIGIBILITYREQUEST,
2771    /**
2772     * This resource provides eligibility and plan details from the processing of an
2773     * Eligibility resource.
2774     */
2775    ELIGIBILITYRESPONSE,
2776    /**
2777     * An interaction between a patient and healthcare provider(s) for the purpose
2778     * of providing healthcare service(s) or assessing the health status of a
2779     * patient.
2780     */
2781    ENCOUNTER,
2782    /**
2783     * This resource provides the insurance enrollment details to the insurer
2784     * regarding a specified coverage.
2785     */
2786    ENROLLMENTREQUEST,
2787    /**
2788     * This resource provides enrollment and plan details from the processing of an
2789     * Enrollment resource.
2790     */
2791    ENROLLMENTRESPONSE,
2792    /**
2793     * An association between a patient and an organization / healthcare provider(s)
2794     * during which time encounters may occur. The managing organization assumes a
2795     * level of responsibility for the patient during this time.
2796     */
2797    EPISODEOFCARE,
2798    /**
2799     * This resource provides: the claim details; adjudication details from the
2800     * processing of a Claim; and optionally account balance information, for
2801     * informing the subscriber of the benefits provided.
2802     */
2803    EXPLANATIONOFBENEFIT,
2804    /**
2805     * Significant health events and conditions for a person related to the patient
2806     * relevant in the context of care for the patient.
2807     */
2808    FAMILYMEMBERHISTORY,
2809    /**
2810     * Prospective warnings of potential issues when providing care to the patient.
2811     */
2812    FLAG,
2813    /**
2814     * Describes the intended objective(s) for a patient, group or organization
2815     * care, for example, weight loss, restoring an activity of daily living,
2816     * obtaining herd immunity via immunization, meeting a process improvement
2817     * objective, etc.
2818     */
2819    GOAL,
2820    /**
2821     * Represents a defined collection of entities that may be discussed or acted
2822     * upon collectively but which are not expected to act collectively and are not
2823     * formally or legally recognized; i.e. a collection of entities that isn't an
2824     * Organization.
2825     */
2826    GROUP,
2827    /**
2828     * The details of a healthcare service available at a location.
2829     */
2830    HEALTHCARESERVICE,
2831    /**
2832     * A manifest of a set of DICOM Service-Object Pair Instances (SOP Instances).
2833     * The referenced SOP Instances (images or other content) are for a single
2834     * patient, and may be from one or more studies. The referenced SOP Instances
2835     * have been selected for a purpose, such as quality assurance, conference, or
2836     * consult. Reflecting that range of purposes, typical ImagingObjectSelection
2837     * resources may include all SOP Instances in a study (perhaps for sharing
2838     * through a Health Information Exchange); key images from multiple studies (for
2839     * reference by a referring or treating physician); a multi-frame ultrasound
2840     * instance ("cine" video clip) and a set of measurements taken from that
2841     * instance (for inclusion in a teaching file); and so on.
2842     */
2843    IMAGINGOBJECTSELECTION,
2844    /**
2845     * Representation of the content produced in a DICOM imaging study. A study
2846     * comprises a set of series, each of which includes a set of Service-Object
2847     * Pair Instances (SOP Instances - images or other data) acquired or produced in
2848     * a common context. A series is of only one modality (e.g. X-ray, CT, MR,
2849     * ultrasound), but a study may have multiple series of different modalities.
2850     */
2851    IMAGINGSTUDY,
2852    /**
2853     * Describes the event of a patient being administered a vaccination or a record
2854     * of a vaccination as reported by a patient, a clinician or another party and
2855     * may include vaccine reaction information and what vaccination protocol was
2856     * followed.
2857     */
2858    IMMUNIZATION,
2859    /**
2860     * A patient's point-in-time immunization and recommendation (i.e. forecasting a
2861     * patient's immunization eligibility according to a published schedule) with
2862     * optional supporting justification.
2863     */
2864    IMMUNIZATIONRECOMMENDATION,
2865    /**
2866     * A set of rules or how FHIR is used to solve a particular problem. This
2867     * resource is used to gather all the parts of an implementation guide into a
2868     * logical whole, and to publish a computable definition of all the parts.
2869     */
2870    IMPLEMENTATIONGUIDE,
2871    /**
2872     * A set of information summarized from a list of other resources.
2873     */
2874    LIST,
2875    /**
2876     * Details and position information for a physical place where services are
2877     * provided and resources and participants may be stored, found, contained or
2878     * accommodated.
2879     */
2880    LOCATION,
2881    /**
2882     * A photo, video, or audio recording acquired or used in healthcare. The actual
2883     * content may be inline or provided by direct reference.
2884     */
2885    MEDIA,
2886    /**
2887     * This resource is primarily used for the identification and definition of a
2888     * medication. It covers the ingredients and the packaging for a medication.
2889     */
2890    MEDICATION,
2891    /**
2892     * Describes the event of a patient consuming or otherwise being administered a
2893     * medication. This may be as simple as swallowing a tablet or it may be a long
2894     * running infusion. Related resources tie this event to the authorizing
2895     * prescription, and the specific encounter between patient and health care
2896     * practitioner.
2897     */
2898    MEDICATIONADMINISTRATION,
2899    /**
2900     * Indicates that a medication product is to be or has been dispensed for a
2901     * named person/patient. This includes a description of the medication product
2902     * (supply) provided and the instructions for administering the medication. The
2903     * medication dispense is the result of a pharmacy system responding to a
2904     * medication order.
2905     */
2906    MEDICATIONDISPENSE,
2907    /**
2908     * An order for both supply of the medication and the instructions for
2909     * administration of the medication to a patient. The resource is called
2910     * "MedicationOrder" rather than "MedicationPrescription" to generalize the use
2911     * across inpatient and outpatient settings as well as for care plans, etc.
2912     */
2913    MEDICATIONORDER,
2914    /**
2915     * A record of a medication that is being consumed by a patient. A
2916     * MedicationStatement may indicate that the patient may be taking the
2917     * medication now, or has taken the medication in the past or will be taking the
2918     * medication in the future. The source of this information can be the patient,
2919     * significant other (such as a family member or spouse), or a clinician. A
2920     * common scenario where this information is captured is during the history
2921     * taking process during a patient visit or stay. The medication information may
2922     * come from e.g. the patient's memory, from a prescription bottle, or from a
2923     * list of medications the patient, clinician or other party maintains
2924     * 
2925     * The primary difference between a medication statement and a medication
2926     * administration is that the medication administration has complete
2927     * administration information and is based on actual administration information
2928     * from the person who administered the medication. A medication statement is
2929     * often, if not always, less specific. There is no required date/time when the
2930     * medication was administered, in fact we only know that a source has reported
2931     * the patient is taking this medication, where details such as time, quantity,
2932     * or rate or even medication product may be incomplete or missing or less
2933     * precise. As stated earlier, the medication statement information may come
2934     * from the patient's memory, from a prescription bottle or from a list of
2935     * medications the patient, clinician or other party maintains. Medication
2936     * administration is more formal and is not missing detailed information.
2937     */
2938    MEDICATIONSTATEMENT,
2939    /**
2940     * The header for a message exchange that is either requesting or responding to
2941     * an action. The reference(s) that are the subject of the action as well as
2942     * other information related to the action are typically transmitted in a bundle
2943     * in which the MessageHeader resource instance is the first resource in the
2944     * bundle.
2945     */
2946    MESSAGEHEADER,
2947    /**
2948     * A curated namespace that issues unique symbols within that namespace for the
2949     * identification of concepts, people, devices, etc. Represents a "System" used
2950     * within the Identifier and Coding data types.
2951     */
2952    NAMINGSYSTEM,
2953    /**
2954     * A request to supply a diet, formula feeding (enteral) or oral nutritional
2955     * supplement to a patient/resident.
2956     */
2957    NUTRITIONORDER,
2958    /**
2959     * Measurements and simple assertions made about a patient, device or other
2960     * subject.
2961     */
2962    OBSERVATION,
2963    /**
2964     * A formal computable definition of an operation (on the RESTful interface) or
2965     * a named query (using the search interaction).
2966     */
2967    OPERATIONDEFINITION,
2968    /**
2969     * A collection of error, warning or information messages that result from a
2970     * system action.
2971     */
2972    OPERATIONOUTCOME,
2973    /**
2974     * A request to perform an action.
2975     */
2976    ORDER,
2977    /**
2978     * A response to an order.
2979     */
2980    ORDERRESPONSE,
2981    /**
2982     * A formally or informally recognized grouping of people or organizations
2983     * formed for the purpose of achieving some form of collective action. Includes
2984     * companies, institutions, corporations, departments, community groups,
2985     * healthcare practice groups, etc.
2986     */
2987    ORGANIZATION,
2988    /**
2989     * This special resource type is used to represent an operation request and
2990     * response (operations.html). It has no other use, and there is no RESTful
2991     * endpoint associated with it.
2992     */
2993    PARAMETERS,
2994    /**
2995     * Demographics and other administrative information about an individual or
2996     * animal receiving care or other health-related services.
2997     */
2998    PATIENT,
2999    /**
3000     * This resource provides the status of the payment for goods and services
3001     * rendered, and the request and response resource references.
3002     */
3003    PAYMENTNOTICE,
3004    /**
3005     * This resource provides payment details and claim references supporting a bulk
3006     * payment.
3007     */
3008    PAYMENTRECONCILIATION,
3009    /**
3010     * Demographics and administrative information about a person independent of a
3011     * specific health-related context.
3012     */
3013    PERSON,
3014    /**
3015     * A person who is directly or indirectly involved in the provisioning of
3016     * healthcare.
3017     */
3018    PRACTITIONER,
3019    /**
3020     * An action that is or was performed on a patient. This can be a physical
3021     * intervention like an operation, or less invasive like counseling or
3022     * hypnotherapy.
3023     */
3024    PROCEDURE,
3025    /**
3026     * A request for a procedure to be performed. May be a proposal or an order.
3027     */
3028    PROCEDUREREQUEST,
3029    /**
3030     * This resource provides the target, request and response, and action details
3031     * for an action to be performed by the target on or about existing resources.
3032     */
3033    PROCESSREQUEST,
3034    /**
3035     * This resource provides processing status, errors and notes from the
3036     * processing of a resource.
3037     */
3038    PROCESSRESPONSE,
3039    /**
3040     * Provenance of a resource is a record that describes entities and processes
3041     * involved in producing and delivering or otherwise influencing that resource.
3042     * Provenance provides a critical foundation for assessing authenticity,
3043     * enabling trust, and allowing reproducibility. Provenance assertions are a
3044     * form of contextual metadata and can themselves become important records with
3045     * their own provenance. Provenance statement indicates clinical significance in
3046     * terms of confidence in authenticity, reliability, and trustworthiness,
3047     * integrity, and stage in lifecycle (e.g. Document Completion - has the
3048     * artifact been legally authenticated), all of which may impact security,
3049     * privacy, and trust policies.
3050     */
3051    PROVENANCE,
3052    /**
3053     * A structured set of questions intended to guide the collection of answers.
3054     * The questions are ordered and grouped into coherent subsets, corresponding to
3055     * the structure of the grouping of the underlying questions.
3056     */
3057    QUESTIONNAIRE,
3058    /**
3059     * A structured set of questions and their answers. The questions are ordered
3060     * and grouped into coherent subsets, corresponding to the structure of the
3061     * grouping of the underlying questions.
3062     */
3063    QUESTIONNAIRERESPONSE,
3064    /**
3065     * Used to record and send details about a request for referral service or
3066     * transfer of a patient to the care of another provider or provider
3067     * organization.
3068     */
3069    REFERRALREQUEST,
3070    /**
3071     * Information about a person that is involved in the care for a patient, but
3072     * who is not the target of healthcare, nor has a formal responsibility in the
3073     * care process.
3074     */
3075    RELATEDPERSON,
3076    /**
3077     * --- Abstract Type! ---This is the base resource type for everything.
3078     */
3079    RESOURCE,
3080    /**
3081     * An assessment of the likely outcome(s) for a patient or other subject as well
3082     * as the likelihood of each outcome.
3083     */
3084    RISKASSESSMENT,
3085    /**
3086     * A container for slot(s) of time that may be available for booking
3087     * appointments.
3088     */
3089    SCHEDULE,
3090    /**
3091     * A search parameter that defines a named search item that can be used to
3092     * search/filter on a resource.
3093     */
3094    SEARCHPARAMETER,
3095    /**
3096     * A slot of time on a schedule that may be available for booking appointments.
3097     */
3098    SLOT,
3099    /**
3100     * A sample to be used for analysis.
3101     */
3102    SPECIMEN,
3103    /**
3104     * A definition of a FHIR structure. This resource is used to describe the
3105     * underlying resources, data types defined in FHIR, and also for describing
3106     * extensions, and constraints on resources and data types.
3107     */
3108    STRUCTUREDEFINITION,
3109    /**
3110     * The subscription resource is used to define a push based subscription from a
3111     * server to another system. Once a subscription is registered with the server,
3112     * the server checks every resource that is created or updated, and if the
3113     * resource matches the given criteria, it sends a message on the defined
3114     * "channel" so that another system is able to take an appropriate action.
3115     */
3116    SUBSCRIPTION,
3117    /**
3118     * A homogeneous material with a definite composition.
3119     */
3120    SUBSTANCE,
3121    /**
3122     * Record of delivery of what is supplied.
3123     */
3124    SUPPLYDELIVERY,
3125    /**
3126     * A record of a request for a medication, substance or device used in the
3127     * healthcare setting.
3128     */
3129    SUPPLYREQUEST,
3130    /**
3131     * TestScript is a resource that specifies a suite of tests against a FHIR
3132     * server implementation to determine compliance against the FHIR specification.
3133     */
3134    TESTSCRIPT,
3135    /**
3136     * A value set specifies a set of codes drawn from one or more code systems.
3137     */
3138    VALUESET,
3139    /**
3140     * An authorization for the supply of glasses and/or contact lenses to a
3141     * patient.
3142     */
3143    VISIONPRESCRIPTION,
3144    /**
3145     * added to help the parsers
3146     */
3147    NULL;
3148
3149    public static FHIRDefinedType fromCode(String codeString) throws FHIRException {
3150      if (codeString == null || "".equals(codeString))
3151        return null;
3152      if ("Address".equals(codeString))
3153        return ADDRESS;
3154      if ("Age".equals(codeString))
3155        return AGE;
3156      if ("Annotation".equals(codeString))
3157        return ANNOTATION;
3158      if ("Attachment".equals(codeString))
3159        return ATTACHMENT;
3160      if ("BackboneElement".equals(codeString))
3161        return BACKBONEELEMENT;
3162      if ("CodeableConcept".equals(codeString))
3163        return CODEABLECONCEPT;
3164      if ("Coding".equals(codeString))
3165        return CODING;
3166      if ("ContactPoint".equals(codeString))
3167        return CONTACTPOINT;
3168      if ("Count".equals(codeString))
3169        return COUNT;
3170      if ("Distance".equals(codeString))
3171        return DISTANCE;
3172      if ("Duration".equals(codeString))
3173        return DURATION;
3174      if ("Element".equals(codeString))
3175        return ELEMENT;
3176      if ("ElementDefinition".equals(codeString))
3177        return ELEMENTDEFINITION;
3178      if ("Extension".equals(codeString))
3179        return EXTENSION;
3180      if ("HumanName".equals(codeString))
3181        return HUMANNAME;
3182      if ("Identifier".equals(codeString))
3183        return IDENTIFIER;
3184      if ("Meta".equals(codeString))
3185        return META;
3186      if ("Money".equals(codeString))
3187        return MONEY;
3188      if ("Narrative".equals(codeString))
3189        return NARRATIVE;
3190      if ("Period".equals(codeString))
3191        return PERIOD;
3192      if ("Quantity".equals(codeString))
3193        return QUANTITY;
3194      if ("Range".equals(codeString))
3195        return RANGE;
3196      if ("Ratio".equals(codeString))
3197        return RATIO;
3198      if ("Reference".equals(codeString))
3199        return REFERENCE;
3200      if ("SampledData".equals(codeString))
3201        return SAMPLEDDATA;
3202      if ("Signature".equals(codeString))
3203        return SIGNATURE;
3204      if ("SimpleQuantity".equals(codeString))
3205        return SIMPLEQUANTITY;
3206      if ("Timing".equals(codeString))
3207        return TIMING;
3208      if ("base64Binary".equals(codeString))
3209        return BASE64BINARY;
3210      if ("boolean".equals(codeString))
3211        return BOOLEAN;
3212      if ("code".equals(codeString))
3213        return CODE;
3214      if ("date".equals(codeString))
3215        return DATE;
3216      if ("dateTime".equals(codeString))
3217        return DATETIME;
3218      if ("decimal".equals(codeString))
3219        return DECIMAL;
3220      if ("id".equals(codeString))
3221        return ID;
3222      if ("instant".equals(codeString))
3223        return INSTANT;
3224      if ("integer".equals(codeString))
3225        return INTEGER;
3226      if ("markdown".equals(codeString))
3227        return MARKDOWN;
3228      if ("oid".equals(codeString))
3229        return OID;
3230      if ("positiveInt".equals(codeString))
3231        return POSITIVEINT;
3232      if ("string".equals(codeString))
3233        return STRING;
3234      if ("time".equals(codeString))
3235        return TIME;
3236      if ("unsignedInt".equals(codeString))
3237        return UNSIGNEDINT;
3238      if ("uri".equals(codeString))
3239        return URI;
3240      if ("uuid".equals(codeString))
3241        return UUID;
3242      if ("xhtml".equals(codeString))
3243        return XHTML;
3244      if ("Account".equals(codeString))
3245        return ACCOUNT;
3246      if ("AllergyIntolerance".equals(codeString))
3247        return ALLERGYINTOLERANCE;
3248      if ("Appointment".equals(codeString))
3249        return APPOINTMENT;
3250      if ("AppointmentResponse".equals(codeString))
3251        return APPOINTMENTRESPONSE;
3252      if ("AuditEvent".equals(codeString))
3253        return AUDITEVENT;
3254      if ("Basic".equals(codeString))
3255        return BASIC;
3256      if ("Binary".equals(codeString))
3257        return BINARY;
3258      if ("BodySite".equals(codeString))
3259        return BODYSITE;
3260      if ("Bundle".equals(codeString))
3261        return BUNDLE;
3262      if ("CarePlan".equals(codeString))
3263        return CAREPLAN;
3264      if ("Claim".equals(codeString))
3265        return CLAIM;
3266      if ("ClaimResponse".equals(codeString))
3267        return CLAIMRESPONSE;
3268      if ("ClinicalImpression".equals(codeString))
3269        return CLINICALIMPRESSION;
3270      if ("Communication".equals(codeString))
3271        return COMMUNICATION;
3272      if ("CommunicationRequest".equals(codeString))
3273        return COMMUNICATIONREQUEST;
3274      if ("Composition".equals(codeString))
3275        return COMPOSITION;
3276      if ("ConceptMap".equals(codeString))
3277        return CONCEPTMAP;
3278      if ("Condition".equals(codeString))
3279        return CONDITION;
3280      if ("Conformance".equals(codeString))
3281        return CONFORMANCE;
3282      if ("Contract".equals(codeString))
3283        return CONTRACT;
3284      if ("Coverage".equals(codeString))
3285        return COVERAGE;
3286      if ("DataElement".equals(codeString))
3287        return DATAELEMENT;
3288      if ("DetectedIssue".equals(codeString))
3289        return DETECTEDISSUE;
3290      if ("Device".equals(codeString))
3291        return DEVICE;
3292      if ("DeviceComponent".equals(codeString))
3293        return DEVICECOMPONENT;
3294      if ("DeviceMetric".equals(codeString))
3295        return DEVICEMETRIC;
3296      if ("DeviceUseRequest".equals(codeString))
3297        return DEVICEUSEREQUEST;
3298      if ("DeviceUseStatement".equals(codeString))
3299        return DEVICEUSESTATEMENT;
3300      if ("DiagnosticOrder".equals(codeString))
3301        return DIAGNOSTICORDER;
3302      if ("DiagnosticReport".equals(codeString))
3303        return DIAGNOSTICREPORT;
3304      if ("DocumentManifest".equals(codeString))
3305        return DOCUMENTMANIFEST;
3306      if ("DocumentReference".equals(codeString))
3307        return DOCUMENTREFERENCE;
3308      if ("DomainResource".equals(codeString))
3309        return DOMAINRESOURCE;
3310      if ("EligibilityRequest".equals(codeString))
3311        return ELIGIBILITYREQUEST;
3312      if ("EligibilityResponse".equals(codeString))
3313        return ELIGIBILITYRESPONSE;
3314      if ("Encounter".equals(codeString))
3315        return ENCOUNTER;
3316      if ("EnrollmentRequest".equals(codeString))
3317        return ENROLLMENTREQUEST;
3318      if ("EnrollmentResponse".equals(codeString))
3319        return ENROLLMENTRESPONSE;
3320      if ("EpisodeOfCare".equals(codeString))
3321        return EPISODEOFCARE;
3322      if ("ExplanationOfBenefit".equals(codeString))
3323        return EXPLANATIONOFBENEFIT;
3324      if ("FamilyMemberHistory".equals(codeString))
3325        return FAMILYMEMBERHISTORY;
3326      if ("Flag".equals(codeString))
3327        return FLAG;
3328      if ("Goal".equals(codeString))
3329        return GOAL;
3330      if ("Group".equals(codeString))
3331        return GROUP;
3332      if ("HealthcareService".equals(codeString))
3333        return HEALTHCARESERVICE;
3334      if ("ImagingObjectSelection".equals(codeString))
3335        return IMAGINGOBJECTSELECTION;
3336      if ("ImagingStudy".equals(codeString))
3337        return IMAGINGSTUDY;
3338      if ("Immunization".equals(codeString))
3339        return IMMUNIZATION;
3340      if ("ImmunizationRecommendation".equals(codeString))
3341        return IMMUNIZATIONRECOMMENDATION;
3342      if ("ImplementationGuide".equals(codeString))
3343        return IMPLEMENTATIONGUIDE;
3344      if ("List".equals(codeString))
3345        return LIST;
3346      if ("Location".equals(codeString))
3347        return LOCATION;
3348      if ("Media".equals(codeString))
3349        return MEDIA;
3350      if ("Medication".equals(codeString))
3351        return MEDICATION;
3352      if ("MedicationAdministration".equals(codeString))
3353        return MEDICATIONADMINISTRATION;
3354      if ("MedicationDispense".equals(codeString))
3355        return MEDICATIONDISPENSE;
3356      if ("MedicationOrder".equals(codeString))
3357        return MEDICATIONORDER;
3358      if ("MedicationStatement".equals(codeString))
3359        return MEDICATIONSTATEMENT;
3360      if ("MessageHeader".equals(codeString))
3361        return MESSAGEHEADER;
3362      if ("NamingSystem".equals(codeString))
3363        return NAMINGSYSTEM;
3364      if ("NutritionOrder".equals(codeString))
3365        return NUTRITIONORDER;
3366      if ("Observation".equals(codeString))
3367        return OBSERVATION;
3368      if ("OperationDefinition".equals(codeString))
3369        return OPERATIONDEFINITION;
3370      if ("OperationOutcome".equals(codeString))
3371        return OPERATIONOUTCOME;
3372      if ("Order".equals(codeString))
3373        return ORDER;
3374      if ("OrderResponse".equals(codeString))
3375        return ORDERRESPONSE;
3376      if ("Organization".equals(codeString))
3377        return ORGANIZATION;
3378      if ("Parameters".equals(codeString))
3379        return PARAMETERS;
3380      if ("Patient".equals(codeString))
3381        return PATIENT;
3382      if ("PaymentNotice".equals(codeString))
3383        return PAYMENTNOTICE;
3384      if ("PaymentReconciliation".equals(codeString))
3385        return PAYMENTRECONCILIATION;
3386      if ("Person".equals(codeString))
3387        return PERSON;
3388      if ("Practitioner".equals(codeString))
3389        return PRACTITIONER;
3390      if ("Procedure".equals(codeString))
3391        return PROCEDURE;
3392      if ("ProcedureRequest".equals(codeString))
3393        return PROCEDUREREQUEST;
3394      if ("ProcessRequest".equals(codeString))
3395        return PROCESSREQUEST;
3396      if ("ProcessResponse".equals(codeString))
3397        return PROCESSRESPONSE;
3398      if ("Provenance".equals(codeString))
3399        return PROVENANCE;
3400      if ("Questionnaire".equals(codeString))
3401        return QUESTIONNAIRE;
3402      if ("QuestionnaireResponse".equals(codeString))
3403        return QUESTIONNAIRERESPONSE;
3404      if ("ReferralRequest".equals(codeString))
3405        return REFERRALREQUEST;
3406      if ("RelatedPerson".equals(codeString))
3407        return RELATEDPERSON;
3408      if ("Resource".equals(codeString))
3409        return RESOURCE;
3410      if ("RiskAssessment".equals(codeString))
3411        return RISKASSESSMENT;
3412      if ("Schedule".equals(codeString))
3413        return SCHEDULE;
3414      if ("SearchParameter".equals(codeString))
3415        return SEARCHPARAMETER;
3416      if ("Slot".equals(codeString))
3417        return SLOT;
3418      if ("Specimen".equals(codeString))
3419        return SPECIMEN;
3420      if ("StructureDefinition".equals(codeString))
3421        return STRUCTUREDEFINITION;
3422      if ("Subscription".equals(codeString))
3423        return SUBSCRIPTION;
3424      if ("Substance".equals(codeString))
3425        return SUBSTANCE;
3426      if ("SupplyDelivery".equals(codeString))
3427        return SUPPLYDELIVERY;
3428      if ("SupplyRequest".equals(codeString))
3429        return SUPPLYREQUEST;
3430      if ("TestScript".equals(codeString))
3431        return TESTSCRIPT;
3432      if ("ValueSet".equals(codeString))
3433        return VALUESET;
3434      if ("VisionPrescription".equals(codeString))
3435        return VISIONPRESCRIPTION;
3436      throw new FHIRException("Unknown FHIRDefinedType code '" + codeString + "'");
3437    }
3438
3439    public String toCode() {
3440      switch (this) {
3441      case ADDRESS:
3442        return "Address";
3443      case AGE:
3444        return "Age";
3445      case ANNOTATION:
3446        return "Annotation";
3447      case ATTACHMENT:
3448        return "Attachment";
3449      case BACKBONEELEMENT:
3450        return "BackboneElement";
3451      case CODEABLECONCEPT:
3452        return "CodeableConcept";
3453      case CODING:
3454        return "Coding";
3455      case CONTACTPOINT:
3456        return "ContactPoint";
3457      case COUNT:
3458        return "Count";
3459      case DISTANCE:
3460        return "Distance";
3461      case DURATION:
3462        return "Duration";
3463      case ELEMENT:
3464        return "Element";
3465      case ELEMENTDEFINITION:
3466        return "ElementDefinition";
3467      case EXTENSION:
3468        return "Extension";
3469      case HUMANNAME:
3470        return "HumanName";
3471      case IDENTIFIER:
3472        return "Identifier";
3473      case META:
3474        return "Meta";
3475      case MONEY:
3476        return "Money";
3477      case NARRATIVE:
3478        return "Narrative";
3479      case PERIOD:
3480        return "Period";
3481      case QUANTITY:
3482        return "Quantity";
3483      case RANGE:
3484        return "Range";
3485      case RATIO:
3486        return "Ratio";
3487      case REFERENCE:
3488        return "Reference";
3489      case SAMPLEDDATA:
3490        return "SampledData";
3491      case SIGNATURE:
3492        return "Signature";
3493      case SIMPLEQUANTITY:
3494        return "SimpleQuantity";
3495      case TIMING:
3496        return "Timing";
3497      case BASE64BINARY:
3498        return "base64Binary";
3499      case BOOLEAN:
3500        return "boolean";
3501      case CODE:
3502        return "code";
3503      case DATE:
3504        return "date";
3505      case DATETIME:
3506        return "dateTime";
3507      case DECIMAL:
3508        return "decimal";
3509      case ID:
3510        return "id";
3511      case INSTANT:
3512        return "instant";
3513      case INTEGER:
3514        return "integer";
3515      case MARKDOWN:
3516        return "markdown";
3517      case OID:
3518        return "oid";
3519      case POSITIVEINT:
3520        return "positiveInt";
3521      case STRING:
3522        return "string";
3523      case TIME:
3524        return "time";
3525      case UNSIGNEDINT:
3526        return "unsignedInt";
3527      case URI:
3528        return "uri";
3529      case UUID:
3530        return "uuid";
3531      case XHTML:
3532        return "xhtml";
3533      case ACCOUNT:
3534        return "Account";
3535      case ALLERGYINTOLERANCE:
3536        return "AllergyIntolerance";
3537      case APPOINTMENT:
3538        return "Appointment";
3539      case APPOINTMENTRESPONSE:
3540        return "AppointmentResponse";
3541      case AUDITEVENT:
3542        return "AuditEvent";
3543      case BASIC:
3544        return "Basic";
3545      case BINARY:
3546        return "Binary";
3547      case BODYSITE:
3548        return "BodySite";
3549      case BUNDLE:
3550        return "Bundle";
3551      case CAREPLAN:
3552        return "CarePlan";
3553      case CLAIM:
3554        return "Claim";
3555      case CLAIMRESPONSE:
3556        return "ClaimResponse";
3557      case CLINICALIMPRESSION:
3558        return "ClinicalImpression";
3559      case COMMUNICATION:
3560        return "Communication";
3561      case COMMUNICATIONREQUEST:
3562        return "CommunicationRequest";
3563      case COMPOSITION:
3564        return "Composition";
3565      case CONCEPTMAP:
3566        return "ConceptMap";
3567      case CONDITION:
3568        return "Condition";
3569      case CONFORMANCE:
3570        return "Conformance";
3571      case CONTRACT:
3572        return "Contract";
3573      case COVERAGE:
3574        return "Coverage";
3575      case DATAELEMENT:
3576        return "DataElement";
3577      case DETECTEDISSUE:
3578        return "DetectedIssue";
3579      case DEVICE:
3580        return "Device";
3581      case DEVICECOMPONENT:
3582        return "DeviceComponent";
3583      case DEVICEMETRIC:
3584        return "DeviceMetric";
3585      case DEVICEUSEREQUEST:
3586        return "DeviceUseRequest";
3587      case DEVICEUSESTATEMENT:
3588        return "DeviceUseStatement";
3589      case DIAGNOSTICORDER:
3590        return "DiagnosticOrder";
3591      case DIAGNOSTICREPORT:
3592        return "DiagnosticReport";
3593      case DOCUMENTMANIFEST:
3594        return "DocumentManifest";
3595      case DOCUMENTREFERENCE:
3596        return "DocumentReference";
3597      case DOMAINRESOURCE:
3598        return "DomainResource";
3599      case ELIGIBILITYREQUEST:
3600        return "EligibilityRequest";
3601      case ELIGIBILITYRESPONSE:
3602        return "EligibilityResponse";
3603      case ENCOUNTER:
3604        return "Encounter";
3605      case ENROLLMENTREQUEST:
3606        return "EnrollmentRequest";
3607      case ENROLLMENTRESPONSE:
3608        return "EnrollmentResponse";
3609      case EPISODEOFCARE:
3610        return "EpisodeOfCare";
3611      case EXPLANATIONOFBENEFIT:
3612        return "ExplanationOfBenefit";
3613      case FAMILYMEMBERHISTORY:
3614        return "FamilyMemberHistory";
3615      case FLAG:
3616        return "Flag";
3617      case GOAL:
3618        return "Goal";
3619      case GROUP:
3620        return "Group";
3621      case HEALTHCARESERVICE:
3622        return "HealthcareService";
3623      case IMAGINGOBJECTSELECTION:
3624        return "ImagingObjectSelection";
3625      case IMAGINGSTUDY:
3626        return "ImagingStudy";
3627      case IMMUNIZATION:
3628        return "Immunization";
3629      case IMMUNIZATIONRECOMMENDATION:
3630        return "ImmunizationRecommendation";
3631      case IMPLEMENTATIONGUIDE:
3632        return "ImplementationGuide";
3633      case LIST:
3634        return "List";
3635      case LOCATION:
3636        return "Location";
3637      case MEDIA:
3638        return "Media";
3639      case MEDICATION:
3640        return "Medication";
3641      case MEDICATIONADMINISTRATION:
3642        return "MedicationAdministration";
3643      case MEDICATIONDISPENSE:
3644        return "MedicationDispense";
3645      case MEDICATIONORDER:
3646        return "MedicationOrder";
3647      case MEDICATIONSTATEMENT:
3648        return "MedicationStatement";
3649      case MESSAGEHEADER:
3650        return "MessageHeader";
3651      case NAMINGSYSTEM:
3652        return "NamingSystem";
3653      case NUTRITIONORDER:
3654        return "NutritionOrder";
3655      case OBSERVATION:
3656        return "Observation";
3657      case OPERATIONDEFINITION:
3658        return "OperationDefinition";
3659      case OPERATIONOUTCOME:
3660        return "OperationOutcome";
3661      case ORDER:
3662        return "Order";
3663      case ORDERRESPONSE:
3664        return "OrderResponse";
3665      case ORGANIZATION:
3666        return "Organization";
3667      case PARAMETERS:
3668        return "Parameters";
3669      case PATIENT:
3670        return "Patient";
3671      case PAYMENTNOTICE:
3672        return "PaymentNotice";
3673      case PAYMENTRECONCILIATION:
3674        return "PaymentReconciliation";
3675      case PERSON:
3676        return "Person";
3677      case PRACTITIONER:
3678        return "Practitioner";
3679      case PROCEDURE:
3680        return "Procedure";
3681      case PROCEDUREREQUEST:
3682        return "ProcedureRequest";
3683      case PROCESSREQUEST:
3684        return "ProcessRequest";
3685      case PROCESSRESPONSE:
3686        return "ProcessResponse";
3687      case PROVENANCE:
3688        return "Provenance";
3689      case QUESTIONNAIRE:
3690        return "Questionnaire";
3691      case QUESTIONNAIRERESPONSE:
3692        return "QuestionnaireResponse";
3693      case REFERRALREQUEST:
3694        return "ReferralRequest";
3695      case RELATEDPERSON:
3696        return "RelatedPerson";
3697      case RESOURCE:
3698        return "Resource";
3699      case RISKASSESSMENT:
3700        return "RiskAssessment";
3701      case SCHEDULE:
3702        return "Schedule";
3703      case SEARCHPARAMETER:
3704        return "SearchParameter";
3705      case SLOT:
3706        return "Slot";
3707      case SPECIMEN:
3708        return "Specimen";
3709      case STRUCTUREDEFINITION:
3710        return "StructureDefinition";
3711      case SUBSCRIPTION:
3712        return "Subscription";
3713      case SUBSTANCE:
3714        return "Substance";
3715      case SUPPLYDELIVERY:
3716        return "SupplyDelivery";
3717      case SUPPLYREQUEST:
3718        return "SupplyRequest";
3719      case TESTSCRIPT:
3720        return "TestScript";
3721      case VALUESET:
3722        return "ValueSet";
3723      case VISIONPRESCRIPTION:
3724        return "VisionPrescription";
3725      case NULL:
3726        return null;
3727      default:
3728        return "?";
3729      }
3730    }
3731
3732    public String getSystem() {
3733      switch (this) {
3734      case ADDRESS:
3735        return "http://hl7.org/fhir/data-types";
3736      case AGE:
3737        return "http://hl7.org/fhir/data-types";
3738      case ANNOTATION:
3739        return "http://hl7.org/fhir/data-types";
3740      case ATTACHMENT:
3741        return "http://hl7.org/fhir/data-types";
3742      case BACKBONEELEMENT:
3743        return "http://hl7.org/fhir/data-types";
3744      case CODEABLECONCEPT:
3745        return "http://hl7.org/fhir/data-types";
3746      case CODING:
3747        return "http://hl7.org/fhir/data-types";
3748      case CONTACTPOINT:
3749        return "http://hl7.org/fhir/data-types";
3750      case COUNT:
3751        return "http://hl7.org/fhir/data-types";
3752      case DISTANCE:
3753        return "http://hl7.org/fhir/data-types";
3754      case DURATION:
3755        return "http://hl7.org/fhir/data-types";
3756      case ELEMENT:
3757        return "http://hl7.org/fhir/data-types";
3758      case ELEMENTDEFINITION:
3759        return "http://hl7.org/fhir/data-types";
3760      case EXTENSION:
3761        return "http://hl7.org/fhir/data-types";
3762      case HUMANNAME:
3763        return "http://hl7.org/fhir/data-types";
3764      case IDENTIFIER:
3765        return "http://hl7.org/fhir/data-types";
3766      case META:
3767        return "http://hl7.org/fhir/data-types";
3768      case MONEY:
3769        return "http://hl7.org/fhir/data-types";
3770      case NARRATIVE:
3771        return "http://hl7.org/fhir/data-types";
3772      case PERIOD:
3773        return "http://hl7.org/fhir/data-types";
3774      case QUANTITY:
3775        return "http://hl7.org/fhir/data-types";
3776      case RANGE:
3777        return "http://hl7.org/fhir/data-types";
3778      case RATIO:
3779        return "http://hl7.org/fhir/data-types";
3780      case REFERENCE:
3781        return "http://hl7.org/fhir/data-types";
3782      case SAMPLEDDATA:
3783        return "http://hl7.org/fhir/data-types";
3784      case SIGNATURE:
3785        return "http://hl7.org/fhir/data-types";
3786      case SIMPLEQUANTITY:
3787        return "http://hl7.org/fhir/data-types";
3788      case TIMING:
3789        return "http://hl7.org/fhir/data-types";
3790      case BASE64BINARY:
3791        return "http://hl7.org/fhir/data-types";
3792      case BOOLEAN:
3793        return "http://hl7.org/fhir/data-types";
3794      case CODE:
3795        return "http://hl7.org/fhir/data-types";
3796      case DATE:
3797        return "http://hl7.org/fhir/data-types";
3798      case DATETIME:
3799        return "http://hl7.org/fhir/data-types";
3800      case DECIMAL:
3801        return "http://hl7.org/fhir/data-types";
3802      case ID:
3803        return "http://hl7.org/fhir/data-types";
3804      case INSTANT:
3805        return "http://hl7.org/fhir/data-types";
3806      case INTEGER:
3807        return "http://hl7.org/fhir/data-types";
3808      case MARKDOWN:
3809        return "http://hl7.org/fhir/data-types";
3810      case OID:
3811        return "http://hl7.org/fhir/data-types";
3812      case POSITIVEINT:
3813        return "http://hl7.org/fhir/data-types";
3814      case STRING:
3815        return "http://hl7.org/fhir/data-types";
3816      case TIME:
3817        return "http://hl7.org/fhir/data-types";
3818      case UNSIGNEDINT:
3819        return "http://hl7.org/fhir/data-types";
3820      case URI:
3821        return "http://hl7.org/fhir/data-types";
3822      case UUID:
3823        return "http://hl7.org/fhir/data-types";
3824      case XHTML:
3825        return "http://hl7.org/fhir/data-types";
3826      case ACCOUNT:
3827        return "http://hl7.org/fhir/resource-types";
3828      case ALLERGYINTOLERANCE:
3829        return "http://hl7.org/fhir/resource-types";
3830      case APPOINTMENT:
3831        return "http://hl7.org/fhir/resource-types";
3832      case APPOINTMENTRESPONSE:
3833        return "http://hl7.org/fhir/resource-types";
3834      case AUDITEVENT:
3835        return "http://hl7.org/fhir/resource-types";
3836      case BASIC:
3837        return "http://hl7.org/fhir/resource-types";
3838      case BINARY:
3839        return "http://hl7.org/fhir/resource-types";
3840      case BODYSITE:
3841        return "http://hl7.org/fhir/resource-types";
3842      case BUNDLE:
3843        return "http://hl7.org/fhir/resource-types";
3844      case CAREPLAN:
3845        return "http://hl7.org/fhir/resource-types";
3846      case CLAIM:
3847        return "http://hl7.org/fhir/resource-types";
3848      case CLAIMRESPONSE:
3849        return "http://hl7.org/fhir/resource-types";
3850      case CLINICALIMPRESSION:
3851        return "http://hl7.org/fhir/resource-types";
3852      case COMMUNICATION:
3853        return "http://hl7.org/fhir/resource-types";
3854      case COMMUNICATIONREQUEST:
3855        return "http://hl7.org/fhir/resource-types";
3856      case COMPOSITION:
3857        return "http://hl7.org/fhir/resource-types";
3858      case CONCEPTMAP:
3859        return "http://hl7.org/fhir/resource-types";
3860      case CONDITION:
3861        return "http://hl7.org/fhir/resource-types";
3862      case CONFORMANCE:
3863        return "http://hl7.org/fhir/resource-types";
3864      case CONTRACT:
3865        return "http://hl7.org/fhir/resource-types";
3866      case COVERAGE:
3867        return "http://hl7.org/fhir/resource-types";
3868      case DATAELEMENT:
3869        return "http://hl7.org/fhir/resource-types";
3870      case DETECTEDISSUE:
3871        return "http://hl7.org/fhir/resource-types";
3872      case DEVICE:
3873        return "http://hl7.org/fhir/resource-types";
3874      case DEVICECOMPONENT:
3875        return "http://hl7.org/fhir/resource-types";
3876      case DEVICEMETRIC:
3877        return "http://hl7.org/fhir/resource-types";
3878      case DEVICEUSEREQUEST:
3879        return "http://hl7.org/fhir/resource-types";
3880      case DEVICEUSESTATEMENT:
3881        return "http://hl7.org/fhir/resource-types";
3882      case DIAGNOSTICORDER:
3883        return "http://hl7.org/fhir/resource-types";
3884      case DIAGNOSTICREPORT:
3885        return "http://hl7.org/fhir/resource-types";
3886      case DOCUMENTMANIFEST:
3887        return "http://hl7.org/fhir/resource-types";
3888      case DOCUMENTREFERENCE:
3889        return "http://hl7.org/fhir/resource-types";
3890      case DOMAINRESOURCE:
3891        return "http://hl7.org/fhir/resource-types";
3892      case ELIGIBILITYREQUEST:
3893        return "http://hl7.org/fhir/resource-types";
3894      case ELIGIBILITYRESPONSE:
3895        return "http://hl7.org/fhir/resource-types";
3896      case ENCOUNTER:
3897        return "http://hl7.org/fhir/resource-types";
3898      case ENROLLMENTREQUEST:
3899        return "http://hl7.org/fhir/resource-types";
3900      case ENROLLMENTRESPONSE:
3901        return "http://hl7.org/fhir/resource-types";
3902      case EPISODEOFCARE:
3903        return "http://hl7.org/fhir/resource-types";
3904      case EXPLANATIONOFBENEFIT:
3905        return "http://hl7.org/fhir/resource-types";
3906      case FAMILYMEMBERHISTORY:
3907        return "http://hl7.org/fhir/resource-types";
3908      case FLAG:
3909        return "http://hl7.org/fhir/resource-types";
3910      case GOAL:
3911        return "http://hl7.org/fhir/resource-types";
3912      case GROUP:
3913        return "http://hl7.org/fhir/resource-types";
3914      case HEALTHCARESERVICE:
3915        return "http://hl7.org/fhir/resource-types";
3916      case IMAGINGOBJECTSELECTION:
3917        return "http://hl7.org/fhir/resource-types";
3918      case IMAGINGSTUDY:
3919        return "http://hl7.org/fhir/resource-types";
3920      case IMMUNIZATION:
3921        return "http://hl7.org/fhir/resource-types";
3922      case IMMUNIZATIONRECOMMENDATION:
3923        return "http://hl7.org/fhir/resource-types";
3924      case IMPLEMENTATIONGUIDE:
3925        return "http://hl7.org/fhir/resource-types";
3926      case LIST:
3927        return "http://hl7.org/fhir/resource-types";
3928      case LOCATION:
3929        return "http://hl7.org/fhir/resource-types";
3930      case MEDIA:
3931        return "http://hl7.org/fhir/resource-types";
3932      case MEDICATION:
3933        return "http://hl7.org/fhir/resource-types";
3934      case MEDICATIONADMINISTRATION:
3935        return "http://hl7.org/fhir/resource-types";
3936      case MEDICATIONDISPENSE:
3937        return "http://hl7.org/fhir/resource-types";
3938      case MEDICATIONORDER:
3939        return "http://hl7.org/fhir/resource-types";
3940      case MEDICATIONSTATEMENT:
3941        return "http://hl7.org/fhir/resource-types";
3942      case MESSAGEHEADER:
3943        return "http://hl7.org/fhir/resource-types";
3944      case NAMINGSYSTEM:
3945        return "http://hl7.org/fhir/resource-types";
3946      case NUTRITIONORDER:
3947        return "http://hl7.org/fhir/resource-types";
3948      case OBSERVATION:
3949        return "http://hl7.org/fhir/resource-types";
3950      case OPERATIONDEFINITION:
3951        return "http://hl7.org/fhir/resource-types";
3952      case OPERATIONOUTCOME:
3953        return "http://hl7.org/fhir/resource-types";
3954      case ORDER:
3955        return "http://hl7.org/fhir/resource-types";
3956      case ORDERRESPONSE:
3957        return "http://hl7.org/fhir/resource-types";
3958      case ORGANIZATION:
3959        return "http://hl7.org/fhir/resource-types";
3960      case PARAMETERS:
3961        return "http://hl7.org/fhir/resource-types";
3962      case PATIENT:
3963        return "http://hl7.org/fhir/resource-types";
3964      case PAYMENTNOTICE:
3965        return "http://hl7.org/fhir/resource-types";
3966      case PAYMENTRECONCILIATION:
3967        return "http://hl7.org/fhir/resource-types";
3968      case PERSON:
3969        return "http://hl7.org/fhir/resource-types";
3970      case PRACTITIONER:
3971        return "http://hl7.org/fhir/resource-types";
3972      case PROCEDURE:
3973        return "http://hl7.org/fhir/resource-types";
3974      case PROCEDUREREQUEST:
3975        return "http://hl7.org/fhir/resource-types";
3976      case PROCESSREQUEST:
3977        return "http://hl7.org/fhir/resource-types";
3978      case PROCESSRESPONSE:
3979        return "http://hl7.org/fhir/resource-types";
3980      case PROVENANCE:
3981        return "http://hl7.org/fhir/resource-types";
3982      case QUESTIONNAIRE:
3983        return "http://hl7.org/fhir/resource-types";
3984      case QUESTIONNAIRERESPONSE:
3985        return "http://hl7.org/fhir/resource-types";
3986      case REFERRALREQUEST:
3987        return "http://hl7.org/fhir/resource-types";
3988      case RELATEDPERSON:
3989        return "http://hl7.org/fhir/resource-types";
3990      case RESOURCE:
3991        return "http://hl7.org/fhir/resource-types";
3992      case RISKASSESSMENT:
3993        return "http://hl7.org/fhir/resource-types";
3994      case SCHEDULE:
3995        return "http://hl7.org/fhir/resource-types";
3996      case SEARCHPARAMETER:
3997        return "http://hl7.org/fhir/resource-types";
3998      case SLOT:
3999        return "http://hl7.org/fhir/resource-types";
4000      case SPECIMEN:
4001        return "http://hl7.org/fhir/resource-types";
4002      case STRUCTUREDEFINITION:
4003        return "http://hl7.org/fhir/resource-types";
4004      case SUBSCRIPTION:
4005        return "http://hl7.org/fhir/resource-types";
4006      case SUBSTANCE:
4007        return "http://hl7.org/fhir/resource-types";
4008      case SUPPLYDELIVERY:
4009        return "http://hl7.org/fhir/resource-types";
4010      case SUPPLYREQUEST:
4011        return "http://hl7.org/fhir/resource-types";
4012      case TESTSCRIPT:
4013        return "http://hl7.org/fhir/resource-types";
4014      case VALUESET:
4015        return "http://hl7.org/fhir/resource-types";
4016      case VISIONPRESCRIPTION:
4017        return "http://hl7.org/fhir/resource-types";
4018      case NULL:
4019        return null;
4020      default:
4021        return "?";
4022      }
4023    }
4024
4025    public String getDefinition() {
4026      switch (this) {
4027      case ADDRESS:
4028        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.";
4029      case AGE:
4030        return "";
4031      case ANNOTATION:
4032        return "A  text note which also  contains information about who made the statement and when.";
4033      case ATTACHMENT:
4034        return "For referring to data content defined in other formats.";
4035      case BACKBONEELEMENT:
4036        return "Base definition for all elements that are defined inside a resource - but not those in a data type.";
4037      case CODEABLECONCEPT:
4038        return "A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text.";
4039      case CODING:
4040        return "A reference to a code defined by a terminology system.";
4041      case CONTACTPOINT:
4042        return "Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc.";
4043      case COUNT:
4044        return "";
4045      case DISTANCE:
4046        return "";
4047      case DURATION:
4048        return "";
4049      case ELEMENT:
4050        return "Base definition for all elements in a resource.";
4051      case ELEMENTDEFINITION:
4052        return "Captures constraints on each element within the resource, profile, or extension.";
4053      case EXTENSION:
4054        return "Optional Extensions Element - found in all resources.";
4055      case HUMANNAME:
4056        return "A human's name with the ability to identify parts and usage.";
4057      case IDENTIFIER:
4058        return "A technical identifier - identifies some entity uniquely and unambiguously.";
4059      case META:
4060        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.";
4061      case MONEY:
4062        return "";
4063      case NARRATIVE:
4064        return "A human-readable formatted text, including images.";
4065      case PERIOD:
4066        return "A time period defined by a start and end date and optionally time.";
4067      case QUANTITY:
4068        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.";
4069      case RANGE:
4070        return "A set of ordered Quantities defined by a low and high limit.";
4071      case RATIO:
4072        return "A relationship of two Quantity values - expressed as a numerator and a denominator.";
4073      case REFERENCE:
4074        return "A reference from one resource to another.";
4075      case SAMPLEDDATA:
4076        return "A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data.";
4077      case SIGNATURE:
4078        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.";
4079      case SIMPLEQUANTITY:
4080        return "";
4081      case TIMING:
4082        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.";
4083      case BASE64BINARY:
4084        return "A stream of bytes";
4085      case BOOLEAN:
4086        return "Value of \"true\" or \"false\"";
4087      case CODE:
4088        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";
4089      case DATE:
4090        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.";
4091      case DATETIME:
4092        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.";
4093      case DECIMAL:
4094        return "A rational number with implicit precision";
4095      case ID:
4096        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.";
4097      case INSTANT:
4098        return "An instant in time - known at least to the second";
4099      case INTEGER:
4100        return "A whole number";
4101      case MARKDOWN:
4102        return "A string that may contain markdown syntax for optional processing by a mark down presentation engine";
4103      case OID:
4104        return "An oid represented as a URI";
4105      case POSITIVEINT:
4106        return "An integer with a value that is positive (e.g. >0)";
4107      case STRING:
4108        return "A sequence of Unicode characters";
4109      case TIME:
4110        return "A time during the day, with no date specified";
4111      case UNSIGNEDINT:
4112        return "An integer with a value that is not negative (e.g. >= 0)";
4113      case URI:
4114        return "String of characters used to identify a name or a resource";
4115      case UUID:
4116        return "A UUID, represented as a URI";
4117      case XHTML:
4118        return "XHTML format, as defined by W3C, but restricted usage (mainly, no active content)";
4119      case ACCOUNT:
4120        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.";
4121      case ALLERGYINTOLERANCE:
4122        return "Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance.";
4123      case APPOINTMENT:
4124        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).";
4125      case APPOINTMENTRESPONSE:
4126        return "A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection.";
4127      case AUDITEVENT:
4128        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.";
4129      case BASIC:
4130        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.";
4131      case BINARY:
4132        return "A binary resource can contain any content, whether text, image, pdf, zip archive, etc.";
4133      case BODYSITE:
4134        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.";
4135      case BUNDLE:
4136        return "A container for a collection of resources.";
4137      case CAREPLAN:
4138        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.";
4139      case CLAIM:
4140        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.";
4141      case CLAIMRESPONSE:
4142        return "This resource provides the adjudication details from the processing of a Claim resource.";
4143      case CLINICALIMPRESSION:
4144        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.";
4145      case COMMUNICATION:
4146        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.";
4147      case COMMUNICATIONREQUEST:
4148        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.";
4149      case COMPOSITION:
4150        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.";
4151      case CONCEPTMAP:
4152        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.";
4153      case CONDITION:
4154        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.";
4155      case CONFORMANCE:
4156        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.";
4157      case CONTRACT:
4158        return "A formal agreement between parties regarding the conduct of business, exchange of information or other matters.";
4159      case COVERAGE:
4160        return "Financial instrument which may be used to pay for or reimburse health care products and services.";
4161      case DATAELEMENT:
4162        return "The formal description of a single piece of information that can be gathered and reported.";
4163      case DETECTEDISSUE:
4164        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.";
4165      case DEVICE:
4166        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.";
4167      case DEVICECOMPONENT:
4168        return "Describes the characteristics, operational status and capabilities of a medical-related component of a medical device.";
4169      case DEVICEMETRIC:
4170        return "Describes a measurement, calculation or setting capability of a medical device.";
4171      case DEVICEUSEREQUEST:
4172        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.";
4173      case DEVICEUSESTATEMENT:
4174        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.";
4175      case DIAGNOSTICORDER:
4176        return "A record of a request for a diagnostic investigation service to be performed.";
4177      case DIAGNOSTICREPORT:
4178        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.";
4179      case DOCUMENTMANIFEST:
4180        return "A manifest that defines a set of documents.";
4181      case DOCUMENTREFERENCE:
4182        return "A reference to a document .";
4183      case DOMAINRESOURCE:
4184        return "--- Abstract Type! ---A resource that includes narrative, extensions, and contained resources.";
4185      case ELIGIBILITYREQUEST:
4186        return "This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service.";
4187      case ELIGIBILITYRESPONSE:
4188        return "This resource provides eligibility and plan details from the processing of an Eligibility resource.";
4189      case ENCOUNTER:
4190        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.";
4191      case ENROLLMENTREQUEST:
4192        return "This resource provides the insurance enrollment details to the insurer regarding a specified coverage.";
4193      case ENROLLMENTRESPONSE:
4194        return "This resource provides enrollment and plan details from the processing of an Enrollment resource.";
4195      case EPISODEOFCARE:
4196        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.";
4197      case EXPLANATIONOFBENEFIT:
4198        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.";
4199      case FAMILYMEMBERHISTORY:
4200        return "Significant health events and conditions for a person related to the patient relevant in the context of care for the patient.";
4201      case FLAG:
4202        return "Prospective warnings of potential issues when providing care to the patient.";
4203      case GOAL:
4204        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.";
4205      case GROUP:
4206        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.";
4207      case HEALTHCARESERVICE:
4208        return "The details of a healthcare service available at a location.";
4209      case IMAGINGOBJECTSELECTION:
4210        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.";
4211      case IMAGINGSTUDY:
4212        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.";
4213      case IMMUNIZATION:
4214        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.";
4215      case IMMUNIZATIONRECOMMENDATION:
4216        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.";
4217      case IMPLEMENTATIONGUIDE:
4218        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.";
4219      case LIST:
4220        return "A set of information summarized from a list of other resources.";
4221      case LOCATION:
4222        return "Details and position information for a physical place where services are provided  and resources and participants may be stored, found, contained or accommodated.";
4223      case MEDIA:
4224        return "A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference.";
4225      case MEDICATION:
4226        return "This resource is primarily used for the identification and definition of a medication. It covers the ingredients and the packaging for a medication.";
4227      case MEDICATIONADMINISTRATION:
4228        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.";
4229      case MEDICATIONDISPENSE:
4230        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.";
4231      case MEDICATIONORDER:
4232        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.";
4233      case MEDICATIONSTATEMENT:
4234        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.";
4235      case MESSAGEHEADER:
4236        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.";
4237      case NAMINGSYSTEM:
4238        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.";
4239      case NUTRITIONORDER:
4240        return "A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.";
4241      case OBSERVATION:
4242        return "Measurements and simple assertions made about a patient, device or other subject.";
4243      case OPERATIONDEFINITION:
4244        return "A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction).";
4245      case OPERATIONOUTCOME:
4246        return "A collection of error, warning or information messages that result from a system action.";
4247      case ORDER:
4248        return "A request to perform an action.";
4249      case ORDERRESPONSE:
4250        return "A response to an order.";
4251      case ORGANIZATION:
4252        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.";
4253      case PARAMETERS:
4254        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.";
4255      case PATIENT:
4256        return "Demographics and other administrative information about an individual or animal receiving care or other health-related services.";
4257      case PAYMENTNOTICE:
4258        return "This resource provides the status of the payment for goods and services rendered, and the request and response resource references.";
4259      case PAYMENTRECONCILIATION:
4260        return "This resource provides payment details and claim references supporting a bulk payment.";
4261      case PERSON:
4262        return "Demographics and administrative information about a person independent of a specific health-related context.";
4263      case PRACTITIONER:
4264        return "A person who is directly or indirectly involved in the provisioning of healthcare.";
4265      case PROCEDURE:
4266        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.";
4267      case PROCEDUREREQUEST:
4268        return "A request for a procedure to be performed. May be a proposal or an order.";
4269      case PROCESSREQUEST:
4270        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.";
4271      case PROCESSRESPONSE:
4272        return "This resource provides processing status, errors and notes from the processing of a resource.";
4273      case PROVENANCE:
4274        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.";
4275      case QUESTIONNAIRE:
4276        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.";
4277      case QUESTIONNAIRERESPONSE:
4278        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.";
4279      case REFERRALREQUEST:
4280        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.";
4281      case RELATEDPERSON:
4282        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.";
4283      case RESOURCE:
4284        return "--- Abstract Type! ---This is the base resource type for everything.";
4285      case RISKASSESSMENT:
4286        return "An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome.";
4287      case SCHEDULE:
4288        return "A container for slot(s) of time that may be available for booking appointments.";
4289      case SEARCHPARAMETER:
4290        return "A search parameter that defines a named search item that can be used to search/filter on a resource.";
4291      case SLOT:
4292        return "A slot of time on a schedule that may be available for booking appointments.";
4293      case SPECIMEN:
4294        return "A sample to be used for analysis.";
4295      case STRUCTUREDEFINITION:
4296        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.";
4297      case SUBSCRIPTION:
4298        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.";
4299      case SUBSTANCE:
4300        return "A homogeneous material with a definite composition.";
4301      case SUPPLYDELIVERY:
4302        return "Record of delivery of what is supplied.";
4303      case SUPPLYREQUEST:
4304        return "A record of a request for a medication, substance or device used in the healthcare setting.";
4305      case TESTSCRIPT:
4306        return "TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine compliance against the FHIR specification.";
4307      case VALUESET:
4308        return "A value set specifies a set of codes drawn from one or more code systems.";
4309      case VISIONPRESCRIPTION:
4310        return "An authorization for the supply of glasses and/or contact lenses to a patient.";
4311      case NULL:
4312        return null;
4313      default:
4314        return "?";
4315      }
4316    }
4317
4318    public String getDisplay() {
4319      switch (this) {
4320      case ADDRESS:
4321        return "Address";
4322      case AGE:
4323        return "Age";
4324      case ANNOTATION:
4325        return "Annotation";
4326      case ATTACHMENT:
4327        return "Attachment";
4328      case BACKBONEELEMENT:
4329        return "BackboneElement";
4330      case CODEABLECONCEPT:
4331        return "CodeableConcept";
4332      case CODING:
4333        return "Coding";
4334      case CONTACTPOINT:
4335        return "ContactPoint";
4336      case COUNT:
4337        return "Count";
4338      case DISTANCE:
4339        return "Distance";
4340      case DURATION:
4341        return "Duration";
4342      case ELEMENT:
4343        return "Element";
4344      case ELEMENTDEFINITION:
4345        return "ElementDefinition";
4346      case EXTENSION:
4347        return "Extension";
4348      case HUMANNAME:
4349        return "HumanName";
4350      case IDENTIFIER:
4351        return "Identifier";
4352      case META:
4353        return "Meta";
4354      case MONEY:
4355        return "Money";
4356      case NARRATIVE:
4357        return "Narrative";
4358      case PERIOD:
4359        return "Period";
4360      case QUANTITY:
4361        return "Quantity";
4362      case RANGE:
4363        return "Range";
4364      case RATIO:
4365        return "Ratio";
4366      case REFERENCE:
4367        return "Reference";
4368      case SAMPLEDDATA:
4369        return "SampledData";
4370      case SIGNATURE:
4371        return "Signature";
4372      case SIMPLEQUANTITY:
4373        return "SimpleQuantity";
4374      case TIMING:
4375        return "Timing";
4376      case BASE64BINARY:
4377        return "base64Binary";
4378      case BOOLEAN:
4379        return "boolean";
4380      case CODE:
4381        return "code";
4382      case DATE:
4383        return "date";
4384      case DATETIME:
4385        return "dateTime";
4386      case DECIMAL:
4387        return "decimal";
4388      case ID:
4389        return "id";
4390      case INSTANT:
4391        return "instant";
4392      case INTEGER:
4393        return "integer";
4394      case MARKDOWN:
4395        return "markdown";
4396      case OID:
4397        return "oid";
4398      case POSITIVEINT:
4399        return "positiveInt";
4400      case STRING:
4401        return "string";
4402      case TIME:
4403        return "time";
4404      case UNSIGNEDINT:
4405        return "unsignedInt";
4406      case URI:
4407        return "uri";
4408      case UUID:
4409        return "uuid";
4410      case XHTML:
4411        return "XHTML";
4412      case ACCOUNT:
4413        return "Account";
4414      case ALLERGYINTOLERANCE:
4415        return "AllergyIntolerance";
4416      case APPOINTMENT:
4417        return "Appointment";
4418      case APPOINTMENTRESPONSE:
4419        return "AppointmentResponse";
4420      case AUDITEVENT:
4421        return "AuditEvent";
4422      case BASIC:
4423        return "Basic";
4424      case BINARY:
4425        return "Binary";
4426      case BODYSITE:
4427        return "BodySite";
4428      case BUNDLE:
4429        return "Bundle";
4430      case CAREPLAN:
4431        return "CarePlan";
4432      case CLAIM:
4433        return "Claim";
4434      case CLAIMRESPONSE:
4435        return "ClaimResponse";
4436      case CLINICALIMPRESSION:
4437        return "ClinicalImpression";
4438      case COMMUNICATION:
4439        return "Communication";
4440      case COMMUNICATIONREQUEST:
4441        return "CommunicationRequest";
4442      case COMPOSITION:
4443        return "Composition";
4444      case CONCEPTMAP:
4445        return "ConceptMap";
4446      case CONDITION:
4447        return "Condition";
4448      case CONFORMANCE:
4449        return "Conformance";
4450      case CONTRACT:
4451        return "Contract";
4452      case COVERAGE:
4453        return "Coverage";
4454      case DATAELEMENT:
4455        return "DataElement";
4456      case DETECTEDISSUE:
4457        return "DetectedIssue";
4458      case DEVICE:
4459        return "Device";
4460      case DEVICECOMPONENT:
4461        return "DeviceComponent";
4462      case DEVICEMETRIC:
4463        return "DeviceMetric";
4464      case DEVICEUSEREQUEST:
4465        return "DeviceUseRequest";
4466      case DEVICEUSESTATEMENT:
4467        return "DeviceUseStatement";
4468      case DIAGNOSTICORDER:
4469        return "DiagnosticOrder";
4470      case DIAGNOSTICREPORT:
4471        return "DiagnosticReport";
4472      case DOCUMENTMANIFEST:
4473        return "DocumentManifest";
4474      case DOCUMENTREFERENCE:
4475        return "DocumentReference";
4476      case DOMAINRESOURCE:
4477        return "DomainResource";
4478      case ELIGIBILITYREQUEST:
4479        return "EligibilityRequest";
4480      case ELIGIBILITYRESPONSE:
4481        return "EligibilityResponse";
4482      case ENCOUNTER:
4483        return "Encounter";
4484      case ENROLLMENTREQUEST:
4485        return "EnrollmentRequest";
4486      case ENROLLMENTRESPONSE:
4487        return "EnrollmentResponse";
4488      case EPISODEOFCARE:
4489        return "EpisodeOfCare";
4490      case EXPLANATIONOFBENEFIT:
4491        return "ExplanationOfBenefit";
4492      case FAMILYMEMBERHISTORY:
4493        return "FamilyMemberHistory";
4494      case FLAG:
4495        return "Flag";
4496      case GOAL:
4497        return "Goal";
4498      case GROUP:
4499        return "Group";
4500      case HEALTHCARESERVICE:
4501        return "HealthcareService";
4502      case IMAGINGOBJECTSELECTION:
4503        return "ImagingObjectSelection";
4504      case IMAGINGSTUDY:
4505        return "ImagingStudy";
4506      case IMMUNIZATION:
4507        return "Immunization";
4508      case IMMUNIZATIONRECOMMENDATION:
4509        return "ImmunizationRecommendation";
4510      case IMPLEMENTATIONGUIDE:
4511        return "ImplementationGuide";
4512      case LIST:
4513        return "List";
4514      case LOCATION:
4515        return "Location";
4516      case MEDIA:
4517        return "Media";
4518      case MEDICATION:
4519        return "Medication";
4520      case MEDICATIONADMINISTRATION:
4521        return "MedicationAdministration";
4522      case MEDICATIONDISPENSE:
4523        return "MedicationDispense";
4524      case MEDICATIONORDER:
4525        return "MedicationOrder";
4526      case MEDICATIONSTATEMENT:
4527        return "MedicationStatement";
4528      case MESSAGEHEADER:
4529        return "MessageHeader";
4530      case NAMINGSYSTEM:
4531        return "NamingSystem";
4532      case NUTRITIONORDER:
4533        return "NutritionOrder";
4534      case OBSERVATION:
4535        return "Observation";
4536      case OPERATIONDEFINITION:
4537        return "OperationDefinition";
4538      case OPERATIONOUTCOME:
4539        return "OperationOutcome";
4540      case ORDER:
4541        return "Order";
4542      case ORDERRESPONSE:
4543        return "OrderResponse";
4544      case ORGANIZATION:
4545        return "Organization";
4546      case PARAMETERS:
4547        return "Parameters";
4548      case PATIENT:
4549        return "Patient";
4550      case PAYMENTNOTICE:
4551        return "PaymentNotice";
4552      case PAYMENTRECONCILIATION:
4553        return "PaymentReconciliation";
4554      case PERSON:
4555        return "Person";
4556      case PRACTITIONER:
4557        return "Practitioner";
4558      case PROCEDURE:
4559        return "Procedure";
4560      case PROCEDUREREQUEST:
4561        return "ProcedureRequest";
4562      case PROCESSREQUEST:
4563        return "ProcessRequest";
4564      case PROCESSRESPONSE:
4565        return "ProcessResponse";
4566      case PROVENANCE:
4567        return "Provenance";
4568      case QUESTIONNAIRE:
4569        return "Questionnaire";
4570      case QUESTIONNAIRERESPONSE:
4571        return "QuestionnaireResponse";
4572      case REFERRALREQUEST:
4573        return "ReferralRequest";
4574      case RELATEDPERSON:
4575        return "RelatedPerson";
4576      case RESOURCE:
4577        return "Resource";
4578      case RISKASSESSMENT:
4579        return "RiskAssessment";
4580      case SCHEDULE:
4581        return "Schedule";
4582      case SEARCHPARAMETER:
4583        return "SearchParameter";
4584      case SLOT:
4585        return "Slot";
4586      case SPECIMEN:
4587        return "Specimen";
4588      case STRUCTUREDEFINITION:
4589        return "StructureDefinition";
4590      case SUBSCRIPTION:
4591        return "Subscription";
4592      case SUBSTANCE:
4593        return "Substance";
4594      case SUPPLYDELIVERY:
4595        return "SupplyDelivery";
4596      case SUPPLYREQUEST:
4597        return "SupplyRequest";
4598      case TESTSCRIPT:
4599        return "TestScript";
4600      case VALUESET:
4601        return "ValueSet";
4602      case VISIONPRESCRIPTION:
4603        return "VisionPrescription";
4604      case NULL:
4605        return null;
4606      default:
4607        return "?";
4608      }
4609    }
4610  }
4611
4612  public static class FHIRDefinedTypeEnumFactory implements EnumFactory<FHIRDefinedType> {
4613    public FHIRDefinedType fromCode(String codeString) throws IllegalArgumentException {
4614      if (codeString == null || "".equals(codeString))
4615        if (codeString == null || "".equals(codeString))
4616          return null;
4617      if ("Address".equals(codeString))
4618        return FHIRDefinedType.ADDRESS;
4619      if ("Age".equals(codeString))
4620        return FHIRDefinedType.AGE;
4621      if ("Annotation".equals(codeString))
4622        return FHIRDefinedType.ANNOTATION;
4623      if ("Attachment".equals(codeString))
4624        return FHIRDefinedType.ATTACHMENT;
4625      if ("BackboneElement".equals(codeString))
4626        return FHIRDefinedType.BACKBONEELEMENT;
4627      if ("CodeableConcept".equals(codeString))
4628        return FHIRDefinedType.CODEABLECONCEPT;
4629      if ("Coding".equals(codeString))
4630        return FHIRDefinedType.CODING;
4631      if ("ContactPoint".equals(codeString))
4632        return FHIRDefinedType.CONTACTPOINT;
4633      if ("Count".equals(codeString))
4634        return FHIRDefinedType.COUNT;
4635      if ("Distance".equals(codeString))
4636        return FHIRDefinedType.DISTANCE;
4637      if ("Duration".equals(codeString))
4638        return FHIRDefinedType.DURATION;
4639      if ("Element".equals(codeString))
4640        return FHIRDefinedType.ELEMENT;
4641      if ("ElementDefinition".equals(codeString))
4642        return FHIRDefinedType.ELEMENTDEFINITION;
4643      if ("Extension".equals(codeString))
4644        return FHIRDefinedType.EXTENSION;
4645      if ("HumanName".equals(codeString))
4646        return FHIRDefinedType.HUMANNAME;
4647      if ("Identifier".equals(codeString))
4648        return FHIRDefinedType.IDENTIFIER;
4649      if ("Meta".equals(codeString))
4650        return FHIRDefinedType.META;
4651      if ("Money".equals(codeString))
4652        return FHIRDefinedType.MONEY;
4653      if ("Narrative".equals(codeString))
4654        return FHIRDefinedType.NARRATIVE;
4655      if ("Period".equals(codeString))
4656        return FHIRDefinedType.PERIOD;
4657      if ("Quantity".equals(codeString))
4658        return FHIRDefinedType.QUANTITY;
4659      if ("Range".equals(codeString))
4660        return FHIRDefinedType.RANGE;
4661      if ("Ratio".equals(codeString))
4662        return FHIRDefinedType.RATIO;
4663      if ("Reference".equals(codeString))
4664        return FHIRDefinedType.REFERENCE;
4665      if ("SampledData".equals(codeString))
4666        return FHIRDefinedType.SAMPLEDDATA;
4667      if ("Signature".equals(codeString))
4668        return FHIRDefinedType.SIGNATURE;
4669      if ("SimpleQuantity".equals(codeString))
4670        return FHIRDefinedType.SIMPLEQUANTITY;
4671      if ("Timing".equals(codeString))
4672        return FHIRDefinedType.TIMING;
4673      if ("base64Binary".equals(codeString))
4674        return FHIRDefinedType.BASE64BINARY;
4675      if ("boolean".equals(codeString))
4676        return FHIRDefinedType.BOOLEAN;
4677      if ("code".equals(codeString))
4678        return FHIRDefinedType.CODE;
4679      if ("date".equals(codeString))
4680        return FHIRDefinedType.DATE;
4681      if ("dateTime".equals(codeString))
4682        return FHIRDefinedType.DATETIME;
4683      if ("decimal".equals(codeString))
4684        return FHIRDefinedType.DECIMAL;
4685      if ("id".equals(codeString))
4686        return FHIRDefinedType.ID;
4687      if ("instant".equals(codeString))
4688        return FHIRDefinedType.INSTANT;
4689      if ("integer".equals(codeString))
4690        return FHIRDefinedType.INTEGER;
4691      if ("markdown".equals(codeString))
4692        return FHIRDefinedType.MARKDOWN;
4693      if ("oid".equals(codeString))
4694        return FHIRDefinedType.OID;
4695      if ("positiveInt".equals(codeString))
4696        return FHIRDefinedType.POSITIVEINT;
4697      if ("string".equals(codeString))
4698        return FHIRDefinedType.STRING;
4699      if ("time".equals(codeString))
4700        return FHIRDefinedType.TIME;
4701      if ("unsignedInt".equals(codeString))
4702        return FHIRDefinedType.UNSIGNEDINT;
4703      if ("uri".equals(codeString))
4704        return FHIRDefinedType.URI;
4705      if ("uuid".equals(codeString))
4706        return FHIRDefinedType.UUID;
4707      if ("xhtml".equals(codeString))
4708        return FHIRDefinedType.XHTML;
4709      if ("Account".equals(codeString))
4710        return FHIRDefinedType.ACCOUNT;
4711      if ("AllergyIntolerance".equals(codeString))
4712        return FHIRDefinedType.ALLERGYINTOLERANCE;
4713      if ("Appointment".equals(codeString))
4714        return FHIRDefinedType.APPOINTMENT;
4715      if ("AppointmentResponse".equals(codeString))
4716        return FHIRDefinedType.APPOINTMENTRESPONSE;
4717      if ("AuditEvent".equals(codeString))
4718        return FHIRDefinedType.AUDITEVENT;
4719      if ("Basic".equals(codeString))
4720        return FHIRDefinedType.BASIC;
4721      if ("Binary".equals(codeString))
4722        return FHIRDefinedType.BINARY;
4723      if ("BodySite".equals(codeString))
4724        return FHIRDefinedType.BODYSITE;
4725      if ("Bundle".equals(codeString))
4726        return FHIRDefinedType.BUNDLE;
4727      if ("CarePlan".equals(codeString))
4728        return FHIRDefinedType.CAREPLAN;
4729      if ("Claim".equals(codeString))
4730        return FHIRDefinedType.CLAIM;
4731      if ("ClaimResponse".equals(codeString))
4732        return FHIRDefinedType.CLAIMRESPONSE;
4733      if ("ClinicalImpression".equals(codeString))
4734        return FHIRDefinedType.CLINICALIMPRESSION;
4735      if ("Communication".equals(codeString))
4736        return FHIRDefinedType.COMMUNICATION;
4737      if ("CommunicationRequest".equals(codeString))
4738        return FHIRDefinedType.COMMUNICATIONREQUEST;
4739      if ("Composition".equals(codeString))
4740        return FHIRDefinedType.COMPOSITION;
4741      if ("ConceptMap".equals(codeString))
4742        return FHIRDefinedType.CONCEPTMAP;
4743      if ("Condition".equals(codeString))
4744        return FHIRDefinedType.CONDITION;
4745      if ("Conformance".equals(codeString))
4746        return FHIRDefinedType.CONFORMANCE;
4747      if ("Contract".equals(codeString))
4748        return FHIRDefinedType.CONTRACT;
4749      if ("Coverage".equals(codeString))
4750        return FHIRDefinedType.COVERAGE;
4751      if ("DataElement".equals(codeString))
4752        return FHIRDefinedType.DATAELEMENT;
4753      if ("DetectedIssue".equals(codeString))
4754        return FHIRDefinedType.DETECTEDISSUE;
4755      if ("Device".equals(codeString))
4756        return FHIRDefinedType.DEVICE;
4757      if ("DeviceComponent".equals(codeString))
4758        return FHIRDefinedType.DEVICECOMPONENT;
4759      if ("DeviceMetric".equals(codeString))
4760        return FHIRDefinedType.DEVICEMETRIC;
4761      if ("DeviceUseRequest".equals(codeString))
4762        return FHIRDefinedType.DEVICEUSEREQUEST;
4763      if ("DeviceUseStatement".equals(codeString))
4764        return FHIRDefinedType.DEVICEUSESTATEMENT;
4765      if ("DiagnosticOrder".equals(codeString))
4766        return FHIRDefinedType.DIAGNOSTICORDER;
4767      if ("DiagnosticReport".equals(codeString))
4768        return FHIRDefinedType.DIAGNOSTICREPORT;
4769      if ("DocumentManifest".equals(codeString))
4770        return FHIRDefinedType.DOCUMENTMANIFEST;
4771      if ("DocumentReference".equals(codeString))
4772        return FHIRDefinedType.DOCUMENTREFERENCE;
4773      if ("DomainResource".equals(codeString))
4774        return FHIRDefinedType.DOMAINRESOURCE;
4775      if ("EligibilityRequest".equals(codeString))
4776        return FHIRDefinedType.ELIGIBILITYREQUEST;
4777      if ("EligibilityResponse".equals(codeString))
4778        return FHIRDefinedType.ELIGIBILITYRESPONSE;
4779      if ("Encounter".equals(codeString))
4780        return FHIRDefinedType.ENCOUNTER;
4781      if ("EnrollmentRequest".equals(codeString))
4782        return FHIRDefinedType.ENROLLMENTREQUEST;
4783      if ("EnrollmentResponse".equals(codeString))
4784        return FHIRDefinedType.ENROLLMENTRESPONSE;
4785      if ("EpisodeOfCare".equals(codeString))
4786        return FHIRDefinedType.EPISODEOFCARE;
4787      if ("ExplanationOfBenefit".equals(codeString))
4788        return FHIRDefinedType.EXPLANATIONOFBENEFIT;
4789      if ("FamilyMemberHistory".equals(codeString))
4790        return FHIRDefinedType.FAMILYMEMBERHISTORY;
4791      if ("Flag".equals(codeString))
4792        return FHIRDefinedType.FLAG;
4793      if ("Goal".equals(codeString))
4794        return FHIRDefinedType.GOAL;
4795      if ("Group".equals(codeString))
4796        return FHIRDefinedType.GROUP;
4797      if ("HealthcareService".equals(codeString))
4798        return FHIRDefinedType.HEALTHCARESERVICE;
4799      if ("ImagingObjectSelection".equals(codeString))
4800        return FHIRDefinedType.IMAGINGOBJECTSELECTION;
4801      if ("ImagingStudy".equals(codeString))
4802        return FHIRDefinedType.IMAGINGSTUDY;
4803      if ("Immunization".equals(codeString))
4804        return FHIRDefinedType.IMMUNIZATION;
4805      if ("ImmunizationRecommendation".equals(codeString))
4806        return FHIRDefinedType.IMMUNIZATIONRECOMMENDATION;
4807      if ("ImplementationGuide".equals(codeString))
4808        return FHIRDefinedType.IMPLEMENTATIONGUIDE;
4809      if ("List".equals(codeString))
4810        return FHIRDefinedType.LIST;
4811      if ("Location".equals(codeString))
4812        return FHIRDefinedType.LOCATION;
4813      if ("Media".equals(codeString))
4814        return FHIRDefinedType.MEDIA;
4815      if ("Medication".equals(codeString))
4816        return FHIRDefinedType.MEDICATION;
4817      if ("MedicationAdministration".equals(codeString))
4818        return FHIRDefinedType.MEDICATIONADMINISTRATION;
4819      if ("MedicationDispense".equals(codeString))
4820        return FHIRDefinedType.MEDICATIONDISPENSE;
4821      if ("MedicationOrder".equals(codeString))
4822        return FHIRDefinedType.MEDICATIONORDER;
4823      if ("MedicationStatement".equals(codeString))
4824        return FHIRDefinedType.MEDICATIONSTATEMENT;
4825      if ("MessageHeader".equals(codeString))
4826        return FHIRDefinedType.MESSAGEHEADER;
4827      if ("NamingSystem".equals(codeString))
4828        return FHIRDefinedType.NAMINGSYSTEM;
4829      if ("NutritionOrder".equals(codeString))
4830        return FHIRDefinedType.NUTRITIONORDER;
4831      if ("Observation".equals(codeString))
4832        return FHIRDefinedType.OBSERVATION;
4833      if ("OperationDefinition".equals(codeString))
4834        return FHIRDefinedType.OPERATIONDEFINITION;
4835      if ("OperationOutcome".equals(codeString))
4836        return FHIRDefinedType.OPERATIONOUTCOME;
4837      if ("Order".equals(codeString))
4838        return FHIRDefinedType.ORDER;
4839      if ("OrderResponse".equals(codeString))
4840        return FHIRDefinedType.ORDERRESPONSE;
4841      if ("Organization".equals(codeString))
4842        return FHIRDefinedType.ORGANIZATION;
4843      if ("Parameters".equals(codeString))
4844        return FHIRDefinedType.PARAMETERS;
4845      if ("Patient".equals(codeString))
4846        return FHIRDefinedType.PATIENT;
4847      if ("PaymentNotice".equals(codeString))
4848        return FHIRDefinedType.PAYMENTNOTICE;
4849      if ("PaymentReconciliation".equals(codeString))
4850        return FHIRDefinedType.PAYMENTRECONCILIATION;
4851      if ("Person".equals(codeString))
4852        return FHIRDefinedType.PERSON;
4853      if ("Practitioner".equals(codeString))
4854        return FHIRDefinedType.PRACTITIONER;
4855      if ("Procedure".equals(codeString))
4856        return FHIRDefinedType.PROCEDURE;
4857      if ("ProcedureRequest".equals(codeString))
4858        return FHIRDefinedType.PROCEDUREREQUEST;
4859      if ("ProcessRequest".equals(codeString))
4860        return FHIRDefinedType.PROCESSREQUEST;
4861      if ("ProcessResponse".equals(codeString))
4862        return FHIRDefinedType.PROCESSRESPONSE;
4863      if ("Provenance".equals(codeString))
4864        return FHIRDefinedType.PROVENANCE;
4865      if ("Questionnaire".equals(codeString))
4866        return FHIRDefinedType.QUESTIONNAIRE;
4867      if ("QuestionnaireResponse".equals(codeString))
4868        return FHIRDefinedType.QUESTIONNAIRERESPONSE;
4869      if ("ReferralRequest".equals(codeString))
4870        return FHIRDefinedType.REFERRALREQUEST;
4871      if ("RelatedPerson".equals(codeString))
4872        return FHIRDefinedType.RELATEDPERSON;
4873      if ("Resource".equals(codeString))
4874        return FHIRDefinedType.RESOURCE;
4875      if ("RiskAssessment".equals(codeString))
4876        return FHIRDefinedType.RISKASSESSMENT;
4877      if ("Schedule".equals(codeString))
4878        return FHIRDefinedType.SCHEDULE;
4879      if ("SearchParameter".equals(codeString))
4880        return FHIRDefinedType.SEARCHPARAMETER;
4881      if ("Slot".equals(codeString))
4882        return FHIRDefinedType.SLOT;
4883      if ("Specimen".equals(codeString))
4884        return FHIRDefinedType.SPECIMEN;
4885      if ("StructureDefinition".equals(codeString))
4886        return FHIRDefinedType.STRUCTUREDEFINITION;
4887      if ("Subscription".equals(codeString))
4888        return FHIRDefinedType.SUBSCRIPTION;
4889      if ("Substance".equals(codeString))
4890        return FHIRDefinedType.SUBSTANCE;
4891      if ("SupplyDelivery".equals(codeString))
4892        return FHIRDefinedType.SUPPLYDELIVERY;
4893      if ("SupplyRequest".equals(codeString))
4894        return FHIRDefinedType.SUPPLYREQUEST;
4895      if ("TestScript".equals(codeString))
4896        return FHIRDefinedType.TESTSCRIPT;
4897      if ("ValueSet".equals(codeString))
4898        return FHIRDefinedType.VALUESET;
4899      if ("VisionPrescription".equals(codeString))
4900        return FHIRDefinedType.VISIONPRESCRIPTION;
4901      throw new IllegalArgumentException("Unknown FHIRDefinedType code '" + codeString + "'");
4902    }
4903
4904    public Enumeration<FHIRDefinedType> fromType(Base code) throws FHIRException {
4905      if (code == null || code.isEmpty())
4906        return null;
4907      String codeString = ((PrimitiveType) code).asStringValue();
4908      if (codeString == null || "".equals(codeString))
4909        return null;
4910      if ("Address".equals(codeString))
4911        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.ADDRESS);
4912      if ("Age".equals(codeString))
4913        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.AGE);
4914      if ("Annotation".equals(codeString))
4915        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.ANNOTATION);
4916      if ("Attachment".equals(codeString))
4917        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.ATTACHMENT);
4918      if ("BackboneElement".equals(codeString))
4919        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.BACKBONEELEMENT);
4920      if ("CodeableConcept".equals(codeString))
4921        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.CODEABLECONCEPT);
4922      if ("Coding".equals(codeString))
4923        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.CODING);
4924      if ("ContactPoint".equals(codeString))
4925        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.CONTACTPOINT);
4926      if ("Count".equals(codeString))
4927        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.COUNT);
4928      if ("Distance".equals(codeString))
4929        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.DISTANCE);
4930      if ("Duration".equals(codeString))
4931        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.DURATION);
4932      if ("Element".equals(codeString))
4933        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.ELEMENT);
4934      if ("ElementDefinition".equals(codeString))
4935        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.ELEMENTDEFINITION);
4936      if ("Extension".equals(codeString))
4937        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.EXTENSION);
4938      if ("HumanName".equals(codeString))
4939        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.HUMANNAME);
4940      if ("Identifier".equals(codeString))
4941        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.IDENTIFIER);
4942      if ("Meta".equals(codeString))
4943        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.META);
4944      if ("Money".equals(codeString))
4945        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.MONEY);
4946      if ("Narrative".equals(codeString))
4947        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.NARRATIVE);
4948      if ("Period".equals(codeString))
4949        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.PERIOD);
4950      if ("Quantity".equals(codeString))
4951        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.QUANTITY);
4952      if ("Range".equals(codeString))
4953        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.RANGE);
4954      if ("Ratio".equals(codeString))
4955        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.RATIO);
4956      if ("Reference".equals(codeString))
4957        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.REFERENCE);
4958      if ("SampledData".equals(codeString))
4959        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.SAMPLEDDATA);
4960      if ("Signature".equals(codeString))
4961        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.SIGNATURE);
4962      if ("SimpleQuantity".equals(codeString))
4963        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.SIMPLEQUANTITY);
4964      if ("Timing".equals(codeString))
4965        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.TIMING);
4966      if ("base64Binary".equals(codeString))
4967        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.BASE64BINARY);
4968      if ("boolean".equals(codeString))
4969        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.BOOLEAN);
4970      if ("code".equals(codeString))
4971        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.CODE);
4972      if ("date".equals(codeString))
4973        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.DATE);
4974      if ("dateTime".equals(codeString))
4975        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.DATETIME);
4976      if ("decimal".equals(codeString))
4977        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.DECIMAL);
4978      if ("id".equals(codeString))
4979        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.ID);
4980      if ("instant".equals(codeString))
4981        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.INSTANT);
4982      if ("integer".equals(codeString))
4983        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.INTEGER);
4984      if ("markdown".equals(codeString))
4985        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.MARKDOWN);
4986      if ("oid".equals(codeString))
4987        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.OID);
4988      if ("positiveInt".equals(codeString))
4989        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.POSITIVEINT);
4990      if ("string".equals(codeString))
4991        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.STRING);
4992      if ("time".equals(codeString))
4993        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.TIME);
4994      if ("unsignedInt".equals(codeString))
4995        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.UNSIGNEDINT);
4996      if ("uri".equals(codeString))
4997        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.URI);
4998      if ("uuid".equals(codeString))
4999        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.UUID);
5000      if ("xhtml".equals(codeString))
5001        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.XHTML);
5002      if ("Account".equals(codeString))
5003        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.ACCOUNT);
5004      if ("AllergyIntolerance".equals(codeString))
5005        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.ALLERGYINTOLERANCE);
5006      if ("Appointment".equals(codeString))
5007        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.APPOINTMENT);
5008      if ("AppointmentResponse".equals(codeString))
5009        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.APPOINTMENTRESPONSE);
5010      if ("AuditEvent".equals(codeString))
5011        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.AUDITEVENT);
5012      if ("Basic".equals(codeString))
5013        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.BASIC);
5014      if ("Binary".equals(codeString))
5015        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.BINARY);
5016      if ("BodySite".equals(codeString))
5017        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.BODYSITE);
5018      if ("Bundle".equals(codeString))
5019        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.BUNDLE);
5020      if ("CarePlan".equals(codeString))
5021        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.CAREPLAN);
5022      if ("Claim".equals(codeString))
5023        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.CLAIM);
5024      if ("ClaimResponse".equals(codeString))
5025        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.CLAIMRESPONSE);
5026      if ("ClinicalImpression".equals(codeString))
5027        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.CLINICALIMPRESSION);
5028      if ("Communication".equals(codeString))
5029        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.COMMUNICATION);
5030      if ("CommunicationRequest".equals(codeString))
5031        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.COMMUNICATIONREQUEST);
5032      if ("Composition".equals(codeString))
5033        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.COMPOSITION);
5034      if ("ConceptMap".equals(codeString))
5035        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.CONCEPTMAP);
5036      if ("Condition".equals(codeString))
5037        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.CONDITION);
5038      if ("Conformance".equals(codeString))
5039        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.CONFORMANCE);
5040      if ("Contract".equals(codeString))
5041        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.CONTRACT);
5042      if ("Coverage".equals(codeString))
5043        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.COVERAGE);
5044      if ("DataElement".equals(codeString))
5045        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.DATAELEMENT);
5046      if ("DetectedIssue".equals(codeString))
5047        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.DETECTEDISSUE);
5048      if ("Device".equals(codeString))
5049        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.DEVICE);
5050      if ("DeviceComponent".equals(codeString))
5051        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.DEVICECOMPONENT);
5052      if ("DeviceMetric".equals(codeString))
5053        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.DEVICEMETRIC);
5054      if ("DeviceUseRequest".equals(codeString))
5055        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.DEVICEUSEREQUEST);
5056      if ("DeviceUseStatement".equals(codeString))
5057        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.DEVICEUSESTATEMENT);
5058      if ("DiagnosticOrder".equals(codeString))
5059        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.DIAGNOSTICORDER);
5060      if ("DiagnosticReport".equals(codeString))
5061        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.DIAGNOSTICREPORT);
5062      if ("DocumentManifest".equals(codeString))
5063        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.DOCUMENTMANIFEST);
5064      if ("DocumentReference".equals(codeString))
5065        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.DOCUMENTREFERENCE);
5066      if ("DomainResource".equals(codeString))
5067        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.DOMAINRESOURCE);
5068      if ("EligibilityRequest".equals(codeString))
5069        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.ELIGIBILITYREQUEST);
5070      if ("EligibilityResponse".equals(codeString))
5071        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.ELIGIBILITYRESPONSE);
5072      if ("Encounter".equals(codeString))
5073        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.ENCOUNTER);
5074      if ("EnrollmentRequest".equals(codeString))
5075        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.ENROLLMENTREQUEST);
5076      if ("EnrollmentResponse".equals(codeString))
5077        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.ENROLLMENTRESPONSE);
5078      if ("EpisodeOfCare".equals(codeString))
5079        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.EPISODEOFCARE);
5080      if ("ExplanationOfBenefit".equals(codeString))
5081        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.EXPLANATIONOFBENEFIT);
5082      if ("FamilyMemberHistory".equals(codeString))
5083        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.FAMILYMEMBERHISTORY);
5084      if ("Flag".equals(codeString))
5085        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.FLAG);
5086      if ("Goal".equals(codeString))
5087        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.GOAL);
5088      if ("Group".equals(codeString))
5089        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.GROUP);
5090      if ("HealthcareService".equals(codeString))
5091        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.HEALTHCARESERVICE);
5092      if ("ImagingObjectSelection".equals(codeString))
5093        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.IMAGINGOBJECTSELECTION);
5094      if ("ImagingStudy".equals(codeString))
5095        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.IMAGINGSTUDY);
5096      if ("Immunization".equals(codeString))
5097        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.IMMUNIZATION);
5098      if ("ImmunizationRecommendation".equals(codeString))
5099        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.IMMUNIZATIONRECOMMENDATION);
5100      if ("ImplementationGuide".equals(codeString))
5101        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.IMPLEMENTATIONGUIDE);
5102      if ("List".equals(codeString))
5103        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.LIST);
5104      if ("Location".equals(codeString))
5105        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.LOCATION);
5106      if ("Media".equals(codeString))
5107        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.MEDIA);
5108      if ("Medication".equals(codeString))
5109        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.MEDICATION);
5110      if ("MedicationAdministration".equals(codeString))
5111        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.MEDICATIONADMINISTRATION);
5112      if ("MedicationDispense".equals(codeString))
5113        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.MEDICATIONDISPENSE);
5114      if ("MedicationOrder".equals(codeString))
5115        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.MEDICATIONORDER);
5116      if ("MedicationStatement".equals(codeString))
5117        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.MEDICATIONSTATEMENT);
5118      if ("MessageHeader".equals(codeString))
5119        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.MESSAGEHEADER);
5120      if ("NamingSystem".equals(codeString))
5121        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.NAMINGSYSTEM);
5122      if ("NutritionOrder".equals(codeString))
5123        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.NUTRITIONORDER);
5124      if ("Observation".equals(codeString))
5125        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.OBSERVATION);
5126      if ("OperationDefinition".equals(codeString))
5127        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.OPERATIONDEFINITION);
5128      if ("OperationOutcome".equals(codeString))
5129        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.OPERATIONOUTCOME);
5130      if ("Order".equals(codeString))
5131        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.ORDER);
5132      if ("OrderResponse".equals(codeString))
5133        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.ORDERRESPONSE);
5134      if ("Organization".equals(codeString))
5135        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.ORGANIZATION);
5136      if ("Parameters".equals(codeString))
5137        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.PARAMETERS);
5138      if ("Patient".equals(codeString))
5139        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.PATIENT);
5140      if ("PaymentNotice".equals(codeString))
5141        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.PAYMENTNOTICE);
5142      if ("PaymentReconciliation".equals(codeString))
5143        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.PAYMENTRECONCILIATION);
5144      if ("Person".equals(codeString))
5145        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.PERSON);
5146      if ("Practitioner".equals(codeString))
5147        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.PRACTITIONER);
5148      if ("Procedure".equals(codeString))
5149        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.PROCEDURE);
5150      if ("ProcedureRequest".equals(codeString))
5151        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.PROCEDUREREQUEST);
5152      if ("ProcessRequest".equals(codeString))
5153        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.PROCESSREQUEST);
5154      if ("ProcessResponse".equals(codeString))
5155        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.PROCESSRESPONSE);
5156      if ("Provenance".equals(codeString))
5157        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.PROVENANCE);
5158      if ("Questionnaire".equals(codeString))
5159        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.QUESTIONNAIRE);
5160      if ("QuestionnaireResponse".equals(codeString))
5161        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.QUESTIONNAIRERESPONSE);
5162      if ("ReferralRequest".equals(codeString))
5163        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.REFERRALREQUEST);
5164      if ("RelatedPerson".equals(codeString))
5165        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.RELATEDPERSON);
5166      if ("Resource".equals(codeString))
5167        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.RESOURCE);
5168      if ("RiskAssessment".equals(codeString))
5169        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.RISKASSESSMENT);
5170      if ("Schedule".equals(codeString))
5171        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.SCHEDULE);
5172      if ("SearchParameter".equals(codeString))
5173        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.SEARCHPARAMETER);
5174      if ("Slot".equals(codeString))
5175        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.SLOT);
5176      if ("Specimen".equals(codeString))
5177        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.SPECIMEN);
5178      if ("StructureDefinition".equals(codeString))
5179        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.STRUCTUREDEFINITION);
5180      if ("Subscription".equals(codeString))
5181        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.SUBSCRIPTION);
5182      if ("Substance".equals(codeString))
5183        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.SUBSTANCE);
5184      if ("SupplyDelivery".equals(codeString))
5185        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.SUPPLYDELIVERY);
5186      if ("SupplyRequest".equals(codeString))
5187        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.SUPPLYREQUEST);
5188      if ("TestScript".equals(codeString))
5189        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.TESTSCRIPT);
5190      if ("ValueSet".equals(codeString))
5191        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.VALUESET);
5192      if ("VisionPrescription".equals(codeString))
5193        return new Enumeration<FHIRDefinedType>(this, FHIRDefinedType.VISIONPRESCRIPTION);
5194      throw new FHIRException("Unknown FHIRDefinedType code '" + codeString + "'");
5195    }
5196
5197    public String toCode(FHIRDefinedType code) {
5198      if (code == FHIRDefinedType.ADDRESS)
5199        return "Address";
5200      if (code == FHIRDefinedType.AGE)
5201        return "Age";
5202      if (code == FHIRDefinedType.ANNOTATION)
5203        return "Annotation";
5204      if (code == FHIRDefinedType.ATTACHMENT)
5205        return "Attachment";
5206      if (code == FHIRDefinedType.BACKBONEELEMENT)
5207        return "BackboneElement";
5208      if (code == FHIRDefinedType.CODEABLECONCEPT)
5209        return "CodeableConcept";
5210      if (code == FHIRDefinedType.CODING)
5211        return "Coding";
5212      if (code == FHIRDefinedType.CONTACTPOINT)
5213        return "ContactPoint";
5214      if (code == FHIRDefinedType.COUNT)
5215        return "Count";
5216      if (code == FHIRDefinedType.DISTANCE)
5217        return "Distance";
5218      if (code == FHIRDefinedType.DURATION)
5219        return "Duration";
5220      if (code == FHIRDefinedType.ELEMENT)
5221        return "Element";
5222      if (code == FHIRDefinedType.ELEMENTDEFINITION)
5223        return "ElementDefinition";
5224      if (code == FHIRDefinedType.EXTENSION)
5225        return "Extension";
5226      if (code == FHIRDefinedType.HUMANNAME)
5227        return "HumanName";
5228      if (code == FHIRDefinedType.IDENTIFIER)
5229        return "Identifier";
5230      if (code == FHIRDefinedType.META)
5231        return "Meta";
5232      if (code == FHIRDefinedType.MONEY)
5233        return "Money";
5234      if (code == FHIRDefinedType.NARRATIVE)
5235        return "Narrative";
5236      if (code == FHIRDefinedType.PERIOD)
5237        return "Period";
5238      if (code == FHIRDefinedType.QUANTITY)
5239        return "Quantity";
5240      if (code == FHIRDefinedType.RANGE)
5241        return "Range";
5242      if (code == FHIRDefinedType.RATIO)
5243        return "Ratio";
5244      if (code == FHIRDefinedType.REFERENCE)
5245        return "Reference";
5246      if (code == FHIRDefinedType.SAMPLEDDATA)
5247        return "SampledData";
5248      if (code == FHIRDefinedType.SIGNATURE)
5249        return "Signature";
5250      if (code == FHIRDefinedType.SIMPLEQUANTITY)
5251        return "SimpleQuantity";
5252      if (code == FHIRDefinedType.TIMING)
5253        return "Timing";
5254      if (code == FHIRDefinedType.BASE64BINARY)
5255        return "base64Binary";
5256      if (code == FHIRDefinedType.BOOLEAN)
5257        return "boolean";
5258      if (code == FHIRDefinedType.CODE)
5259        return "code";
5260      if (code == FHIRDefinedType.DATE)
5261        return "date";
5262      if (code == FHIRDefinedType.DATETIME)
5263        return "dateTime";
5264      if (code == FHIRDefinedType.DECIMAL)
5265        return "decimal";
5266      if (code == FHIRDefinedType.ID)
5267        return "id";
5268      if (code == FHIRDefinedType.INSTANT)
5269        return "instant";
5270      if (code == FHIRDefinedType.INTEGER)
5271        return "integer";
5272      if (code == FHIRDefinedType.MARKDOWN)
5273        return "markdown";
5274      if (code == FHIRDefinedType.OID)
5275        return "oid";
5276      if (code == FHIRDefinedType.POSITIVEINT)
5277        return "positiveInt";
5278      if (code == FHIRDefinedType.STRING)
5279        return "string";
5280      if (code == FHIRDefinedType.TIME)
5281        return "time";
5282      if (code == FHIRDefinedType.UNSIGNEDINT)
5283        return "unsignedInt";
5284      if (code == FHIRDefinedType.URI)
5285        return "uri";
5286      if (code == FHIRDefinedType.UUID)
5287        return "uuid";
5288      if (code == FHIRDefinedType.XHTML)
5289        return "xhtml";
5290      if (code == FHIRDefinedType.ACCOUNT)
5291        return "Account";
5292      if (code == FHIRDefinedType.ALLERGYINTOLERANCE)
5293        return "AllergyIntolerance";
5294      if (code == FHIRDefinedType.APPOINTMENT)
5295        return "Appointment";
5296      if (code == FHIRDefinedType.APPOINTMENTRESPONSE)
5297        return "AppointmentResponse";
5298      if (code == FHIRDefinedType.AUDITEVENT)
5299        return "AuditEvent";
5300      if (code == FHIRDefinedType.BASIC)
5301        return "Basic";
5302      if (code == FHIRDefinedType.BINARY)
5303        return "Binary";
5304      if (code == FHIRDefinedType.BODYSITE)
5305        return "BodySite";
5306      if (code == FHIRDefinedType.BUNDLE)
5307        return "Bundle";
5308      if (code == FHIRDefinedType.CAREPLAN)
5309        return "CarePlan";
5310      if (code == FHIRDefinedType.CLAIM)
5311        return "Claim";
5312      if (code == FHIRDefinedType.CLAIMRESPONSE)
5313        return "ClaimResponse";
5314      if (code == FHIRDefinedType.CLINICALIMPRESSION)
5315        return "ClinicalImpression";
5316      if (code == FHIRDefinedType.COMMUNICATION)
5317        return "Communication";
5318      if (code == FHIRDefinedType.COMMUNICATIONREQUEST)
5319        return "CommunicationRequest";
5320      if (code == FHIRDefinedType.COMPOSITION)
5321        return "Composition";
5322      if (code == FHIRDefinedType.CONCEPTMAP)
5323        return "ConceptMap";
5324      if (code == FHIRDefinedType.CONDITION)
5325        return "Condition";
5326      if (code == FHIRDefinedType.CONFORMANCE)
5327        return "Conformance";
5328      if (code == FHIRDefinedType.CONTRACT)
5329        return "Contract";
5330      if (code == FHIRDefinedType.COVERAGE)
5331        return "Coverage";
5332      if (code == FHIRDefinedType.DATAELEMENT)
5333        return "DataElement";
5334      if (code == FHIRDefinedType.DETECTEDISSUE)
5335        return "DetectedIssue";
5336      if (code == FHIRDefinedType.DEVICE)
5337        return "Device";
5338      if (code == FHIRDefinedType.DEVICECOMPONENT)
5339        return "DeviceComponent";
5340      if (code == FHIRDefinedType.DEVICEMETRIC)
5341        return "DeviceMetric";
5342      if (code == FHIRDefinedType.DEVICEUSEREQUEST)
5343        return "DeviceUseRequest";
5344      if (code == FHIRDefinedType.DEVICEUSESTATEMENT)
5345        return "DeviceUseStatement";
5346      if (code == FHIRDefinedType.DIAGNOSTICORDER)
5347        return "DiagnosticOrder";
5348      if (code == FHIRDefinedType.DIAGNOSTICREPORT)
5349        return "DiagnosticReport";
5350      if (code == FHIRDefinedType.DOCUMENTMANIFEST)
5351        return "DocumentManifest";
5352      if (code == FHIRDefinedType.DOCUMENTREFERENCE)
5353        return "DocumentReference";
5354      if (code == FHIRDefinedType.DOMAINRESOURCE)
5355        return "DomainResource";
5356      if (code == FHIRDefinedType.ELIGIBILITYREQUEST)
5357        return "EligibilityRequest";
5358      if (code == FHIRDefinedType.ELIGIBILITYRESPONSE)
5359        return "EligibilityResponse";
5360      if (code == FHIRDefinedType.ENCOUNTER)
5361        return "Encounter";
5362      if (code == FHIRDefinedType.ENROLLMENTREQUEST)
5363        return "EnrollmentRequest";
5364      if (code == FHIRDefinedType.ENROLLMENTRESPONSE)
5365        return "EnrollmentResponse";
5366      if (code == FHIRDefinedType.EPISODEOFCARE)
5367        return "EpisodeOfCare";
5368      if (code == FHIRDefinedType.EXPLANATIONOFBENEFIT)
5369        return "ExplanationOfBenefit";
5370      if (code == FHIRDefinedType.FAMILYMEMBERHISTORY)
5371        return "FamilyMemberHistory";
5372      if (code == FHIRDefinedType.FLAG)
5373        return "Flag";
5374      if (code == FHIRDefinedType.GOAL)
5375        return "Goal";
5376      if (code == FHIRDefinedType.GROUP)
5377        return "Group";
5378      if (code == FHIRDefinedType.HEALTHCARESERVICE)
5379        return "HealthcareService";
5380      if (code == FHIRDefinedType.IMAGINGOBJECTSELECTION)
5381        return "ImagingObjectSelection";
5382      if (code == FHIRDefinedType.IMAGINGSTUDY)
5383        return "ImagingStudy";
5384      if (code == FHIRDefinedType.IMMUNIZATION)
5385        return "Immunization";
5386      if (code == FHIRDefinedType.IMMUNIZATIONRECOMMENDATION)
5387        return "ImmunizationRecommendation";
5388      if (code == FHIRDefinedType.IMPLEMENTATIONGUIDE)
5389        return "ImplementationGuide";
5390      if (code == FHIRDefinedType.LIST)
5391        return "List";
5392      if (code == FHIRDefinedType.LOCATION)
5393        return "Location";
5394      if (code == FHIRDefinedType.MEDIA)
5395        return "Media";
5396      if (code == FHIRDefinedType.MEDICATION)
5397        return "Medication";
5398      if (code == FHIRDefinedType.MEDICATIONADMINISTRATION)
5399        return "MedicationAdministration";
5400      if (code == FHIRDefinedType.MEDICATIONDISPENSE)
5401        return "MedicationDispense";
5402      if (code == FHIRDefinedType.MEDICATIONORDER)
5403        return "MedicationOrder";
5404      if (code == FHIRDefinedType.MEDICATIONSTATEMENT)
5405        return "MedicationStatement";
5406      if (code == FHIRDefinedType.MESSAGEHEADER)
5407        return "MessageHeader";
5408      if (code == FHIRDefinedType.NAMINGSYSTEM)
5409        return "NamingSystem";
5410      if (code == FHIRDefinedType.NUTRITIONORDER)
5411        return "NutritionOrder";
5412      if (code == FHIRDefinedType.OBSERVATION)
5413        return "Observation";
5414      if (code == FHIRDefinedType.OPERATIONDEFINITION)
5415        return "OperationDefinition";
5416      if (code == FHIRDefinedType.OPERATIONOUTCOME)
5417        return "OperationOutcome";
5418      if (code == FHIRDefinedType.ORDER)
5419        return "Order";
5420      if (code == FHIRDefinedType.ORDERRESPONSE)
5421        return "OrderResponse";
5422      if (code == FHIRDefinedType.ORGANIZATION)
5423        return "Organization";
5424      if (code == FHIRDefinedType.PARAMETERS)
5425        return "Parameters";
5426      if (code == FHIRDefinedType.PATIENT)
5427        return "Patient";
5428      if (code == FHIRDefinedType.PAYMENTNOTICE)
5429        return "PaymentNotice";
5430      if (code == FHIRDefinedType.PAYMENTRECONCILIATION)
5431        return "PaymentReconciliation";
5432      if (code == FHIRDefinedType.PERSON)
5433        return "Person";
5434      if (code == FHIRDefinedType.PRACTITIONER)
5435        return "Practitioner";
5436      if (code == FHIRDefinedType.PROCEDURE)
5437        return "Procedure";
5438      if (code == FHIRDefinedType.PROCEDUREREQUEST)
5439        return "ProcedureRequest";
5440      if (code == FHIRDefinedType.PROCESSREQUEST)
5441        return "ProcessRequest";
5442      if (code == FHIRDefinedType.PROCESSRESPONSE)
5443        return "ProcessResponse";
5444      if (code == FHIRDefinedType.PROVENANCE)
5445        return "Provenance";
5446      if (code == FHIRDefinedType.QUESTIONNAIRE)
5447        return "Questionnaire";
5448      if (code == FHIRDefinedType.QUESTIONNAIRERESPONSE)
5449        return "QuestionnaireResponse";
5450      if (code == FHIRDefinedType.REFERRALREQUEST)
5451        return "ReferralRequest";
5452      if (code == FHIRDefinedType.RELATEDPERSON)
5453        return "RelatedPerson";
5454      if (code == FHIRDefinedType.RESOURCE)
5455        return "Resource";
5456      if (code == FHIRDefinedType.RISKASSESSMENT)
5457        return "RiskAssessment";
5458      if (code == FHIRDefinedType.SCHEDULE)
5459        return "Schedule";
5460      if (code == FHIRDefinedType.SEARCHPARAMETER)
5461        return "SearchParameter";
5462      if (code == FHIRDefinedType.SLOT)
5463        return "Slot";
5464      if (code == FHIRDefinedType.SPECIMEN)
5465        return "Specimen";
5466      if (code == FHIRDefinedType.STRUCTUREDEFINITION)
5467        return "StructureDefinition";
5468      if (code == FHIRDefinedType.SUBSCRIPTION)
5469        return "Subscription";
5470      if (code == FHIRDefinedType.SUBSTANCE)
5471        return "Substance";
5472      if (code == FHIRDefinedType.SUPPLYDELIVERY)
5473        return "SupplyDelivery";
5474      if (code == FHIRDefinedType.SUPPLYREQUEST)
5475        return "SupplyRequest";
5476      if (code == FHIRDefinedType.TESTSCRIPT)
5477        return "TestScript";
5478      if (code == FHIRDefinedType.VALUESET)
5479        return "ValueSet";
5480      if (code == FHIRDefinedType.VISIONPRESCRIPTION)
5481        return "VisionPrescription";
5482      return "?";
5483    }
5484  }
5485
5486  public enum MessageEvent {
5487    /**
5488     * Change the status of a Medication Administration to show that it is complete.
5489     */
5490    MEDICATIONADMINISTRATIONCOMPLETE,
5491    /**
5492     * Someone wishes to record that the record of administration of a medication is
5493     * in error and should be ignored.
5494     */
5495    MEDICATIONADMINISTRATIONNULLIFICATION,
5496    /**
5497     * Indicates that a medication has been recorded against the patient's record.
5498     */
5499    MEDICATIONADMINISTRATIONRECORDING,
5500    /**
5501     * Update a Medication Administration record.
5502     */
5503    MEDICATIONADMINISTRATIONUPDATE,
5504    /**
5505     * Notification of a change to an administrative resource (either create or
5506     * update). Note that there is no delete, though some administrative resources
5507     * have status or period elements for this use.
5508     */
5509    ADMINNOTIFY,
5510    /**
5511     * Provide a diagnostic report, or update a previously provided diagnostic
5512     * report.
5513     */
5514    DIAGNOSTICREPORTPROVIDE,
5515    /**
5516     * Provide a simple observation or update a previously provided simple
5517     * observation.
5518     */
5519    OBSERVATIONPROVIDE,
5520    /**
5521     * Notification that two patient records actually identify the same patient.
5522     */
5523    PATIENTLINK,
5524    /**
5525     * Notification that previous advice that two patient records concern the same
5526     * patient is now considered incorrect.
5527     */
5528    PATIENTUNLINK,
5529    /**
5530     * The definition of a value set is used to create a simple collection of codes
5531     * suitable for use for data entry or validation. An expanded value set will be
5532     * returned, or an error message.
5533     */
5534    VALUESETEXPAND,
5535    /**
5536     * added to help the parsers
5537     */
5538    NULL;
5539
5540    public static MessageEvent fromCode(String codeString) throws FHIRException {
5541      if (codeString == null || "".equals(codeString))
5542        return null;
5543      if ("MedicationAdministration-Complete".equals(codeString))
5544        return MEDICATIONADMINISTRATIONCOMPLETE;
5545      if ("MedicationAdministration-Nullification".equals(codeString))
5546        return MEDICATIONADMINISTRATIONNULLIFICATION;
5547      if ("MedicationAdministration-Recording".equals(codeString))
5548        return MEDICATIONADMINISTRATIONRECORDING;
5549      if ("MedicationAdministration-Update".equals(codeString))
5550        return MEDICATIONADMINISTRATIONUPDATE;
5551      if ("admin-notify".equals(codeString))
5552        return ADMINNOTIFY;
5553      if ("diagnosticreport-provide".equals(codeString))
5554        return DIAGNOSTICREPORTPROVIDE;
5555      if ("observation-provide".equals(codeString))
5556        return OBSERVATIONPROVIDE;
5557      if ("patient-link".equals(codeString))
5558        return PATIENTLINK;
5559      if ("patient-unlink".equals(codeString))
5560        return PATIENTUNLINK;
5561      if ("valueset-expand".equals(codeString))
5562        return VALUESETEXPAND;
5563      throw new FHIRException("Unknown MessageEvent code '" + codeString + "'");
5564    }
5565
5566    public String toCode() {
5567      switch (this) {
5568      case MEDICATIONADMINISTRATIONCOMPLETE:
5569        return "MedicationAdministration-Complete";
5570      case MEDICATIONADMINISTRATIONNULLIFICATION:
5571        return "MedicationAdministration-Nullification";
5572      case MEDICATIONADMINISTRATIONRECORDING:
5573        return "MedicationAdministration-Recording";
5574      case MEDICATIONADMINISTRATIONUPDATE:
5575        return "MedicationAdministration-Update";
5576      case ADMINNOTIFY:
5577        return "admin-notify";
5578      case DIAGNOSTICREPORTPROVIDE:
5579        return "diagnosticreport-provide";
5580      case OBSERVATIONPROVIDE:
5581        return "observation-provide";
5582      case PATIENTLINK:
5583        return "patient-link";
5584      case PATIENTUNLINK:
5585        return "patient-unlink";
5586      case VALUESETEXPAND:
5587        return "valueset-expand";
5588      case NULL:
5589        return null;
5590      default:
5591        return "?";
5592      }
5593    }
5594
5595    public String getSystem() {
5596      switch (this) {
5597      case MEDICATIONADMINISTRATIONCOMPLETE:
5598        return "http://hl7.org/fhir/message-events";
5599      case MEDICATIONADMINISTRATIONNULLIFICATION:
5600        return "http://hl7.org/fhir/message-events";
5601      case MEDICATIONADMINISTRATIONRECORDING:
5602        return "http://hl7.org/fhir/message-events";
5603      case MEDICATIONADMINISTRATIONUPDATE:
5604        return "http://hl7.org/fhir/message-events";
5605      case ADMINNOTIFY:
5606        return "http://hl7.org/fhir/message-events";
5607      case DIAGNOSTICREPORTPROVIDE:
5608        return "http://hl7.org/fhir/message-events";
5609      case OBSERVATIONPROVIDE:
5610        return "http://hl7.org/fhir/message-events";
5611      case PATIENTLINK:
5612        return "http://hl7.org/fhir/message-events";
5613      case PATIENTUNLINK:
5614        return "http://hl7.org/fhir/message-events";
5615      case VALUESETEXPAND:
5616        return "http://hl7.org/fhir/message-events";
5617      case NULL:
5618        return null;
5619      default:
5620        return "?";
5621      }
5622    }
5623
5624    public String getDefinition() {
5625      switch (this) {
5626      case MEDICATIONADMINISTRATIONCOMPLETE:
5627        return "Change the status of a Medication Administration to show that it is complete.";
5628      case MEDICATIONADMINISTRATIONNULLIFICATION:
5629        return "Someone wishes to record that the record of administration of a medication is in error and should be ignored.";
5630      case MEDICATIONADMINISTRATIONRECORDING:
5631        return "Indicates that a medication has been recorded against the patient's record.";
5632      case MEDICATIONADMINISTRATIONUPDATE:
5633        return "Update a Medication Administration record.";
5634      case ADMINNOTIFY:
5635        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.";
5636      case DIAGNOSTICREPORTPROVIDE:
5637        return "Provide a diagnostic report, or update a previously provided diagnostic report.";
5638      case OBSERVATIONPROVIDE:
5639        return "Provide a simple observation or update a previously provided simple observation.";
5640      case PATIENTLINK:
5641        return "Notification that two patient records actually identify the same patient.";
5642      case PATIENTUNLINK:
5643        return "Notification that previous advice that two patient records concern the same patient is now considered incorrect.";
5644      case VALUESETEXPAND:
5645        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.";
5646      case NULL:
5647        return null;
5648      default:
5649        return "?";
5650      }
5651    }
5652
5653    public String getDisplay() {
5654      switch (this) {
5655      case MEDICATIONADMINISTRATIONCOMPLETE:
5656        return "MedicationAdministration-Complete";
5657      case MEDICATIONADMINISTRATIONNULLIFICATION:
5658        return "MedicationAdministration-Nullification";
5659      case MEDICATIONADMINISTRATIONRECORDING:
5660        return "MedicationAdministration-Recording";
5661      case MEDICATIONADMINISTRATIONUPDATE:
5662        return "MedicationAdministration-Update";
5663      case ADMINNOTIFY:
5664        return "admin-notify";
5665      case DIAGNOSTICREPORTPROVIDE:
5666        return "diagnosticreport-provide";
5667      case OBSERVATIONPROVIDE:
5668        return "observation-provide";
5669      case PATIENTLINK:
5670        return "patient-link";
5671      case PATIENTUNLINK:
5672        return "patient-unlink";
5673      case VALUESETEXPAND:
5674        return "valueset-expand";
5675      case NULL:
5676        return null;
5677      default:
5678        return "?";
5679      }
5680    }
5681  }
5682
5683  public static class MessageEventEnumFactory implements EnumFactory<MessageEvent> {
5684    public MessageEvent fromCode(String codeString) throws IllegalArgumentException {
5685      if (codeString == null || "".equals(codeString))
5686        if (codeString == null || "".equals(codeString))
5687          return null;
5688      if ("MedicationAdministration-Complete".equals(codeString))
5689        return MessageEvent.MEDICATIONADMINISTRATIONCOMPLETE;
5690      if ("MedicationAdministration-Nullification".equals(codeString))
5691        return MessageEvent.MEDICATIONADMINISTRATIONNULLIFICATION;
5692      if ("MedicationAdministration-Recording".equals(codeString))
5693        return MessageEvent.MEDICATIONADMINISTRATIONRECORDING;
5694      if ("MedicationAdministration-Update".equals(codeString))
5695        return MessageEvent.MEDICATIONADMINISTRATIONUPDATE;
5696      if ("admin-notify".equals(codeString))
5697        return MessageEvent.ADMINNOTIFY;
5698      if ("diagnosticreport-provide".equals(codeString))
5699        return MessageEvent.DIAGNOSTICREPORTPROVIDE;
5700      if ("observation-provide".equals(codeString))
5701        return MessageEvent.OBSERVATIONPROVIDE;
5702      if ("patient-link".equals(codeString))
5703        return MessageEvent.PATIENTLINK;
5704      if ("patient-unlink".equals(codeString))
5705        return MessageEvent.PATIENTUNLINK;
5706      if ("valueset-expand".equals(codeString))
5707        return MessageEvent.VALUESETEXPAND;
5708      throw new IllegalArgumentException("Unknown MessageEvent code '" + codeString + "'");
5709    }
5710
5711    public Enumeration<MessageEvent> fromType(Base code) throws FHIRException {
5712      if (code == null || code.isEmpty())
5713        return null;
5714      String codeString = ((PrimitiveType) code).asStringValue();
5715      if (codeString == null || "".equals(codeString))
5716        return null;
5717      if ("MedicationAdministration-Complete".equals(codeString))
5718        return new Enumeration<MessageEvent>(this, MessageEvent.MEDICATIONADMINISTRATIONCOMPLETE);
5719      if ("MedicationAdministration-Nullification".equals(codeString))
5720        return new Enumeration<MessageEvent>(this, MessageEvent.MEDICATIONADMINISTRATIONNULLIFICATION);
5721      if ("MedicationAdministration-Recording".equals(codeString))
5722        return new Enumeration<MessageEvent>(this, MessageEvent.MEDICATIONADMINISTRATIONRECORDING);
5723      if ("MedicationAdministration-Update".equals(codeString))
5724        return new Enumeration<MessageEvent>(this, MessageEvent.MEDICATIONADMINISTRATIONUPDATE);
5725      if ("admin-notify".equals(codeString))
5726        return new Enumeration<MessageEvent>(this, MessageEvent.ADMINNOTIFY);
5727      if ("diagnosticreport-provide".equals(codeString))
5728        return new Enumeration<MessageEvent>(this, MessageEvent.DIAGNOSTICREPORTPROVIDE);
5729      if ("observation-provide".equals(codeString))
5730        return new Enumeration<MessageEvent>(this, MessageEvent.OBSERVATIONPROVIDE);
5731      if ("patient-link".equals(codeString))
5732        return new Enumeration<MessageEvent>(this, MessageEvent.PATIENTLINK);
5733      if ("patient-unlink".equals(codeString))
5734        return new Enumeration<MessageEvent>(this, MessageEvent.PATIENTUNLINK);
5735      if ("valueset-expand".equals(codeString))
5736        return new Enumeration<MessageEvent>(this, MessageEvent.VALUESETEXPAND);
5737      throw new FHIRException("Unknown MessageEvent code '" + codeString + "'");
5738    }
5739
5740    public String toCode(MessageEvent code) {
5741      if (code == MessageEvent.MEDICATIONADMINISTRATIONCOMPLETE)
5742        return "MedicationAdministration-Complete";
5743      if (code == MessageEvent.MEDICATIONADMINISTRATIONNULLIFICATION)
5744        return "MedicationAdministration-Nullification";
5745      if (code == MessageEvent.MEDICATIONADMINISTRATIONRECORDING)
5746        return "MedicationAdministration-Recording";
5747      if (code == MessageEvent.MEDICATIONADMINISTRATIONUPDATE)
5748        return "MedicationAdministration-Update";
5749      if (code == MessageEvent.ADMINNOTIFY)
5750        return "admin-notify";
5751      if (code == MessageEvent.DIAGNOSTICREPORTPROVIDE)
5752        return "diagnosticreport-provide";
5753      if (code == MessageEvent.OBSERVATIONPROVIDE)
5754        return "observation-provide";
5755      if (code == MessageEvent.PATIENTLINK)
5756        return "patient-link";
5757      if (code == MessageEvent.PATIENTUNLINK)
5758        return "patient-unlink";
5759      if (code == MessageEvent.VALUESETEXPAND)
5760        return "valueset-expand";
5761      return "?";
5762    }
5763  }
5764
5765  public enum NoteType {
5766    /**
5767     * Display the note.
5768     */
5769    DISPLAY,
5770    /**
5771     * Print the note on the form.
5772     */
5773    PRINT,
5774    /**
5775     * Print the note for the operator.
5776     */
5777    PRINTOPER,
5778    /**
5779     * added to help the parsers
5780     */
5781    NULL;
5782
5783    public static NoteType fromCode(String codeString) throws FHIRException {
5784      if (codeString == null || "".equals(codeString))
5785        return null;
5786      if ("display".equals(codeString))
5787        return DISPLAY;
5788      if ("print".equals(codeString))
5789        return PRINT;
5790      if ("printoper".equals(codeString))
5791        return PRINTOPER;
5792      throw new FHIRException("Unknown NoteType code '" + codeString + "'");
5793    }
5794
5795    public String toCode() {
5796      switch (this) {
5797      case DISPLAY:
5798        return "display";
5799      case PRINT:
5800        return "print";
5801      case PRINTOPER:
5802        return "printoper";
5803      case NULL:
5804        return null;
5805      default:
5806        return "?";
5807      }
5808    }
5809
5810    public String getSystem() {
5811      switch (this) {
5812      case DISPLAY:
5813        return "http://hl7.org/fhir/note-type";
5814      case PRINT:
5815        return "http://hl7.org/fhir/note-type";
5816      case PRINTOPER:
5817        return "http://hl7.org/fhir/note-type";
5818      case NULL:
5819        return null;
5820      default:
5821        return "?";
5822      }
5823    }
5824
5825    public String getDefinition() {
5826      switch (this) {
5827      case DISPLAY:
5828        return "Display the note.";
5829      case PRINT:
5830        return "Print the note on the form.";
5831      case PRINTOPER:
5832        return "Print the note for the operator.";
5833      case NULL:
5834        return null;
5835      default:
5836        return "?";
5837      }
5838    }
5839
5840    public String getDisplay() {
5841      switch (this) {
5842      case DISPLAY:
5843        return "Display";
5844      case PRINT:
5845        return "Print (Form)";
5846      case PRINTOPER:
5847        return "Print (Operator)";
5848      case NULL:
5849        return null;
5850      default:
5851        return "?";
5852      }
5853    }
5854  }
5855
5856  public static class NoteTypeEnumFactory implements EnumFactory<NoteType> {
5857    public NoteType fromCode(String codeString) throws IllegalArgumentException {
5858      if (codeString == null || "".equals(codeString))
5859        if (codeString == null || "".equals(codeString))
5860          return null;
5861      if ("display".equals(codeString))
5862        return NoteType.DISPLAY;
5863      if ("print".equals(codeString))
5864        return NoteType.PRINT;
5865      if ("printoper".equals(codeString))
5866        return NoteType.PRINTOPER;
5867      throw new IllegalArgumentException("Unknown NoteType code '" + codeString + "'");
5868    }
5869
5870    public Enumeration<NoteType> fromType(Base code) throws FHIRException {
5871      if (code == null || code.isEmpty())
5872        return null;
5873      String codeString = ((PrimitiveType) code).asStringValue();
5874      if (codeString == null || "".equals(codeString))
5875        return null;
5876      if ("display".equals(codeString))
5877        return new Enumeration<NoteType>(this, NoteType.DISPLAY);
5878      if ("print".equals(codeString))
5879        return new Enumeration<NoteType>(this, NoteType.PRINT);
5880      if ("printoper".equals(codeString))
5881        return new Enumeration<NoteType>(this, NoteType.PRINTOPER);
5882      throw new FHIRException("Unknown NoteType code '" + codeString + "'");
5883    }
5884
5885    public String toCode(NoteType code) {
5886      if (code == NoteType.DISPLAY)
5887        return "display";
5888      if (code == NoteType.PRINT)
5889        return "print";
5890      if (code == NoteType.PRINTOPER)
5891        return "printoper";
5892      return "?";
5893    }
5894  }
5895
5896  public enum RemittanceOutcome {
5897    /**
5898     * The processing completed without errors.
5899     */
5900    COMPLETE,
5901    /**
5902     * The processing identified errors.
5903     */
5904    ERROR,
5905    /**
5906     * added to help the parsers
5907     */
5908    NULL;
5909
5910    public static RemittanceOutcome fromCode(String codeString) throws FHIRException {
5911      if (codeString == null || "".equals(codeString))
5912        return null;
5913      if ("complete".equals(codeString))
5914        return COMPLETE;
5915      if ("error".equals(codeString))
5916        return ERROR;
5917      throw new FHIRException("Unknown RemittanceOutcome code '" + codeString + "'");
5918    }
5919
5920    public String toCode() {
5921      switch (this) {
5922      case COMPLETE:
5923        return "complete";
5924      case ERROR:
5925        return "error";
5926      case NULL:
5927        return null;
5928      default:
5929        return "?";
5930      }
5931    }
5932
5933    public String getSystem() {
5934      switch (this) {
5935      case COMPLETE:
5936        return "http://hl7.org/fhir/remittance-outcome";
5937      case ERROR:
5938        return "http://hl7.org/fhir/remittance-outcome";
5939      case NULL:
5940        return null;
5941      default:
5942        return "?";
5943      }
5944    }
5945
5946    public String getDefinition() {
5947      switch (this) {
5948      case COMPLETE:
5949        return "The processing completed without errors.";
5950      case ERROR:
5951        return "The processing identified errors.";
5952      case NULL:
5953        return null;
5954      default:
5955        return "?";
5956      }
5957    }
5958
5959    public String getDisplay() {
5960      switch (this) {
5961      case COMPLETE:
5962        return "Complete";
5963      case ERROR:
5964        return "Error";
5965      case NULL:
5966        return null;
5967      default:
5968        return "?";
5969      }
5970    }
5971  }
5972
5973  public static class RemittanceOutcomeEnumFactory implements EnumFactory<RemittanceOutcome> {
5974    public RemittanceOutcome fromCode(String codeString) throws IllegalArgumentException {
5975      if (codeString == null || "".equals(codeString))
5976        if (codeString == null || "".equals(codeString))
5977          return null;
5978      if ("complete".equals(codeString))
5979        return RemittanceOutcome.COMPLETE;
5980      if ("error".equals(codeString))
5981        return RemittanceOutcome.ERROR;
5982      throw new IllegalArgumentException("Unknown RemittanceOutcome code '" + codeString + "'");
5983    }
5984
5985    public Enumeration<RemittanceOutcome> fromType(Base code) throws FHIRException {
5986      if (code == null || code.isEmpty())
5987        return null;
5988      String codeString = ((PrimitiveType) code).asStringValue();
5989      if (codeString == null || "".equals(codeString))
5990        return null;
5991      if ("complete".equals(codeString))
5992        return new Enumeration<RemittanceOutcome>(this, RemittanceOutcome.COMPLETE);
5993      if ("error".equals(codeString))
5994        return new Enumeration<RemittanceOutcome>(this, RemittanceOutcome.ERROR);
5995      throw new FHIRException("Unknown RemittanceOutcome code '" + codeString + "'");
5996    }
5997
5998    public String toCode(RemittanceOutcome code) {
5999      if (code == RemittanceOutcome.COMPLETE)
6000        return "complete";
6001      if (code == RemittanceOutcome.ERROR)
6002        return "error";
6003      return "?";
6004    }
6005  }
6006
6007  public enum ResourceType {
6008    /**
6009     * A financial tool for tracking value accrued for a particular purpose. In the
6010     * healthcare field, used to track charges for a patient, cost centres, etc.
6011     */
6012    ACCOUNT,
6013    /**
6014     * Risk of harmful or undesirable, physiological response which is unique to an
6015     * individual and associated with exposure to a substance.
6016     */
6017    ALLERGYINTOLERANCE,
6018    /**
6019     * A booking of a healthcare event among patient(s), practitioner(s), related
6020     * person(s) and/or device(s) for a specific date/time. This may result in one
6021     * or more Encounter(s).
6022     */
6023    APPOINTMENT,
6024    /**
6025     * A reply to an appointment request for a patient and/or practitioner(s), such
6026     * as a confirmation or rejection.
6027     */
6028    APPOINTMENTRESPONSE,
6029    /**
6030     * A record of an event made for purposes of maintaining a security log. Typical
6031     * uses include detection of intrusion attempts and monitoring for inappropriate
6032     * usage.
6033     */
6034    AUDITEVENT,
6035    /**
6036     * Basic is used for handling concepts not yet defined in FHIR, narrative-only
6037     * resources that don't map to an existing resource, and custom resources not
6038     * appropriate for inclusion in the FHIR specification.
6039     */
6040    BASIC,
6041    /**
6042     * A binary resource can contain any content, whether text, image, pdf, zip
6043     * archive, etc.
6044     */
6045    BINARY,
6046    /**
6047     * Record details about the anatomical location of a specimen or body part. This
6048     * resource may be used when a coded concept does not provide the necessary
6049     * detail needed for the use case.
6050     */
6051    BODYSITE,
6052    /**
6053     * A container for a collection of resources.
6054     */
6055    BUNDLE,
6056    /**
6057     * Describes the intention of how one or more practitioners intend to deliver
6058     * care for a particular patient, group or community for a period of time,
6059     * possibly limited to care for a specific condition or set of conditions.
6060     */
6061    CAREPLAN,
6062    /**
6063     * A provider issued list of services and products provided, or to be provided,
6064     * to a patient which is provided to an insurer for payment recovery.
6065     */
6066    CLAIM,
6067    /**
6068     * This resource provides the adjudication details from the processing of a
6069     * Claim resource.
6070     */
6071    CLAIMRESPONSE,
6072    /**
6073     * A record of a clinical assessment performed to determine what problem(s) may
6074     * affect the patient and before planning the treatments or management
6075     * strategies that are best to manage a patient's condition. Assessments are
6076     * often 1:1 with a clinical consultation / encounter, but this varies greatly
6077     * depending on the clinical workflow. This resource is called
6078     * "ClinicalImpression" rather than "ClinicalAssessment" to avoid confusion with
6079     * the recording of assessment tools such as Apgar score.
6080     */
6081    CLINICALIMPRESSION,
6082    /**
6083     * An occurrence of information being transmitted; e.g. an alert that was sent
6084     * to a responsible provider, a public health agency was notified about a
6085     * reportable condition.
6086     */
6087    COMMUNICATION,
6088    /**
6089     * A request to convey information; e.g. the CDS system proposes that an alert
6090     * be sent to a responsible provider, the CDS system proposes that the public
6091     * health agency be notified about a reportable condition.
6092     */
6093    COMMUNICATIONREQUEST,
6094    /**
6095     * A set of healthcare-related information that is assembled together into a
6096     * single logical document that provides a single coherent statement of meaning,
6097     * establishes its own context and that has clinical attestation with regard to
6098     * who is making the statement. While a Composition defines the structure, it
6099     * does not actually contain the content: rather the full content of a document
6100     * is contained in a Bundle, of which the Composition is the first resource
6101     * contained.
6102     */
6103    COMPOSITION,
6104    /**
6105     * A statement of relationships from one set of concepts to one or more other
6106     * concepts - either code systems or data elements, or classes in class models.
6107     */
6108    CONCEPTMAP,
6109    /**
6110     * Use to record detailed information about conditions, problems or diagnoses
6111     * recognized by a clinician. There are many uses including: recording a
6112     * diagnosis during an encounter; populating a problem list or a summary
6113     * statement, such as a discharge summary.
6114     */
6115    CONDITION,
6116    /**
6117     * A conformance statement is a set of capabilities of a FHIR Server that may be
6118     * used as a statement of actual server functionality or a statement of required
6119     * or desired server implementation.
6120     */
6121    CONFORMANCE,
6122    /**
6123     * A formal agreement between parties regarding the conduct of business,
6124     * exchange of information or other matters.
6125     */
6126    CONTRACT,
6127    /**
6128     * Financial instrument which may be used to pay for or reimburse health care
6129     * products and services.
6130     */
6131    COVERAGE,
6132    /**
6133     * The formal description of a single piece of information that can be gathered
6134     * and reported.
6135     */
6136    DATAELEMENT,
6137    /**
6138     * Indicates an actual or potential clinical issue with or between one or more
6139     * active or proposed clinical actions for a patient; e.g. Drug-drug
6140     * interaction, Ineffective treatment frequency, Procedure-condition conflict,
6141     * etc.
6142     */
6143    DETECTEDISSUE,
6144    /**
6145     * This resource identifies an instance of a manufactured item that is used in
6146     * the provision of healthcare without being substantially changed through that
6147     * activity. The device may be a medical or non-medical device. Medical devices
6148     * includes durable (reusable) medical equipment, implantable devices, as well
6149     * as disposable equipment used for diagnostic, treatment, and research for
6150     * healthcare and public health. Non-medical devices may include items such as a
6151     * machine, cellphone, computer, application, etc.
6152     */
6153    DEVICE,
6154    /**
6155     * Describes the characteristics, operational status and capabilities of a
6156     * medical-related component of a medical device.
6157     */
6158    DEVICECOMPONENT,
6159    /**
6160     * Describes a measurement, calculation or setting capability of a medical
6161     * device.
6162     */
6163    DEVICEMETRIC,
6164    /**
6165     * Represents a request for a patient to employ a medical device. The device may
6166     * be an implantable device, or an external assistive device, such as a walker.
6167     */
6168    DEVICEUSEREQUEST,
6169    /**
6170     * A record of a device being used by a patient where the record is the result
6171     * of a report from the patient or another clinician.
6172     */
6173    DEVICEUSESTATEMENT,
6174    /**
6175     * A record of a request for a diagnostic investigation service to be performed.
6176     */
6177    DIAGNOSTICORDER,
6178    /**
6179     * The findings and interpretation of diagnostic tests performed on patients,
6180     * groups of patients, devices, and locations, and/or specimens derived from
6181     * these. The report includes clinical context such as requesting and provider
6182     * information, and some mix of atomic results, images, textual and coded
6183     * interpretations, and formatted representation of diagnostic reports.
6184     */
6185    DIAGNOSTICREPORT,
6186    /**
6187     * A manifest that defines a set of documents.
6188     */
6189    DOCUMENTMANIFEST,
6190    /**
6191     * A reference to a document .
6192     */
6193    DOCUMENTREFERENCE,
6194    /**
6195     * --- Abstract Type! ---A resource that includes narrative, extensions, and
6196     * contained resources.
6197     */
6198    DOMAINRESOURCE,
6199    /**
6200     * This resource provides the insurance eligibility details from the insurer
6201     * regarding a specified coverage and optionally some class of service.
6202     */
6203    ELIGIBILITYREQUEST,
6204    /**
6205     * This resource provides eligibility and plan details from the processing of an
6206     * Eligibility resource.
6207     */
6208    ELIGIBILITYRESPONSE,
6209    /**
6210     * An interaction between a patient and healthcare provider(s) for the purpose
6211     * of providing healthcare service(s) or assessing the health status of a
6212     * patient.
6213     */
6214    ENCOUNTER,
6215    /**
6216     * This resource provides the insurance enrollment details to the insurer
6217     * regarding a specified coverage.
6218     */
6219    ENROLLMENTREQUEST,
6220    /**
6221     * This resource provides enrollment and plan details from the processing of an
6222     * Enrollment resource.
6223     */
6224    ENROLLMENTRESPONSE,
6225    /**
6226     * An association between a patient and an organization / healthcare provider(s)
6227     * during which time encounters may occur. The managing organization assumes a
6228     * level of responsibility for the patient during this time.
6229     */
6230    EPISODEOFCARE,
6231    /**
6232     * This resource provides: the claim details; adjudication details from the
6233     * processing of a Claim; and optionally account balance information, for
6234     * informing the subscriber of the benefits provided.
6235     */
6236    EXPLANATIONOFBENEFIT,
6237    /**
6238     * Significant health events and conditions for a person related to the patient
6239     * relevant in the context of care for the patient.
6240     */
6241    FAMILYMEMBERHISTORY,
6242    /**
6243     * Prospective warnings of potential issues when providing care to the patient.
6244     */
6245    FLAG,
6246    /**
6247     * Describes the intended objective(s) for a patient, group or organization
6248     * care, for example, weight loss, restoring an activity of daily living,
6249     * obtaining herd immunity via immunization, meeting a process improvement
6250     * objective, etc.
6251     */
6252    GOAL,
6253    /**
6254     * Represents a defined collection of entities that may be discussed or acted
6255     * upon collectively but which are not expected to act collectively and are not
6256     * formally or legally recognized; i.e. a collection of entities that isn't an
6257     * Organization.
6258     */
6259    GROUP,
6260    /**
6261     * The details of a healthcare service available at a location.
6262     */
6263    HEALTHCARESERVICE,
6264    /**
6265     * A manifest of a set of DICOM Service-Object Pair Instances (SOP Instances).
6266     * The referenced SOP Instances (images or other content) are for a single
6267     * patient, and may be from one or more studies. The referenced SOP Instances
6268     * have been selected for a purpose, such as quality assurance, conference, or
6269     * consult. Reflecting that range of purposes, typical ImagingObjectSelection
6270     * resources may include all SOP Instances in a study (perhaps for sharing
6271     * through a Health Information Exchange); key images from multiple studies (for
6272     * reference by a referring or treating physician); a multi-frame ultrasound
6273     * instance ("cine" video clip) and a set of measurements taken from that
6274     * instance (for inclusion in a teaching file); and so on.
6275     */
6276    IMAGINGOBJECTSELECTION,
6277    /**
6278     * Representation of the content produced in a DICOM imaging study. A study
6279     * comprises a set of series, each of which includes a set of Service-Object
6280     * Pair Instances (SOP Instances - images or other data) acquired or produced in
6281     * a common context. A series is of only one modality (e.g. X-ray, CT, MR,
6282     * ultrasound), but a study may have multiple series of different modalities.
6283     */
6284    IMAGINGSTUDY,
6285    /**
6286     * Describes the event of a patient being administered a vaccination or a record
6287     * of a vaccination as reported by a patient, a clinician or another party and
6288     * may include vaccine reaction information and what vaccination protocol was
6289     * followed.
6290     */
6291    IMMUNIZATION,
6292    /**
6293     * A patient's point-in-time immunization and recommendation (i.e. forecasting a
6294     * patient's immunization eligibility according to a published schedule) with
6295     * optional supporting justification.
6296     */
6297    IMMUNIZATIONRECOMMENDATION,
6298    /**
6299     * A set of rules or how FHIR is used to solve a particular problem. This
6300     * resource is used to gather all the parts of an implementation guide into a
6301     * logical whole, and to publish a computable definition of all the parts.
6302     */
6303    IMPLEMENTATIONGUIDE,
6304    /**
6305     * A set of information summarized from a list of other resources.
6306     */
6307    LIST,
6308    /**
6309     * Details and position information for a physical place where services are
6310     * provided and resources and participants may be stored, found, contained or
6311     * accommodated.
6312     */
6313    LOCATION,
6314    /**
6315     * A photo, video, or audio recording acquired or used in healthcare. The actual
6316     * content may be inline or provided by direct reference.
6317     */
6318    MEDIA,
6319    /**
6320     * This resource is primarily used for the identification and definition of a
6321     * medication. It covers the ingredients and the packaging for a medication.
6322     */
6323    MEDICATION,
6324    /**
6325     * Describes the event of a patient consuming or otherwise being administered a
6326     * medication. This may be as simple as swallowing a tablet or it may be a long
6327     * running infusion. Related resources tie this event to the authorizing
6328     * prescription, and the specific encounter between patient and health care
6329     * practitioner.
6330     */
6331    MEDICATIONADMINISTRATION,
6332    /**
6333     * Indicates that a medication product is to be or has been dispensed for a
6334     * named person/patient. This includes a description of the medication product
6335     * (supply) provided and the instructions for administering the medication. The
6336     * medication dispense is the result of a pharmacy system responding to a
6337     * medication order.
6338     */
6339    MEDICATIONDISPENSE,
6340    /**
6341     * An order for both supply of the medication and the instructions for
6342     * administration of the medication to a patient. The resource is called
6343     * "MedicationOrder" rather than "MedicationPrescription" to generalize the use
6344     * across inpatient and outpatient settings as well as for care plans, etc.
6345     */
6346    MEDICATIONORDER,
6347    /**
6348     * A record of a medication that is being consumed by a patient. A
6349     * MedicationStatement may indicate that the patient may be taking the
6350     * medication now, or has taken the medication in the past or will be taking the
6351     * medication in the future. The source of this information can be the patient,
6352     * significant other (such as a family member or spouse), or a clinician. A
6353     * common scenario where this information is captured is during the history
6354     * taking process during a patient visit or stay. The medication information may
6355     * come from e.g. the patient's memory, from a prescription bottle, or from a
6356     * list of medications the patient, clinician or other party maintains
6357     * 
6358     * The primary difference between a medication statement and a medication
6359     * administration is that the medication administration has complete
6360     * administration information and is based on actual administration information
6361     * from the person who administered the medication. A medication statement is
6362     * often, if not always, less specific. There is no required date/time when the
6363     * medication was administered, in fact we only know that a source has reported
6364     * the patient is taking this medication, where details such as time, quantity,
6365     * or rate or even medication product may be incomplete or missing or less
6366     * precise. As stated earlier, the medication statement information may come
6367     * from the patient's memory, from a prescription bottle or from a list of
6368     * medications the patient, clinician or other party maintains. Medication
6369     * administration is more formal and is not missing detailed information.
6370     */
6371    MEDICATIONSTATEMENT,
6372    /**
6373     * The header for a message exchange that is either requesting or responding to
6374     * an action. The reference(s) that are the subject of the action as well as
6375     * other information related to the action are typically transmitted in a bundle
6376     * in which the MessageHeader resource instance is the first resource in the
6377     * bundle.
6378     */
6379    MESSAGEHEADER,
6380    /**
6381     * A curated namespace that issues unique symbols within that namespace for the
6382     * identification of concepts, people, devices, etc. Represents a "System" used
6383     * within the Identifier and Coding data types.
6384     */
6385    NAMINGSYSTEM,
6386    /**
6387     * A request to supply a diet, formula feeding (enteral) or oral nutritional
6388     * supplement to a patient/resident.
6389     */
6390    NUTRITIONORDER,
6391    /**
6392     * Measurements and simple assertions made about a patient, device or other
6393     * subject.
6394     */
6395    OBSERVATION,
6396    /**
6397     * A formal computable definition of an operation (on the RESTful interface) or
6398     * a named query (using the search interaction).
6399     */
6400    OPERATIONDEFINITION,
6401    /**
6402     * A collection of error, warning or information messages that result from a
6403     * system action.
6404     */
6405    OPERATIONOUTCOME,
6406    /**
6407     * A request to perform an action.
6408     */
6409    ORDER,
6410    /**
6411     * A response to an order.
6412     */
6413    ORDERRESPONSE,
6414    /**
6415     * A formally or informally recognized grouping of people or organizations
6416     * formed for the purpose of achieving some form of collective action. Includes
6417     * companies, institutions, corporations, departments, community groups,
6418     * healthcare practice groups, etc.
6419     */
6420    ORGANIZATION,
6421    /**
6422     * This special resource type is used to represent an operation request and
6423     * response (operations.html). It has no other use, and there is no RESTful
6424     * endpoint associated with it.
6425     */
6426    PARAMETERS,
6427    /**
6428     * Demographics and other administrative information about an individual or
6429     * animal receiving care or other health-related services.
6430     */
6431    PATIENT,
6432    /**
6433     * This resource provides the status of the payment for goods and services
6434     * rendered, and the request and response resource references.
6435     */
6436    PAYMENTNOTICE,
6437    /**
6438     * This resource provides payment details and claim references supporting a bulk
6439     * payment.
6440     */
6441    PAYMENTRECONCILIATION,
6442    /**
6443     * Demographics and administrative information about a person independent of a
6444     * specific health-related context.
6445     */
6446    PERSON,
6447    /**
6448     * A person who is directly or indirectly involved in the provisioning of
6449     * healthcare.
6450     */
6451    PRACTITIONER,
6452    /**
6453     * An action that is or was performed on a patient. This can be a physical
6454     * intervention like an operation, or less invasive like counseling or
6455     * hypnotherapy.
6456     */
6457    PROCEDURE,
6458    /**
6459     * A request for a procedure to be performed. May be a proposal or an order.
6460     */
6461    PROCEDUREREQUEST,
6462    /**
6463     * This resource provides the target, request and response, and action details
6464     * for an action to be performed by the target on or about existing resources.
6465     */
6466    PROCESSREQUEST,
6467    /**
6468     * This resource provides processing status, errors and notes from the
6469     * processing of a resource.
6470     */
6471    PROCESSRESPONSE,
6472    /**
6473     * Provenance of a resource is a record that describes entities and processes
6474     * involved in producing and delivering or otherwise influencing that resource.
6475     * Provenance provides a critical foundation for assessing authenticity,
6476     * enabling trust, and allowing reproducibility. Provenance assertions are a
6477     * form of contextual metadata and can themselves become important records with
6478     * their own provenance. Provenance statement indicates clinical significance in
6479     * terms of confidence in authenticity, reliability, and trustworthiness,
6480     * integrity, and stage in lifecycle (e.g. Document Completion - has the
6481     * artifact been legally authenticated), all of which may impact security,
6482     * privacy, and trust policies.
6483     */
6484    PROVENANCE,
6485    /**
6486     * A structured set of questions intended to guide the collection of answers.
6487     * The questions are ordered and grouped into coherent subsets, corresponding to
6488     * the structure of the grouping of the underlying questions.
6489     */
6490    QUESTIONNAIRE,
6491    /**
6492     * A structured set of questions and their answers. The questions are ordered
6493     * and grouped into coherent subsets, corresponding to the structure of the
6494     * grouping of the underlying questions.
6495     */
6496    QUESTIONNAIRERESPONSE,
6497    /**
6498     * Used to record and send details about a request for referral service or
6499     * transfer of a patient to the care of another provider or provider
6500     * organization.
6501     */
6502    REFERRALREQUEST,
6503    /**
6504     * Information about a person that is involved in the care for a patient, but
6505     * who is not the target of healthcare, nor has a formal responsibility in the
6506     * care process.
6507     */
6508    RELATEDPERSON,
6509    /**
6510     * --- Abstract Type! ---This is the base resource type for everything.
6511     */
6512    RESOURCE,
6513    /**
6514     * An assessment of the likely outcome(s) for a patient or other subject as well
6515     * as the likelihood of each outcome.
6516     */
6517    RISKASSESSMENT,
6518    /**
6519     * A container for slot(s) of time that may be available for booking
6520     * appointments.
6521     */
6522    SCHEDULE,
6523    /**
6524     * A search parameter that defines a named search item that can be used to
6525     * search/filter on a resource.
6526     */
6527    SEARCHPARAMETER,
6528    /**
6529     * A slot of time on a schedule that may be available for booking appointments.
6530     */
6531    SLOT,
6532    /**
6533     * A sample to be used for analysis.
6534     */
6535    SPECIMEN,
6536    /**
6537     * A definition of a FHIR structure. This resource is used to describe the
6538     * underlying resources, data types defined in FHIR, and also for describing
6539     * extensions, and constraints on resources and data types.
6540     */
6541    STRUCTUREDEFINITION,
6542    /**
6543     * The subscription resource is used to define a push based subscription from a
6544     * server to another system. Once a subscription is registered with the server,
6545     * the server checks every resource that is created or updated, and if the
6546     * resource matches the given criteria, it sends a message on the defined
6547     * "channel" so that another system is able to take an appropriate action.
6548     */
6549    SUBSCRIPTION,
6550    /**
6551     * A homogeneous material with a definite composition.
6552     */
6553    SUBSTANCE,
6554    /**
6555     * Record of delivery of what is supplied.
6556     */
6557    SUPPLYDELIVERY,
6558    /**
6559     * A record of a request for a medication, substance or device used in the
6560     * healthcare setting.
6561     */
6562    SUPPLYREQUEST,
6563    /**
6564     * TestScript is a resource that specifies a suite of tests against a FHIR
6565     * server implementation to determine compliance against the FHIR specification.
6566     */
6567    TESTSCRIPT,
6568    /**
6569     * A value set specifies a set of codes drawn from one or more code systems.
6570     */
6571    VALUESET,
6572    /**
6573     * An authorization for the supply of glasses and/or contact lenses to a
6574     * patient.
6575     */
6576    VISIONPRESCRIPTION,
6577    /**
6578     * added to help the parsers
6579     */
6580    NULL;
6581
6582    public static ResourceType fromCode(String codeString) throws FHIRException {
6583      if (codeString == null || "".equals(codeString))
6584        return null;
6585      if ("Account".equals(codeString))
6586        return ACCOUNT;
6587      if ("AllergyIntolerance".equals(codeString))
6588        return ALLERGYINTOLERANCE;
6589      if ("Appointment".equals(codeString))
6590        return APPOINTMENT;
6591      if ("AppointmentResponse".equals(codeString))
6592        return APPOINTMENTRESPONSE;
6593      if ("AuditEvent".equals(codeString))
6594        return AUDITEVENT;
6595      if ("Basic".equals(codeString))
6596        return BASIC;
6597      if ("Binary".equals(codeString))
6598        return BINARY;
6599      if ("BodySite".equals(codeString))
6600        return BODYSITE;
6601      if ("Bundle".equals(codeString))
6602        return BUNDLE;
6603      if ("CarePlan".equals(codeString))
6604        return CAREPLAN;
6605      if ("Claim".equals(codeString))
6606        return CLAIM;
6607      if ("ClaimResponse".equals(codeString))
6608        return CLAIMRESPONSE;
6609      if ("ClinicalImpression".equals(codeString))
6610        return CLINICALIMPRESSION;
6611      if ("Communication".equals(codeString))
6612        return COMMUNICATION;
6613      if ("CommunicationRequest".equals(codeString))
6614        return COMMUNICATIONREQUEST;
6615      if ("Composition".equals(codeString))
6616        return COMPOSITION;
6617      if ("ConceptMap".equals(codeString))
6618        return CONCEPTMAP;
6619      if ("Condition".equals(codeString))
6620        return CONDITION;
6621      if ("Conformance".equals(codeString))
6622        return CONFORMANCE;
6623      if ("Contract".equals(codeString))
6624        return CONTRACT;
6625      if ("Coverage".equals(codeString))
6626        return COVERAGE;
6627      if ("DataElement".equals(codeString))
6628        return DATAELEMENT;
6629      if ("DetectedIssue".equals(codeString))
6630        return DETECTEDISSUE;
6631      if ("Device".equals(codeString))
6632        return DEVICE;
6633      if ("DeviceComponent".equals(codeString))
6634        return DEVICECOMPONENT;
6635      if ("DeviceMetric".equals(codeString))
6636        return DEVICEMETRIC;
6637      if ("DeviceUseRequest".equals(codeString))
6638        return DEVICEUSEREQUEST;
6639      if ("DeviceUseStatement".equals(codeString))
6640        return DEVICEUSESTATEMENT;
6641      if ("DiagnosticOrder".equals(codeString))
6642        return DIAGNOSTICORDER;
6643      if ("DiagnosticReport".equals(codeString))
6644        return DIAGNOSTICREPORT;
6645      if ("DocumentManifest".equals(codeString))
6646        return DOCUMENTMANIFEST;
6647      if ("DocumentReference".equals(codeString))
6648        return DOCUMENTREFERENCE;
6649      if ("DomainResource".equals(codeString))
6650        return DOMAINRESOURCE;
6651      if ("EligibilityRequest".equals(codeString))
6652        return ELIGIBILITYREQUEST;
6653      if ("EligibilityResponse".equals(codeString))
6654        return ELIGIBILITYRESPONSE;
6655      if ("Encounter".equals(codeString))
6656        return ENCOUNTER;
6657      if ("EnrollmentRequest".equals(codeString))
6658        return ENROLLMENTREQUEST;
6659      if ("EnrollmentResponse".equals(codeString))
6660        return ENROLLMENTRESPONSE;
6661      if ("EpisodeOfCare".equals(codeString))
6662        return EPISODEOFCARE;
6663      if ("ExplanationOfBenefit".equals(codeString))
6664        return EXPLANATIONOFBENEFIT;
6665      if ("FamilyMemberHistory".equals(codeString))
6666        return FAMILYMEMBERHISTORY;
6667      if ("Flag".equals(codeString))
6668        return FLAG;
6669      if ("Goal".equals(codeString))
6670        return GOAL;
6671      if ("Group".equals(codeString))
6672        return GROUP;
6673      if ("HealthcareService".equals(codeString))
6674        return HEALTHCARESERVICE;
6675      if ("ImagingObjectSelection".equals(codeString))
6676        return IMAGINGOBJECTSELECTION;
6677      if ("ImagingStudy".equals(codeString))
6678        return IMAGINGSTUDY;
6679      if ("Immunization".equals(codeString))
6680        return IMMUNIZATION;
6681      if ("ImmunizationRecommendation".equals(codeString))
6682        return IMMUNIZATIONRECOMMENDATION;
6683      if ("ImplementationGuide".equals(codeString))
6684        return IMPLEMENTATIONGUIDE;
6685      if ("List".equals(codeString))
6686        return LIST;
6687      if ("Location".equals(codeString))
6688        return LOCATION;
6689      if ("Media".equals(codeString))
6690        return MEDIA;
6691      if ("Medication".equals(codeString))
6692        return MEDICATION;
6693      if ("MedicationAdministration".equals(codeString))
6694        return MEDICATIONADMINISTRATION;
6695      if ("MedicationDispense".equals(codeString))
6696        return MEDICATIONDISPENSE;
6697      if ("MedicationOrder".equals(codeString))
6698        return MEDICATIONORDER;
6699      if ("MedicationStatement".equals(codeString))
6700        return MEDICATIONSTATEMENT;
6701      if ("MessageHeader".equals(codeString))
6702        return MESSAGEHEADER;
6703      if ("NamingSystem".equals(codeString))
6704        return NAMINGSYSTEM;
6705      if ("NutritionOrder".equals(codeString))
6706        return NUTRITIONORDER;
6707      if ("Observation".equals(codeString))
6708        return OBSERVATION;
6709      if ("OperationDefinition".equals(codeString))
6710        return OPERATIONDEFINITION;
6711      if ("OperationOutcome".equals(codeString))
6712        return OPERATIONOUTCOME;
6713      if ("Order".equals(codeString))
6714        return ORDER;
6715      if ("OrderResponse".equals(codeString))
6716        return ORDERRESPONSE;
6717      if ("Organization".equals(codeString))
6718        return ORGANIZATION;
6719      if ("Parameters".equals(codeString))
6720        return PARAMETERS;
6721      if ("Patient".equals(codeString))
6722        return PATIENT;
6723      if ("PaymentNotice".equals(codeString))
6724        return PAYMENTNOTICE;
6725      if ("PaymentReconciliation".equals(codeString))
6726        return PAYMENTRECONCILIATION;
6727      if ("Person".equals(codeString))
6728        return PERSON;
6729      if ("Practitioner".equals(codeString))
6730        return PRACTITIONER;
6731      if ("Procedure".equals(codeString))
6732        return PROCEDURE;
6733      if ("ProcedureRequest".equals(codeString))
6734        return PROCEDUREREQUEST;
6735      if ("ProcessRequest".equals(codeString))
6736        return PROCESSREQUEST;
6737      if ("ProcessResponse".equals(codeString))
6738        return PROCESSRESPONSE;
6739      if ("Provenance".equals(codeString))
6740        return PROVENANCE;
6741      if ("Questionnaire".equals(codeString))
6742        return QUESTIONNAIRE;
6743      if ("QuestionnaireResponse".equals(codeString))
6744        return QUESTIONNAIRERESPONSE;
6745      if ("ReferralRequest".equals(codeString))
6746        return REFERRALREQUEST;
6747      if ("RelatedPerson".equals(codeString))
6748        return RELATEDPERSON;
6749      if ("Resource".equals(codeString))
6750        return RESOURCE;
6751      if ("RiskAssessment".equals(codeString))
6752        return RISKASSESSMENT;
6753      if ("Schedule".equals(codeString))
6754        return SCHEDULE;
6755      if ("SearchParameter".equals(codeString))
6756        return SEARCHPARAMETER;
6757      if ("Slot".equals(codeString))
6758        return SLOT;
6759      if ("Specimen".equals(codeString))
6760        return SPECIMEN;
6761      if ("StructureDefinition".equals(codeString))
6762        return STRUCTUREDEFINITION;
6763      if ("Subscription".equals(codeString))
6764        return SUBSCRIPTION;
6765      if ("Substance".equals(codeString))
6766        return SUBSTANCE;
6767      if ("SupplyDelivery".equals(codeString))
6768        return SUPPLYDELIVERY;
6769      if ("SupplyRequest".equals(codeString))
6770        return SUPPLYREQUEST;
6771      if ("TestScript".equals(codeString))
6772        return TESTSCRIPT;
6773      if ("ValueSet".equals(codeString))
6774        return VALUESET;
6775      if ("VisionPrescription".equals(codeString))
6776        return VISIONPRESCRIPTION;
6777      throw new FHIRException("Unknown ResourceType code '" + codeString + "'");
6778    }
6779
6780    public String toCode() {
6781      switch (this) {
6782      case ACCOUNT:
6783        return "Account";
6784      case ALLERGYINTOLERANCE:
6785        return "AllergyIntolerance";
6786      case APPOINTMENT:
6787        return "Appointment";
6788      case APPOINTMENTRESPONSE:
6789        return "AppointmentResponse";
6790      case AUDITEVENT:
6791        return "AuditEvent";
6792      case BASIC:
6793        return "Basic";
6794      case BINARY:
6795        return "Binary";
6796      case BODYSITE:
6797        return "BodySite";
6798      case BUNDLE:
6799        return "Bundle";
6800      case CAREPLAN:
6801        return "CarePlan";
6802      case CLAIM:
6803        return "Claim";
6804      case CLAIMRESPONSE:
6805        return "ClaimResponse";
6806      case CLINICALIMPRESSION:
6807        return "ClinicalImpression";
6808      case COMMUNICATION:
6809        return "Communication";
6810      case COMMUNICATIONREQUEST:
6811        return "CommunicationRequest";
6812      case COMPOSITION:
6813        return "Composition";
6814      case CONCEPTMAP:
6815        return "ConceptMap";
6816      case CONDITION:
6817        return "Condition";
6818      case CONFORMANCE:
6819        return "Conformance";
6820      case CONTRACT:
6821        return "Contract";
6822      case COVERAGE:
6823        return "Coverage";
6824      case DATAELEMENT:
6825        return "DataElement";
6826      case DETECTEDISSUE:
6827        return "DetectedIssue";
6828      case DEVICE:
6829        return "Device";
6830      case DEVICECOMPONENT:
6831        return "DeviceComponent";
6832      case DEVICEMETRIC:
6833        return "DeviceMetric";
6834      case DEVICEUSEREQUEST:
6835        return "DeviceUseRequest";
6836      case DEVICEUSESTATEMENT:
6837        return "DeviceUseStatement";
6838      case DIAGNOSTICORDER:
6839        return "DiagnosticOrder";
6840      case DIAGNOSTICREPORT:
6841        return "DiagnosticReport";
6842      case DOCUMENTMANIFEST:
6843        return "DocumentManifest";
6844      case DOCUMENTREFERENCE:
6845        return "DocumentReference";
6846      case DOMAINRESOURCE:
6847        return "DomainResource";
6848      case ELIGIBILITYREQUEST:
6849        return "EligibilityRequest";
6850      case ELIGIBILITYRESPONSE:
6851        return "EligibilityResponse";
6852      case ENCOUNTER:
6853        return "Encounter";
6854      case ENROLLMENTREQUEST:
6855        return "EnrollmentRequest";
6856      case ENROLLMENTRESPONSE:
6857        return "EnrollmentResponse";
6858      case EPISODEOFCARE:
6859        return "EpisodeOfCare";
6860      case EXPLANATIONOFBENEFIT:
6861        return "ExplanationOfBenefit";
6862      case FAMILYMEMBERHISTORY:
6863        return "FamilyMemberHistory";
6864      case FLAG:
6865        return "Flag";
6866      case GOAL:
6867        return "Goal";
6868      case GROUP:
6869        return "Group";
6870      case HEALTHCARESERVICE:
6871        return "HealthcareService";
6872      case IMAGINGOBJECTSELECTION:
6873        return "ImagingObjectSelection";
6874      case IMAGINGSTUDY:
6875        return "ImagingStudy";
6876      case IMMUNIZATION:
6877        return "Immunization";
6878      case IMMUNIZATIONRECOMMENDATION:
6879        return "ImmunizationRecommendation";
6880      case IMPLEMENTATIONGUIDE:
6881        return "ImplementationGuide";
6882      case LIST:
6883        return "List";
6884      case LOCATION:
6885        return "Location";
6886      case MEDIA:
6887        return "Media";
6888      case MEDICATION:
6889        return "Medication";
6890      case MEDICATIONADMINISTRATION:
6891        return "MedicationAdministration";
6892      case MEDICATIONDISPENSE:
6893        return "MedicationDispense";
6894      case MEDICATIONORDER:
6895        return "MedicationOrder";
6896      case MEDICATIONSTATEMENT:
6897        return "MedicationStatement";
6898      case MESSAGEHEADER:
6899        return "MessageHeader";
6900      case NAMINGSYSTEM:
6901        return "NamingSystem";
6902      case NUTRITIONORDER:
6903        return "NutritionOrder";
6904      case OBSERVATION:
6905        return "Observation";
6906      case OPERATIONDEFINITION:
6907        return "OperationDefinition";
6908      case OPERATIONOUTCOME:
6909        return "OperationOutcome";
6910      case ORDER:
6911        return "Order";
6912      case ORDERRESPONSE:
6913        return "OrderResponse";
6914      case ORGANIZATION:
6915        return "Organization";
6916      case PARAMETERS:
6917        return "Parameters";
6918      case PATIENT:
6919        return "Patient";
6920      case PAYMENTNOTICE:
6921        return "PaymentNotice";
6922      case PAYMENTRECONCILIATION:
6923        return "PaymentReconciliation";
6924      case PERSON:
6925        return "Person";
6926      case PRACTITIONER:
6927        return "Practitioner";
6928      case PROCEDURE:
6929        return "Procedure";
6930      case PROCEDUREREQUEST:
6931        return "ProcedureRequest";
6932      case PROCESSREQUEST:
6933        return "ProcessRequest";
6934      case PROCESSRESPONSE:
6935        return "ProcessResponse";
6936      case PROVENANCE:
6937        return "Provenance";
6938      case QUESTIONNAIRE:
6939        return "Questionnaire";
6940      case QUESTIONNAIRERESPONSE:
6941        return "QuestionnaireResponse";
6942      case REFERRALREQUEST:
6943        return "ReferralRequest";
6944      case RELATEDPERSON:
6945        return "RelatedPerson";
6946      case RESOURCE:
6947        return "Resource";
6948      case RISKASSESSMENT:
6949        return "RiskAssessment";
6950      case SCHEDULE:
6951        return "Schedule";
6952      case SEARCHPARAMETER:
6953        return "SearchParameter";
6954      case SLOT:
6955        return "Slot";
6956      case SPECIMEN:
6957        return "Specimen";
6958      case STRUCTUREDEFINITION:
6959        return "StructureDefinition";
6960      case SUBSCRIPTION:
6961        return "Subscription";
6962      case SUBSTANCE:
6963        return "Substance";
6964      case SUPPLYDELIVERY:
6965        return "SupplyDelivery";
6966      case SUPPLYREQUEST:
6967        return "SupplyRequest";
6968      case TESTSCRIPT:
6969        return "TestScript";
6970      case VALUESET:
6971        return "ValueSet";
6972      case VISIONPRESCRIPTION:
6973        return "VisionPrescription";
6974      case NULL:
6975        return null;
6976      default:
6977        return "?";
6978      }
6979    }
6980
6981    public String getSystem() {
6982      switch (this) {
6983      case ACCOUNT:
6984        return "http://hl7.org/fhir/resource-types";
6985      case ALLERGYINTOLERANCE:
6986        return "http://hl7.org/fhir/resource-types";
6987      case APPOINTMENT:
6988        return "http://hl7.org/fhir/resource-types";
6989      case APPOINTMENTRESPONSE:
6990        return "http://hl7.org/fhir/resource-types";
6991      case AUDITEVENT:
6992        return "http://hl7.org/fhir/resource-types";
6993      case BASIC:
6994        return "http://hl7.org/fhir/resource-types";
6995      case BINARY:
6996        return "http://hl7.org/fhir/resource-types";
6997      case BODYSITE:
6998        return "http://hl7.org/fhir/resource-types";
6999      case BUNDLE:
7000        return "http://hl7.org/fhir/resource-types";
7001      case CAREPLAN:
7002        return "http://hl7.org/fhir/resource-types";
7003      case CLAIM:
7004        return "http://hl7.org/fhir/resource-types";
7005      case CLAIMRESPONSE:
7006        return "http://hl7.org/fhir/resource-types";
7007      case CLINICALIMPRESSION:
7008        return "http://hl7.org/fhir/resource-types";
7009      case COMMUNICATION:
7010        return "http://hl7.org/fhir/resource-types";
7011      case COMMUNICATIONREQUEST:
7012        return "http://hl7.org/fhir/resource-types";
7013      case COMPOSITION:
7014        return "http://hl7.org/fhir/resource-types";
7015      case CONCEPTMAP:
7016        return "http://hl7.org/fhir/resource-types";
7017      case CONDITION:
7018        return "http://hl7.org/fhir/resource-types";
7019      case CONFORMANCE:
7020        return "http://hl7.org/fhir/resource-types";
7021      case CONTRACT:
7022        return "http://hl7.org/fhir/resource-types";
7023      case COVERAGE:
7024        return "http://hl7.org/fhir/resource-types";
7025      case DATAELEMENT:
7026        return "http://hl7.org/fhir/resource-types";
7027      case DETECTEDISSUE:
7028        return "http://hl7.org/fhir/resource-types";
7029      case DEVICE:
7030        return "http://hl7.org/fhir/resource-types";
7031      case DEVICECOMPONENT:
7032        return "http://hl7.org/fhir/resource-types";
7033      case DEVICEMETRIC:
7034        return "http://hl7.org/fhir/resource-types";
7035      case DEVICEUSEREQUEST:
7036        return "http://hl7.org/fhir/resource-types";
7037      case DEVICEUSESTATEMENT:
7038        return "http://hl7.org/fhir/resource-types";
7039      case DIAGNOSTICORDER:
7040        return "http://hl7.org/fhir/resource-types";
7041      case DIAGNOSTICREPORT:
7042        return "http://hl7.org/fhir/resource-types";
7043      case DOCUMENTMANIFEST:
7044        return "http://hl7.org/fhir/resource-types";
7045      case DOCUMENTREFERENCE:
7046        return "http://hl7.org/fhir/resource-types";
7047      case DOMAINRESOURCE:
7048        return "http://hl7.org/fhir/resource-types";
7049      case ELIGIBILITYREQUEST:
7050        return "http://hl7.org/fhir/resource-types";
7051      case ELIGIBILITYRESPONSE:
7052        return "http://hl7.org/fhir/resource-types";
7053      case ENCOUNTER:
7054        return "http://hl7.org/fhir/resource-types";
7055      case ENROLLMENTREQUEST:
7056        return "http://hl7.org/fhir/resource-types";
7057      case ENROLLMENTRESPONSE:
7058        return "http://hl7.org/fhir/resource-types";
7059      case EPISODEOFCARE:
7060        return "http://hl7.org/fhir/resource-types";
7061      case EXPLANATIONOFBENEFIT:
7062        return "http://hl7.org/fhir/resource-types";
7063      case FAMILYMEMBERHISTORY:
7064        return "http://hl7.org/fhir/resource-types";
7065      case FLAG:
7066        return "http://hl7.org/fhir/resource-types";
7067      case GOAL:
7068        return "http://hl7.org/fhir/resource-types";
7069      case GROUP:
7070        return "http://hl7.org/fhir/resource-types";
7071      case HEALTHCARESERVICE:
7072        return "http://hl7.org/fhir/resource-types";
7073      case IMAGINGOBJECTSELECTION:
7074        return "http://hl7.org/fhir/resource-types";
7075      case IMAGINGSTUDY:
7076        return "http://hl7.org/fhir/resource-types";
7077      case IMMUNIZATION:
7078        return "http://hl7.org/fhir/resource-types";
7079      case IMMUNIZATIONRECOMMENDATION:
7080        return "http://hl7.org/fhir/resource-types";
7081      case IMPLEMENTATIONGUIDE:
7082        return "http://hl7.org/fhir/resource-types";
7083      case LIST:
7084        return "http://hl7.org/fhir/resource-types";
7085      case LOCATION:
7086        return "http://hl7.org/fhir/resource-types";
7087      case MEDIA:
7088        return "http://hl7.org/fhir/resource-types";
7089      case MEDICATION:
7090        return "http://hl7.org/fhir/resource-types";
7091      case MEDICATIONADMINISTRATION:
7092        return "http://hl7.org/fhir/resource-types";
7093      case MEDICATIONDISPENSE:
7094        return "http://hl7.org/fhir/resource-types";
7095      case MEDICATIONORDER:
7096        return "http://hl7.org/fhir/resource-types";
7097      case MEDICATIONSTATEMENT:
7098        return "http://hl7.org/fhir/resource-types";
7099      case MESSAGEHEADER:
7100        return "http://hl7.org/fhir/resource-types";
7101      case NAMINGSYSTEM:
7102        return "http://hl7.org/fhir/resource-types";
7103      case NUTRITIONORDER:
7104        return "http://hl7.org/fhir/resource-types";
7105      case OBSERVATION:
7106        return "http://hl7.org/fhir/resource-types";
7107      case OPERATIONDEFINITION:
7108        return "http://hl7.org/fhir/resource-types";
7109      case OPERATIONOUTCOME:
7110        return "http://hl7.org/fhir/resource-types";
7111      case ORDER:
7112        return "http://hl7.org/fhir/resource-types";
7113      case ORDERRESPONSE:
7114        return "http://hl7.org/fhir/resource-types";
7115      case ORGANIZATION:
7116        return "http://hl7.org/fhir/resource-types";
7117      case PARAMETERS:
7118        return "http://hl7.org/fhir/resource-types";
7119      case PATIENT:
7120        return "http://hl7.org/fhir/resource-types";
7121      case PAYMENTNOTICE:
7122        return "http://hl7.org/fhir/resource-types";
7123      case PAYMENTRECONCILIATION:
7124        return "http://hl7.org/fhir/resource-types";
7125      case PERSON:
7126        return "http://hl7.org/fhir/resource-types";
7127      case PRACTITIONER:
7128        return "http://hl7.org/fhir/resource-types";
7129      case PROCEDURE:
7130        return "http://hl7.org/fhir/resource-types";
7131      case PROCEDUREREQUEST:
7132        return "http://hl7.org/fhir/resource-types";
7133      case PROCESSREQUEST:
7134        return "http://hl7.org/fhir/resource-types";
7135      case PROCESSRESPONSE:
7136        return "http://hl7.org/fhir/resource-types";
7137      case PROVENANCE:
7138        return "http://hl7.org/fhir/resource-types";
7139      case QUESTIONNAIRE:
7140        return "http://hl7.org/fhir/resource-types";
7141      case QUESTIONNAIRERESPONSE:
7142        return "http://hl7.org/fhir/resource-types";
7143      case REFERRALREQUEST:
7144        return "http://hl7.org/fhir/resource-types";
7145      case RELATEDPERSON:
7146        return "http://hl7.org/fhir/resource-types";
7147      case RESOURCE:
7148        return "http://hl7.org/fhir/resource-types";
7149      case RISKASSESSMENT:
7150        return "http://hl7.org/fhir/resource-types";
7151      case SCHEDULE:
7152        return "http://hl7.org/fhir/resource-types";
7153      case SEARCHPARAMETER:
7154        return "http://hl7.org/fhir/resource-types";
7155      case SLOT:
7156        return "http://hl7.org/fhir/resource-types";
7157      case SPECIMEN:
7158        return "http://hl7.org/fhir/resource-types";
7159      case STRUCTUREDEFINITION:
7160        return "http://hl7.org/fhir/resource-types";
7161      case SUBSCRIPTION:
7162        return "http://hl7.org/fhir/resource-types";
7163      case SUBSTANCE:
7164        return "http://hl7.org/fhir/resource-types";
7165      case SUPPLYDELIVERY:
7166        return "http://hl7.org/fhir/resource-types";
7167      case SUPPLYREQUEST:
7168        return "http://hl7.org/fhir/resource-types";
7169      case TESTSCRIPT:
7170        return "http://hl7.org/fhir/resource-types";
7171      case VALUESET:
7172        return "http://hl7.org/fhir/resource-types";
7173      case VISIONPRESCRIPTION:
7174        return "http://hl7.org/fhir/resource-types";
7175      case NULL:
7176        return null;
7177      default:
7178        return "?";
7179      }
7180    }
7181
7182    public String getDefinition() {
7183      switch (this) {
7184      case ACCOUNT:
7185        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.";
7186      case ALLERGYINTOLERANCE:
7187        return "Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance.";
7188      case APPOINTMENT:
7189        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).";
7190      case APPOINTMENTRESPONSE:
7191        return "A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection.";
7192      case AUDITEVENT:
7193        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.";
7194      case BASIC:
7195        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.";
7196      case BINARY:
7197        return "A binary resource can contain any content, whether text, image, pdf, zip archive, etc.";
7198      case BODYSITE:
7199        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.";
7200      case BUNDLE:
7201        return "A container for a collection of resources.";
7202      case CAREPLAN:
7203        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.";
7204      case CLAIM:
7205        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.";
7206      case CLAIMRESPONSE:
7207        return "This resource provides the adjudication details from the processing of a Claim resource.";
7208      case CLINICALIMPRESSION:
7209        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.";
7210      case COMMUNICATION:
7211        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.";
7212      case COMMUNICATIONREQUEST:
7213        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.";
7214      case COMPOSITION:
7215        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.";
7216      case CONCEPTMAP:
7217        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.";
7218      case CONDITION:
7219        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.";
7220      case CONFORMANCE:
7221        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.";
7222      case CONTRACT:
7223        return "A formal agreement between parties regarding the conduct of business, exchange of information or other matters.";
7224      case COVERAGE:
7225        return "Financial instrument which may be used to pay for or reimburse health care products and services.";
7226      case DATAELEMENT:
7227        return "The formal description of a single piece of information that can be gathered and reported.";
7228      case DETECTEDISSUE:
7229        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.";
7230      case DEVICE:
7231        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.";
7232      case DEVICECOMPONENT:
7233        return "Describes the characteristics, operational status and capabilities of a medical-related component of a medical device.";
7234      case DEVICEMETRIC:
7235        return "Describes a measurement, calculation or setting capability of a medical device.";
7236      case DEVICEUSEREQUEST:
7237        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.";
7238      case DEVICEUSESTATEMENT:
7239        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.";
7240      case DIAGNOSTICORDER:
7241        return "A record of a request for a diagnostic investigation service to be performed.";
7242      case DIAGNOSTICREPORT:
7243        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.";
7244      case DOCUMENTMANIFEST:
7245        return "A manifest that defines a set of documents.";
7246      case DOCUMENTREFERENCE:
7247        return "A reference to a document .";
7248      case DOMAINRESOURCE:
7249        return "--- Abstract Type! ---A resource that includes narrative, extensions, and contained resources.";
7250      case ELIGIBILITYREQUEST:
7251        return "This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service.";
7252      case ELIGIBILITYRESPONSE:
7253        return "This resource provides eligibility and plan details from the processing of an Eligibility resource.";
7254      case ENCOUNTER:
7255        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.";
7256      case ENROLLMENTREQUEST:
7257        return "This resource provides the insurance enrollment details to the insurer regarding a specified coverage.";
7258      case ENROLLMENTRESPONSE:
7259        return "This resource provides enrollment and plan details from the processing of an Enrollment resource.";
7260      case EPISODEOFCARE:
7261        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.";
7262      case EXPLANATIONOFBENEFIT:
7263        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.";
7264      case FAMILYMEMBERHISTORY:
7265        return "Significant health events and conditions for a person related to the patient relevant in the context of care for the patient.";
7266      case FLAG:
7267        return "Prospective warnings of potential issues when providing care to the patient.";
7268      case GOAL:
7269        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.";
7270      case GROUP:
7271        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.";
7272      case HEALTHCARESERVICE:
7273        return "The details of a healthcare service available at a location.";
7274      case IMAGINGOBJECTSELECTION:
7275        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.";
7276      case IMAGINGSTUDY:
7277        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.";
7278      case IMMUNIZATION:
7279        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.";
7280      case IMMUNIZATIONRECOMMENDATION:
7281        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.";
7282      case IMPLEMENTATIONGUIDE:
7283        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.";
7284      case LIST:
7285        return "A set of information summarized from a list of other resources.";
7286      case LOCATION:
7287        return "Details and position information for a physical place where services are provided  and resources and participants may be stored, found, contained or accommodated.";
7288      case MEDIA:
7289        return "A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference.";
7290      case MEDICATION:
7291        return "This resource is primarily used for the identification and definition of a medication. It covers the ingredients and the packaging for a medication.";
7292      case MEDICATIONADMINISTRATION:
7293        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.";
7294      case MEDICATIONDISPENSE:
7295        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.";
7296      case MEDICATIONORDER:
7297        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.";
7298      case MEDICATIONSTATEMENT:
7299        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.";
7300      case MESSAGEHEADER:
7301        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.";
7302      case NAMINGSYSTEM:
7303        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.";
7304      case NUTRITIONORDER:
7305        return "A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.";
7306      case OBSERVATION:
7307        return "Measurements and simple assertions made about a patient, device or other subject.";
7308      case OPERATIONDEFINITION:
7309        return "A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction).";
7310      case OPERATIONOUTCOME:
7311        return "A collection of error, warning or information messages that result from a system action.";
7312      case ORDER:
7313        return "A request to perform an action.";
7314      case ORDERRESPONSE:
7315        return "A response to an order.";
7316      case ORGANIZATION:
7317        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.";
7318      case PARAMETERS:
7319        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.";
7320      case PATIENT:
7321        return "Demographics and other administrative information about an individual or animal receiving care or other health-related services.";
7322      case PAYMENTNOTICE:
7323        return "This resource provides the status of the payment for goods and services rendered, and the request and response resource references.";
7324      case PAYMENTRECONCILIATION:
7325        return "This resource provides payment details and claim references supporting a bulk payment.";
7326      case PERSON:
7327        return "Demographics and administrative information about a person independent of a specific health-related context.";
7328      case PRACTITIONER:
7329        return "A person who is directly or indirectly involved in the provisioning of healthcare.";
7330      case PROCEDURE:
7331        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.";
7332      case PROCEDUREREQUEST:
7333        return "A request for a procedure to be performed. May be a proposal or an order.";
7334      case PROCESSREQUEST:
7335        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.";
7336      case PROCESSRESPONSE:
7337        return "This resource provides processing status, errors and notes from the processing of a resource.";
7338      case PROVENANCE:
7339        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.";
7340      case QUESTIONNAIRE:
7341        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.";
7342      case QUESTIONNAIRERESPONSE:
7343        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.";
7344      case REFERRALREQUEST:
7345        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.";
7346      case RELATEDPERSON:
7347        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.";
7348      case RESOURCE:
7349        return "--- Abstract Type! ---This is the base resource type for everything.";
7350      case RISKASSESSMENT:
7351        return "An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome.";
7352      case SCHEDULE:
7353        return "A container for slot(s) of time that may be available for booking appointments.";
7354      case SEARCHPARAMETER:
7355        return "A search parameter that defines a named search item that can be used to search/filter on a resource.";
7356      case SLOT:
7357        return "A slot of time on a schedule that may be available for booking appointments.";
7358      case SPECIMEN:
7359        return "A sample to be used for analysis.";
7360      case STRUCTUREDEFINITION:
7361        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.";
7362      case SUBSCRIPTION:
7363        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.";
7364      case SUBSTANCE:
7365        return "A homogeneous material with a definite composition.";
7366      case SUPPLYDELIVERY:
7367        return "Record of delivery of what is supplied.";
7368      case SUPPLYREQUEST:
7369        return "A record of a request for a medication, substance or device used in the healthcare setting.";
7370      case TESTSCRIPT:
7371        return "TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine compliance against the FHIR specification.";
7372      case VALUESET:
7373        return "A value set specifies a set of codes drawn from one or more code systems.";
7374      case VISIONPRESCRIPTION:
7375        return "An authorization for the supply of glasses and/or contact lenses to a patient.";
7376      case NULL:
7377        return null;
7378      default:
7379        return "?";
7380      }
7381    }
7382
7383    public String getDisplay() {
7384      switch (this) {
7385      case ACCOUNT:
7386        return "Account";
7387      case ALLERGYINTOLERANCE:
7388        return "AllergyIntolerance";
7389      case APPOINTMENT:
7390        return "Appointment";
7391      case APPOINTMENTRESPONSE:
7392        return "AppointmentResponse";
7393      case AUDITEVENT:
7394        return "AuditEvent";
7395      case BASIC:
7396        return "Basic";
7397      case BINARY:
7398        return "Binary";
7399      case BODYSITE:
7400        return "BodySite";
7401      case BUNDLE:
7402        return "Bundle";
7403      case CAREPLAN:
7404        return "CarePlan";
7405      case CLAIM:
7406        return "Claim";
7407      case CLAIMRESPONSE:
7408        return "ClaimResponse";
7409      case CLINICALIMPRESSION:
7410        return "ClinicalImpression";
7411      case COMMUNICATION:
7412        return "Communication";
7413      case COMMUNICATIONREQUEST:
7414        return "CommunicationRequest";
7415      case COMPOSITION:
7416        return "Composition";
7417      case CONCEPTMAP:
7418        return "ConceptMap";
7419      case CONDITION:
7420        return "Condition";
7421      case CONFORMANCE:
7422        return "Conformance";
7423      case CONTRACT:
7424        return "Contract";
7425      case COVERAGE:
7426        return "Coverage";
7427      case DATAELEMENT:
7428        return "DataElement";
7429      case DETECTEDISSUE:
7430        return "DetectedIssue";
7431      case DEVICE:
7432        return "Device";
7433      case DEVICECOMPONENT:
7434        return "DeviceComponent";
7435      case DEVICEMETRIC:
7436        return "DeviceMetric";
7437      case DEVICEUSEREQUEST:
7438        return "DeviceUseRequest";
7439      case DEVICEUSESTATEMENT:
7440        return "DeviceUseStatement";
7441      case DIAGNOSTICORDER:
7442        return "DiagnosticOrder";
7443      case DIAGNOSTICREPORT:
7444        return "DiagnosticReport";
7445      case DOCUMENTMANIFEST:
7446        return "DocumentManifest";
7447      case DOCUMENTREFERENCE:
7448        return "DocumentReference";
7449      case DOMAINRESOURCE:
7450        return "DomainResource";
7451      case ELIGIBILITYREQUEST:
7452        return "EligibilityRequest";
7453      case ELIGIBILITYRESPONSE:
7454        return "EligibilityResponse";
7455      case ENCOUNTER:
7456        return "Encounter";
7457      case ENROLLMENTREQUEST:
7458        return "EnrollmentRequest";
7459      case ENROLLMENTRESPONSE:
7460        return "EnrollmentResponse";
7461      case EPISODEOFCARE:
7462        return "EpisodeOfCare";
7463      case EXPLANATIONOFBENEFIT:
7464        return "ExplanationOfBenefit";
7465      case FAMILYMEMBERHISTORY:
7466        return "FamilyMemberHistory";
7467      case FLAG:
7468        return "Flag";
7469      case GOAL:
7470        return "Goal";
7471      case GROUP:
7472        return "Group";
7473      case HEALTHCARESERVICE:
7474        return "HealthcareService";
7475      case IMAGINGOBJECTSELECTION:
7476        return "ImagingObjectSelection";
7477      case IMAGINGSTUDY:
7478        return "ImagingStudy";
7479      case IMMUNIZATION:
7480        return "Immunization";
7481      case IMMUNIZATIONRECOMMENDATION:
7482        return "ImmunizationRecommendation";
7483      case IMPLEMENTATIONGUIDE:
7484        return "ImplementationGuide";
7485      case LIST:
7486        return "List";
7487      case LOCATION:
7488        return "Location";
7489      case MEDIA:
7490        return "Media";
7491      case MEDICATION:
7492        return "Medication";
7493      case MEDICATIONADMINISTRATION:
7494        return "MedicationAdministration";
7495      case MEDICATIONDISPENSE:
7496        return "MedicationDispense";
7497      case MEDICATIONORDER:
7498        return "MedicationOrder";
7499      case MEDICATIONSTATEMENT:
7500        return "MedicationStatement";
7501      case MESSAGEHEADER:
7502        return "MessageHeader";
7503      case NAMINGSYSTEM:
7504        return "NamingSystem";
7505      case NUTRITIONORDER:
7506        return "NutritionOrder";
7507      case OBSERVATION:
7508        return "Observation";
7509      case OPERATIONDEFINITION:
7510        return "OperationDefinition";
7511      case OPERATIONOUTCOME:
7512        return "OperationOutcome";
7513      case ORDER:
7514        return "Order";
7515      case ORDERRESPONSE:
7516        return "OrderResponse";
7517      case ORGANIZATION:
7518        return "Organization";
7519      case PARAMETERS:
7520        return "Parameters";
7521      case PATIENT:
7522        return "Patient";
7523      case PAYMENTNOTICE:
7524        return "PaymentNotice";
7525      case PAYMENTRECONCILIATION:
7526        return "PaymentReconciliation";
7527      case PERSON:
7528        return "Person";
7529      case PRACTITIONER:
7530        return "Practitioner";
7531      case PROCEDURE:
7532        return "Procedure";
7533      case PROCEDUREREQUEST:
7534        return "ProcedureRequest";
7535      case PROCESSREQUEST:
7536        return "ProcessRequest";
7537      case PROCESSRESPONSE:
7538        return "ProcessResponse";
7539      case PROVENANCE:
7540        return "Provenance";
7541      case QUESTIONNAIRE:
7542        return "Questionnaire";
7543      case QUESTIONNAIRERESPONSE:
7544        return "QuestionnaireResponse";
7545      case REFERRALREQUEST:
7546        return "ReferralRequest";
7547      case RELATEDPERSON:
7548        return "RelatedPerson";
7549      case RESOURCE:
7550        return "Resource";
7551      case RISKASSESSMENT:
7552        return "RiskAssessment";
7553      case SCHEDULE:
7554        return "Schedule";
7555      case SEARCHPARAMETER:
7556        return "SearchParameter";
7557      case SLOT:
7558        return "Slot";
7559      case SPECIMEN:
7560        return "Specimen";
7561      case STRUCTUREDEFINITION:
7562        return "StructureDefinition";
7563      case SUBSCRIPTION:
7564        return "Subscription";
7565      case SUBSTANCE:
7566        return "Substance";
7567      case SUPPLYDELIVERY:
7568        return "SupplyDelivery";
7569      case SUPPLYREQUEST:
7570        return "SupplyRequest";
7571      case TESTSCRIPT:
7572        return "TestScript";
7573      case VALUESET:
7574        return "ValueSet";
7575      case VISIONPRESCRIPTION:
7576        return "VisionPrescription";
7577      case NULL:
7578        return null;
7579      default:
7580        return "?";
7581      }
7582    }
7583  }
7584
7585  public static class ResourceTypeEnumFactory implements EnumFactory<ResourceType> {
7586    public ResourceType fromCode(String codeString) throws IllegalArgumentException {
7587      if (codeString == null || "".equals(codeString))
7588        if (codeString == null || "".equals(codeString))
7589          return null;
7590      if ("Account".equals(codeString))
7591        return ResourceType.ACCOUNT;
7592      if ("AllergyIntolerance".equals(codeString))
7593        return ResourceType.ALLERGYINTOLERANCE;
7594      if ("Appointment".equals(codeString))
7595        return ResourceType.APPOINTMENT;
7596      if ("AppointmentResponse".equals(codeString))
7597        return ResourceType.APPOINTMENTRESPONSE;
7598      if ("AuditEvent".equals(codeString))
7599        return ResourceType.AUDITEVENT;
7600      if ("Basic".equals(codeString))
7601        return ResourceType.BASIC;
7602      if ("Binary".equals(codeString))
7603        return ResourceType.BINARY;
7604      if ("BodySite".equals(codeString))
7605        return ResourceType.BODYSITE;
7606      if ("Bundle".equals(codeString))
7607        return ResourceType.BUNDLE;
7608      if ("CarePlan".equals(codeString))
7609        return ResourceType.CAREPLAN;
7610      if ("Claim".equals(codeString))
7611        return ResourceType.CLAIM;
7612      if ("ClaimResponse".equals(codeString))
7613        return ResourceType.CLAIMRESPONSE;
7614      if ("ClinicalImpression".equals(codeString))
7615        return ResourceType.CLINICALIMPRESSION;
7616      if ("Communication".equals(codeString))
7617        return ResourceType.COMMUNICATION;
7618      if ("CommunicationRequest".equals(codeString))
7619        return ResourceType.COMMUNICATIONREQUEST;
7620      if ("Composition".equals(codeString))
7621        return ResourceType.COMPOSITION;
7622      if ("ConceptMap".equals(codeString))
7623        return ResourceType.CONCEPTMAP;
7624      if ("Condition".equals(codeString))
7625        return ResourceType.CONDITION;
7626      if ("Conformance".equals(codeString))
7627        return ResourceType.CONFORMANCE;
7628      if ("Contract".equals(codeString))
7629        return ResourceType.CONTRACT;
7630      if ("Coverage".equals(codeString))
7631        return ResourceType.COVERAGE;
7632      if ("DataElement".equals(codeString))
7633        return ResourceType.DATAELEMENT;
7634      if ("DetectedIssue".equals(codeString))
7635        return ResourceType.DETECTEDISSUE;
7636      if ("Device".equals(codeString))
7637        return ResourceType.DEVICE;
7638      if ("DeviceComponent".equals(codeString))
7639        return ResourceType.DEVICECOMPONENT;
7640      if ("DeviceMetric".equals(codeString))
7641        return ResourceType.DEVICEMETRIC;
7642      if ("DeviceUseRequest".equals(codeString))
7643        return ResourceType.DEVICEUSEREQUEST;
7644      if ("DeviceUseStatement".equals(codeString))
7645        return ResourceType.DEVICEUSESTATEMENT;
7646      if ("DiagnosticOrder".equals(codeString))
7647        return ResourceType.DIAGNOSTICORDER;
7648      if ("DiagnosticReport".equals(codeString))
7649        return ResourceType.DIAGNOSTICREPORT;
7650      if ("DocumentManifest".equals(codeString))
7651        return ResourceType.DOCUMENTMANIFEST;
7652      if ("DocumentReference".equals(codeString))
7653        return ResourceType.DOCUMENTREFERENCE;
7654      if ("DomainResource".equals(codeString))
7655        return ResourceType.DOMAINRESOURCE;
7656      if ("EligibilityRequest".equals(codeString))
7657        return ResourceType.ELIGIBILITYREQUEST;
7658      if ("EligibilityResponse".equals(codeString))
7659        return ResourceType.ELIGIBILITYRESPONSE;
7660      if ("Encounter".equals(codeString))
7661        return ResourceType.ENCOUNTER;
7662      if ("EnrollmentRequest".equals(codeString))
7663        return ResourceType.ENROLLMENTREQUEST;
7664      if ("EnrollmentResponse".equals(codeString))
7665        return ResourceType.ENROLLMENTRESPONSE;
7666      if ("EpisodeOfCare".equals(codeString))
7667        return ResourceType.EPISODEOFCARE;
7668      if ("ExplanationOfBenefit".equals(codeString))
7669        return ResourceType.EXPLANATIONOFBENEFIT;
7670      if ("FamilyMemberHistory".equals(codeString))
7671        return ResourceType.FAMILYMEMBERHISTORY;
7672      if ("Flag".equals(codeString))
7673        return ResourceType.FLAG;
7674      if ("Goal".equals(codeString))
7675        return ResourceType.GOAL;
7676      if ("Group".equals(codeString))
7677        return ResourceType.GROUP;
7678      if ("HealthcareService".equals(codeString))
7679        return ResourceType.HEALTHCARESERVICE;
7680      if ("ImagingObjectSelection".equals(codeString))
7681        return ResourceType.IMAGINGOBJECTSELECTION;
7682      if ("ImagingStudy".equals(codeString))
7683        return ResourceType.IMAGINGSTUDY;
7684      if ("Immunization".equals(codeString))
7685        return ResourceType.IMMUNIZATION;
7686      if ("ImmunizationRecommendation".equals(codeString))
7687        return ResourceType.IMMUNIZATIONRECOMMENDATION;
7688      if ("ImplementationGuide".equals(codeString))
7689        return ResourceType.IMPLEMENTATIONGUIDE;
7690      if ("List".equals(codeString))
7691        return ResourceType.LIST;
7692      if ("Location".equals(codeString))
7693        return ResourceType.LOCATION;
7694      if ("Media".equals(codeString))
7695        return ResourceType.MEDIA;
7696      if ("Medication".equals(codeString))
7697        return ResourceType.MEDICATION;
7698      if ("MedicationAdministration".equals(codeString))
7699        return ResourceType.MEDICATIONADMINISTRATION;
7700      if ("MedicationDispense".equals(codeString))
7701        return ResourceType.MEDICATIONDISPENSE;
7702      if ("MedicationOrder".equals(codeString))
7703        return ResourceType.MEDICATIONORDER;
7704      if ("MedicationStatement".equals(codeString))
7705        return ResourceType.MEDICATIONSTATEMENT;
7706      if ("MessageHeader".equals(codeString))
7707        return ResourceType.MESSAGEHEADER;
7708      if ("NamingSystem".equals(codeString))
7709        return ResourceType.NAMINGSYSTEM;
7710      if ("NutritionOrder".equals(codeString))
7711        return ResourceType.NUTRITIONORDER;
7712      if ("Observation".equals(codeString))
7713        return ResourceType.OBSERVATION;
7714      if ("OperationDefinition".equals(codeString))
7715        return ResourceType.OPERATIONDEFINITION;
7716      if ("OperationOutcome".equals(codeString))
7717        return ResourceType.OPERATIONOUTCOME;
7718      if ("Order".equals(codeString))
7719        return ResourceType.ORDER;
7720      if ("OrderResponse".equals(codeString))
7721        return ResourceType.ORDERRESPONSE;
7722      if ("Organization".equals(codeString))
7723        return ResourceType.ORGANIZATION;
7724      if ("Parameters".equals(codeString))
7725        return ResourceType.PARAMETERS;
7726      if ("Patient".equals(codeString))
7727        return ResourceType.PATIENT;
7728      if ("PaymentNotice".equals(codeString))
7729        return ResourceType.PAYMENTNOTICE;
7730      if ("PaymentReconciliation".equals(codeString))
7731        return ResourceType.PAYMENTRECONCILIATION;
7732      if ("Person".equals(codeString))
7733        return ResourceType.PERSON;
7734      if ("Practitioner".equals(codeString))
7735        return ResourceType.PRACTITIONER;
7736      if ("Procedure".equals(codeString))
7737        return ResourceType.PROCEDURE;
7738      if ("ProcedureRequest".equals(codeString))
7739        return ResourceType.PROCEDUREREQUEST;
7740      if ("ProcessRequest".equals(codeString))
7741        return ResourceType.PROCESSREQUEST;
7742      if ("ProcessResponse".equals(codeString))
7743        return ResourceType.PROCESSRESPONSE;
7744      if ("Provenance".equals(codeString))
7745        return ResourceType.PROVENANCE;
7746      if ("Questionnaire".equals(codeString))
7747        return ResourceType.QUESTIONNAIRE;
7748      if ("QuestionnaireResponse".equals(codeString))
7749        return ResourceType.QUESTIONNAIRERESPONSE;
7750      if ("ReferralRequest".equals(codeString))
7751        return ResourceType.REFERRALREQUEST;
7752      if ("RelatedPerson".equals(codeString))
7753        return ResourceType.RELATEDPERSON;
7754      if ("Resource".equals(codeString))
7755        return ResourceType.RESOURCE;
7756      if ("RiskAssessment".equals(codeString))
7757        return ResourceType.RISKASSESSMENT;
7758      if ("Schedule".equals(codeString))
7759        return ResourceType.SCHEDULE;
7760      if ("SearchParameter".equals(codeString))
7761        return ResourceType.SEARCHPARAMETER;
7762      if ("Slot".equals(codeString))
7763        return ResourceType.SLOT;
7764      if ("Specimen".equals(codeString))
7765        return ResourceType.SPECIMEN;
7766      if ("StructureDefinition".equals(codeString))
7767        return ResourceType.STRUCTUREDEFINITION;
7768      if ("Subscription".equals(codeString))
7769        return ResourceType.SUBSCRIPTION;
7770      if ("Substance".equals(codeString))
7771        return ResourceType.SUBSTANCE;
7772      if ("SupplyDelivery".equals(codeString))
7773        return ResourceType.SUPPLYDELIVERY;
7774      if ("SupplyRequest".equals(codeString))
7775        return ResourceType.SUPPLYREQUEST;
7776      if ("TestScript".equals(codeString))
7777        return ResourceType.TESTSCRIPT;
7778      if ("ValueSet".equals(codeString))
7779        return ResourceType.VALUESET;
7780      if ("VisionPrescription".equals(codeString))
7781        return ResourceType.VISIONPRESCRIPTION;
7782      throw new IllegalArgumentException("Unknown ResourceType code '" + codeString + "'");
7783    }
7784
7785    public Enumeration<ResourceType> fromType(Base code) throws FHIRException {
7786      if (code == null || code.isEmpty())
7787        return null;
7788      String codeString = ((PrimitiveType) code).asStringValue();
7789      if (codeString == null || "".equals(codeString))
7790        return null;
7791      if ("Account".equals(codeString))
7792        return new Enumeration<ResourceType>(this, ResourceType.ACCOUNT);
7793      if ("AllergyIntolerance".equals(codeString))
7794        return new Enumeration<ResourceType>(this, ResourceType.ALLERGYINTOLERANCE);
7795      if ("Appointment".equals(codeString))
7796        return new Enumeration<ResourceType>(this, ResourceType.APPOINTMENT);
7797      if ("AppointmentResponse".equals(codeString))
7798        return new Enumeration<ResourceType>(this, ResourceType.APPOINTMENTRESPONSE);
7799      if ("AuditEvent".equals(codeString))
7800        return new Enumeration<ResourceType>(this, ResourceType.AUDITEVENT);
7801      if ("Basic".equals(codeString))
7802        return new Enumeration<ResourceType>(this, ResourceType.BASIC);
7803      if ("Binary".equals(codeString))
7804        return new Enumeration<ResourceType>(this, ResourceType.BINARY);
7805      if ("BodySite".equals(codeString))
7806        return new Enumeration<ResourceType>(this, ResourceType.BODYSITE);
7807      if ("Bundle".equals(codeString))
7808        return new Enumeration<ResourceType>(this, ResourceType.BUNDLE);
7809      if ("CarePlan".equals(codeString))
7810        return new Enumeration<ResourceType>(this, ResourceType.CAREPLAN);
7811      if ("Claim".equals(codeString))
7812        return new Enumeration<ResourceType>(this, ResourceType.CLAIM);
7813      if ("ClaimResponse".equals(codeString))
7814        return new Enumeration<ResourceType>(this, ResourceType.CLAIMRESPONSE);
7815      if ("ClinicalImpression".equals(codeString))
7816        return new Enumeration<ResourceType>(this, ResourceType.CLINICALIMPRESSION);
7817      if ("Communication".equals(codeString))
7818        return new Enumeration<ResourceType>(this, ResourceType.COMMUNICATION);
7819      if ("CommunicationRequest".equals(codeString))
7820        return new Enumeration<ResourceType>(this, ResourceType.COMMUNICATIONREQUEST);
7821      if ("Composition".equals(codeString))
7822        return new Enumeration<ResourceType>(this, ResourceType.COMPOSITION);
7823      if ("ConceptMap".equals(codeString))
7824        return new Enumeration<ResourceType>(this, ResourceType.CONCEPTMAP);
7825      if ("Condition".equals(codeString))
7826        return new Enumeration<ResourceType>(this, ResourceType.CONDITION);
7827      if ("Conformance".equals(codeString))
7828        return new Enumeration<ResourceType>(this, ResourceType.CONFORMANCE);
7829      if ("Contract".equals(codeString))
7830        return new Enumeration<ResourceType>(this, ResourceType.CONTRACT);
7831      if ("Coverage".equals(codeString))
7832        return new Enumeration<ResourceType>(this, ResourceType.COVERAGE);
7833      if ("DataElement".equals(codeString))
7834        return new Enumeration<ResourceType>(this, ResourceType.DATAELEMENT);
7835      if ("DetectedIssue".equals(codeString))
7836        return new Enumeration<ResourceType>(this, ResourceType.DETECTEDISSUE);
7837      if ("Device".equals(codeString))
7838        return new Enumeration<ResourceType>(this, ResourceType.DEVICE);
7839      if ("DeviceComponent".equals(codeString))
7840        return new Enumeration<ResourceType>(this, ResourceType.DEVICECOMPONENT);
7841      if ("DeviceMetric".equals(codeString))
7842        return new Enumeration<ResourceType>(this, ResourceType.DEVICEMETRIC);
7843      if ("DeviceUseRequest".equals(codeString))
7844        return new Enumeration<ResourceType>(this, ResourceType.DEVICEUSEREQUEST);
7845      if ("DeviceUseStatement".equals(codeString))
7846        return new Enumeration<ResourceType>(this, ResourceType.DEVICEUSESTATEMENT);
7847      if ("DiagnosticOrder".equals(codeString))
7848        return new Enumeration<ResourceType>(this, ResourceType.DIAGNOSTICORDER);
7849      if ("DiagnosticReport".equals(codeString))
7850        return new Enumeration<ResourceType>(this, ResourceType.DIAGNOSTICREPORT);
7851      if ("DocumentManifest".equals(codeString))
7852        return new Enumeration<ResourceType>(this, ResourceType.DOCUMENTMANIFEST);
7853      if ("DocumentReference".equals(codeString))
7854        return new Enumeration<ResourceType>(this, ResourceType.DOCUMENTREFERENCE);
7855      if ("DomainResource".equals(codeString))
7856        return new Enumeration<ResourceType>(this, ResourceType.DOMAINRESOURCE);
7857      if ("EligibilityRequest".equals(codeString))
7858        return new Enumeration<ResourceType>(this, ResourceType.ELIGIBILITYREQUEST);
7859      if ("EligibilityResponse".equals(codeString))
7860        return new Enumeration<ResourceType>(this, ResourceType.ELIGIBILITYRESPONSE);
7861      if ("Encounter".equals(codeString))
7862        return new Enumeration<ResourceType>(this, ResourceType.ENCOUNTER);
7863      if ("EnrollmentRequest".equals(codeString))
7864        return new Enumeration<ResourceType>(this, ResourceType.ENROLLMENTREQUEST);
7865      if ("EnrollmentResponse".equals(codeString))
7866        return new Enumeration<ResourceType>(this, ResourceType.ENROLLMENTRESPONSE);
7867      if ("EpisodeOfCare".equals(codeString))
7868        return new Enumeration<ResourceType>(this, ResourceType.EPISODEOFCARE);
7869      if ("ExplanationOfBenefit".equals(codeString))
7870        return new Enumeration<ResourceType>(this, ResourceType.EXPLANATIONOFBENEFIT);
7871      if ("FamilyMemberHistory".equals(codeString))
7872        return new Enumeration<ResourceType>(this, ResourceType.FAMILYMEMBERHISTORY);
7873      if ("Flag".equals(codeString))
7874        return new Enumeration<ResourceType>(this, ResourceType.FLAG);
7875      if ("Goal".equals(codeString))
7876        return new Enumeration<ResourceType>(this, ResourceType.GOAL);
7877      if ("Group".equals(codeString))
7878        return new Enumeration<ResourceType>(this, ResourceType.GROUP);
7879      if ("HealthcareService".equals(codeString))
7880        return new Enumeration<ResourceType>(this, ResourceType.HEALTHCARESERVICE);
7881      if ("ImagingObjectSelection".equals(codeString))
7882        return new Enumeration<ResourceType>(this, ResourceType.IMAGINGOBJECTSELECTION);
7883      if ("ImagingStudy".equals(codeString))
7884        return new Enumeration<ResourceType>(this, ResourceType.IMAGINGSTUDY);
7885      if ("Immunization".equals(codeString))
7886        return new Enumeration<ResourceType>(this, ResourceType.IMMUNIZATION);
7887      if ("ImmunizationRecommendation".equals(codeString))
7888        return new Enumeration<ResourceType>(this, ResourceType.IMMUNIZATIONRECOMMENDATION);
7889      if ("ImplementationGuide".equals(codeString))
7890        return new Enumeration<ResourceType>(this, ResourceType.IMPLEMENTATIONGUIDE);
7891      if ("List".equals(codeString))
7892        return new Enumeration<ResourceType>(this, ResourceType.LIST);
7893      if ("Location".equals(codeString))
7894        return new Enumeration<ResourceType>(this, ResourceType.LOCATION);
7895      if ("Media".equals(codeString))
7896        return new Enumeration<ResourceType>(this, ResourceType.MEDIA);
7897      if ("Medication".equals(codeString))
7898        return new Enumeration<ResourceType>(this, ResourceType.MEDICATION);
7899      if ("MedicationAdministration".equals(codeString))
7900        return new Enumeration<ResourceType>(this, ResourceType.MEDICATIONADMINISTRATION);
7901      if ("MedicationDispense".equals(codeString))
7902        return new Enumeration<ResourceType>(this, ResourceType.MEDICATIONDISPENSE);
7903      if ("MedicationOrder".equals(codeString))
7904        return new Enumeration<ResourceType>(this, ResourceType.MEDICATIONORDER);
7905      if ("MedicationStatement".equals(codeString))
7906        return new Enumeration<ResourceType>(this, ResourceType.MEDICATIONSTATEMENT);
7907      if ("MessageHeader".equals(codeString))
7908        return new Enumeration<ResourceType>(this, ResourceType.MESSAGEHEADER);
7909      if ("NamingSystem".equals(codeString))
7910        return new Enumeration<ResourceType>(this, ResourceType.NAMINGSYSTEM);
7911      if ("NutritionOrder".equals(codeString))
7912        return new Enumeration<ResourceType>(this, ResourceType.NUTRITIONORDER);
7913      if ("Observation".equals(codeString))
7914        return new Enumeration<ResourceType>(this, ResourceType.OBSERVATION);
7915      if ("OperationDefinition".equals(codeString))
7916        return new Enumeration<ResourceType>(this, ResourceType.OPERATIONDEFINITION);
7917      if ("OperationOutcome".equals(codeString))
7918        return new Enumeration<ResourceType>(this, ResourceType.OPERATIONOUTCOME);
7919      if ("Order".equals(codeString))
7920        return new Enumeration<ResourceType>(this, ResourceType.ORDER);
7921      if ("OrderResponse".equals(codeString))
7922        return new Enumeration<ResourceType>(this, ResourceType.ORDERRESPONSE);
7923      if ("Organization".equals(codeString))
7924        return new Enumeration<ResourceType>(this, ResourceType.ORGANIZATION);
7925      if ("Parameters".equals(codeString))
7926        return new Enumeration<ResourceType>(this, ResourceType.PARAMETERS);
7927      if ("Patient".equals(codeString))
7928        return new Enumeration<ResourceType>(this, ResourceType.PATIENT);
7929      if ("PaymentNotice".equals(codeString))
7930        return new Enumeration<ResourceType>(this, ResourceType.PAYMENTNOTICE);
7931      if ("PaymentReconciliation".equals(codeString))
7932        return new Enumeration<ResourceType>(this, ResourceType.PAYMENTRECONCILIATION);
7933      if ("Person".equals(codeString))
7934        return new Enumeration<ResourceType>(this, ResourceType.PERSON);
7935      if ("Practitioner".equals(codeString))
7936        return new Enumeration<ResourceType>(this, ResourceType.PRACTITIONER);
7937      if ("Procedure".equals(codeString))
7938        return new Enumeration<ResourceType>(this, ResourceType.PROCEDURE);
7939      if ("ProcedureRequest".equals(codeString))
7940        return new Enumeration<ResourceType>(this, ResourceType.PROCEDUREREQUEST);
7941      if ("ProcessRequest".equals(codeString))
7942        return new Enumeration<ResourceType>(this, ResourceType.PROCESSREQUEST);
7943      if ("ProcessResponse".equals(codeString))
7944        return new Enumeration<ResourceType>(this, ResourceType.PROCESSRESPONSE);
7945      if ("Provenance".equals(codeString))
7946        return new Enumeration<ResourceType>(this, ResourceType.PROVENANCE);
7947      if ("Questionnaire".equals(codeString))
7948        return new Enumeration<ResourceType>(this, ResourceType.QUESTIONNAIRE);
7949      if ("QuestionnaireResponse".equals(codeString))
7950        return new Enumeration<ResourceType>(this, ResourceType.QUESTIONNAIRERESPONSE);
7951      if ("ReferralRequest".equals(codeString))
7952        return new Enumeration<ResourceType>(this, ResourceType.REFERRALREQUEST);
7953      if ("RelatedPerson".equals(codeString))
7954        return new Enumeration<ResourceType>(this, ResourceType.RELATEDPERSON);
7955      if ("Resource".equals(codeString))
7956        return new Enumeration<ResourceType>(this, ResourceType.RESOURCE);
7957      if ("RiskAssessment".equals(codeString))
7958        return new Enumeration<ResourceType>(this, ResourceType.RISKASSESSMENT);
7959      if ("Schedule".equals(codeString))
7960        return new Enumeration<ResourceType>(this, ResourceType.SCHEDULE);
7961      if ("SearchParameter".equals(codeString))
7962        return new Enumeration<ResourceType>(this, ResourceType.SEARCHPARAMETER);
7963      if ("Slot".equals(codeString))
7964        return new Enumeration<ResourceType>(this, ResourceType.SLOT);
7965      if ("Specimen".equals(codeString))
7966        return new Enumeration<ResourceType>(this, ResourceType.SPECIMEN);
7967      if ("StructureDefinition".equals(codeString))
7968        return new Enumeration<ResourceType>(this, ResourceType.STRUCTUREDEFINITION);
7969      if ("Subscription".equals(codeString))
7970        return new Enumeration<ResourceType>(this, ResourceType.SUBSCRIPTION);
7971      if ("Substance".equals(codeString))
7972        return new Enumeration<ResourceType>(this, ResourceType.SUBSTANCE);
7973      if ("SupplyDelivery".equals(codeString))
7974        return new Enumeration<ResourceType>(this, ResourceType.SUPPLYDELIVERY);
7975      if ("SupplyRequest".equals(codeString))
7976        return new Enumeration<ResourceType>(this, ResourceType.SUPPLYREQUEST);
7977      if ("TestScript".equals(codeString))
7978        return new Enumeration<ResourceType>(this, ResourceType.TESTSCRIPT);
7979      if ("ValueSet".equals(codeString))
7980        return new Enumeration<ResourceType>(this, ResourceType.VALUESET);
7981      if ("VisionPrescription".equals(codeString))
7982        return new Enumeration<ResourceType>(this, ResourceType.VISIONPRESCRIPTION);
7983      throw new FHIRException("Unknown ResourceType code '" + codeString + "'");
7984    }
7985
7986    public String toCode(ResourceType code) {
7987      if (code == ResourceType.ACCOUNT)
7988        return "Account";
7989      if (code == ResourceType.ALLERGYINTOLERANCE)
7990        return "AllergyIntolerance";
7991      if (code == ResourceType.APPOINTMENT)
7992        return "Appointment";
7993      if (code == ResourceType.APPOINTMENTRESPONSE)
7994        return "AppointmentResponse";
7995      if (code == ResourceType.AUDITEVENT)
7996        return "AuditEvent";
7997      if (code == ResourceType.BASIC)
7998        return "Basic";
7999      if (code == ResourceType.BINARY)
8000        return "Binary";
8001      if (code == ResourceType.BODYSITE)
8002        return "BodySite";
8003      if (code == ResourceType.BUNDLE)
8004        return "Bundle";
8005      if (code == ResourceType.CAREPLAN)
8006        return "CarePlan";
8007      if (code == ResourceType.CLAIM)
8008        return "Claim";
8009      if (code == ResourceType.CLAIMRESPONSE)
8010        return "ClaimResponse";
8011      if (code == ResourceType.CLINICALIMPRESSION)
8012        return "ClinicalImpression";
8013      if (code == ResourceType.COMMUNICATION)
8014        return "Communication";
8015      if (code == ResourceType.COMMUNICATIONREQUEST)
8016        return "CommunicationRequest";
8017      if (code == ResourceType.COMPOSITION)
8018        return "Composition";
8019      if (code == ResourceType.CONCEPTMAP)
8020        return "ConceptMap";
8021      if (code == ResourceType.CONDITION)
8022        return "Condition";
8023      if (code == ResourceType.CONFORMANCE)
8024        return "Conformance";
8025      if (code == ResourceType.CONTRACT)
8026        return "Contract";
8027      if (code == ResourceType.COVERAGE)
8028        return "Coverage";
8029      if (code == ResourceType.DATAELEMENT)
8030        return "DataElement";
8031      if (code == ResourceType.DETECTEDISSUE)
8032        return "DetectedIssue";
8033      if (code == ResourceType.DEVICE)
8034        return "Device";
8035      if (code == ResourceType.DEVICECOMPONENT)
8036        return "DeviceComponent";
8037      if (code == ResourceType.DEVICEMETRIC)
8038        return "DeviceMetric";
8039      if (code == ResourceType.DEVICEUSEREQUEST)
8040        return "DeviceUseRequest";
8041      if (code == ResourceType.DEVICEUSESTATEMENT)
8042        return "DeviceUseStatement";
8043      if (code == ResourceType.DIAGNOSTICORDER)
8044        return "DiagnosticOrder";
8045      if (code == ResourceType.DIAGNOSTICREPORT)
8046        return "DiagnosticReport";
8047      if (code == ResourceType.DOCUMENTMANIFEST)
8048        return "DocumentManifest";
8049      if (code == ResourceType.DOCUMENTREFERENCE)
8050        return "DocumentReference";
8051      if (code == ResourceType.DOMAINRESOURCE)
8052        return "DomainResource";
8053      if (code == ResourceType.ELIGIBILITYREQUEST)
8054        return "EligibilityRequest";
8055      if (code == ResourceType.ELIGIBILITYRESPONSE)
8056        return "EligibilityResponse";
8057      if (code == ResourceType.ENCOUNTER)
8058        return "Encounter";
8059      if (code == ResourceType.ENROLLMENTREQUEST)
8060        return "EnrollmentRequest";
8061      if (code == ResourceType.ENROLLMENTRESPONSE)
8062        return "EnrollmentResponse";
8063      if (code == ResourceType.EPISODEOFCARE)
8064        return "EpisodeOfCare";
8065      if (code == ResourceType.EXPLANATIONOFBENEFIT)
8066        return "ExplanationOfBenefit";
8067      if (code == ResourceType.FAMILYMEMBERHISTORY)
8068        return "FamilyMemberHistory";
8069      if (code == ResourceType.FLAG)
8070        return "Flag";
8071      if (code == ResourceType.GOAL)
8072        return "Goal";
8073      if (code == ResourceType.GROUP)
8074        return "Group";
8075      if (code == ResourceType.HEALTHCARESERVICE)
8076        return "HealthcareService";
8077      if (code == ResourceType.IMAGINGOBJECTSELECTION)
8078        return "ImagingObjectSelection";
8079      if (code == ResourceType.IMAGINGSTUDY)
8080        return "ImagingStudy";
8081      if (code == ResourceType.IMMUNIZATION)
8082        return "Immunization";
8083      if (code == ResourceType.IMMUNIZATIONRECOMMENDATION)
8084        return "ImmunizationRecommendation";
8085      if (code == ResourceType.IMPLEMENTATIONGUIDE)
8086        return "ImplementationGuide";
8087      if (code == ResourceType.LIST)
8088        return "List";
8089      if (code == ResourceType.LOCATION)
8090        return "Location";
8091      if (code == ResourceType.MEDIA)
8092        return "Media";
8093      if (code == ResourceType.MEDICATION)
8094        return "Medication";
8095      if (code == ResourceType.MEDICATIONADMINISTRATION)
8096        return "MedicationAdministration";
8097      if (code == ResourceType.MEDICATIONDISPENSE)
8098        return "MedicationDispense";
8099      if (code == ResourceType.MEDICATIONORDER)
8100        return "MedicationOrder";
8101      if (code == ResourceType.MEDICATIONSTATEMENT)
8102        return "MedicationStatement";
8103      if (code == ResourceType.MESSAGEHEADER)
8104        return "MessageHeader";
8105      if (code == ResourceType.NAMINGSYSTEM)
8106        return "NamingSystem";
8107      if (code == ResourceType.NUTRITIONORDER)
8108        return "NutritionOrder";
8109      if (code == ResourceType.OBSERVATION)
8110        return "Observation";
8111      if (code == ResourceType.OPERATIONDEFINITION)
8112        return "OperationDefinition";
8113      if (code == ResourceType.OPERATIONOUTCOME)
8114        return "OperationOutcome";
8115      if (code == ResourceType.ORDER)
8116        return "Order";
8117      if (code == ResourceType.ORDERRESPONSE)
8118        return "OrderResponse";
8119      if (code == ResourceType.ORGANIZATION)
8120        return "Organization";
8121      if (code == ResourceType.PARAMETERS)
8122        return "Parameters";
8123      if (code == ResourceType.PATIENT)
8124        return "Patient";
8125      if (code == ResourceType.PAYMENTNOTICE)
8126        return "PaymentNotice";
8127      if (code == ResourceType.PAYMENTRECONCILIATION)
8128        return "PaymentReconciliation";
8129      if (code == ResourceType.PERSON)
8130        return "Person";
8131      if (code == ResourceType.PRACTITIONER)
8132        return "Practitioner";
8133      if (code == ResourceType.PROCEDURE)
8134        return "Procedure";
8135      if (code == ResourceType.PROCEDUREREQUEST)
8136        return "ProcedureRequest";
8137      if (code == ResourceType.PROCESSREQUEST)
8138        return "ProcessRequest";
8139      if (code == ResourceType.PROCESSRESPONSE)
8140        return "ProcessResponse";
8141      if (code == ResourceType.PROVENANCE)
8142        return "Provenance";
8143      if (code == ResourceType.QUESTIONNAIRE)
8144        return "Questionnaire";
8145      if (code == ResourceType.QUESTIONNAIRERESPONSE)
8146        return "QuestionnaireResponse";
8147      if (code == ResourceType.REFERRALREQUEST)
8148        return "ReferralRequest";
8149      if (code == ResourceType.RELATEDPERSON)
8150        return "RelatedPerson";
8151      if (code == ResourceType.RESOURCE)
8152        return "Resource";
8153      if (code == ResourceType.RISKASSESSMENT)
8154        return "RiskAssessment";
8155      if (code == ResourceType.SCHEDULE)
8156        return "Schedule";
8157      if (code == ResourceType.SEARCHPARAMETER)
8158        return "SearchParameter";
8159      if (code == ResourceType.SLOT)
8160        return "Slot";
8161      if (code == ResourceType.SPECIMEN)
8162        return "Specimen";
8163      if (code == ResourceType.STRUCTUREDEFINITION)
8164        return "StructureDefinition";
8165      if (code == ResourceType.SUBSCRIPTION)
8166        return "Subscription";
8167      if (code == ResourceType.SUBSTANCE)
8168        return "Substance";
8169      if (code == ResourceType.SUPPLYDELIVERY)
8170        return "SupplyDelivery";
8171      if (code == ResourceType.SUPPLYREQUEST)
8172        return "SupplyRequest";
8173      if (code == ResourceType.TESTSCRIPT)
8174        return "TestScript";
8175      if (code == ResourceType.VALUESET)
8176        return "ValueSet";
8177      if (code == ResourceType.VISIONPRESCRIPTION)
8178        return "VisionPrescription";
8179      return "?";
8180    }
8181  }
8182
8183  public enum SearchParamType {
8184    /**
8185     * Search parameter SHALL be a number (a whole number, or a decimal).
8186     */
8187    NUMBER,
8188    /**
8189     * Search parameter is on a date/time. The date format is the standard XML
8190     * format, though other formats may be supported.
8191     */
8192    DATE,
8193    /**
8194     * Search parameter is a simple string, like a name part. Search is
8195     * case-insensitive and accent-insensitive. May match just the start of a
8196     * string. String parameters may contain spaces.
8197     */
8198    STRING,
8199    /**
8200     * Search parameter on a coded element or identifier. May be used to search
8201     * through the text, displayname, code and code/codesystem (for codes) and
8202     * label, system and key (for identifier). Its value is either a string or a
8203     * pair of namespace and value, separated by a "|", depending on the modifier
8204     * used.
8205     */
8206    TOKEN,
8207    /**
8208     * A reference to another resource.
8209     */
8210    REFERENCE,
8211    /**
8212     * A composite search parameter that combines a search on two values together.
8213     */
8214    COMPOSITE,
8215    /**
8216     * A search parameter that searches on a quantity.
8217     */
8218    QUANTITY,
8219    /**
8220     * A search parameter that searches on a URI (RFC 3986).
8221     */
8222    URI,
8223    /**
8224     * added to help the parsers
8225     */
8226    NULL;
8227
8228    public static SearchParamType fromCode(String codeString) throws FHIRException {
8229      if (codeString == null || "".equals(codeString))
8230        return null;
8231      if ("number".equals(codeString))
8232        return NUMBER;
8233      if ("date".equals(codeString))
8234        return DATE;
8235      if ("string".equals(codeString))
8236        return STRING;
8237      if ("token".equals(codeString))
8238        return TOKEN;
8239      if ("reference".equals(codeString))
8240        return REFERENCE;
8241      if ("composite".equals(codeString))
8242        return COMPOSITE;
8243      if ("quantity".equals(codeString))
8244        return QUANTITY;
8245      if ("uri".equals(codeString))
8246        return URI;
8247      throw new FHIRException("Unknown SearchParamType code '" + codeString + "'");
8248    }
8249
8250    public String toCode() {
8251      switch (this) {
8252      case NUMBER:
8253        return "number";
8254      case DATE:
8255        return "date";
8256      case STRING:
8257        return "string";
8258      case TOKEN:
8259        return "token";
8260      case REFERENCE:
8261        return "reference";
8262      case COMPOSITE:
8263        return "composite";
8264      case QUANTITY:
8265        return "quantity";
8266      case URI:
8267        return "uri";
8268      case NULL:
8269        return null;
8270      default:
8271        return "?";
8272      }
8273    }
8274
8275    public String getSystem() {
8276      switch (this) {
8277      case NUMBER:
8278        return "http://hl7.org/fhir/search-param-type";
8279      case DATE:
8280        return "http://hl7.org/fhir/search-param-type";
8281      case STRING:
8282        return "http://hl7.org/fhir/search-param-type";
8283      case TOKEN:
8284        return "http://hl7.org/fhir/search-param-type";
8285      case REFERENCE:
8286        return "http://hl7.org/fhir/search-param-type";
8287      case COMPOSITE:
8288        return "http://hl7.org/fhir/search-param-type";
8289      case QUANTITY:
8290        return "http://hl7.org/fhir/search-param-type";
8291      case URI:
8292        return "http://hl7.org/fhir/search-param-type";
8293      case NULL:
8294        return null;
8295      default:
8296        return "?";
8297      }
8298    }
8299
8300    public String getDefinition() {
8301      switch (this) {
8302      case NUMBER:
8303        return "Search parameter SHALL be a number (a whole number, or a decimal).";
8304      case DATE:
8305        return "Search parameter is on a date/time. The date format is the standard XML format, though other formats may be supported.";
8306      case STRING:
8307        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.";
8308      case TOKEN:
8309        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.";
8310      case REFERENCE:
8311        return "A reference to another resource.";
8312      case COMPOSITE:
8313        return "A composite search parameter that combines a search on two values together.";
8314      case QUANTITY:
8315        return "A search parameter that searches on a quantity.";
8316      case URI:
8317        return "A search parameter that searches on a URI (RFC 3986).";
8318      case NULL:
8319        return null;
8320      default:
8321        return "?";
8322      }
8323    }
8324
8325    public String getDisplay() {
8326      switch (this) {
8327      case NUMBER:
8328        return "Number";
8329      case DATE:
8330        return "Date/DateTime";
8331      case STRING:
8332        return "String";
8333      case TOKEN:
8334        return "Token";
8335      case REFERENCE:
8336        return "Reference";
8337      case COMPOSITE:
8338        return "Composite";
8339      case QUANTITY:
8340        return "Quantity";
8341      case URI:
8342        return "URI";
8343      case NULL:
8344        return null;
8345      default:
8346        return "?";
8347      }
8348    }
8349  }
8350
8351  public static class SearchParamTypeEnumFactory implements EnumFactory<SearchParamType> {
8352    public SearchParamType fromCode(String codeString) throws IllegalArgumentException {
8353      if (codeString == null || "".equals(codeString))
8354        if (codeString == null || "".equals(codeString))
8355          return null;
8356      if ("number".equals(codeString))
8357        return SearchParamType.NUMBER;
8358      if ("date".equals(codeString))
8359        return SearchParamType.DATE;
8360      if ("string".equals(codeString))
8361        return SearchParamType.STRING;
8362      if ("token".equals(codeString))
8363        return SearchParamType.TOKEN;
8364      if ("reference".equals(codeString))
8365        return SearchParamType.REFERENCE;
8366      if ("composite".equals(codeString))
8367        return SearchParamType.COMPOSITE;
8368      if ("quantity".equals(codeString))
8369        return SearchParamType.QUANTITY;
8370      if ("uri".equals(codeString))
8371        return SearchParamType.URI;
8372      throw new IllegalArgumentException("Unknown SearchParamType code '" + codeString + "'");
8373    }
8374
8375    public Enumeration<SearchParamType> fromType(Base code) throws FHIRException {
8376      if (code == null || code.isEmpty())
8377        return null;
8378      String codeString = ((PrimitiveType) code).asStringValue();
8379      if (codeString == null || "".equals(codeString))
8380        return null;
8381      if ("number".equals(codeString))
8382        return new Enumeration<SearchParamType>(this, SearchParamType.NUMBER);
8383      if ("date".equals(codeString))
8384        return new Enumeration<SearchParamType>(this, SearchParamType.DATE);
8385      if ("string".equals(codeString))
8386        return new Enumeration<SearchParamType>(this, SearchParamType.STRING);
8387      if ("token".equals(codeString))
8388        return new Enumeration<SearchParamType>(this, SearchParamType.TOKEN);
8389      if ("reference".equals(codeString))
8390        return new Enumeration<SearchParamType>(this, SearchParamType.REFERENCE);
8391      if ("composite".equals(codeString))
8392        return new Enumeration<SearchParamType>(this, SearchParamType.COMPOSITE);
8393      if ("quantity".equals(codeString))
8394        return new Enumeration<SearchParamType>(this, SearchParamType.QUANTITY);
8395      if ("uri".equals(codeString))
8396        return new Enumeration<SearchParamType>(this, SearchParamType.URI);
8397      throw new FHIRException("Unknown SearchParamType code '" + codeString + "'");
8398    }
8399
8400    public String toCode(SearchParamType code) {
8401      if (code == SearchParamType.NUMBER)
8402        return "number";
8403      if (code == SearchParamType.DATE)
8404        return "date";
8405      if (code == SearchParamType.STRING)
8406        return "string";
8407      if (code == SearchParamType.TOKEN)
8408        return "token";
8409      if (code == SearchParamType.REFERENCE)
8410        return "reference";
8411      if (code == SearchParamType.COMPOSITE)
8412        return "composite";
8413      if (code == SearchParamType.QUANTITY)
8414        return "quantity";
8415      if (code == SearchParamType.URI)
8416        return "uri";
8417      return "?";
8418    }
8419  }
8420
8421  public enum SpecialValues {
8422    /**
8423     * Boolean true.
8424     */
8425    TRUE,
8426    /**
8427     * Boolean false.
8428     */
8429    FALSE,
8430    /**
8431     * The content is greater than zero, but too small to be quantified.
8432     */
8433    TRACE,
8434    /**
8435     * The specific quantity is not known, but is known to be non-zero and is not
8436     * specified because it makes up the bulk of the material.
8437     */
8438    SUFFICIENT,
8439    /**
8440     * The value is no longer available.
8441     */
8442    WITHDRAWN,
8443    /**
8444     * The are no known applicable values in this context.
8445     */
8446    NILKNOWN,
8447    /**
8448     * added to help the parsers
8449     */
8450    NULL;
8451
8452    public static SpecialValues fromCode(String codeString) throws FHIRException {
8453      if (codeString == null || "".equals(codeString))
8454        return null;
8455      if ("true".equals(codeString))
8456        return TRUE;
8457      if ("false".equals(codeString))
8458        return FALSE;
8459      if ("trace".equals(codeString))
8460        return TRACE;
8461      if ("sufficient".equals(codeString))
8462        return SUFFICIENT;
8463      if ("withdrawn".equals(codeString))
8464        return WITHDRAWN;
8465      if ("nil-known".equals(codeString))
8466        return NILKNOWN;
8467      throw new FHIRException("Unknown SpecialValues code '" + codeString + "'");
8468    }
8469
8470    public String toCode() {
8471      switch (this) {
8472      case TRUE:
8473        return "true";
8474      case FALSE:
8475        return "false";
8476      case TRACE:
8477        return "trace";
8478      case SUFFICIENT:
8479        return "sufficient";
8480      case WITHDRAWN:
8481        return "withdrawn";
8482      case NILKNOWN:
8483        return "nil-known";
8484      case NULL:
8485        return null;
8486      default:
8487        return "?";
8488      }
8489    }
8490
8491    public String getSystem() {
8492      switch (this) {
8493      case TRUE:
8494        return "http://hl7.org/fhir/special-values";
8495      case FALSE:
8496        return "http://hl7.org/fhir/special-values";
8497      case TRACE:
8498        return "http://hl7.org/fhir/special-values";
8499      case SUFFICIENT:
8500        return "http://hl7.org/fhir/special-values";
8501      case WITHDRAWN:
8502        return "http://hl7.org/fhir/special-values";
8503      case NILKNOWN:
8504        return "http://hl7.org/fhir/special-values";
8505      case NULL:
8506        return null;
8507      default:
8508        return "?";
8509      }
8510    }
8511
8512    public String getDefinition() {
8513      switch (this) {
8514      case TRUE:
8515        return "Boolean true.";
8516      case FALSE:
8517        return "Boolean false.";
8518      case TRACE:
8519        return "The content is greater than zero, but too small to be quantified.";
8520      case SUFFICIENT:
8521        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.";
8522      case WITHDRAWN:
8523        return "The value is no longer available.";
8524      case NILKNOWN:
8525        return "The are no known applicable values in this context.";
8526      case NULL:
8527        return null;
8528      default:
8529        return "?";
8530      }
8531    }
8532
8533    public String getDisplay() {
8534      switch (this) {
8535      case TRUE:
8536        return "true";
8537      case FALSE:
8538        return "false";
8539      case TRACE:
8540        return "Trace Amount Detected";
8541      case SUFFICIENT:
8542        return "Sufficient Quantity";
8543      case WITHDRAWN:
8544        return "Value Withdrawn";
8545      case NILKNOWN:
8546        return "Nil Known";
8547      case NULL:
8548        return null;
8549      default:
8550        return "?";
8551      }
8552    }
8553  }
8554
8555  public static class SpecialValuesEnumFactory implements EnumFactory<SpecialValues> {
8556    public SpecialValues fromCode(String codeString) throws IllegalArgumentException {
8557      if (codeString == null || "".equals(codeString))
8558        if (codeString == null || "".equals(codeString))
8559          return null;
8560      if ("true".equals(codeString))
8561        return SpecialValues.TRUE;
8562      if ("false".equals(codeString))
8563        return SpecialValues.FALSE;
8564      if ("trace".equals(codeString))
8565        return SpecialValues.TRACE;
8566      if ("sufficient".equals(codeString))
8567        return SpecialValues.SUFFICIENT;
8568      if ("withdrawn".equals(codeString))
8569        return SpecialValues.WITHDRAWN;
8570      if ("nil-known".equals(codeString))
8571        return SpecialValues.NILKNOWN;
8572      throw new IllegalArgumentException("Unknown SpecialValues code '" + codeString + "'");
8573    }
8574
8575    public Enumeration<SpecialValues> fromType(Base code) throws FHIRException {
8576      if (code == null || code.isEmpty())
8577        return null;
8578      String codeString = ((PrimitiveType) code).asStringValue();
8579      if (codeString == null || "".equals(codeString))
8580        return null;
8581      if ("true".equals(codeString))
8582        return new Enumeration<SpecialValues>(this, SpecialValues.TRUE);
8583      if ("false".equals(codeString))
8584        return new Enumeration<SpecialValues>(this, SpecialValues.FALSE);
8585      if ("trace".equals(codeString))
8586        return new Enumeration<SpecialValues>(this, SpecialValues.TRACE);
8587      if ("sufficient".equals(codeString))
8588        return new Enumeration<SpecialValues>(this, SpecialValues.SUFFICIENT);
8589      if ("withdrawn".equals(codeString))
8590        return new Enumeration<SpecialValues>(this, SpecialValues.WITHDRAWN);
8591      if ("nil-known".equals(codeString))
8592        return new Enumeration<SpecialValues>(this, SpecialValues.NILKNOWN);
8593      throw new FHIRException("Unknown SpecialValues code '" + codeString + "'");
8594    }
8595
8596    public String toCode(SpecialValues code) {
8597      if (code == SpecialValues.TRUE)
8598        return "true";
8599      if (code == SpecialValues.FALSE)
8600        return "false";
8601      if (code == SpecialValues.TRACE)
8602        return "trace";
8603      if (code == SpecialValues.SUFFICIENT)
8604        return "sufficient";
8605      if (code == SpecialValues.WITHDRAWN)
8606        return "withdrawn";
8607      if (code == SpecialValues.NILKNOWN)
8608        return "nil-known";
8609      return "?";
8610    }
8611  }
8612
8613}