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